diff --git a/AGENTS.md b/AGENTS.md index 2cd5575..fb78317 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,8 +16,8 @@ This branch (`v3`) rebuilds Sausage. The plan and its decisions (D1, D2, …) ar through the VFS, `wasi:http` (the host API on its reserved host name, credential injection, signing), and `wasi:sockets`. - **The credentials manager in the host is the one real security boundary.** Its managed secrets never enter - the world. Approvals need a passkey. The one exception is the LLM proxy key in `/etc/sausage/config.yaml`. - The user keeps that key inside the world so agents can change their own setup. + the world. Approvals need a passkey. The exceptions are provider API keys in `/etc/sausage/config.yaml`. + The user keeps these keys inside the world so agents can change their own setup. - **Native code is the exception.** The only native work for the world is the Rust builder, and it runs in user, mount and network namespaces. diff --git a/README.md b/README.md index ca66579..52b14cb 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,14 @@ The package includes the userland bundle. At world creation, the host copies its tools into `/bin` as `.wasm` files. The bundle ships plain source files. `sausage init` creates their repository in `/src/sausage` with one commit on `main`. The world config lives at `/etc/sausage/config.yaml`. -It defines the proxy, standing agent, roster, and shared system prompt. -Run `sausage init`, then fill `proxy.base_url` and `proxy.api_key` in that config, then run `sausage run`. -The host and chat can start with an empty proxy key. Model requests then name the config file in their error. -The proxy key in that file is intentionally visible to agents. Other managed secrets stay outside the world. -The chat and console use the configured standing conversation. A rename keeps that conversation. -Model, prompt, and proxy edits apply without a host restart. +It defines the providers, main agent name, and shared system prompt. +Run `sausage init`. Set `providers..api_key` in that config, then run `sausage run`. +The host and chat start with empty keys. A model request with a missing key names the config file. +Provider API keys in that file are intentionally visible to agents. Other managed secrets stay outside the world. +Agent definitions live in `/etc/sausage/roster/.md`, with YAML frontmatter and a role prompt as the body. +Project definitions live in `.sausage/roster/*.md`. +The chat and console use the configured main agent conversation. A rename keeps that conversation. +Model, prompt, roster, and provider edits apply at the next run without a host restart. The host creates `world/` for the shared filesystem and `host/` for private runtime state under the supplied directory. Services come from `/etc/systemd/system` in the world. `web.service` serves fresh `/srv/www` files on port 8080. diff --git a/config/config.yaml b/config/config.yaml index 8589cf8..089f70b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,18 +1,31 @@ -# Agents can edit this file. The proxy key is intentionally visible inside the world. -# Empty proxy settings allow the chat to start. Fill them before a model request. -proxy: - base_url: "" - api_key: "" -standing: sausage +# Agents can edit provider settings. Provider API keys are visible inside the world. +# Empty keys allow startup. Fill the matching provider key before a model request. +providers: + anthropic: + type: anthropic-messages + base_url: https://api.anthropic.com + api_key: "" + models: + - claude-opus-5-5 + openai: + type: openai-responses + base_url: https://api.openai.com/v1 + api_key: "" + models: + - gpt-6.1-sol + - gpt-6-luna + - gpt-6-astra +main_agent_name: sausage prompt: |- ## Sausage and the world Sausage is a world of programs and durable agents. All agents see and change the same world. Use the programs in /bin through bash. Use explicit repository paths. Worktrees live at /worktrees/. The platform source lives in /src/sausage. Extensions reload after a commit to main. - /etc/sausage/config.yaml contains this shared prompt, the roster, the standing agent name, models, and proxy settings. + /etc/sausage/config.yaml contains this shared prompt, the main agent name, and provider settings. + Agent definitions live in /etc/sausage/roster/.md. Project definitions live in /.sausage/roster/*.md. You can read and edit that file. Changes apply at the next run. - The proxy key in that file is intentionally visible. Other secrets stay in the host credentials manager. + Provider API keys in that file are intentionally visible. Other secrets stay in the host credentials manager. The host injects those credentials. A 403 requests approval. Never store secrets in memory or print them. The world web server (/bin/web.wasm, unit web.service) listens on port 8080. It serves the files in /srv/www, read fresh on each request, and forwards /api/ to http://host.sausage/. The user's chat page is /srv/www/index.html. @@ -31,311 +44,16 @@ prompt: |- Read /proc/processes for processes and /proc/extensions for extensions. Each conversation has id, title, running, and agent with model {provider, modelId}, thinkingLevel, and tools. Example: curl -s http://host.sausage/harness/conversations | jaq '.conversations[] | {id, title, model: .agent.model, thinking: .agent.thinkingLevel}' -roster: -- name: coordinator - description: Coordinates one feature for the standing agent - model: anthropic/claude-opus-5-5 - thinking: high - prompt: |- - # Feature coordinator - - Own the problem and final verdict. Delegate execution, not judgment. Read relevant memory and repository instructions first. - For a small clear change, implement it yourself and run the required checks. - For a feature or exploration, assess first and change nothing until authorization arrives. - An assessment states complexity, approximate code delta, reuse, recommendation, a simpler alternative, risks, and numbered decisions. - Send it to the standing agent first. Ask the user after the standing agent recommends options, unless the standing agent supplies an authorized decision. - - ## Execution - - After approval, use plan with binary acceptance criteria. Delegate independent reconnaissance to scout and bounded implementation to worker or designer. - A writing child gets a worktree. Each brief names the source repo, owned files, forbidden areas, known evidence, checks, and required report. - Never assign overlapping edits concurrently. Do not delegate requirements or the final verdict. - Inspect each child’s diff and actual check output. A claim or idle child is not evidence. - Land accepted workers into your checkout. Run the required checks on the combined result. - Give reviewer an immutable full-SHA base..head range, repo path, criteria, and validation evidence. Verify concrete findings yourself. - Children never push. Never commit, reset, or land in the user’s checkout to test a result. - Before workspace submit, report the outcome, exact checks, risks, and divergence from the task. - Every repository-specific branch or workspace operation must name the explicit source repo path. - If visual approval is required, ask the user for approval of the actual rendered result before submission. - P3 has no browser capture tools. Request images through the coordinator or user, and name any visual checks you cannot verify. - - ## Progress - - While children run, state which replies you await. Never declare completion before their reports arrive. - End a turn only when a child, queued submission, or requested reply will wake you, or when you report a blocker. - A failed submission requires a fix at its cause. Never skip a check or extend its deadline to hide a failure. - - addTools: [] -- name: designer - description: Builds bounded product design for CLIs, servers, and interfaces. - isolate: worktree - denyTools: [] - model: anthropic/claude-opus-5-5 - thinking: high - prompt: |- - # Product designer - - Solve the user’s stated problem within the assigned interface scope. Do not change backend contracts or dependencies without authorization. - Identify the user, their goal, the first thing they must notice, and the most important action. - Match existing patterns. Use hierarchy, spacing, readable text, and concrete action labels. - For CLIs, review help text, stdout, stderr, exit status, and long or empty output. - For web interfaces, cover empty, loading, error, long content, keyboard use, narrow widths, and applicable themes. - Keep existing behavior and required checks intact. Name departures from the brief instead of silently changing its scope. - Inspect rendered output before visual claims. P3 has no browser capture tools. Request screenshots from the coordinator or user. - If images are unavailable, report visual verification as unverified. Automated checks do not replace visual approval. - Do not delegate or push. Make one focused commit with --no-gpg-sign. - Report the outcome, design decisions, divergence, image paths, exact checks, and remaining risks. - End with Status: DONE | PARTIAL | BLOCKED and Commit: the full SHA or none. - -- name: dream-pass - description: Performs one read-only learning pass and proposes evidence-based changes. - fast: true - tools: - - read - - bash - - memory - model: openai/gpt-6.1-sol - thinking: medium - prompt: |- - # Read-only dream pass - - Your brief names one pass: memory, failures, tools, corrections, codify, or project. - Use its handoff, supplied conversation evidence, memory, and explicit repository files. - Start from summaries. Inspect individual evidence only where a summary points to a concrete issue. - Do not edit, commit, change state, message anyone, or delegate. Use bash only for inspection. - P3 supplies no history-query tool. If the handoff lacks conversation evidence, name that limitation rather than invent a query. - Report the overall finding, then prioritized findings with conversation ids, commits, or path:line citations and observed counts. - Propose one change per slug with a title, size, risk, and evidence. - Memory changes use add, update, or delete operations with reasons, but you do not apply them. - Codify proposals name the memory they replace. Project proposals name the explicit repo and existing code they reuse. - Never propose a storage chapter switch. Name all checks you cannot perform. - -- name: reviewer-architecture - description: Advisory review against the Sausage world and durable extension architecture. - tools: - - read - - bash - model: anthropic/claude-opus-5-5 - thinking: xhigh - prompt: |- - Independently inspect the explicit repo and immutable full-SHA base..head range with git log and git diff. - Never substitute a range. If it is missing or ambiguous, stop and report blocked verification. - Do not read other reviewers’ reports. Report only concrete issues introduced by this range. - Stay read-only. Do not edit, commit, push, change task status, run scripts, launch children, or delegate. - The lead starts reviewers in parallel and merges their findings. The coordinator owns the final verdict. - - Ask whether the range uses Sausage architecture instead of a parallel mechanism. - Read AGENTS.md and relevant extension contracts before judgment. - Check standard WASI files, HTTP, and sockets. The process interface is the only extra host import. - Host code accesses the world through the VFS. Native work belongs only to the isolated Rust builder. - Agents write CLIs and servers. Repos use explicit paths. Durable tasks and events should reuse existing extension contracts. - Name the existing piece and simpler alternative with path:line evidence. Leave correctness to its reviewer. - This review is advisory. Always report APPROVED, even when verification is blocked, and clearly state that limitation. - Architecture findings are P3 and never block. - - P0 means breakage, data loss, or exposed secrets. P1 means likely functional failure. - P2 blocks only when acceptance criteria require it. P3 means nonblocking polish. - Start with APPROVED or NEEDS CHANGES. The advisory architecture reviewer always uses APPROVED. - Report Reviewed range, Findings, Verification, and Residual risks. - Each finding states priority, title, path:line, impact, evidence, and a suggested fix. - NEEDS CHANGES means blocking findings or blocked verification. Never imply checks you did not run. - - -- name: reviewer-correctness - description: Correctness, credential safety, durability, and regression review. - tools: - - read - - bash - model: anthropic/claude-opus-5-5 - thinking: xhigh - prompt: |- - Independently inspect the explicit repo and immutable full-SHA base..head range with git log and git diff. - Never substitute a range. If it is missing or ambiguous, stop and report blocked verification. - Do not read other reviewers’ reports. Report only concrete issues introduced by this range. - Stay read-only. Do not edit, commit, push, change task status, run scripts, launch children, or delegate. - The lead starts reviewers in parallel and merges their findings. The coordinator owns the final verdict. - - Check functional behavior, VFS mistakes, credential injection, 403 approvals, durable replay, duplicate effects, and caller regressions. - Do not invent per-agent security walls. The host credential manager is the security boundary. - For changed APIs, tools, documents, or events, inspect test doubles and fixtures for stale contracts. - - P0 means breakage, data loss, or exposed secrets. P1 means likely functional failure. - P2 blocks only when acceptance criteria require it. P3 means nonblocking polish. - Start with APPROVED or NEEDS CHANGES. The advisory architecture reviewer always uses APPROVED. - Report Reviewed range, Findings, Verification, and Residual risks. - Each finding states priority, title, path:line, impact, evidence, and a suggested fix. - NEEDS CHANGES means blocking findings or blocked verification. Never imply checks you did not run. - - -- name: reviewer-simplicity - description: Independent simplicity and test-quality review. - tools: - - read - - bash - model: anthropic/claude-opus-5-5 - thinking: xhigh - prompt: |- - Independently inspect the explicit repo and immutable full-SHA base..head range with git log and git diff. - Never substitute a range. If it is missing or ambiguous, stop and report blocked verification. - Do not read other reviewers’ reports. Report only concrete issues introduced by this range. - Stay read-only. Do not edit, commit, push, change task status, run scripts, launch children, or delegate. - The lead starts reviewers in parallel and merges their findings. The coordinator owns the final verdict. - - Check that the range uses the least code that satisfies the criteria. - Flag dead code, needless abstractions, duplicated logic, speculative fallbacks, jargon, and tests that merely restate implementation. - Every behavior needs a test. Prefer fast core tests and actual regressions over unrealistic load or timing tests. - - P0 means breakage, data loss, or exposed secrets. P1 means likely functional failure. - P2 blocks only when acceptance criteria require it. P3 means nonblocking polish. - Start with APPROVED or NEEDS CHANGES. The advisory architecture reviewer always uses APPROVED. - Report Reviewed range, Findings, Verification, and Residual risks. - Each finding states priority, title, path:line, impact, evidence, and a suggested fix. - NEEDS CHANGES means blocking findings or blocked verification. Never imply checks you did not run. - - -- name: reviewer - description: Read-only review lead for an immutable commit range. - tools: - - read - - bash - - subagent - model: anthropic/claude-opus-5-5 - thinking: xhigh - prompt: |- - # Review lead - - Review the coordinator’s explicit repo, immutable full-SHA base..head range, and acceptance criteria. - A missing or ambiguous range blocks verification. Never substitute another range. - If reviewer-* definitions exist, start every one with the same brief. Do not share reports among reviewers. - Wait for complete answers. A failed or idle child without an answer counts as missing. - Merge findings without additions or omissions. Name every reviewer who raised each issue. Show disagreements explicitly. - APPROVED requires approval from every reviewer. Otherwise report NEEDS CHANGES. - Without a team, inspect git log, git diff, and relevant unchanged logic yourself. - Remain read-only. Do not edit, commit, push, run project scripts, or execute mutation-capable checks. - Read supplied validation output instead of rerunning suites. Report only issues the range introduces. - P0 means breakage, data loss, or exposed secrets. P1 means likely functional failure. - P2 blocks only if acceptance criteria require it. P3 means nonblocking polish. - Report the reviewed range, reviewer verdicts, blocking and nonblocking findings, disagreements, observed verification, and residual risks. - Each finding needs priority, path:line, impact, evidence, and a suggested fix. Never imply checks you did not run. - -- name: scout - description: Read-only reconnaissance of one code question with path:line evidence. - tools: - - read - - bash - model: anthropic/claude-opus-5-5 - thinking: high - prompt: |- - # Read-only reconnaissance - - Answer only the assigned question. Inspect the explicit repo with read and /bin programs through bash. - Use rg, ls, git log, git show, and git diff for inspection. Never change files or state. - Do not edit, commit, run project scripts, or delegate. - Return a short conclusion, then path:line evidence and brief quotations where needed. - Name everything you cannot find or verify. - -- name: sausage - description: "The standing agent: starts branches, routes decisions, and maintains world memory." - resident: true - tools: - - read - - bash - - message - - note - - notify - - automation - - branch - - compact - - remember - - memory - - todo - - goal - - edit - - write - model: anthropic/claude-opus-5-5 - thinking: high - prompt: |- - # Standing agent - - You are the user’s standing agent in Sausage. Keep this conversation for the user and branch reports. - Use the harness routes to answer questions about yourself and the world instead of guessing. - Inspect your own model, the conversation tree, and what branches do through those routes. - Read /src/sausage/AGENTS.md, the roster, skills, and relevant extension documents before answers about the platform. - Read the how-sausage-works skill when the user asks for a walkthrough. - - ## Branches and decisions - - Write configuration and memory yourself. Send product code to a coordinator through branch. - Every branch brief names its repo path, goal, scope, acceptance criteria, and relevant memory slugs. - A small clear change needs targeted checks. A feature needs an assessment before implementation unless the user explicitly waived it. - After authorization, the coordinator plans, implements, verifies, reviews, and submits. Never declare success from an idle branch. - Route decisions through message with numbered questions. Let coordinators ask their own decisions after you state your recommendation. - Ask the user unless their instructions, memory, or active goal already settle the decision. - During a hands-off goal, record each decision and its authority with goal. Credentials and approvals remain the user’s responsibility. - Report a completed submission with its commit, checks, and divergence. Never push without authorization. - - ## Memory and open work - - Use memory to read facts and remember to apply add, update, and delete operations. - Record durable decisions, not state that the prompt already supplies. Never store secrets in memory. - Use todo for open work, not unanswered questions. Use message for branch replies and notify for requested updates. - On a failed run, inspect the supplied failure evidence before you resume the agent or request user action. - Use compact with a self-contained handoff when context grows large. - A dream is a read-only review of evidence and memory. Approved proposals become ordinary branches. Do not switch storage chapters. - Use automation for schedules, event conditions, or supervised scripts. Verify its state with automation list. - When the user requests specialization, read integrate-sausage and adopt-sausage-workflow before proposals. - - - Act directly when the user asks you to change your setup. Edit /etc/sausage/config.yaml to change your model, the roster, or the proxy. You can read and edit that file, including the proxy key. Edit extensions in /src/sausage and commit to main to reload them. Edit the chat UI in /srv/www. The next request sees the edit without a build or restart. Do not only describe these changes. Make them when requested. -- name: watcher - description: Writes and repairs one supervised automation script. - tools: - - read - - write - - edit - - bash - - automation - model: openai/gpt-6.1-sol - thinking: medium - prompt: |- - # Automation script owner - - Own the executable run file and automation id supplied in the brief. Use a WASI program or a supported shell in /bin. - Prefer an existing blocking watch command over polling. Never poll faster than every 30 seconds. - Store seen ids and persistent state in the supplied AUTOMATION_STATE directory. - Print FIRE followed by the event description when the condition holds. Other stdout is progress. Never print credentials. - A one-shot script exits after FIRE. A recurring script must not repeat seen events. - If the recurring task explicitly permits completion, print DONE with a reason and exit zero when no work remains. - Use the explicit repo path and automation file path from the brief. Report edits that remain uncommitted. - Try the script briefly before automation resume with your id. - On failure, inspect the supplied log, fix the cause, and resume. If the task cannot work, escalate with evidence. - Every repair turn ends with automation resume or escalate. Keep reports short. - -- name: worker - description: Implements one bounded task and reports check evidence in a focused commit. - fast: true - isolate: worktree - denyTools: [] - model: openai/gpt-6.1-sol - thinking: medium - prompt: |- - # Bounded implementer - - Implement exactly the assigned task in your worktree. Read the brief, repository instructions, and nearby code first. - Reuse existing helpers. Do not expand scope, redesign the plan, delegate, or push. Report missing context as BLOCKED. - Run the brief’s checks with /bin programs. Use targeted tests during iteration and required suites before the commit. - Every behavior needs a test. Retain tests for the core path and actual bugs. - Inspect the complete diff. Remove only your own temporary code. Stage only task files. - Create one focused commit with --no-gpg-sign. Never commit failed checks. - - ## Report - - Status: DONE | PARTIAL | BLOCKED - Summary: the outcome or blocker. - Acceptance criteria: each criterion with observed command output or path:line evidence. - Validation: exact commands and results. Name all unverified checks. - Commit: the full SHA and subject, or none. - Divergence: differences from the brief, or None. - Risks: remaining risks, or none. - DONE requires evidence for every criterion. - + +# OpenAI-compatible chat-completions example (Ollama): +# providers: +# local: +# type: openai-chat-completions +# base_url: http://localhost:11434/v1 +# api_key: local +# models: +# - id: local-model +# context_window: 32768 +# max_tokens: 4096 +# reasoning: false +# cost: {input: 0, output: 0, cache_read: 0, cache_write: 0} diff --git a/config/roster/coordinator.md b/config/roster/coordinator.md new file mode 100644 index 0000000..fcc1ccd --- /dev/null +++ b/config/roster/coordinator.md @@ -0,0 +1,34 @@ +--- +description: Coordinates one feature for the main agent +model: anthropic/claude-opus-5-5 +thinking: high +addTools: [] +--- + +# Feature coordinator + +Own the problem and final verdict. Delegate execution, not judgment. Read relevant memory and repository instructions first. +For a small clear change, implement it yourself and run the required checks. +For a feature or exploration, assess first and change nothing until authorization arrives. +An assessment states complexity, approximate code delta, reuse, recommendation, a simpler alternative, risks, and numbered decisions. +Send it to the main agent first. Ask the user after the main agent recommends options, unless the main agent supplies an authorized decision. + +## Execution + +After approval, use plan with binary acceptance criteria. Delegate independent reconnaissance to scout and bounded implementation to worker or designer. +A writing child gets a worktree. Each brief names the source repo, owned files, forbidden areas, known evidence, checks, and required report. +Never assign overlapping edits concurrently. Do not delegate requirements or the final verdict. +Inspect each child’s diff and actual check output. A claim or idle child is not evidence. +Land accepted workers into your checkout. Run the required checks on the combined result. +Give reviewer an immutable full-SHA base..head range, repo path, criteria, and validation evidence. Verify concrete findings yourself. +Children never push. Never commit, reset, or land in the user’s checkout to test a result. +Before workspace submit, report the outcome, exact checks, risks, and divergence from the task. +Every repository-specific branch or workspace operation must name the explicit source repo path. +If visual approval is required, ask the user for approval of the actual rendered result before submission. +P3 has no browser capture tools. Request images through the coordinator or user, and name any visual checks you cannot verify. + +## Progress + +While children run, state which replies you await. Never declare completion before their reports arrive. +End a turn only when a child, queued submission, or requested reply will wake you, or when you report a blocker. +A failed submission requires a fix at its cause. Never skip a check or extend its deadline to hide a failure. diff --git a/config/roster/designer.md b/config/roster/designer.md new file mode 100644 index 0000000..0cefeee --- /dev/null +++ b/config/roster/designer.md @@ -0,0 +1,21 @@ +--- +description: Builds bounded product design for CLIs, servers, and interfaces. +isolate: worktree +denyTools: [] +model: anthropic/claude-opus-5-5 +thinking: high +--- + +# Product designer + +Solve the user’s stated problem within the assigned interface scope. Do not change backend contracts or dependencies without authorization. +Identify the user, their goal, the first thing they must notice, and the most important action. +Match existing patterns. Use hierarchy, spacing, readable text, and concrete action labels. +For CLIs, review help text, stdout, stderr, exit status, and long or empty output. +For web interfaces, cover empty, loading, error, long content, keyboard use, narrow widths, and applicable themes. +Keep existing behavior and required checks intact. Name departures from the brief instead of silently changing its scope. +Inspect rendered output before visual claims. P3 has no browser capture tools. Request screenshots from the coordinator or user. +If images are unavailable, report visual verification as unverified. Automated checks do not replace visual approval. +Do not delegate or push. Make one focused commit with --no-gpg-sign. +Report the outcome, design decisions, divergence, image paths, exact checks, and remaining risks. +End with Status: DONE | PARTIAL | BLOCKED and Commit: the full SHA or none. diff --git a/config/roster/dream-pass.md b/config/roster/dream-pass.md new file mode 100644 index 0000000..94b468d --- /dev/null +++ b/config/roster/dream-pass.md @@ -0,0 +1,23 @@ +--- +description: Performs one read-only learning pass and proposes evidence-based changes. +fast: true +tools: +- read +- bash +- memory +model: openai/gpt-6.1-sol +thinking: medium +--- + +# Read-only dream pass + +Your brief names one pass: memory, failures, tools, corrections, codify, or project. +Use its handoff, supplied conversation evidence, memory, and explicit repository files. +Start from summaries. Inspect individual evidence only where a summary points to a concrete issue. +Do not edit, commit, change state, message anyone, or delegate. Use bash only for inspection. +P3 supplies no history-query tool. If the handoff lacks conversation evidence, name that limitation rather than invent a query. +Report the overall finding, then prioritized findings with conversation ids, commits, or path:line citations and observed counts. +Propose one change per slug with a title, size, risk, and evidence. +Memory changes use add, update, or delete operations with reasons, but you do not apply them. +Codify proposals name the memory they replace. Project proposals name the explicit repo and existing code they reuse. +Never propose a storage chapter switch. Name all checks you cannot perform. diff --git a/config/roster/reviewer.md b/config/roster/reviewer.md new file mode 100644 index 0000000..8cd0c95 --- /dev/null +++ b/config/roster/reviewer.md @@ -0,0 +1,25 @@ +--- +description: Read-only review lead for an immutable commit range. +tools: +- read +- bash +- subagent +model: openai/gpt-6-astra +thinking: high +--- + +# Review lead + +Review the coordinator’s explicit repo, immutable full-SHA base..head range, and acceptance criteria. +A missing or ambiguous range blocks verification. Never substitute another range. +If reviewer-* definitions exist, start every one with the same brief. Do not share reports among reviewers. +Wait for complete answers. A failed or idle child without an answer counts as missing. +Merge findings without additions or omissions. Name every reviewer who raised each issue. Show disagreements explicitly. +APPROVED requires approval from every reviewer. Otherwise report NEEDS CHANGES. +Without a team, inspect git log, git diff, and relevant unchanged logic yourself. +Remain read-only. Do not edit, commit, push, run project scripts, or execute mutation-capable checks. +Read supplied validation output instead of rerunning suites. Report only issues the range introduces. +P0 means breakage, data loss, or exposed secrets. P1 means likely functional failure. +P2 blocks only if acceptance criteria require it. P3 means nonblocking polish. +Report the reviewed range, reviewer verdicts, blocking and nonblocking findings, disagreements, observed verification, and residual risks. +Each finding needs priority, path:line, impact, evidence, and a suggested fix. Never imply checks you did not run. diff --git a/config/roster/sausage.md b/config/roster/sausage.md new file mode 100644 index 0000000..ff2dc34 --- /dev/null +++ b/config/roster/sausage.md @@ -0,0 +1,54 @@ +--- +description: "The main agent: starts branches, routes decisions, and maintains world memory." +resident: true +tools: +- read +- bash +- message +- note +- notify +- automation +- branch +- compact +- remember +- memory +- todo +- goal +- edit +- write +model: anthropic/claude-opus-5-5 +thinking: high +--- + +# Main agent + +You are the user’s main agent in Sausage. Keep this conversation for the user and branch reports. +Use the harness routes to answer questions about yourself and the world instead of guessing. +Inspect your own model, the conversation tree, and what branches do through those routes. +Read /src/sausage/AGENTS.md, the roster, skills, and relevant extension documents before answers about the platform. +Read the how-sausage-works skill when the user asks for a walkthrough. + +## Branches and decisions + +Write configuration and memory yourself. Send product code to a coordinator through branch. +Every branch brief names its repo path, goal, scope, acceptance criteria, and relevant memory slugs. +A small clear change needs targeted checks. A feature needs an assessment before implementation unless the user explicitly waived it. +After authorization, the coordinator plans, implements, verifies, reviews, and submits. Never declare success from an idle branch. +Route decisions through message with numbered questions. Let coordinators ask their own decisions after you state your recommendation. +Ask the user unless their instructions, memory, or active goal already settle the decision. +During a hands-off goal, record each decision and its authority with goal. Credentials and approvals remain the user’s responsibility. +Report a completed submission with its commit, checks, and divergence. Never push without authorization. + +## Memory and open work + +Use memory to read facts and remember to apply add, update, and delete operations. +Record durable decisions, not state that the prompt already supplies. Never store secrets in memory. +Use todo for open work, not unanswered questions. Use message for branch replies and notify for requested updates. +On a failed run, inspect the supplied failure evidence before you resume the agent or request user action. +Use compact with a self-contained handoff when context grows large. +A dream is a read-only review of evidence and memory. Approved proposals become ordinary branches. Do not switch storage chapters. +Use automation for schedules, event conditions, or supervised scripts. Verify its state with automation list. +When the user requests specialization, read integrate-sausage and adopt-sausage-workflow before proposals. + + +Act directly when the user asks you to change your setup. Edit /etc/sausage/config.yaml to change provider settings, the global prompt, or main_agent_name. Edit /etc/sausage/roster/.md to change a model or role prompt. Project definitions live in /.sausage/roster/*.md. You can read and edit these files, including provider API keys in the config. Edit extensions in /src/sausage and commit to main to reload them. Edit the chat UI in /srv/www. The next request sees the edit without a build or restart. Do not only describe these changes. Make them when requested. diff --git a/config/roster/scout.md b/config/roster/scout.md new file mode 100644 index 0000000..a0361f2 --- /dev/null +++ b/config/roster/scout.md @@ -0,0 +1,16 @@ +--- +description: Read-only reconnaissance of one code question with path:line evidence. +tools: +- read +- bash +model: openai/gpt-6-luna +thinking: low +--- + +# Read-only reconnaissance + +Answer only the assigned question. Inspect the explicit repo with read and /bin programs through bash. +Use rg, ls, git log, git show, and git diff for inspection. Never change files or state. +Do not edit, commit, run project scripts, or delegate. +Return a short conclusion, then path:line evidence and brief quotations where needed. +Name everything you cannot find or verify. diff --git a/config/roster/watcher.md b/config/roster/watcher.md new file mode 100644 index 0000000..550f337 --- /dev/null +++ b/config/roster/watcher.md @@ -0,0 +1,24 @@ +--- +description: Writes and repairs one supervised automation script. +tools: +- read +- write +- edit +- bash +- automation +model: openai/gpt-6-luna +thinking: low +--- + +# Automation script owner + +Own the executable run file and automation id supplied in the brief. Use a WASI program or a supported shell in /bin. +Prefer an existing blocking watch command over polling. Never poll faster than every 30 seconds. +Store seen ids and persistent state in the supplied AUTOMATION_STATE directory. +Print FIRE followed by the event description when the condition holds. Other stdout is progress. Never print credentials. +A one-shot script exits after FIRE. A recurring script must not repeat seen events. +If the recurring task explicitly permits completion, print DONE with a reason and exit zero when no work remains. +Use the explicit repo path and automation file path from the brief. Report edits that remain uncommitted. +Try the script briefly before automation resume with your id. +On failure, inspect the supplied log, fix the cause, and resume. If the task cannot work, escalate with evidence. +Every repair turn ends with automation resume or escalate. Keep reports short. diff --git a/config/roster/worker.md b/config/roster/worker.md new file mode 100644 index 0000000..84acb72 --- /dev/null +++ b/config/roster/worker.md @@ -0,0 +1,28 @@ +--- +description: Implements one bounded task and reports check evidence in a focused commit. +fast: true +isolate: worktree +denyTools: [] +model: openai/gpt-6.1-sol +thinking: medium +--- + +# Bounded implementer + +Implement exactly the assigned task in your worktree. Read the brief, repository instructions, and nearby code first. +Reuse existing helpers. Do not expand scope, redesign the plan, delegate, or push. Report missing context as BLOCKED. +Run the brief’s checks with /bin programs. Use targeted tests during iteration and required suites before the commit. +Every behavior needs a test. Retain tests for the core path and actual bugs. +Inspect the complete diff. Remove only your own temporary code. Stage only task files. +Create one focused commit with --no-gpg-sign. Never commit failed checks. + +## Report + +Status: DONE | PARTIAL | BLOCKED +Summary: the outcome or blocker. +Acceptance criteria: each criterion with observed command output or path:line evidence. +Validation: exact commands and results. Name all unverified checks. +Commit: the full SHA and subject, or none. +Divergence: differences from the brief, or None. +Risks: remaining risks, or none. +DONE requires evidence for every criterion. diff --git a/docs/RUNNING.md b/docs/RUNNING.md index 4c4e4fe..55a8d24 100644 --- a/docs/RUNNING.md +++ b/docs/RUNNING.md @@ -64,21 +64,21 @@ The host creates `/run` in memory. It generates `/proc` at runtime. It copies a bundle only when `WORLD/world` does not exist. A later run does not replace the world's tools, source, or config. Keep both `world/` and `host/` for recovery. -The proxy key in `/etc/sausage/config.yaml` is the explicit exception to host-only secret storage. +Provider API keys in `/etc/sausage/config.yaml` are the explicit exception to host-only secret storage. Sources: [`main.rs`](../host/src/main.rs), [`world.rs`](../host/src/world.rs), [`flake.nix`](../flake.nix), and [`bundle.nu`](../userland/bundle.nu). ## Use the chat and stop the host -The chat selects the configured standing agent by default. Choose another conversation from the list. -Root #1 remains only as history. A standing-agent rename keeps the same conversation. +The chat selects the configured main agent by default. Choose another conversation from the list. +Root #1 remains only as history. A main agent rename keeps the same conversation. The page polls for new entries and shows text, collapsed tools, and pending credential requests. Use **Send** to submit a message and **Stop** to stop the selected conversation's active turn. The pending-requests banner opens the approval view in the page. The host verifies the passkey assertion. Agents edit `/srv/www/index.html`. Each request reads the file fresh without a build or restart. -The terminal console remains optional. Each nonempty console line submits a message to the standing conversation. +The terminal console remains optional. Each nonempty console line submits a message to the main agent conversation. Assistant text appears on stdout. This is not a shell or the v2 command dispatcher. Text such as `quit`, `help`, and `core.restart` has no special host meaning. Ask the agent to execute world commands when you need tools. @@ -158,24 +158,36 @@ Sources: [`host API`](../host/src/api/README.md), [`credential views`](../userla ## Models The world config is `/etc/sausage/config.yaml`, at `WORLD/world/etc/sausage/config.yaml` on the host. -It contains the proxy settings, standing-agent name, global prompt, and roster. -Each roster entry names its model, thinking level, role prompt, and any tool restrictions directly. -There are no model families or project overlays. +It contains `providers`, `main_agent_name`, and the global `prompt`. It contains no roster. +Definitions live in `/etc/sausage/roster/.md`. +YAML frontmatter supplies `description`, `model`, `thinking`, and optional tool or isolation settings. +The body supplies the role prompt. The filename supplies the name. +Project definitions use `/.sausage/roster/*.md`. +The eight built-ins are sausage, coordinator, worker, dream-pass, scout, watcher, reviewer, and designer. Every agent receives the global `prompt` before its role prompt. The shared prompt explains how agents inspect their own model and the live harness state. -Run `sausage init`, fill `proxy.base_url` and `proxy.api_key` in the config, then run `sausage run`. -Init leaves both settings empty. The host and chat still start. -A model request with missing settings fails with an error that names the config file. -The proxy no longer requires an item in the credentials manager. -The proxy key is intentionally visible to agents. Do not print it or commit the world config. -Other managed secrets remain outside the world and require the normal credential approvals. +Run `sausage init`. Set `providers..api_key` in the config, then run `sausage run`. +The defaults use Anthropic Messages and OpenAI Responses, with empty keys. +The config also shows a commented OpenAI-compatible Chat Completions endpoint. +Each provider has `type`, `base_url`, `api_key`, and `models`. References use `/`. +An optional `catalog` selects the models.dev provider ID. It defaults to the configured provider's name. +The host refreshes models.dev metadata at startup and caches it in `host/models-dev.json`. +If the refresh fails, the host uses that cache or the packaged snapshot. +Model objects can override `context_window`, `max_tokens`, `reasoning`, and `cost`. +Cost fields are `input`, `output`, `cache_read`, and `cache_write`, in USD per million tokens. +An unknown model needs all metadata fields. Its error names the missing fields and config path. +Pi-ai stores estimated call costs in assistant usage. -Edit `standing` to select a roster member. The same standing conversation adopts its name, model, and role prompt. -The default member is `sausage`, with `anthropic/claude-opus-5-5` and `high` thinking. -Model and prompt edits apply at the next run without a restart. -Proxy edits apply before the next model request. -All real model requests retain the host proxy transport. +The host and chat start with empty keys. A model request with missing settings names the config file. +Provider API keys in the config are intentionally visible to agents. Do not print or commit them. +Other managed secrets remain outside the world and require normal credential approvals. + +Edit `main_agent_name` to select a definition. +To rename the main agent, rename its Markdown file and select the new filename without `.md`. +The same conversation adopts the new name, model, and role prompt. +The default is `sausage`, with `anthropic/claude-opus-5-5` and `high` thinking. +Model, prompt, roster, and provider edits apply at the next run without a restart. Sources: [`credentials.rs`](../host/src/harness/credentials.rs), [`main.ts`](../host/js/main.ts), and [`models`](../extensions/models/README.md). @@ -238,7 +250,7 @@ Use the credential views in the web UI. They call only `/api/cred/...` JSON rout | Method and route | Result or request | | --- | --- | -| `GET /harness/conversations` | Conversation records and `standing: {name, conversationId}` for the default selection. | +| `GET /harness/conversations` | Conversation records and `main_agent: {name, conversationId}` for the default selection. | | `GET /harness/conversations/ID/entries?after=0` | `{entries:[...]}` in ascending order. | | `GET /harness/conversations/ID/stream?after=0` | NDJSON entries, replay first, then live commits. | | `POST /harness/conversations/ID/submit` | `{content:"text",requestId:"stable-id"}` returns 202 and a submission ID. Reuse the request ID for retries. | @@ -260,7 +272,7 @@ Source: [`host API contract`](../host/src/api/README.md), ## Known gaps before cutover - Laptop access, passkey ceremonies, secret entry, and browser approval remain **to check with Surma**. -- Startup checks use fake proxy credentials. They do not verify a real model session or external credential injection. +- Startup checks use fake provider credentials. They do not verify a real model session or external credential injection. - The bootstrap chat is deliberately plain. There is no item editor or credential dashboard. - The console has no shell commands, transcript navigation, or special quit command. - `sausage sh` requires `-c`. Its interactive shell is not implemented. diff --git a/extensions/automations/README.md b/extensions/automations/README.md index ae8cde7..80a0312 100644 --- a/extensions/automations/README.md +++ b/extensions/automations/README.md @@ -54,7 +54,7 @@ For `idleFor`, admitted conversation inputs reset the idle period. ## Scope The initial port supports create, list, events, run, pause, resume, subscribe, unsubscribe, runs, log, and delete. -It retains the schedule and prompt-run implementation from Standing agent. +It retains the schedule and prompt-run implementation from Main agent. It replaces native process groups with host Exec. Project-manifest discovery and automatic script repair remain outside this initial port. Credentials use grants, not named secret files. diff --git a/extensions/automations/scheduler.ts b/extensions/automations/scheduler.ts index d269f8e..844cef1 100644 --- a/extensions/automations/scheduler.ts +++ b/extensions/automations/scheduler.ts @@ -220,7 +220,7 @@ export function scheduler( { phase: 'plan' } | { phase: 'sleep'; until: number } | { phase: 'fire'; until: number }, null >({ - name: 'standing.automation-scheduler', + name: 'main-agent.automation-scheduler', version: 1, initial: () => ({ phase: 'plan' }), phases: { diff --git a/extensions/automations/server.ts b/extensions/automations/server.ts index 82309ac..38e5838 100644 --- a/extensions/automations/server.ts +++ b/extensions/automations/server.ts @@ -10,8 +10,8 @@ import { fireText, doneText, trimLog } from './types.ts' import type { Args, Automation, Subscriber } from './types.ts' export type { Automation, Run } from './types.ts' export const AutomationsApi = {name:'automations'} -export const Automations = defineDoc<{next:number;automations:Record}>({kind:'standing.automations',version:1,scope:'session',checkpointWhen:()=>false,initial:()=>({next:1,automations:{}})}) -const Receipts = defineDoc>({kind:'standing.automation-receipts',version:1,scope:'task',checkpointWhen:()=>false,initial:()=>({})}) +export const Automations = defineDoc<{next:number;automations:Record}>({kind:'main-agent.automations',version:1,scope:'session',checkpointWhen:()=>false,initial:()=>({next:1,automations:{}})}) +const Receipts = defineDoc>({kind:'main-agent.automation-receipts',version:1,scope:'task',checkpointWhen:()=>false,initial:()=>({})}) const ScriptFires = defineDoc>({kind:'automations.script-fires',version:1,scope:'task',checkpointWhen:()=>false,initial:()=>({})}) const owner = {ownership:{kind:'conversation'},conversationId:ROOT,background:true} as const const terminal = {status:'terminal',outcome:{status:'completed',result:null}} as const @@ -26,7 +26,7 @@ export default function automations(host:any) { throw new Error('Subscriber must be #id or @name') } async function resolve(target:Subscriber) { - return typeof target === 'number' ? target : host.need(SubagentsApi).standing(target.slice(1),context) + return typeof target === 'number' ? target : host.need(SubagentsApi).mainAgent(target.slice(1),context) } const Delivery = defineTask({name:'automations.delivery',version:1,initial:()=>({phase:'deliver'}),phases:{deliver:async(task,runtime,ctx)=>{ const id = await resolve(task.input.target) diff --git a/extensions/automations/triggers.ts b/extensions/automations/triggers.ts index 05f9597..187755c 100644 --- a/extensions/automations/triggers.ts +++ b/extensions/automations/triggers.ts @@ -13,11 +13,11 @@ import { defineDoc } from '@earendil-works/pi-durable' const UserInputEvent = defineEvent('conversations.user-input') export type ContextUsage = {percent?: number; tokens?: number; window?: number} export const ContextUsageDoc = defineDoc({kind:'conversations.context',version:1,scope:'conversation',history:'latest',fork:'initial',initial:()=>({}),checkpointWhen:()=>false}) -import { Standing, SubagentsApi } from '../subagents/api.ts' +import { MainAgent, SubagentsApi } from '../subagents/api.ts' import { describeSchedule } from './schedule.ts' import type { Automations as Ledger } from './server.ts' import type { Automation, TriggerEvent } from './types.ts' -import { RUN_TASK, STANDING } from './types.ts' +import { RUN_TASK, MAIN_AGENT } from './types.ts' export const TRIGGER_EVENTS: TriggerEvent[] = [ { @@ -57,7 +57,7 @@ export const TRIGGER_EVENTS: TriggerEvent[] = [ name: 'conversations.compacted', description: 'A conversation compacted', fields: { - conversation: 'Conversation id, or @name for a standing agent', + conversation: 'Conversation id, or @name for a main agent', reason: 'Compaction reason', }, }, @@ -113,7 +113,7 @@ export function triggers( prepareFires: (tx: Tx) => Promise, ) { async function resolve(of: string): Promise { - if (STANDING.test(of)) return host.need(SubagentsApi).standing(of.slice(1), BACKGROUND_CONTEXT) + if (MAIN_AGENT.test(of)) return host.need(SubagentsApi).mainAgent(of.slice(1), BACKGROUND_CONTEXT) if (/^#[1-9]\d*$/.test(of)) return Number(of.slice(1)) as ConversationId return undefined } @@ -212,8 +212,8 @@ export function triggers( for (const a of Object.values(state.automations)) { if (!a.condition?.idleFor) continue const of = a.condition.of - const target = STANDING.test(of) - ? (await tx.doc(Standing, ROOT_CONVERSATION_ID))[of.slice(1)] + const target = MAIN_AGENT.test(of) + ? (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))[of.slice(1)] : Number(of.slice(1)) if (target === data.conversation) a.condition.inputAt = Date.parse(at) } @@ -227,12 +227,12 @@ export function triggers( async (tx, event) => { const state = await tx.doc(Automations) const matching: Automation[] = [] - // `@name` matches the standing agent's conversation when the event comes: it changes with each chapter. - const standing = await tx.doc(Standing, ROOT_CONVERSATION_ID) + // `@name` matches the main agent's conversation when the event comes: it changes with each chapter. + const mainAgent = await tx.doc(MainAgent, ROOT_CONVERSATION_ID) const expected = (value: string | number | boolean) => - typeof value === 'string' && STANDING.test(value) - ? Object.hasOwn(standing, value.slice(1)) - ? standing[value.slice(1)] + typeof value === 'string' && MAIN_AGENT.test(value) + ? Object.hasOwn(mainAgent, value.slice(1)) + ? mainAgent[value.slice(1)] : null : value // Every read before the first fire: a transaction may not scan tasks after it wrote. @@ -271,10 +271,10 @@ export function triggers( if(closed) return await host.harness().commit(async (tx: any) => { const ledger = await tx.doc(Automations) - const standing = await tx.doc(Standing,ROOT_CONVERSATION_ID) + const mainAgent = await tx.doc(MainAgent,ROOT_CONVERSATION_ID) for(const entry of inputs) for(const a of Object.values(ledger.automations) as Automation[]) { if(!a.condition?.idleFor) continue - const target=STANDING.test(a.condition.of) ? standing[a.condition.of.slice(1)] : Number(a.condition.of.slice(1)) + const target=MAIN_AGENT.test(a.condition.of) ? mainAgent[a.condition.of.slice(1)] : Number(a.condition.of.slice(1)) if(target === entry.conversationId) a.condition.inputAt = entry.model?.[0]?.timestamp ?? Date.now() } for(const {id,usage} of measured) Object.assign(await tx.doc(ContextUsageDoc,id),usage) diff --git a/extensions/automations/types.ts b/extensions/automations/types.ts index 975473c..f6be005 100644 --- a/extensions/automations/types.ts +++ b/extensions/automations/types.ts @@ -19,7 +19,7 @@ export type Run = { finishedAt?: number answer?: string } -/** A conversation an automation wakes: `#id` as a number, or a standing agent's `@name`, resolved at each delivery. */ +/** A conversation an automation wakes: `#id` as a number, or a main agent's `@name`, resolved at each delivery. */ export type Subscriber = number | string export type Automation = { id: string @@ -100,7 +100,7 @@ export type CreateArgs = { subscribers?: Subscriber[] scope?: 'user' | 'project' slug?: string - /** A project script's standing agent to wake on every machine, `@name`; default `the standing agent`. */ + /** A project script's main agent to wake on every machine, `@name`; default `the main agent`. */ to?: string key?: string } @@ -113,8 +113,8 @@ export type Args = Partial & { reason?: string } export type Manifest = { name: string; ask: string; once: boolean; secrets?: string[]; to: string } -/** A standing agent's name as a subscriber or target: `the standing agent`. */ -export const STANDING = /^@[a-zA-Z0-9_-]+$/ +/** A main agent's name as a subscriber or target: `the main agent`. */ +export const MAIN_AGENT = /^@[a-zA-Z0-9_-]+$/ /** How many unplanned script exits in a row escalate instead of waking the watcher again. */ export const FAILURE_LIMIT = 3 export type Effect = { id: string; action: string; previousPid?: number } @@ -137,4 +137,4 @@ export function trimLog(text: string): string { } /** The task kind of an automation's prompt run, which owns the run's conversation. */ -export const RUN_TASK = 'standing.automation-run' +export const RUN_TASK = 'main-agent.automation-run' diff --git a/extensions/conversations/README.md b/extensions/conversations/README.md index 5b7949e..e08664b 100644 --- a/extensions/conversations/README.md +++ b/extensions/conversations/README.md @@ -1,8 +1,8 @@ # Conversation lifecycle The `conversations` service exposes metadata subjects and the concluded set. -`concludeIn(tx, ids)` refuses unknown, owned, root, and standing conversations. -`setStanding`, `setAutomaticSummaries`, and `generatedTitle` update durable conversation state. +`concludeIn(tx, ids)` refuses unknown, owned, root, and main agent conversations. +`setMainAgent`, `setAutomaticSummaries`, and `generatedTitle` update durable conversation state. `generatedTitle` only marks a matching metadata title that no earlier call marked. The `beforeInput` hook resumes the recipient and its owner/fork ancestors. diff --git a/extensions/conversations/server.ts b/extensions/conversations/server.ts index 52c93c9..1dc004b 100644 --- a/extensions/conversations/server.ts +++ b/extensions/conversations/server.ts @@ -11,12 +11,12 @@ export default function conversations(host: any) { const record = await tx.conversation(id) if (!record) throw new Error(`Unknown conversation ${id}`) if (record.owner) throw new Error(`Conversation ${id} is owned`) - if (id === ROOT_CONVERSATION_ID || (await tx.doc(State,id)).standing) throw new Error(`Conversation ${id} is fixed`) + if (id === ROOT_CONVERSATION_ID || (await tx.doc(State,id)).mainAgent) throw new Error(`Conversation ${id} is fixed`) } const state = await tx.doc(Concluded) state.ids = [...new Set([...state.ids,...ids])] }, - setStanding: async (tx: any, id: number, standing: boolean) => { (await tx.doc(State,id)).standing = standing }, + setMainAgent: async (tx: any, id: number, mainAgent: boolean) => { (await tx.doc(State,id)).mainAgent = mainAgent }, setAutomaticSummaries: async (tx: any, id: number, enabled: boolean) => { (await tx.doc(State,id)).automaticSummaries = enabled }, generatedTitle: async (tx: any, id: number, title: string) => { const state = await tx.doc(State,id) diff --git a/extensions/core/agents.test.ts b/extensions/core/agents.test.ts index a76ff73..86fb374 100644 --- a/extensions/core/agents.test.ts +++ b/extensions/core/agents.test.ts @@ -1,67 +1,56 @@ -/** Pure YAML roster checks. Bundle with the host's yaml dependency and run from the repository root. */ +/** Pure checks for world settings, Markdown definitions, overlays, and skill frontmatter. */ import assert from 'node:assert/strict' -import { readFileSync, readdirSync, existsSync } from 'node:fs' -import { parseConfig, parseFrontmatter, definitionRuns, toolsFor } from './agents.ts' -let count = 0 -function test(name: string, run: () => void) { run(); console.log(`ok ${++count} - ${name}`) } -const text=readFileSync('config/config.yaml','utf8') -const config=parseConfig(text) -const fixture=()=>({standing:'worker',prompt:'Shared context',roster:[{name:'worker',description:'Worker',model:'faux/faux-1',thinking:'low',prompt:'Role context',tools:['read']}]}) - -test('default config contains the full roster and the configured standing model',()=>{ - assert.deepEqual(config.definitions.map(d=>d.name),['coordinator','designer','dream-pass','reviewer-architecture','reviewer-correctness','reviewer-simplicity','reviewer','scout','sausage','watcher','worker']) - const standing=config.definitions.find(d=>d.name===config.standing)! - assert.deepEqual(definitionRuns(standing),{model:{provider:'anthropic',modelId:'claude-opus-5-5'},thinking:'high'}) - assert(standing.instructions.includes('/srv/www')) - assert(standing.instructions.includes('instead of guessing')) -}) -test('global prompt states each harness route, the proc files, and the config path',()=>{ - for(const value of ['http://host.sausage/harness/','http://host.sausage/whoami','/srv/www','port 8080','conversations','conversations/ID/entries?after=N','events?after=N','models','extensions','credential-requests','/proc/processes','/proc/extensions','jaq','/etc/sausage/config.yaml']) assert(config.prompt.includes(value),value) -}) -test('YAML block scalars keep the shared and role prompts separate',()=>{ - assert(config.prompt.startsWith('## Sausage and the world')) - assert(config.prompt.includes('\n\n## Inspect the harness state')) - assert(!config.prompt.includes('# Standing agent')) - assert(config.definitions.every(d=>d.instructions.includes('\n'))) -}) -test('JSON is valid YAML and model references preserve slashes in the model id',()=>{ - const value=fixture();value.roster[0].model='faux/org/model' - assert.deepEqual(definitionRuns(parseConfig(JSON.stringify(value)).definitions[0]).model,{provider:'faux',modelId:'org/model'}) -}) -test('reject missing global prompt, unknown standing name, and duplicate roster names',()=>{ - const value=fixture() - assert.throws(()=>parseConfig(JSON.stringify({...value,prompt:null})),/prompt must be a string/) - assert.throws(()=>parseConfig(JSON.stringify({...value,standing:'missing'})),/standing must name a roster member/) - assert.throws(()=>parseConfig(JSON.stringify({...value,roster:[...value.roster,...value.roster]})),/duplicate agent/) -}) -test('reject malformed YAML and invalid roster fields',()=>{ - assert.throws(()=>parseConfig('roster: [\n')) - for(const patch of [{name:'with space'},{description:''},{prompt:''},{model:'missing-provider'},{thinking:'no'},{tools:'read'},{denyTools:[1]}]) { - const value=fixture();Object.assign(value.roster[0],patch) - assert.throws(()=>parseConfig(JSON.stringify(value)),/config.yaml/) +import {readFileSync,readdirSync} from 'node:fs' +import {parseConfig,parseDefinition,parseFrontmatter,definitionRuns,toolsFor} from './agents.ts' +let count=0 +function test(name:string,run:()=>void){run();console.log(`ok ${++count} - ${name}`)} +const config=parseConfig(readFileSync('config/config.yaml','utf8')) +const definitions=readdirSync('config/roster').sort().map(name=>parseDefinition(readFileSync(`config/roster/${name}`,'utf8'),`config/roster/${name}`)) +test('exactly eight built-in Markdown definitions and no inline roster',()=>{ + assert.deepEqual(definitions.map(d=>d.name),['coordinator','designer','dream-pass','reviewer','sausage','scout','watcher','worker']) + assert.equal(config.roster,undefined);assert.equal(config.main_agent_name,'sausage') + for(const d of definitions){ + const model=['coordinator','designer','sausage'].includes(d.name)?'anthropic/claude-opus-5-5':d.name==='reviewer'?'openai/gpt-6-astra':['scout','watcher'].includes(d.name)?'openai/gpt-6-luna':'openai/gpt-6.1-sol' + assert.equal(d.model,model) + assert.equal(d.thinking,['scout','watcher'].includes(d.name)?'low':['worker','dream-pass'].includes(d.name)?'medium':'high') } }) -test('tool denials also apply to inherited tools without changing the parent',()=>{ - const definition=parseConfig(JSON.stringify(fixture())).definitions[0] - const parent=['read','write'] - delete definition.tools;definition.addTools=['bash'];definition.denyTools=['write'] - assert.deepEqual(toolsFor(definition,parent),['read','bash']) - assert.deepEqual(parent,['read','write']) +test('shared prompt contains state inspection and current world paths',()=>{ + for(const text of ['http://host.sausage/harness/','whoami','conversations/ID/entries?after=N','events?after=N','credential-requests','/proc/processes','/proc/extensions','jaq','/etc/sausage/config.yaml'])assert(config.prompt.includes(text),text) }) -test('skill frontmatter uses the same YAML parser',()=>{ - const parsed=parseFrontmatter('---\r\nname: skill\r\ndescription: >\r\n First line\r\n second line\r\n---\r\nBody') - assert.equal(parsed.frontmatter.name,'skill') - assert.equal(parsed.frontmatter.description,'First line second line\n') - assert.equal(parsed.body,'Body') +test('main role describes direct self-change and state inspection',()=>{ + const role=definitions.find(d=>d.name===config.main_agent_name)! + assert(role.instructions.includes('Act directly'));assert(role.instructions.includes('instead of guessing')) }) -test('every built-in skill has its matching name, description, and instructions',()=>{ - for (const folder of readdirSync('skills')) { - const path=`skills/${folder}/SKILL.md` - if (!existsSync(path)) continue - const {frontmatter,body}=parseFrontmatter(readFileSync(path,'utf8')) - assert.equal(frontmatter.name,folder,path) - assert.equal(typeof frontmatter.description,'string',path) - assert(body.trim(),path) +test('filename defines the name and model IDs preserve slashes',()=>{ + const d=parseDefinition('---\ndescription: Example\nmodel: local/org/model\n---\nRole','/roster/new-name.md') + assert.equal(d.name,'new-name');assert.deepEqual(definitionRuns(d).model,{provider:'local',modelId:'org/model'}) +}) +test('an additive project overlay retains base settings and appends instructions',()=>{ + const base=parseDefinition('---\ndescription: Base\nmodel: local/model\ntools: [read]\n---\nBase instructions','/roster/worker.md') + const overlay=parseDefinition('---\naddTools: [bash]\ndenyTools: [read]\n---\nProject instructions','/project/.sausage/roster/worker.md',base) + assert.equal(overlay.model,'local/model');assert.deepEqual(toolsFor(overlay,[]),['bash']) + assert(overlay.instructions.includes('Base instructions'));assert(overlay.instructions.includes('Project instructions')) +}) +test('a complete project definition replaces the body',()=>{ + const base=definitions.find(d=>d.name==='worker')! + const next=parseDefinition('---\ndescription: Project worker\nmodel: local/model\n---\nReplacement','/project/.sausage/roster/worker.md',base) + assert.equal(next.instructions,'Replacement') +}) +test('missing settings and malformed definition fields fail with a path',()=>{ + assert.throws(()=>parseConfig('main_agent_name: sausage'),/prompt/) + assert.throws(()=>parseConfig('prompt: text'),/main_agent_name/) + assert.throws(()=>parseDefinition('---\nmodel: local/model\n---\nRole','/roster/example.md'),/description/) + assert.throws(()=>parseDefinition('---\ndescription: Example\nmodel: invalid\n---\nRole','/roster/example.md'),/example.md/) + assert.throws(()=>parseDefinition('---\ndescription: Example\nmodel: local/model\nthinking: invalid\n---\nRole','/roster/example.md'),/thinking/) +}) +test('tool denials do not mutate inherited tools',()=>{ + const inherited=['read','bash'];assert.deepEqual(toolsFor({...definitions[0],denyTools:['bash']},inherited),['read']);assert.deepEqual(inherited,['read','bash']) +}) +test('all built-in skills contain valid YAML frontmatter',()=>{ + for(const name of readdirSync('skills',{withFileTypes:true}).filter(e=>e.isDirectory()).map(e=>e.name)){ + const skill=parseFrontmatter(readFileSync(`skills/${name}/SKILL.md`,'utf8')) + assert.equal(skill.frontmatter.name,name);assert.equal(typeof skill.frontmatter.description,'string');assert(skill.body.length>0) } }) console.log(`${count} tests passed`) diff --git a/extensions/core/agents.ts b/extensions/core/agents.ts index 01f26b1..158b5b6 100644 --- a/extensions/core/agents.ts +++ b/extensions/core/agents.ts @@ -1,4 +1,4 @@ -/** YAML roster entries, skill metadata, model references, and inherited tools. */ +/** Markdown roster files, YAML settings and skill metadata, model references, and inherited tools. */ import { parse } from 'yaml' export const CONFIG = '/etc/sausage/config.yaml' export const thinkingLevels = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const @@ -25,28 +25,25 @@ export function parseFrontmatter(text: string) { if (!match) throw new Error('Expected frontmatter fields between --- lines') return {frontmatter:parse(match[1]) as Record, body:match[2].trim()} } -export function parseRoster(text: string, path: string) { - const value = parse(text) - if (!value || !Array.isArray(value.roster)) throw new Error(`${path}: roster must be a list`) - const names = new Set() - const definitions = value.roster.map((entry: any): Definition => { - if (!entry || typeof entry.name !== 'string' || !/^[a-zA-Z0-9_-]+$/.test(entry.name)) throw new Error(`${path}: invalid roster name`) - if (names.has(entry.name)) throw new Error(`${path}: duplicate agent ${entry.name}`) - names.add(entry.name) - for (const key of ['description', 'prompt', 'model']) if (typeof entry[key] !== 'string' || !entry[key].trim()) throw new Error(`${path}: ${entry.name}.${key} is required`) - if (entry.thinking !== undefined && !thinkingLevels.includes(entry.thinking)) throw new Error(`${path}: invalid thinking for ${entry.name}`) - for (const key of ['tools', 'addTools', 'denyTools']) if (entry[key] !== undefined && (!Array.isArray(entry[key]) || !entry[key].every((tool: any)=>typeof tool === 'string'))) throw new Error(`${path}: ${entry.name}.${key} must be a list of tool names`) - const {prompt, ...settings} = entry - const definition = {...settings, path, instructions:prompt} - definitionRuns(definition) - return definition - }) - return {...value, definitions} +export const ROSTER = '/etc/sausage/roster' +export function parseDefinition(text: string, path: string, inherited?: Definition): Definition { + const {frontmatter, body} = parseFrontmatter(text) + const name = path.split('/').pop()!.replace(/\.md$/, '') + const settings = {...(inherited ?? {}), ...frontmatter} + const instructions = inherited && frontmatter.addTools !== undefined ? [inherited.instructions, body].filter(Boolean).join('\n\n## Project additions\n\n') : body + const definition = {...settings, name, path, instructions} as Definition + if (!/^[a-zA-Z0-9_-]+$/.test(name)) throw new Error(`${path}: invalid roster name`) + for (const key of ['description','model','instructions']) if (typeof definition[key] !== 'string' || !definition[key].trim()) throw new Error(`${path}: ${key} is required`) + if (definition.thinking !== undefined && !thinkingLevels.includes(definition.thinking)) throw new Error(`${path}: invalid thinking`) + for (const key of ['tools','addTools','denyTools']) if (definition[key] !== undefined && (!Array.isArray(definition[key]) || !definition[key].every((tool: any)=>typeof tool === 'string'))) throw new Error(`${path}: ${key} must be a list of tool names`) + if (inherited && frontmatter.addTools !== undefined) definition.tools = toolsFor(definition, inherited.tools ?? []) + definitionRuns(definition) + return definition } export function parseConfig(text: string) { - const value = parseRoster(text, CONFIG) - if (typeof value.prompt !== 'string') throw new Error(`${CONFIG}: prompt must be a string`) - if (!value.definitions.some((entry: Definition)=>entry.name === value.standing)) throw new Error(`${CONFIG}: standing must name a roster member`) + const value = parse(text) + if (typeof value?.prompt !== 'string') throw new Error(`${CONFIG}: prompt must be a string`) + if (typeof value.main_agent_name !== 'string' || !value.main_agent_name) throw new Error(`${CONFIG}: main_agent_name must name a roster file`) return value } export function definitionRuns(definition: Definition) { diff --git a/extensions/dream/DREAM.md b/extensions/dream/DREAM.md index 2ae09f2..c4e6d55 100644 --- a/extensions/dream/DREAM.md +++ b/extensions/dream/DREAM.md @@ -3,7 +3,7 @@ A dream is a read-only review in an ordinary branch. It does not change code, memory, settings, or storage automatically. The user decides which proposals to accept. Approved proposals become ordinary work. -## For the standing agent +## For the main agent A user request or a built-in automation can request a dream. If a dream branch is active, report that fact. Do not start another branch. @@ -43,12 +43,12 @@ Do not edit files, apply proposals, or switch storage during a dream. ## Built-in automations -Dream creates two ordinary context automations after the standing agent exists: +Dream creates two ordinary context automations after the main agent exists: - `Dream before compaction`: the context exceeds 70%. - `Dream after a pause`: the context exceeds 50% after eight hours without user input. -The automations wake the standing agent. Each fire also adds one passive `dream.requested` entry. +The automations wake the main agent. Each fire also adds one passive `dream.requested` entry. The automation ID and fire number identify that entry across replay and reopen. Creation keys recover a lost receipt without a duplicate automation. A user can pause or delete an automation. Reopen preserves those choices. diff --git a/extensions/dream/built-ins.ts b/extensions/dream/built-ins.ts index d4f8bbb..337cca0 100644 --- a/extensions/dream/built-ins.ts +++ b/extensions/dream/built-ins.ts @@ -2,7 +2,7 @@ import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context' import { defineDoc, ROOT_CONVERSATION_ID as ROOT } from '@earendil-works/pi-durable' import { Automations, AutomationsApi } from '../automations/server.ts' -import { Standing } from '../subagents/api.ts' +import { MainAgent } from '../subagents/api.ts' import { deliver } from './delivery.ts' export const AUTOMATION_NAME='Dream before compaction' export const PAUSE_NAME='Dream after a pause' @@ -12,11 +12,11 @@ const builtIns=[ {doc:BuiltInDoc,name:AUTOMATION_NAME,condition:{metric:'context',above:70}}, {doc:PauseDoc,name:PAUSE_NAME,condition:{metric:'context',above:50,idleFor:8*3600_000}}, ] -export const DREAM_ASK='Dream now: follow "For the standing agent" in /src/sausage/extensions/dream/DREAM.md. Write your handoff into the dream branch prompt in this turn, while your context still holds everything. If a dream branch is already active, say so and do not start another.' +export const DREAM_ASK='Dream now: follow "For the main agent" in /src/sausage/extensions/dream/DREAM.md. Write your handoff into the dream branch prompt in this turn, while your context still holds everything. If a dream branch is already active, say so and do not start another.' export async function ensureAutomation(host:any) { const service=host.want(AutomationsApi) - const standing=(await host.harness().snapshot(Standing,ROOT,context))?.['$standing'] - if(!service || standing===undefined) return + const mainAgent=(await host.harness().snapshot(MainAgent,ROOT,context))?.['$main-agent'] + if(!service || mainAgent===undefined) return for(const {doc,name,condition} of builtIns) { const state=await host.harness().snapshot(doc,ROOT,context) if(state?.deleted) continue @@ -24,7 +24,7 @@ export async function ensureAutomation(host:any) { const list=await service.operate({action:'list'}) if(!list.some((a:any)=>a.id===state.id)) await host.harness().commit(async(tx:any)=>{(await tx.doc(doc,ROOT)).deleted=true},context) } else { - const made=await service.operate({action:'create',name,condition:{...condition,of:`#${standing}`},subscribers:[standing],key:`dream:${doc.definition.kind}`}) + const made=await service.operate({action:'create',name,condition:{...condition,of:`#${mainAgent}`},subscribers:[mainAgent],key:`dream:${doc.definition.kind}`}) await host.harness().commit(async(tx:any)=>{(await tx.doc(doc,ROOT)).id=made.id},context) } } @@ -32,10 +32,10 @@ export async function ensureAutomation(host:any) { export async function fired(host:any,tx:any,id:string,fire:number) { const builtIn=await Promise.all(builtIns.map(async(item)=>({item,id:(await tx.doc(item.doc,ROOT)).id}))) const found=builtIn.find(item=>item.id===id)?.item - const standing=(await tx.doc(Standing,ROOT))['$standing'] - if(!found || standing===undefined) return + const mainAgent=(await tx.doc(MainAgent,ROOT))['$main-agent'] + if(!found || mainAgent===undefined) return const automation=(await tx.doc(Automations)).automations[id] const pause=found.doc===PauseDoc && automation ? Date.now()-(automation.condition?.inputAt??automation.createdAt) : undefined const data={automation:{id,name:automation?.name??found.name,...(pause===undefined?{}:{pause})}} - await deliver(host,tx,standing,{type:'write',requestId:`dream.requested:${id}:${fire}`,kind:'dream.requested',data,content:`Automation ${id} "${data.automation.name}" fired${pause===undefined?'':` after ${Math.round(pause/3600_000)} h away`}. ${DREAM_ASK}`}) + await deliver(host,tx,mainAgent,{type:'write',requestId:`dream.requested:${id}:${fire}`,kind:'dream.requested',data,content:`Automation ${id} "${data.automation.name}" fired${pause===undefined?'':` after ${Math.round(pause/3600_000)} h away`}. ${DREAM_ASK}`}) } diff --git a/extensions/dream/server.ts b/extensions/dream/server.ts index 070b5d7..0b97f18 100644 --- a/extensions/dream/server.ts +++ b/extensions/dream/server.ts @@ -3,7 +3,7 @@ import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context' import { defineDoc, defineExtension, defineTool, ROOT_CONVERSATION_ID as ROOT } from '@earendil-works/pi-durable' import { arr, obj, opt, str } from '@earendil-works/pi-schema' import { Fired } from '../automations/refs.ts' -import { Standing, Started } from '../subagents/api.ts' +import { MainAgent, Started } from '../subagents/api.ts' import { BuiltInDoc, PauseDoc, DREAM_ASK, ensureAutomation, fired } from './built-ins.ts' import { deliver, deliverTask } from './delivery.ts' export const DreamApi={name:'dream'} @@ -27,22 +27,22 @@ export default function dream(host:any) { return run.catch((error:any)=>host.notice(`Dream automations: ${String(error)}`)) } host.onOpen(ensure) - host.react('standing-started',[Started],(_tx:any,{data}:any)=>{ + host.react('mainAgent-started',[Started],(_tx:any,{data}:any)=>{ // Creation commits run after this reactor transaction completes. - if(data.kind==='standing') void ensure() + if(data.kind==='mainAgent') void ensure() },{from:'now'}) host.react('requested',[Fired],(tx:any,{data}:any)=>fired(host,tx,data.id,data.fire),{from:'now'}) async function change(tx:any,args:any) { - const standing=(await tx.doc(Standing,ROOT))['$standing'] - if(standing===undefined) throw new Error('the standing agent has no conversation yet') + const mainAgent=(await tx.doc(MainAgent,ROOT))['$main-agent'] + if(mainAgent===undefined) throw new Error('the main agent has no conversation yet') if(args.action==='start') { - await deliver(host,tx,standing,{type:'input',requestId:`dream.requested:${crypto.randomUUID()}`,kind:'dream.requested',data:{},content:`The user requested a dream. ${DREAM_ASK}`}) + await deliver(host,tx,mainAgent,{type:'input',requestId:`dream.requested:${crypto.randomUUID()}`,kind:'dream.requested',data:{},content:`The user requested a dream. ${DREAM_ASK}`}) return {requested:true} } if(args.action!=='prepare') throw new Error(`Unknown dream action ${args.action}`) const prepared=prepare(args,Date.now()) ;(await tx.doc(Next,ROOT)).prepared=prepared - await deliver(host,tx,standing,{type:'write',requestId:`dream.prepared:${crypto.randomUUID()}`,kind:'dream.prepared',data:prepared,content:`Prepared dream handoff:\n${prepared.learned.join('\n')}\n\n${prepared.handoff}\nContinue in this world. No chapter switch is available.`}) + await deliver(host,tx,mainAgent,{type:'write',requestId:`dream.prepared:${crypto.randomUUID()}`,kind:'dream.prepared',data:prepared,content:`Prepared dream handoff:\n${prepared.learned.join('\n')}\n\n${prepared.handoff}\nContinue in this world. No chapter switch is available.`}) return prepared } host.implement(DreamApi,{operate:(args:any)=>host.harness().commit((tx:any)=>change(tx,args),context)}) diff --git a/extensions/goal/README.md b/extensions/goal/README.md index 05f2ca5..d679fb7 100644 --- a/extensions/goal/README.md +++ b/extensions/goal/README.md @@ -1,15 +1,15 @@ # Hands-off goals The user starts or ends a goal through the exported server actions. -Only the standing `the standing agent` conversation uses the `goal` tool. +Only the main agent conversation uses the `goal` tool. The root document stores one open goal and its decisions. Three failed tries block a criterion. Rewording preserves unchanged criteria. Decisions can name screenshots from the caller's conversation. The `latest` reference never crosses an input boundary. -Each input to `the standing agent` receives the current open goal note. +Each input to `the main agent` receives the current open goal note. A queued start card grants nothing after the user ends the goal. -The start wakes `the standing agent`. The report uses a passive write. +The start wakes `the main agent`. The report uses a passive write. The optional automations service creates one keyed reminder every 30 minutes. A durable task synchronizes its state after each lifecycle change. diff --git a/extensions/goal/delivery.ts b/extensions/goal/delivery.ts index f6c72dd..071d254 100644 --- a/extensions/goal/delivery.ts +++ b/extensions/goal/delivery.ts @@ -3,7 +3,7 @@ import { defineTask } from '@earendil-works/pi-durable' import type { ConversationId, Tx } from '@earendil-works/pi-durable' import type { Host } from '../../host/js/extensions.ts' -/** A goal card for the standing agent: `goal.started` as an input that wakes it, `goal.report` as a write. */ +/** A goal card for the main agent: `goal.started` as an input that wakes it, `goal.report` as a write. */ type Card = { to: number; goal: number; kind: 'goal.started' | 'goal.report'; content: string } /** Created in the commit that changes the goal, so a crash cannot lose the card; the request id makes retries harmless. */ diff --git a/extensions/goal/refs.ts b/extensions/goal/refs.ts index 3bd58df..28a999a 100644 --- a/extensions/goal/refs.ts +++ b/extensions/goal/refs.ts @@ -1,7 +1,7 @@ -/** Hands-off goals in the browser: the goal the user put the standing agent on, and every decision it took for them. Browser-safe. */ +/** Hands-off goals in the browser: the goal the user put the main agent on, and every decision it took for them. Browser-safe. */ import { actionRef, docRef } from '../goal/compat.ts' -/** One decision the standing agent took instead of asking the user. */ +/** One decision the main agent took instead of asking the user. */ export type Decision = { at: number /** What it would have asked the user. */ @@ -11,19 +11,19 @@ export type Decision = { reason: string /** The branch the decision was for. */ conversation?: number - /** The entry of the standing agent's conversation holding the screenshots it judged, such as a UI preview it approved. */ + /** The entry of the main agent's conversation holding the screenshots it judged, such as a UI preview it approved. */ images?: number } /** How a goal ended: met, blocked (every remaining criterion stuck), or ended by the user. */ export type Ending = { at: number - by: 'user' | 'standing' + by: 'user' | 'mainAgent' outcome: 'met' | 'blocked' | 'ended' summary?: string } -/** What "done" means, as the standing agent wrote it down: each criterion open, met, or blocked after repeated failed tries. */ +/** What "done" means, as the main agent wrote it down: each criterion open, met, or blocked after repeated failed tries. */ export type Criterion = { text: string; status: 'open' | 'met' | 'blocked'; tries?: number } export type Goal = { @@ -33,9 +33,9 @@ export type Goal = { startedAt: number criteria: Criterion[] decisions: Decision[] - /** The "Goal reminder" automation that wakes the standing agent every 30 minutes while the goal is open. */ + /** The "Goal reminder" automation that wakes the main agent every 30 minutes while the goal is open. */ reminder?: string - /** Set while the standing agent is blocked on the user: the reminder is paused until it resumes. */ + /** Set while the main agent is blocked on the user: the reminder is paused until it resumes. */ waiting?: { reason: string; at: number } ended?: Ending } @@ -43,12 +43,12 @@ export type Goal = { /** `{ next, goals }` on conversation 1, oldest first; at most one goal is open (no `ended`). */ export const GoalDoc = docRef<{ next: number; goals: Goal[] }>('goal') -/** `goal.started` and `goal.report` entries in the standing agent's conversation name their goal. */ +/** `goal.started` and `goal.report` entries in the main agent's conversation name their goal. */ export type GoalEntry = { goal: number } -/** `{ text }` → the new goal. User-only: puts the standing agent hands-off on it. */ +/** `{ text }` → the new goal. User-only: puts the main agent hands-off on it. */ export const StartAction = actionRef<{ text: string }, Goal>('goal', 'start') -/** No arguments → the ended goal. User-only: ends the open goal; the standing agent asks again as usual. */ +/** No arguments → the ended goal. User-only: ends the open goal; the main agent asks again as usual. */ export const EndAction = actionRef('goal', 'end') /** `{ goal, entry }` → the images of a decision's screenshot entry. */ export const ImagesAction = actionRef< diff --git a/extensions/goal/reminder.ts b/extensions/goal/reminder.ts index 9667f46..3a895ec 100644 --- a/extensions/goal/reminder.ts +++ b/extensions/goal/reminder.ts @@ -1,5 +1,5 @@ /** - * The goal reminder: an automation that wakes the standing agent every 30 minutes while a goal is open, so a stalled goal never + * The goal reminder: an automation that wakes the main agent every 30 minutes while a goal is open, so a stalled goal never * waits silently. Every goal change (start, pause, resume, end) creates a sync task in its own commit; the task brings * the automation in line with the goal as it is when the task runs. A crash leaves at most a task to rerun, and a rerun * gets the automation an earlier try made back from its create key instead of making a second one. @@ -9,7 +9,7 @@ import type { ConversationDocToken, Tx } from '@earendil-works/pi-durable' import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context' import type { Host } from '../../host/js/extensions.ts' import { AutomationsApi } from '../automations/server.ts' -import { Standing } from '../subagents/api.ts' +import { MainAgent } from '../subagents/api.ts' import type { Automation } from '../automations/types.ts' import type { Goal } from './refs.ts' @@ -55,12 +55,12 @@ export function reminderTask(host: Host, Goals: Goals) { if (!own) { // One the user deleted in the Automations panel stays deleted. if (goal.reminder) return false - const standing = await host.harness().commit(async tx => (await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'], context) + const mainAgent = await host.harness().commit(async tx => (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'], context) await automations.operate({ action: 'create', name: reminderName(id), schedule: SCHEDULE, - subscribers: [standing], + subscribers: [mainAgent], key: reminderKey(id), }) return true diff --git a/extensions/goal/server.ts b/extensions/goal/server.ts index 73ba9c9..1a1db34 100644 --- a/extensions/goal/server.ts +++ b/extensions/goal/server.ts @@ -1,7 +1,7 @@ /** - * Hands-off goals: the user puts the standing agent on a goal and goes away. While it is open, the standing agent decides what it would + * Hands-off goals: the user puts the main agent on a goal and goes away. While it is open, the main agent decides what it would * otherwise ask them, records each decision with its reason, and ends the goal with a report. Only the user starts or - * ends a goal early; the standing agent hears it on every run through a per-input note. + * ends a goal early; the main agent hears it on every run through a per-input note. */ import { arr, int, lit, obj, oneOf, opt, str, union } from '@earendil-works/pi-schema' import { @@ -18,7 +18,7 @@ import { implementAction } from '../goal/compat.ts' import { imagesOf, latestImagesEntry } from '../messages/compat.ts' import type { Host } from '../../host/js/extensions.ts' import { AutomationsApi } from '../automations/server.ts' -import { Standing } from '../subagents/api.ts' +import { MainAgent } from '../subagents/api.ts' import { deliver, deliverTask } from './delivery.ts' import { reminderTask } from './reminder.ts' import { EndAction, GoalDoc, ImagesAction, StartAction } from './refs.ts' @@ -42,7 +42,7 @@ export const docs = [Goals] /** A plain copy: the document's overlay is a proxy that structuredClone refuses, and unusable after the commit. */ const copy = (goal: Goal) => JSON.parse(JSON.stringify(goal)) as Goal -const standingOf = async (tx: Tx) => (await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] +const mainAgentOf = async (tx: Tx) => (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] /** The open goal, if any. */ export async function openGoal(tx: Tx) { @@ -87,7 +87,7 @@ const status = (criterion: Criterion) => : criterion.status /** - * the standing agent's per-run note while a goal is open: the goal, its criteria, and how it works; on a fire of its reminder, + * the main agent's per-run note while a goal is open: the goal, its criteria, and how it works; on a fire of its reminder, * what to check. */ export function noteText(goal: Goal, reminded = false) { @@ -135,8 +135,8 @@ type ToolArgs = { summary?: string } -/** One `goal` tool call by the standing agent (`standing`) in `tx`; returns its answer, and the goal when it finished. */ -export async function act(tx: Tx, standing: ConversationId, args: ToolArgs, now: number) { +/** One `goal` tool call by the main agent (`mainAgent`) in `tx`; returns its answer, and the goal when it finished. */ +export async function act(tx: Tx, mainAgent: ConversationId, args: ToolArgs, now: number) { const goal = await openGoal(tx) if (!goal) throw new Error('No hands-off goal is open; ask the user as usual.') const criterion = () => { @@ -163,7 +163,7 @@ export async function act(tx: Tx, standing: ConversationId, args: ToolArgs, now: ...(args.conversation === undefined ? {} : { conversation: args.conversation }), ...(args.images === undefined ? {} - : { images: await imagesEntry(tx, standing, args.images) }), + : { images: await imagesEntry(tx, mainAgent, args.images) }), } goal.decisions.push(decision) return { answer: `Recorded decision ${goal.decisions.length}: ${decision.picked}` } @@ -203,7 +203,7 @@ export async function act(tx: Tx, standing: ConversationId, args: ToolArgs, now: throw new Error("finish needs outcome 'met' or 'blocked'") const ended = await end(tx, { at: now, - by: 'standing', + by: 'mainAgent', outcome: args.outcome, summary: text(args.summary, 'summary'), }) @@ -213,20 +213,20 @@ export async function act(tx: Tx, standing: ConversationId, args: ToolArgs, now: } } -/** The report card's model text: what the standing agent (or the user, ending it) should take from it. */ +/** The report card's model text: what the main agent (or the user, ending it) should take from it. */ const reportText = (goal: Goal) => goal.ended?.by === 'user' ? `The user ended hands-off goal ${goal.id}. From now on ask them as usual.` : `Hands-off goal ${goal.id} ended (${goal.ended?.outcome}); its report card is here for the user. From now on ask them as usual.` /** - * Goal `goal`'s card of `kind` for the standing agent, delivered by a task created in `tx`, the commit that changed the goal. - * The start card says only that the user started it: what the standing agent may do comes from the goal note, built from the + * Goal `goal`'s card of `kind` for the main agent, delivered by a task created in `tx`, the commit that changed the goal. + * The start card says only that the user started it: what the main agent may do comes from the goal note, built from the * goal as it is when the input runs, so a start still queued after the user ended the goal grants nothing. */ async function card(host: Host, tx: Tx, kind: 'goal.started' | 'goal.report', goal: Goal) { - const to = await standingOf(tx) - if (to === undefined) throw new Error('the standing agent has no conversation yet') + const to = await mainAgentOf(tx) + if (to === undefined) throw new Error('the main agent has no conversation yet') await deliver(host, tx, { to, goal: goal.id, @@ -252,7 +252,7 @@ const sync = (host: Host, tx: Tx, goal: number) => }, ) -/** Starting and ending a goal is the user's grant; the standing agent only finishes one through its tool. */ +/** Starting and ending a goal is the user's grant; the main agent only finishes one through its tool. */ export const userActions = ['start', 'end'] export const actions = { start: implementAction(StartAction, (args, { host }) => @@ -299,7 +299,7 @@ export default function goalExtension(host: Host) { // Pi upstream: @earendil-works/pi-durable@1.5.0 — patched transactional beforeInput hook. // A per-run note while a goal is open, never a system-prompt section, keeps the prompt cached. beforeInput: async (input, { tx, conversationId }) => { - if ((await standingOf(tx)) !== conversationId) return undefined + if ((await mainAgentOf(tx)) !== conversationId) return undefined const goal = await openGoal(tx) if (!goal) return undefined // World automations use a plain input with their fire prefix. @@ -351,8 +351,8 @@ export default function goalExtension(host: Host) { async execute(args, api, ctx) { const caller = api.conversationId const result = await api.commit(async (tx) => { - if ((await standingOf(tx)) !== caller) - throw new Error('Only the standing agent keeps the hands-off goal.') + if ((await mainAgentOf(tx)) !== caller) + throw new Error('Only the main agent keeps the hands-off goal.') const acted = await act(tx, caller, args, Date.now()) if (acted.ended) await card(host, tx, 'goal.report', acted.ended) const changed = acted.sync ?? acted.ended?.id diff --git a/extensions/lineage/server.ts b/extensions/lineage/server.ts index 477effb..752efc9 100644 --- a/extensions/lineage/server.ts +++ b/extensions/lineage/server.ts @@ -7,7 +7,7 @@ import type { ConversationId, ConversationRecord, Cursor, EntryId, JsonObject, M import type { ModelThinkingLevel } from "@earendil-works/pi-ai" import { onCommit } from "../messages/compat.ts" import { Started as BoardStarted } from "../messages/addresses.ts" -import { Standing, Started, Subagents } from "../subagents/api.ts" +import { MainAgent, Started, Subagents } from "../subagents/api.ts" import { Branch, Branched, LineageApi, Rooted, Roots } from "./api.ts" import { TallyDoc, SubmissionLanded } from "./refs.ts" import { readMemory, applyMemoryOps, memoryBrief, memoryIndex, memoryText, memorizeTask, Memorized, MEMORY_RULES, MEMORY_SLUG, LINE_CHARS, BODY_CHARS } from "./memory.ts" @@ -534,7 +534,7 @@ async function forkBranch( : await inheritedTally(tx, from, at, root) let caller: string | undefined if (input.by !== undefined) { - const index = await tx.doc(Standing, ROOT_CONVERSATION_ID) + const index = await tx.doc(MainAgent, ROOT_CONVERSATION_ID) const name = Object.keys(index).find((candidate) => index[candidate] === input.by) caller = `#${input.by}${name ? ` (@${name})` : ''}` } @@ -772,7 +772,7 @@ async function refuseTally(tx: Tx, id: ConversationId) { if (!(await tx.doc(Roots, ROOT_CONVERSATION_ID)).roots.includes(id)) return const tally = await tx.doc(Tally, id) if (tally.since !== undefined) - throw new Error(`#${id} is a tally and runs no turns; ask the standing agent to start a branch`) + throw new Error(`#${id} is a tally and runs no turns; ask the main agent to start a branch`) } @@ -963,10 +963,10 @@ export default function lineageExtension(host: any) { // Not replay-safe (the default): an interrupted call is never rerun, so a batch commits at most once. async execute({ root, ops }, api, ctx) { // Every conversation sees the tool, but only the primary agent can write memory. - const standing = await host.harness().snapshot(Standing, ROOT_CONVERSATION_ID, ctx) - if (standing?.['$standing'] !== api.conversationId) + const mainAgent = await host.harness().snapshot(MainAgent, ROOT_CONVERSATION_ID, ctx) + if (mainAgent?.['$main-agent'] !== api.conversationId) throw new Error( - 'Only the standing agent writes project memory; tell the standing agent what to remember (message, reply: false).', + 'Only the main agent writes project memory; tell the main agent what to remember (message, reply: false).', ) const id = await memoryRoot(api.conversationId, root, ctx) const summary = await applyMemoryOps(host, id, ops, Date.now(), `tool:${api.taskId}:${api.callId}`) diff --git a/extensions/messages/README.md b/extensions/messages/README.md index 0d81736..88d66e5 100644 --- a/extensions/messages/README.md +++ b/extensions/messages/README.md @@ -1,6 +1,6 @@ # Messages and lineage -The extensions preserve the durable `board.*` and `lineage.*` identifiers from Standing agent. +The extensions preserve the durable `board.*` and `lineage.*` identifiers from Main agent. They use world files and world git. They do not use native filesystem or process APIs. ## Branches and delivery @@ -27,7 +27,7 @@ The starter's final answer reaches the branch without a faulted routing task. A static test checks free runtime identifiers in every extension module, including function bodies. The grant chain contains fork ancestry before starter ancestry. -Each conversation occurs once. A root fork that the standing agent starts includes `[branch, root, standing]`. +Each conversation occurs once. A root fork that the main agent starts includes `[branch, root, mainAgent]`. ## Tally and catch-up @@ -54,7 +54,7 @@ A shared queue serializes writes across extension reloads. A tool or landing receipt commits in that same file. Thus, a restart after the rename does not apply the operations twice. -Only the standing agent can use the `remember` tool. +Only the main agent can use the `remember` tool. Other extensions can use the lineage service. Branches from a root with memory start with its index and recent landings. diff --git a/extensions/messages/addresses.ts b/extensions/messages/addresses.ts index 676f496..6833db1 100644 --- a/extensions/messages/addresses.ts +++ b/extensions/messages/addresses.ts @@ -3,7 +3,7 @@ import type { Context } from '@earendil-works/chord' import { defineDoc, ROOT_CONVERSATION_ID } from '@earendil-works/pi-durable' import type { ConversationId } from '@earendil-works/pi-durable' import type { Host as ExtensionHost } from '../../host/js/extensions.ts' -import { Standing, Subagents, SubagentsApi } from '../subagents/api.ts' +import { MainAgent, Subagents, SubagentsApi } from '../subagents/api.ts' import { Roots } from '../lineage/api.ts' import { Tally } from '../lineage/server.ts' @@ -36,9 +36,9 @@ export async function parentOf(host: ExtensionHost, id: number, ctx: Context) { } export async function senderName(host: ExtensionHost, id: number | 'user', ctx: Context) { if (id === 'user') return 'user' - if (typeof id !== 'number') return 'another Standing agent' - const index = await host.harness().snapshot(Standing, ROOT_CONVERSATION_ID, ctx) - const name = Object.keys(index ?? {}).find((candidate) => candidate !== '$standing' && index?.[candidate] === id) + if (typeof id !== 'number') return 'another Main agent' + const index = await host.harness().snapshot(MainAgent, ROOT_CONVERSATION_ID, ctx) + const name = Object.keys(index ?? {}).find((candidate) => candidate !== '$main-agent' && index?.[candidate] === id) return `#${id}${name ? ` (@${name})` : ''}` } export async function resolve( @@ -54,9 +54,9 @@ export async function resolve( const valid = await service.residents(ctx) if (!valid.some((item) => `@${item.name}` === to)) throw new Error( - `Unknown address ${to}. Valid standing agents: ${valid.map((item) => `@${item.name}`).join(', ') || '(none)'}`, + `Unknown address ${to}. Valid main agents: ${valid.map((item) => `@${item.name}`).join(', ') || '(none)'}`, ) - id = await service.standing(to.slice(1), ctx) + id = await service.mainAgent(to.slice(1), ctx) } else if (/^#?\d+$/.test(to)) id = Number(to.replace('#', '')) if (id === undefined) throw new Error(`No recipient for ${to}`) if (id === from) throw new Error('You cannot message yourself') diff --git a/extensions/messages/api.ts b/extensions/messages/api.ts index 600bdc2..101d4b2 100644 --- a/extensions/messages/api.ts +++ b/extensions/messages/api.ts @@ -37,7 +37,7 @@ export type Message = { echo?: true /** The questions a reply-expected message to the user asks, answered on its card. */ questions?: Question[] - /** A user answer or dismissal that the standing agent settled for the user, not their own click. */ + /** A user answer or dismissal that the main agent settled for the user, not their own click. */ via?: Via } /** Every message between conversations and the user, on the root conversation. */ diff --git a/extensions/messages/delivery.ts b/extensions/messages/delivery.ts index ad0ca54..2d1112a 100644 --- a/extensions/messages/delivery.ts +++ b/extensions/messages/delivery.ts @@ -9,7 +9,7 @@ import { } from '@earendil-works/pi-durable' import type { ConversationId } from '@earendil-works/pi-durable' import type { Host as ExtensionHost } from '../../host/js/extensions.ts' -import { Standing, SubagentsApi } from '../subagents/api.ts' +import { MainAgent, SubagentsApi } from '../subagents/api.ts' import { Messages } from './api.ts' import type { Message } from './api.ts' @@ -19,13 +19,13 @@ import { append, terminal } from './log.ts' export function delivery(host: ExtensionHost) { const refresh = async (id: number, ctx: Context) => { - const index = await host.harness().snapshot(Standing, ROOT_CONVERSATION_ID, ctx) + const index = await host.harness().snapshot(MainAgent, ROOT_CONVERSATION_ID, ctx) const name = Object.keys(index ?? {}).find((candidate) => index![candidate] === id) if (name === undefined) return const service = host.need(SubagentsApi) // A retired agent's conversation stays addressable by id until the next open prunes it. if ((await service.residents(ctx)).some((agent) => agent.name === name)) - await service.standing(name, ctx) + await service.mainAgent(name, ctx) } return defineTask< { @@ -34,7 +34,7 @@ export function delivery(host: ExtensionHost) { note: boolean fromLabel: string toLabel: string - /** Another project's Standing agent answered `message`: deliver only this reply. */ + /** Another project's Main agent answered `message`: deliver only this reply. */ reply?: { message: Message; failed: boolean; stopped?: boolean } }, | { phase: 'deliver' } diff --git a/extensions/messages/log.ts b/extensions/messages/log.ts index 8f53122..703620a 100644 --- a/extensions/messages/log.ts +++ b/extensions/messages/log.ts @@ -8,7 +8,7 @@ import { Started } from './addresses.ts' export async function append(tx: Tx, input: Omit) { const log = await tx.doc(Messages, ROOT_CONVERSATION_ID) // A branch's reply to its starter awaits the starter's answer, which `board.route` sends down; anyone else's reply - // (a standing agent's) just answered and awaits nothing. + // (a main agent's) just answered and awaits nothing. const awaits = input.re !== undefined && typeof input.from === 'number' && diff --git a/extensions/messages/notice.ts b/extensions/messages/notice.ts index 6e5f299..d842b42 100644 --- a/extensions/messages/notice.ts +++ b/extensions/messages/notice.ts @@ -1,4 +1,4 @@ -/** Passive context for the standing agent about a branch's questions to the user. */ +/** Passive context for the main agent about a branch's questions to the user. */ import { defineTask } from '@earendil-works/pi-durable' import type { ConversationId } from '@earendil-works/pi-durable' import type { Host as ExtensionHost } from '../../host/js/extensions.ts' @@ -14,7 +14,7 @@ export const notice = (host: Pick) => call?: string summary?: string dismissed?: boolean - /** the standing agent settled it for the user. */ + /** the main agent settled it for the user. */ via?: { conversation: number; entry?: number } } content: string diff --git a/extensions/messages/questions.ts b/extensions/messages/questions.ts index d42f71d..0362e9e 100644 --- a/extensions/messages/questions.ts +++ b/extensions/messages/questions.ts @@ -8,7 +8,7 @@ import { ROOT_CONVERSATION_ID } from '@earendil-works/pi-durable' import type { ConversationId, Tx } from '@earendil-works/pi-durable' import { formatAgo } from './compat.ts' import { Messages } from './api.ts' -import { Standing } from '../subagents/api.ts' +import { MainAgent } from '../subagents/api.ts' import type { Message } from './api.ts' import type { Question } from './refs.ts' @@ -129,8 +129,8 @@ export const gist = (message: Pick) => { * open, so the agent treats them as unanswered. A per-input entry, not a system-prompt section, keeps the prompt cached. */ export async function openQuestionsNote(tx: Tx, conversationId: ConversationId, now: number) { - // the standing agent sees every open question to the user, since it settles those the user decides in its chat. - const primary = (await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] === conversationId + // the main agent sees every open question to the user, since it settles those the user decides in its chat. + const primary = (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] === conversationId const open = (await tx.doc(Messages, ROOT_CONVERSATION_ID)).messages.filter( (m) => openQuestion(m) && (primary || m.from === conversationId), ) @@ -143,7 +143,7 @@ export async function openQuestionsNote(tx: Tx, conversationId: ConversationId, ) .join( '\n', - )}${primary ? `\nWhen the user decides one in your chat, settle it with standing.action('messages', 'settle', { messageId, text }).` : ''}` + )}${primary ? `\nWhen the user decides one in your chat, settle it with mainAgent.action('messages', 'settle', { messageId, text }).` : ''}` return { entries: [ { diff --git a/extensions/messages/route.ts b/extensions/messages/route.ts index 036993f..cee7ff6 100644 --- a/extensions/messages/route.ts +++ b/extensions/messages/route.ts @@ -46,7 +46,7 @@ async function live(tx: Tx, kind: string, conversationId?: ConversationId) { */ async function busy(tx: Tx, id: ConversationId) { if ((await tx.doc(LiveDoc, id)).run || (await tx.doc(InboxDoc, id)).items.length) return true - if ((await live(tx, 'standing.subagent-reporter', id)).length) return true + if ((await live(tx, 'main-agent.subagent-reporter', id)).length) return true return (await live(tx, 'lineage.notify', id)).some( (task) => (task.input as { wake?: unknown }).wake !== false, ) diff --git a/extensions/messages/send.ts b/extensions/messages/send.ts index b4c9e73..76bd659 100644 --- a/extensions/messages/send.ts +++ b/extensions/messages/send.ts @@ -3,7 +3,7 @@ import type { Context } from '@earendil-works/chord' import { defineDoc, ROOT_CONVERSATION_ID } from '@earendil-works/pi-durable' import type { ConversationId, EntryId, TaskId } from '@earendil-works/pi-durable' import type { Host as ExtensionHost } from '../../host/js/extensions.ts' -import { Standing } from '../subagents/api.ts' +import { MainAgent } from '../subagents/api.ts' import { Messages, MessageSent } from './api.ts' import type { Question } from './api.ts' import type { Via } from './refs.ts' @@ -71,7 +71,7 @@ export async function send( /** Place it as a note, which starts no run; by default one-way messages to the sender's starter are notes. */ note?: boolean device?: Device - /** The user's answer or dismissal settled by the standing agent on their behalf, from their input `via.entry`. */ + /** The user's answer or dismissal settled by the main agent on their behalf, from their input `via.entry`. */ via?: Via /** A branch's final answer routed as its report: the branch shows as awaiting its starter. */ report?: boolean @@ -90,17 +90,17 @@ export async function send( const sent = await host.harness().snapshot(Sent, taskId, ctx) if (callId !== undefined && sent?.ids[callId] !== undefined) return sent.ids[callId] } - const standing = await host.harness().snapshot(Standing, ROOT_CONVERSATION_ID, ctx) - const primaryId = standing?.['$standing'] + const mainAgent = await host.harness().snapshot(MainAgent, ROOT_CONVERSATION_ID, ctx) + const primaryId = mainAgent?.['$main-agent'] // The primary agent's messages to a busy conversation almost always steer it: new scope, a decision, a stop. const steer = input.steer ?? (from !== 'user' && from === primaryId) - // Checked before resolving, which may create a standing agent's conversation. + // Checked before resolving, which may create a main agent's conversation. const parent = from === 'user' ? undefined : await parentOf(host, from, ctx) const starter = parent ?? (await starterOf(host, from, ctx)) if (input.to === 'user') { if (from !== primaryId && !(parent === undefined && starter !== undefined)) throw new Error( - 'Only the standing agent and branches message the user; send this to the conversation that started you.', + 'Only the main agent and branches message the user; send this to the conversation that started you.', ) } if (!input.text.trim()) throw new Error('Message text must not be empty') @@ -113,7 +113,7 @@ export async function send( ) const to = await resolve(host, input.to, from, ctx) const fromLabel = via - ? `user (settled for them by the standing agent, from what they said in its chat)` + ? `user (settled for them by the main agent, from what they said in its chat)` : await senderName(host, from, ctx) const toLabel = await senderName(host, to, ctx) return host.harness().commit(async (tx) => { @@ -261,7 +261,7 @@ export async function send( ) } // The user's answer or dismissal is their input to the asker; the message's `entry` names it once delivered. One - // the standing agent settled for them is not: their chat input that it came from counted already. + // the main agent settled for them is not: their chat input that it came from counted already. if (from === 'user' && answerId !== undefined && typeof to === 'number' && !via) await host.emit(tx, UserInputEvent, { conversation: to, diff --git a/extensions/messages/server.ts b/extensions/messages/server.ts index 74e60a8..2be0d95 100644 --- a/extensions/messages/server.ts +++ b/extensions/messages/server.ts @@ -8,7 +8,7 @@ import type { Device } from './compat.ts' import type { Via } from './refs.ts' import type { ConversationId, GenerationResult, TaskId } from '@earendil-works/pi-durable' import type { Host as ExtensionHost } from '../../host/js/extensions.ts' -import { Standing, SubagentsApi } from '../subagents/api.ts' +import { MainAgent, SubagentsApi } from '../subagents/api.ts' import { LineageApi } from '../lineage/api.ts' import { Messages, MessagesApi } from './api.ts' import { gist, openQuestion, openQuestionsNote, questionsParameter } from './questions.ts' @@ -26,7 +26,7 @@ async function openMessage(host: ExtensionHost, messageId: number, ctx: Context) if (!message || !openQuestion(message)) throw new Error('These questions are no longer open') return message } -/** The user's answer `text` to open message `messageId`, or the standing agent's on their behalf (`via`). */ +/** The user's answer `text` to open message `messageId`, or the main agent's on their behalf (`via`). */ async function answer( host: ExtensionHost, messageId: number, @@ -35,7 +35,7 @@ async function answer( options: { device?: Device; via?: { via: Via; primary: number } } = {}, ) { const message = await openMessage(host, messageId, ctx) - // the standing agent settling its own question has the answer already: a one-way note, not another turn. + // the main agent settling its own question has the answer already: a one-way note, not another turn. const own = options.via !== undefined && message.from === options.via.primary return send( host, @@ -50,7 +50,7 @@ async function answer( }, ) } -/** Close open message `messageId` unanswered: the user's dismissal, or the standing agent's on their behalf with `reason`. */ +/** Close open message `messageId` unanswered: the user's dismissal, or the main agent's on their behalf with `reason`. */ async function dismiss( host: ExtensionHost, messageId: number, @@ -106,7 +106,7 @@ export default function messages(host: ExtensionHost) { let by = (await api.snapshot(Started, api.conversationId, ctx))?.by const down = by === undefined && - (await api.snapshot(Standing, ROOT_CONVERSATION_ID, ctx))?.['$standing'] === + (await api.snapshot(MainAgent, ROOT_CONVERSATION_ID, ctx))?.['$main-agent'] === api.conversationId if (down) by = api.conversationId if (by === undefined) return undefined @@ -146,7 +146,7 @@ export default function messages(host: ExtensionHost) { starter === undefined ? '' : ` #${starter} started you: when you stop with nothing under way (no subagent, landing or reply pending), your final answer goes to it and wakes it; while work is under way it arrives as a note, and so do your one-way messages to it.` - return `Use message to contact #id or @name. the standing agent and branches may message user. Messages wake their recipient; its answer returns as a reply and wakes you. End your turn instead of waiting. A one-way message (reply: false) gets no answer; use reply: true when you need one. Inputs identify their sender; answer here and your answer is sent to the sender automatically; do not use message to reply. A message to an agent whose message you still owe an answer becomes that answer and ends your run; use it only to attach images.${upward}\n${agents.map((a) => `@${a.name} — ${a.description}`).join('\n')}` + return `Use message to contact #id or @name. the main agent and branches may message user. Messages wake their recipient; its answer returns as a reply and wakes you. End your turn instead of waiting. A one-way message (reply: false) gets no answer; use reply: true when you need one. Inputs identify their sender; answer here and your answer is sent to the sender automatically; do not use message to reply. A message to an agent whose message you still owe an answer becomes that answer and ends your run; use it only to attach images.${upward}\n${agents.map((a) => `@${a.name} — ${a.description}`).join('\n')}` }), ], tools: [ @@ -154,7 +154,7 @@ export default function messages(host: ExtensionHost) { defineTool({ name: 'message', description: - 'Send a message to #id or @name; it returns immediately. A busy recipient gets it after its current run, or during it with steer: true (the default for the standing agent). images forwards screenshots or other images from your conversation, to an agent or to the user. To an agent or the user whose message you owe an answer, it is that answer (with its images and questions) and ends your run.', + 'Send a message to #id or @name; it returns immediately. A busy recipient gets it after its current run, or during it with steer: true (the default for the main agent). images forwards screenshots or other images from your conversation, to an agent or to the user. To an agent or the user whose message you owe an answer, it is that answer (with its images and questions) and ends your run.', parameters: obj({ to: str(), text: str({ minLength: 1 }), @@ -196,7 +196,7 @@ export default function messages(host: ExtensionHost) { } if (input.to !== 'user') return { output: [{ type: 'text', text: `Message ${id} sent.` }] } - // The message is the standing agent's answer: the run ends here instead of restating it, unless a reply it has read + // The message is the main agent's answer: the run ends here instead of restating it, unless a reply it has read // is owed. One still queued gets its own turn. const owed = await host .harness() diff --git a/extensions/models/README.md b/extensions/models/README.md index 44efc29..8b49e3e 100644 --- a/extensions/models/README.md +++ b/extensions/models/README.md @@ -1,52 +1,48 @@ # Model selection The `models` service starts a conversation with `start({agent, cwd, ownership?}, context)`. -The `agent` field names a roster entry in `/etc/sausage/config.yaml`. -The service stores that name in `models.profile`. -`discover(cwd)` exposes the same live definition resolver to subagents. -`configure(tx, id, {agent, inheritedTools, excludeTools?, model?, thinking?})` configures an existing child in its creation transaction. -It retains the parent's tool scope, explicit overrides, and exclusions for subsequent run boundaries. -It applies the definition during creation and before each new run. -Each roster entry names its model and thinking level directly. There are no model families or project overlays. +The `agent` field names `/etc/sausage/roster/.md`. +Each file has YAML frontmatter and a role prompt as its body. The filename supplies the name. +Frontmatter supplies `description`, `model`, `thinking`, and optional tool or isolation settings. +Project definitions use `/.sausage/roster/*.md`. +An additive project overlay retains the base settings and appends its body. +A project definition with `description` and `model` replaces the base role prompt. -Each resolution reads `/etc/sausage/config.yaml` through `host.fs`. -A file edit applies at the next run boundary without a restart. -The global `prompt` precedes the role-specific `prompt` in every agent's system prompt. -A standing conversation follows the current `standing` roster member, even after a rename. +The service stores the selected name in `models.profile`. +`discover(cwd)` exposes the live definition resolver to subagents. +`configure(tx, id, {agent, inheritedTools, excludeTools?, model?, thinking?})` configures a child within its creation transaction. +It retains inherited tools, explicit overrides, and exclusions at later run boundaries. +Each resolution reads the settings and Markdown files through `host.fs`. +Provider, roster, and prompt edits apply at the next run without a restart. +The global `prompt` precedes the role prompt. +The main agent follows `main_agent_name` in `/etc/sausage/config.yaml`. +To rename it, rename its Markdown file and set `main_agent_name` to the new filename without `.md`. +The main agent retains its conversation and adopts the new definition. +A conversation without a role uses the main agent's model. The optional `models.pin` service supplies `pin(tx, conversationId)` for an external model override. -Without that provider, the roster entry selects the model. -A conversation without a role uses the standing roster member's model. -No login fallback runs. -Existing registered models retain their transport. -New model references reuse a template from their own registered provider and retain its proxy auth resolver. -They never inherit another provider's transport. Unknown providers fail instead of silently using OpenAI. -Models absent from the catalog receive zero prices, not the template's prices. -The extension never reads a credential or registers a direct provider SDK. +## Providers and metadata -## Host proxy transports and prices +`providers` is a dictionary in `/etc/sausage/config.yaml`. +Each provider has `type`, `base_url`, `api_key`, and `models`. +Supported API types are `anthropic-messages`, `openai-responses`, and `openai-chat-completions`. +Model references use `/`. +The optional `catalog` field selects a models.dev provider ID. It defaults to the configured provider's name. +Authentication and the base URL come from the config before each request. +Missing keys and unknown providers produce errors that name the config file. +Provider API keys in the config are intentionally visible to agents. Do not print or commit them. -`host/js/proxy-models.ts` reads the authenticated `/v1/models` catalog once at host startup. -OpenAI models use pi-ai's Responses transport. Anthropic models use its Messages transport. -The catalog endpoint determines each model's base URL. -For Anthropic, effort capabilities select adaptive thinking and its advertised effort levels. -Both providers read the proxy key and base URL from `/etc/sausage/config.yaml` before each request. -The usage tag remains unchanged. No provider login or direct endpoint fallback runs. -Empty proxy settings do not prevent startup. A model request names the config file if either setting is empty. +The host refreshes `https://models.dev/api.json` at startup and caches it in `host/models-dev.json`. +A failed refresh uses the cache or the packaged snapshot. +Each model entry is a string ID or an object with `id` and metadata overrides. +Supported overrides are `context_window`, `max_tokens`, `reasoning`, and `cost`. +Cost fields are `input`, `output`, `cache_read`, and `cache_write`, in USD per million tokens. +An unknown model needs all metadata fields. Its error lists missing fields and the config path. +An override retains all catalog values that it does not replace. +Pi-ai computes call costs and stores them in assistant usage. These costs are estimates, not billing totals. +`GET /harness/models` lists configured models and resolved metadata without authentication data. -If the catalog fails or exceeds five seconds, a small table supplies these defaults: - -| Provider/model | API | Proxy path | -| --- | --- | --- | -| `openai/gpt-6.1-sol` | Responses | `/v1/responses` | -| `anthropic/claude-opus-5-5` | Messages, adaptive thinking | `/apis/anthropic/v1/messages` | - -Catalog prices use USD per million tokens, with conversion from `unit_tokens` when necessary. -The host uses the first advertised route's quote, including cache reads and cache writes. -These costs are estimates, not billing totals. Another proxy route can charge different prices. -Unavailable prices remain zero. Catalog changes apply after a host restart. -Roster edits still apply at the next run boundary without a restart. -`host/tests/it/proxy_models.rs` tests the real transports against a local fake proxy. - -`host/tests/it/core_ext.rs` tests these services through the snapshot loader. +`host/tests/it/provider_models.rs` exercises all three real API adapters against a local fake server. +It also checks live provider edits and stored usage costs. +`host/tests/it/core_ext.rs` checks live Markdown edits and main agent renames through the snapshot loader. diff --git a/extensions/models/server.ts b/extensions/models/server.ts index 7c5e662..693efc0 100644 --- a/extensions/models/server.ts +++ b/extensions/models/server.ts @@ -1,34 +1,42 @@ -/** Read the world config at every run boundary. All real requests retain the host proxy transport. */ +/** Read provider settings and Markdown definitions at each run boundary. */ import { AgentDoc, defineExtension, GenerationTask, hook } from '@earendil-works/pi-durable' -import { CONFIG, definitionRuns, parseConfig, toolsFor } from '../core/agents.ts' +import { CONFIG, ROSTER, definitionRuns, parseConfig, parseDefinition, toolsFor } from '../core/agents.ts' +import { repoRoot } from './files.ts' import { ModelsApi, Pin, Profile } from './api.ts' export const order = -200 export default function models(host: any) { - const read = async (_cwd: string) => { + const read = async (cwd: string) => { const config = parseConfig(await host.fs.read(CONFIG)) - return {...config, definitions:config.definitions.map((definition: any)=>({...definition, - resident:definition.name === config.standing || definition.resident, + const definitions = new Map() + for (const folder of [ROSTER, `${await repoRoot(host.fs,cwd)}/.sausage/roster`]) { + let entries + try { entries = await host.fs.list(folder) } catch (error) { if (error.code === 'not_found') continue; throw error } + for (const entry of entries) { + if (!entry.name.endsWith('.md') || entry.kind === 'directory') continue + const path = `${folder}/${entry.name}`, name = entry.name.slice(0,-3) + definitions.set(name,parseDefinition(await host.fs.read(path),path,definitions.get(name))) + } + } + if (!definitions.has(config.main_agent_name)) throw new Error(`${CONFIG}: main_agent_name ${config.main_agent_name} needs ${ROSTER}/${config.main_agent_name}.md`) + return {...config, definitions:[...definitions.values()].map((definition: any)=>({...definition, + resident:definition.name === config.main_agent_name || definition.resident, runs:definitionRuns(definition)})), errors:[], replaced:[]} } const register = (ref: any) => { const store = host.models() if (store.getModel(ref.provider, ref.modelId)) return - const transport = store.getProvider(ref.provider) - const template = store.getModels(ref.provider)[0] - if (!transport || !template) throw new Error(`No proxy transport for ${ref.provider}/${ref.modelId}`) - const prior = store.getModels(ref.provider) - store.setProvider({...transport, getModels:()=>[...prior, {...template, id:ref.modelId, name:ref.modelId, - cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}]}) + throw new Error(`${CONFIG}: unknown provider or unconfigured model ${ref.provider}/${ref.modelId}`) } const apply = async (tx: any, id: number) => { const state = await tx.doc(AgentDoc, id) const profile = await tx.doc(Profile, id) + await host.models().refreshConfig?.() const config = await read(state.cwd ?? '/') - if (profile.standing) profile.agent = config.standing + if (profile.mainAgent) profile.agent = config.main_agent_name const definition = profile.agent ? config.definitions.find(d => d.name === profile.agent) : undefined if (profile.agent && !definition) throw new Error(`Unknown agent ${profile.agent}: ${JSON.stringify(config.errors)}`) - const selected = (definition ?? config.definitions.find((d: any)=>d.name === config.standing)).runs + const selected = (definition ?? config.definitions.find((d: any)=>d.name === config.main_agent_name)).runs const pinned = await host.want(Pin)?.pin(tx, id) const ref = pinned ?? profile.model ?? selected.model register(ref) @@ -49,7 +57,7 @@ export default function models(host: any) { configure: async (tx: any, id: number, options: any) => { const profile = await tx.doc(Profile,id) profile.agent = options.agent - profile.standing = options.standing ?? false + profile.mainAgent = options.mainAgent ?? false profile.inheritedTools = options.inheritedTools profile.excludeTools = options.excludeTools ?? [] if (options.model) profile.model = options.model diff --git a/extensions/pause/README.md b/extensions/pause/README.md index 52816ad..b8094ad 100644 --- a/extensions/pause/README.md +++ b/extensions/pause/README.md @@ -23,4 +23,4 @@ A manual pause always requires Play. The timer operates outside the held scheduler. The stored pause re-arms the timer after restart. -The test module ports all 19 Standing agent pause cases through snapshot-loaded modules. +The test module ports all 19 Main agent pause cases through snapshot-loaded modules. diff --git a/extensions/pause/api.ts b/extensions/pause/api.ts index b93a815..70f4beb 100644 --- a/extensions/pause/api.ts +++ b/extensions/pause/api.ts @@ -1,4 +1,4 @@ -/** Pause: whether the user paused this Standing agent, for timers that start work outside the task scheduler. */ +/** Pause: whether the user paused this Main agent, for timers that start work outside the task scheduler. */ const defineApi = () => (name: string): {name: string; service?: S} => ({name}) export type PauseService = { diff --git a/extensions/pause/refs.ts b/extensions/pause/refs.ts index e0d2928..f09796f 100644 --- a/extensions/pause/refs.ts +++ b/extensions/pause/refs.ts @@ -1,10 +1,10 @@ -/** Pause in the browser: whether this Standing agent is paused, what still runs, and Pause and Play. Browser-safe. */ +/** Pause in the browser: whether this Main agent is paused, what still runs, and Pause and Play. Browser-safe. */ const actionRef = (extension: string, name: string) => ({extension, name}) const docRef = (kind: string) => ({kind}) /** - * The rate limit that paused Standing agent: the provider and model that answered with it, the error as Pi recorded it, - * when (ms), and the conversation it first hit. Also the data of the `pause.limit` card in the standing agent's transcript. + * The rate limit that paused Main agent: the provider and model that answered with it, the error as Pi recorded it, + * when (ms), and the conversation it first hit. Also the data of the `pause.limit` card in the main agent's transcript. */ export type RateLimit = { provider: string @@ -25,7 +25,7 @@ export type PauseDocState = { limit?: RateLimit /** The user pressed Pause during this pause: it never plays by itself. */ manual?: boolean - /** The user's setting: minutes after a rate-limit pause began that Standing agent presses Play by itself; unset is off. */ + /** The user's setting: minutes after a rate-limit pause began that Main agent presses Play by itself; unset is off. */ autoPlay?: number } @@ -44,7 +44,7 @@ export type RunningTask = { export type PauseState = { paused: boolean since?: number - /** The rate limit that paused Standing agent, if one did. */ + /** The rate limit that paused Main agent, if one did. */ limit?: RateLimit /** Minutes after a rate-limit pause began that Play is pressed by itself; unset is off. */ autoPlay?: number @@ -66,7 +66,7 @@ export const PauseAction = actionRef('pause', 'pause') /** User-only: continue. Each run that was mid-turn when paused gets one "Paused for …" note. Returns the state. */ export const PlayAction = actionRef('pause', 'play') /** - * User-only `{ minutes }`: play by itself that many minutes (1 to 1440) after a rate limit paused Standing agent, once per + * User-only `{ minutes }`: play by itself that many minutes (1 to 1440) after a rate limit paused Main agent, once per * pause; `null` turns it off. A pause the user pressed never plays by itself. Returns the state. */ export const AutoPlayAction = actionRef<{ minutes: number | null }, PauseState>('pause', 'autoPlay') @@ -79,9 +79,9 @@ export type PauseNote = { since: number; until: number; finished?: boolean; auto /** * The `pause.held` entry in a subagent's parent, mid-turn when the subagent hit a rate limit: subagent `child` hit - * `provider`'s limit for `model` at `at` (ms), and Standing agent is paused until Play. + * `provider`'s limit for `model` at `at` (ms), and Main agent is paused until Play. */ export type HeldNote = { child: number; provider: string; model: string; at: number } -/** The `pause.autoplay` entry in the standing agent's transcript: the rate-limit pause from `since` played by itself at `at`. */ +/** The `pause.autoplay` entry in the main agent's transcript: the rate-limit pause from `since` played by itself at `at`. */ export type AutoPlayed = { since: number; at: number; minutes: number } diff --git a/extensions/pause/server.ts b/extensions/pause/server.ts index d253680..bb25d0f 100644 --- a/extensions/pause/server.ts +++ b/extensions/pause/server.ts @@ -10,7 +10,7 @@ type ExtensionHost = any const implementAction = (_token: any, handler: any) => handler import { isRetryableAssistantError } from '@earendil-works/pi-ai' const rateLimited = (error: string) => /(?(host: Pick, work: () => Promise * while paused and execute nothing meanwhile, so they never keep the pause from being safe. */ const PASSIVE: Record = { - 'standing.subagent-reporter': ['deliver', 'retry'], - 'standing.automation-scheduler': ['sleep'], - 'standing.automation-run': ['deliver'], + 'main-agent.subagent-reporter': ['deliver', 'retry'], + 'main-agent.automation-scheduler': ['sleep'], + 'main-agent.automation-run': ['deliver'], 'board.delivery': ['deliver', 'reply'], 'board.route': ['observe'], 'conversations.summary': ['observe'], @@ -213,7 +213,7 @@ function arm(host: Host, doc: PauseDocState) { /** * Play the pause by itself once its time came (`now`, for tests), once: Play ends the pause, and a limit that still - * holds pauses again with a new start and a full grace period. Tells the standing agent with a `pause.autoplay` entry first, + * holds pauses again with a new start and a full grace period. Tells the main agent with a `pause.autoplay` entry first, * while the pause is still recorded: a crash before Play reopens paused, re-arms the timer, and the entry's request ID * keeps the second announcement from repeating. */ @@ -224,10 +224,10 @@ export async function autoPlay(host: Host, now = Date.now()) { if (at === undefined || now < at) return false const data: AutoPlayed = { since: doc.since!, at: now, minutes: doc.autoPlay! } const harness = host.harness() - const standing = (await harness.snapshot(Standing, ROOT_CONVERSATION_ID, context))?.['$standing'] - if (standing !== undefined) + const mainAgent = (await harness.snapshot(MainAgent, ROOT_CONVERSATION_ID, context))?.['$main-agent'] + if (mainAgent !== undefined) await ( - await harness.conversation(standing, context) + await harness.conversation(mainAgent, context) )?.submit( { type: 'write', @@ -238,7 +238,7 @@ export async function autoPlay(host: Host, now = Date.now()) { model: [ { role: 'user', - content: `Standing agent played by itself ${lasted(now - data.since)} after the rate limit paused it (the user's setting: ${data.minutes} min).`, + content: `Main agent played by itself ${lasted(now - data.since)} after the rate limit paused it (the user's setting: ${data.minutes} min).`, timestamp: now, }, ], @@ -251,7 +251,7 @@ export async function autoPlay(host: Host, now = Date.now()) { }) } -/** The user's setting: play by itself `minutes` after a rate limit paused Standing agent; `null` turns it off. */ +/** The user's setting: play by itself `minutes` after a rate limit paused Main agent; `null` turns it off. */ async function setAutoPlay(host: Host, minutes: unknown) { if ( minutes !== null && @@ -268,7 +268,7 @@ async function setAutoPlay(host: Host, minutes: unknown) { } /** - * A model answered with a rate limit: pause, so nothing retries into it, and tell the standing agent with one `pause.limit` + * A model answered with a rate limit: pause, so nothing retries into it, and tell the main agent with one `pause.limit` * card. Pi has already scheduled that generation's retry; the hold parks it, and every other run at its next step, * until Play. The caller holds the scheduler already, in the commit's publication, before that retry's timer can fire. */ @@ -318,12 +318,12 @@ async function held(host: Host, limit: RateLimit) { /** The `pause.limit` card for the limit that paused the host, once per pause (its request ID is the pause's start). */ async function card(host: Host, doc: PauseDocState) { const harness = host.harness() - const standing = (await harness.snapshot(Standing, ROOT_CONVERSATION_ID, context))?.['$standing'] - if (!doc.paused || !doc.limit || standing === undefined) return - // Only kind and data, so Pi appends it at once even while the standing agent's own run is held; the model learns of the limit + const mainAgent = (await harness.snapshot(MainAgent, ROOT_CONVERSATION_ID, context))?.['$main-agent'] + if (!doc.paused || !doc.limit || mainAgent === undefined) return + // Only kind and data, so Pi appends it at once even while the main agent's own run is held; the model learns of the limit // from the note Play leaves on each held run. await ( - await harness.conversation(standing, context) + await harness.conversation(mainAgent, context) )?.submit( { type: 'write', @@ -380,7 +380,7 @@ async function play(host: Host, auto = false) { const content = how === 'finished' ? `Paused for ${span} after this run's last answer.` - : `Paused for ${span}; the run continued after ${auto ? 'Standing agent played by itself' : 'Play'}.` + : `Paused for ${span}; the run continued after ${auto ? 'Main agent played by itself' : 'Play'}.` const conversation = await harness.conversation(id, context) await conversation?.submit( { @@ -472,7 +472,7 @@ export default function pauseExtension(host: Host) { flag(host).paused = true host.harness().hold() serial(host, () => limited(host, limit)).catch((error: unknown) => { - // A failed pause released its hold (limited); a failed card leaves the pause standing in the status line. + // A failed pause released its hold (limited); a failed card leaves the pause mainAgent in the status line. console.error('pause: pausing for a rate limit failed:', error) }) } diff --git a/extensions/plan/README.md b/extensions/plan/README.md index e1ab45a..0780f47 100644 --- a/extensions/plan/README.md +++ b/extensions/plan/README.md @@ -1,6 +1,6 @@ # Plan -The `plan` tool maintains a durable epic/task ledger in `standing.plan`. +The `plan` tool maintains a durable epic/task ledger in `main-agent.plan`. Task-owned descendants read their top owner's ledger. Only that owner edits it. Ownerless conversations maintain separate ledgers. @@ -8,7 +8,7 @@ Edits and receipts commit together. Memo namespaces distinguish nested calls tha The tool returns both JSON text and structured content. The compact prompt section excludes completed epics. -The root document `standing.plan.tasks` indexes linked child conversations. +The root document `main-agent.plan.tasks` indexes linked child conversations. A new link or task title change updates the child's metadata title. Other edits preserve a title that the user supplied. diff --git a/extensions/plan/server.ts b/extensions/plan/server.ts index 7216323..1a1ca17 100644 --- a/extensions/plan/server.ts +++ b/extensions/plan/server.ts @@ -37,7 +37,7 @@ export type Epic = { tasks: Record } export const Plan = defineDoc<{ next: number; epics: Record }>({ - kind: 'standing.plan', + kind: 'main-agent.plan', checkpointWhen: () => false, version: 1, scope: 'conversation', @@ -54,7 +54,7 @@ export type TaskLink = { status: Task['status'] } export const TaskIndex = defineDoc<{ children: Record }>({ - kind: 'standing.plan.tasks', + kind: 'main-agent.plan.tasks', checkpointWhen: () => false, version: 1, scope: 'conversation', @@ -65,7 +65,7 @@ export const TaskIndex = defineDoc<{ children: Record }>({ export const docs = [Plan, TaskIndex] // Commit the receipt with the edit, closing the crash window before api.memo stores the result. const Receipt = defineDoc<{ results: Record }>({ - kind: 'standing.plan.receipt', + kind: 'main-agent.plan.receipt', checkpointWhen: () => false, version: 1, scope: 'task', diff --git a/extensions/subagents/README.md b/extensions/subagents/README.md index 7677b75..b5a20cf 100644 --- a/extensions/subagents/README.md +++ b/extensions/subagents/README.md @@ -22,6 +22,6 @@ The recovery observer and startup scan deliver answers to one-way parent message They also recover answers after interrupted or failed delivery. They do not report ordinary child inputs or messages from other conversations. -The service creates standing conversations for resident definitions. +The service creates main agent conversations for resident definitions. The sections list available definitions and child work that remains active. The definitions editor, workspaces, `land`, and `discard` remain outside this extension's current scope. diff --git a/extensions/subagents/api.ts b/extensions/subagents/api.ts index 5e2c143..f33cb8b 100644 --- a/extensions/subagents/api.ts +++ b/extensions/subagents/api.ts @@ -1,16 +1,16 @@ /** - * Subagents: conversations delegated to agent definitions, and the standing agents. Other extensions create - * configured child conversations and open standing agents here; definitions themselves are read with `lib/agents.ts`. + * Subagents: conversations delegated to agent definitions, and the main agents. Other extensions create + * configured child conversations and open main agents here; definitions themselves are read with `lib/agents.ts`. */ import type { Context } from '@earendil-works/chord' import { defineDoc } from '@earendil-works/pi-durable' import type { ConversationId, EntryId, TaskId, Tx } from '@earendil-works/pi-durable' const defineApi = () => (name: string): {name: string; service?: S} => ({name}) -import { RunsDoc, StandingDoc } from './refs.ts' +import { RunsDoc, MainAgentDoc } from './refs.ts' import type { Run } from './refs.ts' import type { createChild } from './children.ts' -export { Started, StandingDoc } from './refs.ts' +export { Started, MainAgentDoc } from './refs.ts' /** Each conversation's subagents and pending subagent actions, on the conversation that started them. */ export const Subagents = defineDoc<{ @@ -38,7 +38,7 @@ export const Subagents = defineDoc<{ } > }>({ - kind: 'standing.subagents', + kind: 'main-agent.subagents', checkpointWhen: () => false, version: 1, scope: 'conversation', @@ -47,9 +47,9 @@ export const Subagents = defineDoc<{ initial: () => ({ agents: {}, actions: {} }), }) -/** `{ [name]: conversationId }` of the standing agents, on the root conversation. */ -export const Standing = defineDoc>({ - kind: StandingDoc.kind, +/** `{ [name]: conversationId }` of the main agents, on the root conversation. */ +export const MainAgent = defineDoc>({ + kind: MainAgentDoc.kind, checkpointWhen: () => false, version: 1, scope: 'conversation', @@ -70,11 +70,11 @@ export const Runs = defineDoc>({ }) /** - * The definition a conversation was configured from: children (including automation runs) and standing agents. An agent + * The definition a conversation was configured from: children (including automation runs) and main agents. An agent * made on the fly has none: `adhoc`, so nothing looks a definition up by its label. */ export const Profile = defineDoc<{ definition?: string; adhoc?: true }>({ - kind: 'standing.agent-profile', + kind: 'main-agent.agent-profile', checkpointWhen: () => false, version: 1, scope: 'conversation', @@ -84,16 +84,16 @@ export const Profile = defineDoc<{ definition?: string; adhoc?: true }>({ }) export type SubagentsService = { - /** The standing agents that run in this home, by name and description; use it to list valid `@name` addresses. */ + /** The main agents that run in this home, by name and description; use it to list valid `@name` addresses. */ residents(ctx: Context): Promise<{ name: string; description: string }[]> - /** The conversation of standing agent `name`, created or refreshed from its definition; throws for unknown names. */ - standing(name: string, ctx: Context): Promise + /** The conversation of main agent `name`, created or refreshed from its definition; throws for unknown names. */ + mainAgent(name: string, ctx: Context): Promise /** Create, inside `tx`, a child conversation configured from a definition or as a copy of the parent's agent. */ createChild: ( tx: Tx, options: Parameters[2], ) => ReturnType } -/** Child conversations and standing agents; `need` it where delegation is required, else `want` it. */ +/** Child conversations and main agents; `need` it where delegation is required, else `want` it. */ export const SubagentsApi = defineApi()('subagents') export const tier = 'core' diff --git a/extensions/subagents/children.ts b/extensions/subagents/children.ts index d88906e..d95e4a9 100644 --- a/extensions/subagents/children.ts +++ b/extensions/subagents/children.ts @@ -3,7 +3,7 @@ import { AgentDoc, configure } from '@earendil-works/pi-durable' import { ModelsApi } from '../models/api.ts' import { Started } from './refs.ts' import { Profile } from './api.ts' -export async function started(host: any, tx: any, conversation: any, agent: string, kind: 'child'|'standing'|'branch') { +export async function started(host: any, tx: any, conversation: any, agent: string, kind: 'child'|'mainAgent'|'branch') { const {model, thinkingLevel} = await tx.doc(AgentDoc, conversation.id) const parent = conversation.owner?.conversationId ?? conversation.parent?.conversationId await host.emit(tx, Started, {id:conversation.id, agent, kind, @@ -21,12 +21,12 @@ export async function createChild(host: any, tx: any, options: any) { if (definition?.summaries === false) await host.want({name:'conversations'})?.setAutomaticSummaries(tx, child.id, false) return child } -/** Standing refreshes and new children share the models service and persistent definition profile. */ +/** MainAgent refreshes and new children share the models service and persistent definition profile. */ export async function configureChild(host: any, tx: any, id: number, options: any) { await configure(tx, id, childConfiguration(options)) if (options.definition) await host.need(ModelsApi).configure(tx, id, { agent:options.definition.name, - standing:options.standing ?? false, + mainAgent:options.mainAgent ?? false, inheritedTools:options.parentAgent.tools.map((tool: any)=>tool.name), excludeTools:options.excludeTools, model:options.model, diff --git a/extensions/subagents/landing.ts b/extensions/subagents/landing.ts index 97a539e..43ccbc0 100644 --- a/extensions/subagents/landing.ts +++ b/extensions/subagents/landing.ts @@ -1,13 +1,13 @@ /** * Where a page opens when no conversation is chosen (a first load, a new chapter, a remembered one that is gone): - * the standing agent's conversation, once the shared state and the standing agents are known; 'create' when the standing agent has no + * the main agent's conversation, once the shared state and the main agents are known; 'create' when the main agent has no * conversation yet, as on a fresh preview. The root is only its history. */ export const landing = ( loaded: boolean, chosen: unknown, - standing: Readonly> | null | undefined, + mainAgent: Readonly> | null | undefined, ): number | 'create' | undefined => { - if (!loaded || chosen !== undefined || standing === undefined) return undefined - return standing?.['$standing'] ?? 'create' + if (!loaded || chosen !== undefined || mainAgent === undefined) return undefined + return mainAgent?.['$main-agent'] ?? 'create' } diff --git a/extensions/subagents/refs.ts b/extensions/subagents/refs.ts index ce52ea9..2df8422 100644 --- a/extensions/subagents/refs.ts +++ b/extensions/subagents/refs.ts @@ -1,6 +1,6 @@ /** Browser-safe identities for child starts and durable indices. */ import { defineEvent } from '@earendil-works/sausage-events' -export const Started = defineEvent<{id:number; agent:string; model?:string; thinking?:string; parent?:number; kind:'child'|'standing'|'branch'}>('subagents.started') +export const Started = defineEvent<{id:number; agent:string; model?:string; thinking?:string; parent?:number; kind:'child'|'mainAgent'|'branch'}>('subagents.started') export type Run = {model?:string; adhoc?:true} export const RunsDoc = {kind:'subagents.runs'} -export const StandingDoc = {kind:'standing.standing-agents'} +export const MainAgentDoc = {kind:'main-agent.index'} diff --git a/extensions/subagents/server.ts b/extensions/subagents/server.ts index 84f0fd2..20bf91e 100644 --- a/extensions/subagents/server.ts +++ b/extensions/subagents/server.ts @@ -5,17 +5,17 @@ import { bool, int, obj, oneOf, opt, str } from '@earendil-works/pi-schema' import type { AssistantMessage } from '@earendil-works/pi-ai' import { AgentDoc, AssistantEntry, ToolResultEntry, defineExtension, defineTask, defineTool, LiveDoc, InboxDoc, GenerationTask, hook, ROOT_CONVERSATION_ID, section } from '@earendil-works/pi-durable' import type { ConversationId, Cursor, EntryId, EntryRecord, TaskId, ToolExecutionApi, SubmissionRecord } from '@earendil-works/pi-durable' -import { Subagents, Standing, Profile, Runs, SubagentsApi } from './api.ts' +import { Subagents, MainAgent, Profile, Runs, SubagentsApi } from './api.ts' import { createChild, configureChild, started } from './children.ts' import { ModelsApi } from '../models/api.ts' -export const docs = [Subagents, Standing, Profile, Runs] +export const docs = [Subagents, MainAgent, Profile, Runs] export const runsLabel = (runs: any) => runs ? `${runs.model.provider}/${runs.model.modelId}${runs.thinking ? ` · ${runs.thinking}` : ''}` : '' const onCommit = (harness: any, callback: any) => { const observation = harness.observeCommits({advance: callback, end: () => {}}) return () => observation.detach() } const Anchor = defineTask({ - name: 'standing.subagent-anchor', + name: 'main-agent.subagent-anchor', version: 1, initial: () => ({ phase: 'done' }), phases: { @@ -63,7 +63,7 @@ function createReporter() { { phase: 'deliver' } | { phase: 'report'; report?: string; answer?: EntryId }, null >({ - name: 'standing.subagent-reporter', + name: 'main-agent.subagent-reporter', version: 1, initial: (input) => input.answer === undefined @@ -306,34 +306,34 @@ export default function subagents(host: any) { return child }, residents: async () => (await models.discover('/src/sausage')).definitions.filter((d: any) => d.resident).map(({name, description}: any) => ({name, description})), - standing: async (name: string, ctx: Context) => { + mainAgent: async (name: string, ctx: Context) => { const found = await models.discover('/src/sausage') const definition = found.definitions.find((d: any) => d.name === name && d.resident) - if (!definition) throw new Error(`Unknown standing agent @${name}`) + if (!definition) throw new Error(`Unknown main agent @${name}`) const root = (await host.harness().conversation(ROOT_CONVERSATION_ID, ctx))! const parentAgent = await root.agent(ctx) return host.harness().commit(async (tx: any) => { - const index = await tx.doc(Standing, ROOT_CONVERSATION_ID) - const primary = name === found.standing - const key = primary ? '$standing' : name + const index = await tx.doc(MainAgent, ROOT_CONVERSATION_ID) + const primary = name === found.main_agent_name + const key = primary ? '$main-agent' : name const existing = index[key] && await tx.conversation(index[key]) const lifecycle = host.want({name:'conversations'}) if (existing) { - await lifecycle?.setStanding(tx, existing.id, true) + await lifecycle?.setMainAgent(tx, existing.id, true) await lifecycle?.setAutomaticSummaries(tx, existing.id, false) - if (primary) for (const alias of Object.keys(index)) if (alias !== '$standing' && index[alias] === existing.id) delete index[alias] + if (primary) for (const alias of Object.keys(index)) if (alias !== '$main-agent' && index[alias] === existing.id) delete index[alias] index[name] = existing.id const metadata = await tx.doc(host.metadata, existing.id) if (metadata.label !== name) Object.assign(metadata, {label:name, title:`@${name}`}) - await configureChild(host, tx, existing.id, {definition, parentAgent, standing:primary}) + await configureChild(host, tx, existing.id, {definition, parentAgent, mainAgent:primary}) return existing.id } - const child = await createChild(host, tx, {owner: {kind:'ownerless'}, definition, parentAgent, metadata:host.metadata, label:name, title:`@${name}`, standing:primary}) + const child = await createChild(host, tx, {owner: {kind:'ownerless'}, definition, parentAgent, metadata:host.metadata, label:name, title:`@${name}`, mainAgent:primary}) index[key] = child.id index[name] = child.id - await lifecycle?.setStanding(tx, child.id, true) + await lifecycle?.setMainAgent(tx, child.id, true) await lifecycle?.setAutomaticSummaries(tx, child.id, false) - await started(host, tx, child, name, 'standing') + await started(host, tx, child, name, 'mainAgent') return child.id }, ctx) }, @@ -434,13 +434,13 @@ export default function subagents(host: any) { host.onOpen(async () => { const found = await models.discover('/src/sausage') if (!found.errors.length) await host.harness().commit(async (tx: any) => { - const index = await tx.doc(Standing, ROOT_CONVERSATION_ID) - for (const name of Object.keys(index)) if (name !== '$standing' && !found.definitions.some((d: any) => d.name === name && d.resident)) { + const index = await tx.doc(MainAgent, ROOT_CONVERSATION_ID) + for (const name of Object.keys(index)) if (name !== '$main-agent' && !found.definitions.some((d: any) => d.name === name && d.resident)) { const id = index[name] delete index[name] - if (id !== index['$standing'] && await tx.conversation(id)) { + if (id !== index['$main-agent'] && await tx.conversation(id)) { delete (await tx.doc(host.metadata, id)).label - await host.want({name:'conversations'})?.setStanding(tx, id, false) + await host.want({name:'conversations'})?.setMainAgent(tx, id, false) } } }, BACKGROUND_CONTEXT) diff --git a/extensions/todos/README.md b/extensions/todos/README.md index 3dc54ab..51ead99 100644 --- a/extensions/todos/README.md +++ b/extensions/todos/README.md @@ -1,17 +1,17 @@ # Todos The root document `todos` stores the world's to-do list. -Each item belongs to `user` or `standing`. +Each item belongs to `user` or `mainAgent`. The `todo` tool adds items, completes items, and lists open items by owner. Text must contain 1–300 characters after the tool trims it. The list retains the newest 50 completed items. The exported `mark` helper also reopens items. -Only the standing `standing` conversation uses the tool. -The reader uses the existing `standing.standing-agents` document contract. +Only the main agent conversation uses the tool. +The reader uses the existing `main-agent.index` document contract. Until subagents supplies that document, no conversation qualifies automatically. -This port does not designate the root as `standing`. +This port does not designate the root as `mainAgent`. -The `beforeInput` hook places a note only when the standing conversation's open list changes. +The `beforeInput` hook places a note only when the main agent conversation's open list changes. The note and the remembered list commit with the input. The tool remains deferred. A caller must load it through `modelTools` or a tool-search extension. diff --git a/extensions/todos/server.ts b/extensions/todos/server.ts index d1e9208..b480267 100644 --- a/extensions/todos/server.ts +++ b/extensions/todos/server.ts @@ -1,4 +1,4 @@ -/** The world's root to-do list, its todo tool, and changed-list notes for the standing conversation. */ +/** The world's root to-do list, its todo tool, and changed-list notes for the mainAgent conversation. */ import { int, obj, oneOf, opt, str } from '@earendil-works/pi-schema' import { defineDoc, @@ -9,12 +9,12 @@ import { ROOT_CONVERSATION_ID, } from '@earendil-works/pi-durable' import type { ConversationId, Tx } from '@earendil-works/pi-durable' -// Read subagents' standing-agent contract without requiring its extension yet. -export const Standing = defineDoc>({ - kind: 'standing.standing-agents', checkpointWhen: () => false, version: 1, +// Read subagents' mainAgent-agent contract without requiring its extension yet. +export const MainAgent = defineDoc>({ + kind: 'main-agent.index', checkpointWhen: () => false, version: 1, scope: 'conversation', history: 'latest', fork: 'initial', initial: () => ({}), }) -export type Todo = { id: number; text: string; owner: 'user' | 'standing'; at: number; done?: number } +export type Todo = { id: number; text: string; owner: 'user' | 'mainAgent'; at: number; done?: number } /** Done to-dos kept; older ones are dropped when another is ticked. */ export const DONE_LIMIT = 50 @@ -29,7 +29,7 @@ export const Todos = defineDoc<{ next: number; items: Todo[] }>({ fork: 'initial', initial: () => ({ next: 1, items: [] }), }) -/** The open list the standing agent last heard, so it hears again only after a change. */ +/** The open list the main agent last heard, so it hears again only after a change. */ const Seen = defineDoc<{ key?: string }>({ kind: 'todos.seen', checkpointWhen: () => false, @@ -41,14 +41,14 @@ const Seen = defineDoc<{ key?: string }>({ }) export const docs = [Todos] -const OWNERS = ['user', 'standing'] as const +const OWNERS = ['user', 'mainAgent'] as const export async function add(tx: Tx, text: unknown, owner: unknown) { if (typeof text !== 'string' || !text.trim()) throw new Error('text must be nonempty') if (text.trim().length > TEXT_CHARS) throw new Error(`text must be at most ${TEXT_CHARS} characters`) if (!OWNERS.includes(owner as Todo['owner'])) - throw new Error("owner must be 'user' or 'standing'") + throw new Error("owner must be 'user' or 'mainAgent'") const todos = await tx.doc(Todos, ROOT_CONVERSATION_ID) const todo: Todo = { id: todos.next++, @@ -85,7 +85,7 @@ const line = (todo: Todo) => `- ${todo.id}: ${todo.text}` export function listText(items: readonly Todo[]) { const open = items.filter((item) => item.done === undefined) if (!open.length) return undefined - const mine = open.filter((item) => item.owner === 'standing') + const mine = open.filter((item) => item.owner === 'mainAgent') const theirs = open.filter((item) => item.owner === 'user') return [ ...(mine.length ? ['Yours:', ...mine.map(line)] : []), @@ -93,7 +93,7 @@ export function listText(items: readonly Todo[]) { ].join('\n') } -/** the standing agent's note when the open list changed since it last heard it; undefined otherwise. */ +/** the main agent's note when the open list changed since it last heard it; undefined otherwise. */ export async function noteFor(tx: Tx, conversationId: ConversationId, now: number) { const items = (await tx.doc(Todos, ROOT_CONVERSATION_ID)).items const text = listText(items) @@ -120,8 +120,8 @@ export async function noteFor(tx: Tx, conversationId: ConversationId, now: numbe } } -const standing = (tx: Tx, id: ConversationId) => - tx.doc(Standing, ROOT_CONVERSATION_ID).then((doc) => doc['$standing'] === id) +const mainAgent = (tx: Tx, id: ConversationId) => + tx.doc(MainAgent, ROOT_CONVERSATION_ID).then((doc) => doc['$main-agent'] === id) export default function todosExtension() { return defineExtension({ @@ -131,7 +131,7 @@ export default function todosExtension() { // Pi upstream: @earendil-works/pi-durable@1.5.0 — patched transactional beforeInput hook. // A per-input note when the list changed, never a system-prompt section, keeps the prompt cached. beforeInput: async (_input, { tx, conversationId }) => - (await standing(tx, conversationId)) + (await mainAgent(tx, conversationId)) ? noteFor(tx, conversationId, Date.now()) : undefined, }), @@ -141,11 +141,11 @@ export default function todosExtension() { name: 'todo', deferred: true, description: - "The world's to-dos, owned by you ('standing') or the user ('user'): add {text, owner}, done {id}, list. Keep open loops here. Only the standing conversation maintains this list.", + "The world's to-dos, owned by you ('mainAgent') or the user ('user'): add {text, owner}, done {id}, list. Keep open loops here. Only the mainAgent conversation maintains this list.", parameters: obj({ action: oneOf(['add', 'done', 'list']), text: opt(str()), - owner: opt(oneOf(['user', 'standing'])), + owner: opt(oneOf(['user', 'mainAgent'])), id: opt(int({ minimum: 1 })), }), // Not replay-safe (the default): an interrupted add is never rerun, so it commits at most once. @@ -154,9 +154,9 @@ export default function todosExtension() { const caller = api.conversationId const text = await api.commit(async (tx) => { // Deferred only hides it: a branch can still find it with tool_search, so the caller is checked here. - if (!(await standing(tx, caller))) + if (!(await mainAgent(tx, caller))) throw new Error( - 'Only the standing agent keeps the to-dos; ask the standing agent to add one.', + 'Only the main agent keeps the to-dos; ask the main agent to add one.', ) if (args.action === 'add') { const todo = await add(tx, args.text, args.owner) diff --git a/extensions/watchdog/README.md b/extensions/watchdog/README.md index 6f2a3ba..65f85f4 100644 --- a/extensions/watchdog/README.md +++ b/extensions/watchdog/README.md @@ -6,13 +6,13 @@ A temporary provider failure creates a durable `watchdog.failure` task. The task A failed continuation does not receive another retry. Permanent errors report immediately. If another run remains active at the deadline, watchdog does not submit a continuation. -Reports use the messages service with a stable request ID. Owned children report to their owner. Other conversations report to the standing agent. -A failure of the standing agent itself produces a notice instead. The service retains the latest 20 reported failures. +Reports use the messages service with a stable request ID. Owned children report to their owner. Other conversations report to the main agent. +A failure of the main agent itself produces a notice instead. The service retains the latest 20 reported failures. Receipts and a high-water mark prevent repeated recovery. Fresh installation excludes historical failures. On reopen, watchdog recovers failures that its observer missed. Retry inputs also use stable request IDs. -Before the standing agent receives an input, watchdog can add an idle-branch note. It does not modify the system prompt. +Before the main agent receives an input, watchdog can add an idle-branch note. It does not modify the system prompt. The note excludes active branches, concluded branches, user questions, and queued landings when workspaces is available. It waits 30 minutes, or two hours while a branch awaits an agent reply. It repeats only when the branch IDs change. diff --git a/extensions/watchdog/idle.ts b/extensions/watchdog/idle.ts index 6fe67cf..01769de 100644 --- a/extensions/watchdog/idle.ts +++ b/extensions/watchdog/idle.ts @@ -58,7 +58,7 @@ export async function idleNote( return false } const idle = [] - // Branches are ownerless, so subagents are skipped before any document read: this runs before every the standing agent input. + // Branches are ownerless, so subagents are skipped before any document read: this runs before every the main agent input. for (const conversation of conversations) { if (conversation.owner || excluded.has(conversation.id)) continue if (!(await tx.doc(Branch, conversation.id)).branch) continue diff --git a/extensions/watchdog/retry.ts b/extensions/watchdog/retry.ts index 31075be..9ef7086 100644 --- a/extensions/watchdog/retry.ts +++ b/extensions/watchdog/retry.ts @@ -128,7 +128,7 @@ import type { AssistantMessage } from '@earendil-works/pi-ai' /** * Whether a model error is a rate limit Pi retries: HTTP 429, "rate limit", "too many requests". Retrying sooner only - * hits the limit again, so Standing agent pauses until the user presses Play, and the held run continues through Pi's retry. + * hits the limit again, so Main agent pauses until the user presses Play, and the held run continues through Pi's retry. * Quota, usage-limit and billing errors are on Pi's no-retry list: they end the run at once and fail as usual. * Overloaded servers (529) are the provider's capacity, not the account's limit. */ diff --git a/extensions/watchdog/server.ts b/extensions/watchdog/server.ts index 59d9728..f6237e3 100644 --- a/extensions/watchdog/server.ts +++ b/extensions/watchdog/server.ts @@ -24,7 +24,7 @@ import type { import type { Host as ExtensionHost } from '../../host/js/extensions.ts' import { rateLimited } from './retry.ts' import { MessagesApi, Messages } from '../messages/api.ts' -import { Standing, Subagents } from '../subagents/api.ts' +import { MainAgent, Subagents } from '../subagents/api.ts' import { idleNote } from './idle.ts' import { WatchdogApi } from './api.ts' import type { ReportedFailure } from './api.ts' @@ -310,10 +310,10 @@ export default function watchdog(host: ExtensionHost) { ) return const child = (await tx.conversation(task.conversationId))! - const standing = (await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] - const recipient = child.owner?.conversationId ?? standing + const mainAgent = (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] + const recipient = child.owner?.conversationId ?? mainAgent if (recipient === undefined) - throw new Error('Watchdog needs the standing agent to report a failed run') + throw new Error('Watchdog needs the main agent to report a failed run') if (task.state.status !== 'terminal' || task.state.outcome.status !== 'failed') return const error = task.state.outcome.error.message const { hint, temporary } = diagnose(error, info.assistant) @@ -412,7 +412,7 @@ export default function watchdog(host: ExtensionHost) { hooks: [ hook(GenerationTask, { beforeInput: async (_input, { tx, conversationId }) => - (await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] === conversationId + (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] === conversationId ? idleNote(tx, host, conversationId, Date.now()) : undefined, }), diff --git a/extensions/workspaces/api.ts b/extensions/workspaces/api.ts index 08d8049..069c2d1 100644 --- a/extensions/workspaces/api.ts +++ b/extensions/workspaces/api.ts @@ -4,7 +4,7 @@ import { defineEvent } from '@earendil-works/sausage-events' export type Workspace = {source:string;target:string;path:string;branch:string;base?:string;state:'preparing'|'ready'|'failed'|'removed';preparation?:number;error?:string;landed?:string} export type Submission = {id:string;conversationId:number;source:string;target:string;tip:string;at:number;divergence:string;title:string;conversations:string[];prepared?:{base:string;sha:string};landed?:{base:string;sha:string;commits:{sha:string;subject:string}[];paths:string[]};outcome?:any} export const Workspaces = defineDoc<{items:Record;queue:Submission[];landers:Record;landerConversations:Record;results:Record}>({ - kind:'standing.workspaces',version:1,scope:'conversation',history:'latest',fork:'initial',checkpointWhen:()=>false, + kind:'main-agent.workspaces',version:1,scope:'conversation',history:'latest',fork:'initial',checkpointWhen:()=>false, initial:()=>({items:{},queue:[],landers:{},landerConversations:{},results:{}}), }) export const WorkspacesApi = {name:'workspaces'} diff --git a/host/js/README.md b/host/js/README.md index d7340b6..f3bb050 100644 --- a/host/js/README.md +++ b/host/js/README.md @@ -37,7 +37,7 @@ CARGO_TARGET_DIR=target/harness nix develop -c cargo test -p sausage --test harn The lock file pins npm dependencies. The bundle command requires Nushell, GNU patch, and npm. It applies `patches/pi-durable-1.5.0.patch` before esbuild runs. -This is Standing agent's patch at `7ec0b4f`, without the Node execution environment hunks (D65). +This is Ultimate's patch at `7ec0b4f`, without the Node execution environment hunks (D65). The patch adds transactional `beforeInput`, input markers, scheduler hold/release, and the failed-run boundary fix. The step verifies an existing application before another bundle build. A mismatched or partially applied patch fails the command. `npm ci` restores the unpatched dependency. The next bundle command applies the patch again. @@ -48,13 +48,14 @@ For Nix, use a separate npm derivation with `importNpmLock` and the checked-in l Run the bundle script there. Pass its output to the Rust source derivation before Crane builds the host. The Rust build must not execute npm or download JavaScript packages. -The console reads the `llm-proxy` credentials item through Rust. -Its public `base_url` field contains the proxy URL. Its secret `api_key` field contains the token. -If the item does not exist, Rust creates it from `PI_PROXY_BASE_URL` and `PI_PROXY_API_KEY` once. -Rust encrypts the token before it commits the item. Later starts ignore these environment variables. -The token enters JavaScript only through an operation. No startup script, transcript, or world file stores it. -The console selects `openai/gpt-6.1-sol` with low reasoning effort. -This model rejects disabled reasoning. Tests use the faux provider without credentials. +The harness reads configured providers from `/etc/sausage/config.yaml` through Rust. +`models.ts` registers pi-ai adapters for Anthropic Messages, OpenAI Responses, and OpenAI-compatible Chat Completions. +Provider API keys in the config are intentionally visible to agents. Rust redacts them from module errors. +The host refreshes models.dev metadata at startup, with a private cache and a packaged snapshot as offline fallbacks. +Metadata supplies context limits, reasoning support, and prices. Pi-ai stores estimated costs in assistant usage. +Provider and Markdown roster edits apply at the next run boundary. +The console targets the configured main agent conversation. A rename retains its conversation. +Tests use the faux provider or local fake servers without real credentials. Credential requests own background pi-durable tasks in their requesting conversations. Filed notifications create tasks. Startup reconciliation also creates missing tasks, including requests decided during a host stop. @@ -85,5 +86,5 @@ The signal client sends `Input::Stop`. The harness closes its watches, credentia The host then stops its process services and HTTP listener. Console output still streams assistant messages, without replay of the historical transcript. -`harness_foundation.rs` runs the three Standing agent input tests and the scheduler phase-boundary test through bundled V8 modules. +`harness_foundation.rs` runs the three Main agent input tests and the scheduler phase-boundary test through bundled V8 modules. It also tests the channel with closed stdin, CLI EOF and SIGTERM, submission scans, and the patched bundle hooks. diff --git a/host/js/automations-pause-cases.ts b/host/js/automations-pause-cases.ts index 9971480..7803534 100644 --- a/host/js/automations-pause-cases.ts +++ b/host/js/automations-pause-cases.ts @@ -1,4 +1,4 @@ -/** All 19 Standing agent pause cases, executed against world snapshot modules. */ +/** All 19 Main agent pause cases, executed against world snapshot modules. */ import {expect,it,until,setImmediate} from "./automations-test-support"; import {fixture} from "./automations-pause-fixture"; import {BACKGROUND_CONTEXT as context} from "@earendil-works/chord/context"; @@ -7,7 +7,7 @@ import {GenerationTask,hook,LiveDoc,ROOT_CONVERSATION_ID,defineExtension} from " import type {Harness,ConversationId} from "@earendil-works/pi-durable"; const {actions,autoPlay,passive,userActions}=await import(`${globalThis.automationBase}/pause/server.ts`); const {lasted}=await import(`${globalThis.automationBase}/pause/lasted.ts`); -const {Standing}=await import(`${globalThis.automationBase}/subagents/api.ts`); +const {MainAgent}=await import(`${globalThis.automationBase}/subagents/api.ts`); const generations = async (harness: Harness) => (await harness.inspect(context)).tasks.filter(({ record }) => record.kind === 'pi.generation') @@ -245,9 +245,9 @@ it('pauses on the first rate-limited answer: the run waits in its retry, fails n }, ]) const { root, harness } = await f.open() - const standing = await harness.createConversation({ ownership: { kind: 'ownerless' } }, context) + const mainAgent = await harness.createConversation({ ownership: { kind: 'ownerless' } }, context) await harness.commit(async (tx) => { - ;(await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] = standing.id + ;(await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] = mainAgent.id }, context) const submission = await root.submit({ type: 'input', content: 'go' }, context) await until(async () => (await f.action('state')).limit !== undefined) @@ -263,7 +263,7 @@ it('pauses on the first rate-limited answer: the run waits in its retry, fails n expect(generation.record.state.status).not.toBe('terminal') expect((await harness.snapshot(LiveDoc, root.id, context))?.run).toBeDefined() const cards = async () => - (await standing.context(context)).entries.filter((entry) => entry.kind === 'pause.limit') + (await mainAgent.context(context)).entries.filter((entry) => entry.kind === 'pause.limit') await until(async () => (await cards()).length === 1) expect((await cards())[0].data).toMatchObject({ error: limit, conversationId: root.id }) @@ -420,9 +420,9 @@ it('plays a rate-limit pause by itself once, N minutes in, only when the user sw }, ]) const { root, harness } = await f.open() - const standing = await harness.createConversation({ ownership: { kind: 'ownerless' } }, context) + const mainAgent = await harness.createConversation({ ownership: { kind: 'ownerless' } }, context) await harness.commit(async (tx) => { - ;(await tx.doc(Standing, ROOT_CONVERSATION_ID))['$standing'] = standing.id + ;(await tx.doc(MainAgent, ROOT_CONVERSATION_ID))['$main-agent'] = mainAgent.id }, context) const submission = await root.submit({ type: 'input', content: 'go' }, context) await until(async () => (await f.action('state')).limit !== undefined) @@ -443,14 +443,14 @@ it('plays a rate-limit pause by itself once, N minutes in, only when the user sw expect(responses).toBe(2) // Once: the pause is over, so a second due timer finds nothing to play. expect(await f.autoPlay(since! + 31 * 60_000)).toBe(false) - const played = (await standing.context(context)).entries.filter( + const played = (await mainAgent.context(context)).entries.filter( (entry) => entry.kind === 'pause.autoplay', ) expect(played).toHaveLength(1) expect(played[0].data).toMatchObject({ since, at: since! + 30 * 60_000, minutes: 30 }) const notes = (await root.context(context)).entries.filter((entry) => entry.kind === 'pause.note') expect(notes[0].data).toMatchObject({ auto: true }) - expect(notes[0].model?.[0]?.content).toMatch(/continued after Standing agent played by itself\.$/) + expect(notes[0].model?.[0]?.content).toMatch(/continued after Main agent played by itself\.$/) // The setting stays for the next limit. expect((await f.action('state')).autoPlay).toBe(30) }) @@ -495,7 +495,7 @@ const at = (kind: string, phase: string) => ({ kind, state: { checkpoint: { phas it('treats message deliveries and routes as passive waiters', () => { expect(passive(at('board.delivery', 'deliver'))).toBe(true) expect(passive(at('board.delivery', 'reply'))).toBe(true) - expect(passive(at('standing.subagent-reporter', 'deliver'))).toBe(true) + expect(passive(at('main-agent.subagent-reporter', 'deliver'))).toBe(true) expect(passive(at('board.route', 'observe'))).toBe(true) expect(passive(at('conversations.summary', 'generate'))).toBe(false) }) diff --git a/host/js/automations-pause-fixture.ts b/host/js/automations-pause-fixture.ts index 4b03478..753d62e 100644 --- a/host/js/automations-pause-fixture.ts +++ b/host/js/automations-pause-fixture.ts @@ -1,4 +1,4 @@ -/** Pause cases use snapshot modules and isolated durable storage, as Standing agent's fixture does. */ +/** Pause cases use snapshot modules and isolated durable storage, as Main agent's fixture does. */ import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context' import { obj } from '@earendil-works/pi-schema' import { createModels } from '@earendil-works/pi-ai/models' diff --git a/host/js/automations-schedule-cases.ts b/host/js/automations-schedule-cases.ts index fe0fc32..6a18bdb 100644 --- a/host/js/automations-schedule-cases.ts +++ b/host/js/automations-schedule-cases.ts @@ -1,4 +1,4 @@ -/** The five Standing agent calendar cases execute inside deno_core's V8. */ +/** The five Main agent calendar cases execute inside deno_core's V8. */ import {describe, expect, it} from "./automations-test-support"; const {describeSchedule,nextAt,parseSchedule}=await import(`${globalThis.automationBase}/automations/schedule.ts`); const time = Date.parse('2026-01-05T08:00:00Z') diff --git a/host/js/automations-test-bundle.js b/host/js/automations-test-bundle.js index e59ee77..fe8aafc 100644 --- a/host/js/automations-test-bundle.js +++ b/host/js/automations-test-bundle.js @@ -40128,10 +40128,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -40381,7 +40381,7 @@ var init_automations_schedule_cases = __esm({ // automations-pause-cases.ts var automations_pause_cases_exports = {}; -var actions, autoPlay, passive, userActions, lasted, Standing, generations, limit, at; +var actions, autoPlay, passive, userActions, lasted, MainAgent, generations, limit, at; var init_automations_pause_cases = __esm({ async "automations-pause-cases.ts"() { init_automations_test_support(); @@ -40391,7 +40391,7 @@ var init_automations_pause_cases = __esm({ init_dist4(); ({ actions, autoPlay, passive, userActions } = await import(`${globalThis.automationBase}/pause/server.ts`)); ({ lasted } = await import(`${globalThis.automationBase}/pause/lasted.ts`)); - ({ Standing } = await import(`${globalThis.automationBase}/subagents/api.ts`)); + ({ MainAgent } = await import(`${globalThis.automationBase}/subagents/api.ts`)); generations = async (harness2) => (await harness2.inspect(BACKGROUND_CONTEXT)).tasks.filter(({ record: record2 }) => record2.kind === "pi.generation"); it("lets a running tool finish, starts no generation after it while paused, and continues on play", async () => { const f = await fixture(); @@ -40604,10 +40604,10 @@ var init_automations_pause_cases = __esm({ } ]); const { root: root2, harness: harness2 } = await f.open(); - const standing = await harness2.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); + const mainAgent = await harness2.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); await harness2.commit(async (tx) => { ; - (await tx.doc(Standing, ROOT_CONVERSATION_ID))["$standing"] = standing.id; + (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))["$main-agent"] = mainAgent.id; }, BACKGROUND_CONTEXT); const submission2 = await root2.submit({ type: "input", content: "go" }, BACKGROUND_CONTEXT); await until2(async () => (await f.action("state")).limit !== void 0); @@ -40621,7 +40621,7 @@ var init_automations_pause_cases = __esm({ const [generation] = await generations(harness2); expect(generation.record.state.status).not.toBe("terminal"); expect((await harness2.snapshot(LiveDoc, root2.id, BACKGROUND_CONTEXT))?.run).toBeDefined(); - const cards = async () => (await standing.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "pause.limit"); + const cards = async () => (await mainAgent.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "pause.limit"); await until2(async () => (await cards()).length === 1); expect((await cards())[0].data).toMatchObject({ error: limit, conversationId: root2.id }); const played = await f.action("play"); @@ -40762,10 +40762,10 @@ var init_automations_pause_cases = __esm({ } ]); const { root: root2, harness: harness2 } = await f.open(); - const standing = await harness2.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); + const mainAgent = await harness2.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); await harness2.commit(async (tx) => { ; - (await tx.doc(Standing, ROOT_CONVERSATION_ID))["$standing"] = standing.id; + (await tx.doc(MainAgent, ROOT_CONVERSATION_ID))["$main-agent"] = mainAgent.id; }, BACKGROUND_CONTEXT); const submission2 = await root2.submit({ type: "input", content: "go" }, BACKGROUND_CONTEXT); await until2(async () => (await f.action("state")).limit !== void 0); @@ -40782,14 +40782,14 @@ var init_automations_pause_cases = __esm({ expect((await submission2.wait(BACKGROUND_CONTEXT)).status).toBe("done"); expect(responses).toBe(2); expect(await f.autoPlay(since + 31 * 6e4)).toBe(false); - const played = (await standing.context(BACKGROUND_CONTEXT)).entries.filter( + const played = (await mainAgent.context(BACKGROUND_CONTEXT)).entries.filter( (entry2) => entry2.kind === "pause.autoplay" ); expect(played).toHaveLength(1); expect(played[0].data).toMatchObject({ since, at: since + 30 * 6e4, minutes: 30 }); const notes = (await root2.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "pause.note"); expect(notes[0].data).toMatchObject({ auto: true }); - expect(notes[0].model?.[0]?.content).toMatch(/continued after Standing agent played by itself\.$/); + expect(notes[0].model?.[0]?.content).toMatch(/continued after Main agent played by itself\.$/); expect((await f.action("state")).autoPlay).toBe(30); }); it("never plays a pause the user pressed, also when a rate limit joins it", async () => { @@ -40828,7 +40828,7 @@ var init_automations_pause_cases = __esm({ it("treats message deliveries and routes as passive waiters", () => { expect(passive(at("board.delivery", "deliver"))).toBe(true); expect(passive(at("board.delivery", "reply"))).toBe(true); - expect(passive(at("standing.subagent-reporter", "deliver"))).toBe(true); + expect(passive(at("main-agent.subagent-reporter", "deliver"))).toBe(true); expect(passive(at("board.route", "observe"))).toBe(true); expect(passive(at("conversations.summary", "generate"))).toBe(false); }); diff --git a/host/js/automations-test-support.ts b/host/js/automations-test-support.ts index df24d62..a0052f0 100644 --- a/host/js/automations-test-support.ts +++ b/host/js/automations-test-support.ts @@ -1,4 +1,4 @@ -/** Minimal assertions for the imported Standing agent cases, without Node or Vitest. */ +/** Minimal assertions for the imported Main agent cases, without Node or Vitest. */ export const cases: {name:string;run:()=>any}[]=[] export const it=(name:string,run:()=>any)=>cases.push({name,run}) export const describe=(_name:string,run:()=>any)=>run() diff --git a/host/js/bundle.js b/host/js/bundle.js index 6b4db25..042810f 100644 --- a/host/js/bundle.js +++ b/host/js/bundle.js @@ -1951,91 +1951,15088 @@ var init_models = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/error-body.js -function normalizeProviderError(error) { - if (!(error instanceof Error)) { - return { message: safeJsonStringify(error), messageCarriesBody: false }; +// node_modules/@anthropic-ai/sdk/internal/tslib.mjs +function __classPrivateFieldSet(receiver, state2, value2, kind, f) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state2.set(receiver, value2), value2; +} +function __classPrivateFieldGet(receiver, state2, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); +} +var init_tslib = __esm({ + "node_modules/@anthropic-ai/sdk/internal/tslib.mjs"() { } - const sdkError = error; - const status = extractStatus(sdkError); - const body = extractBody(sdkError); - const messageCarriesBody = body === void 0 || error.message.includes(body); +}); + +// node_modules/@anthropic-ai/sdk/internal/errors.mjs +function isAbortError(err) { + return typeof err === "object" && err !== null && // Spec-compliant fetch implementations + ("name" in err && err.name === "AbortError" || // Expo fetch + "message" in err && String(err.message).includes("FetchRequestCanceledException")); +} +var castToError; +var init_errors = __esm({ + "node_modules/@anthropic-ai/sdk/internal/errors.mjs"() { + castToError = (err) => { + if (err instanceof Error) + return err; + if (typeof err === "object" && err !== null) { + try { + const tag = Object.prototype.toString.call(err); + if (tag === "[object Error]" || tag === "[object DOMException]") { + const error = new Error(err.message, err.cause ? { cause: err.cause } : {}); + if (err.stack) + error.stack = err.stack; + if (err.cause && !error.cause) + error.cause = err.cause; + if (err.name) + error.name = err.name; + return error; + } + } catch { + } + try { + return new Error(JSON.stringify(err)); + } catch { + } + } + return new Error(err); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/core/error.mjs +var AnthropicError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, RetryableError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError; +var init_error = __esm({ + "node_modules/@anthropic-ai/sdk/core/error.mjs"() { + init_errors(); + AnthropicError = /* @__PURE__ */ (() => { + class AnthropicError2 extends Error { + } + return AnthropicError2; + })(); + APIError = class _APIError extends AnthropicError { + constructor(status, error, message, headers, type) { + super(`${_APIError.makeMessage(status, error, message)}`); + this.status = status; + this.headers = headers; + this.requestID = headers?.get("request-id"); + this.workspaceID = headers?.get("anthropic-workspace-id"); + this.error = error; + this.type = type ?? null; + } + static makeMessage(status, error, message) { + const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message; + if (status && msg) { + return `${status} ${msg}`; + } + if (status) { + return `${status} status code (no body)`; + } + if (msg) { + return msg; + } + return "(no status code or body)"; + } + static generate(status, errorResponse, message, headers) { + if (!status || !headers) { + return new APIConnectionError({ message, cause: castToError(errorResponse) }); + } + const error = errorResponse; + const type = error?.["error"]?.["type"]; + if (status === 400) { + return new BadRequestError(status, error, message, headers, type); + } + if (status === 401) { + return new AuthenticationError(status, error, message, headers, type); + } + if (status === 403) { + return new PermissionDeniedError(status, error, message, headers, type); + } + if (status === 404) { + return new NotFoundError(status, error, message, headers, type); + } + if (status === 409) { + return new ConflictError(status, error, message, headers, type); + } + if (status === 422) { + return new UnprocessableEntityError(status, error, message, headers, type); + } + if (status === 429) { + return new RateLimitError(status, error, message, headers, type); + } + if (status >= 500) { + return new InternalServerError(status, error, message, headers, type); + } + return new _APIError(status, error, message, headers, type); + } + }; + APIUserAbortError = class extends APIError { + constructor({ message } = {}) { + super(void 0, void 0, message || "Request was aborted.", void 0); + } + }; + APIConnectionError = class extends APIError { + constructor({ message, cause }) { + super(void 0, void 0, message || "Connection error.", void 0); + if (cause) + this.cause = cause; + } + }; + APIConnectionTimeoutError = class extends APIConnectionError { + constructor({ message } = {}) { + super({ message: message ?? "Request timed out." }); + } + }; + RetryableError = class extends AnthropicError { + constructor(message, { cause } = {}) { + super(message ?? "Retryable error."); + if (cause !== void 0) + this.cause = cause; + } + }; + BadRequestError = class extends APIError { + }; + AuthenticationError = class extends APIError { + }; + PermissionDeniedError = class extends APIError { + }; + NotFoundError = class extends APIError { + }; + ConflictError = class extends APIError { + }; + UnprocessableEntityError = class extends APIError { + }; + RateLimitError = class extends APIError { + }; + InternalServerError = class extends APIError { + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +function maybeObj(x) { + if (typeof x !== "object") { + return {}; + } + return x ?? {}; +} +function isEmptyObj(obj2) { + if (!obj2) + return true; + for (const _k in obj2) + return false; + return true; +} +function hasOwn(obj2, key) { + return Object.prototype.hasOwnProperty.call(obj2, key); +} +function isObj(obj2) { + return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); +} +function checkNever(_value) { +} +var startsWithSchemeRegexp, isAbsoluteURL, isArray, isReadonlyArray, validatePositiveInteger, safeJSON; +var init_values = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/values.mjs"() { + init_error(); + startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; + isAbsoluteURL = (url) => { + return startsWithSchemeRegexp.test(url); + }; + isArray = (val) => (isArray = Array.isArray, isArray(val)); + isReadonlyArray = isArray; + validatePositiveInteger = (name, n) => { + if (typeof n !== "number" || !Number.isInteger(n)) { + throw new AnthropicError(`${name} must be an integer`); + } + if (n < 0) { + throw new AnthropicError(`${name} must be a positive integer`); + } + return n; + }; + safeJSON = (text2) => { + try { + return JSON.parse(text2); + } catch (err) { + return void 0; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +var sleep; +var init_sleep = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs"() { + sleep = (ms, signal) => new Promise((resolve2) => { + if (signal?.aborted) + return resolve2(); + const onAbort = () => { + clearTimeout(timer); + resolve2(); + }; + const timer = setTimeout(() => { + signal?.removeEventListener("abort", onAbort); + resolve2(); + }, ms); + signal?.addEventListener("abort", onAbort, { once: true }); + }); + } +}); + +// node_modules/@anthropic-ai/sdk/version.mjs +var VERSION; +var init_version2 = __esm({ + "node_modules/@anthropic-ai/sdk/version.mjs"() { + VERSION = "0.129.0"; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +function getDetectedPlatform() { + if (typeof Deno !== "undefined" && Deno.build != null) { + return "deno"; + } + if (typeof EdgeRuntime !== "undefined") { + return "edge"; + } + if (Object.prototype.toString.call(typeof globalThis.process !== "undefined" ? globalThis.process : 0) === "[object process]") { + return "node"; + } + return "unknown"; +} +function getBrowserInfo() { + if (typeof navigator === "undefined" || !navigator) { + return null; + } + const browserPatterns = [ + { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } + ]; + for (const { key, pattern } of browserPatterns) { + const match = pattern.exec(navigator.userAgent); + if (match) { + const major = match[1] || 0; + const minor = match[2] || 0; + const patch = match[3] || 0; + return { browser: key, version: `${major}.${minor}.${patch}` }; + } + } + return null; +} +var isRunningInBrowser, getPlatformProperties, normalizeArch, normalizePlatform, _platformHeaders, getPlatformHeaders; +var init_detect_platform = __esm({ + "node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs"() { + init_version2(); + isRunningInBrowser = () => { + return ( + // @ts-ignore + typeof window !== "undefined" && // @ts-ignore + typeof window.document !== "undefined" && // @ts-ignore + typeof navigator !== "undefined" + ); + }; + getPlatformProperties = () => { + const detectedPlatform = getDetectedPlatform(); + if (detectedPlatform === "deno") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION, + "X-Stainless-OS": normalizePlatform(Deno.build.os), + "X-Stainless-Arch": normalizeArch(Deno.build.arch), + "X-Stainless-Runtime": "deno", + "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" + }; + } + if (typeof EdgeRuntime !== "undefined") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": `other:${EdgeRuntime}`, + "X-Stainless-Runtime": "edge", + "X-Stainless-Runtime-Version": globalThis.process?.version ?? "unknown" + }; + } + if (detectedPlatform === "node") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION, + "X-Stainless-OS": normalizePlatform(globalThis.process.platform ?? "unknown"), + "X-Stainless-Arch": normalizeArch(globalThis.process.arch ?? "unknown"), + "X-Stainless-Runtime": "node", + "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" + }; + } + const browserInfo = getBrowserInfo(); + if (browserInfo) { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": `browser:${browserInfo.browser}`, + "X-Stainless-Runtime-Version": browserInfo.version + }; + } + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": "unknown", + "X-Stainless-Runtime-Version": "unknown" + }; + }; + normalizeArch = (arch) => { + if (arch === "x32") + return "x32"; + if (arch === "x86_64" || arch === "x64") + return "x64"; + if (arch === "arm") + return "arm"; + if (arch === "aarch64" || arch === "arm64") + return "arm64"; + if (arch) + return `other:${arch}`; + return "unknown"; + }; + normalizePlatform = (platform) => { + platform = platform.toLowerCase(); + if (platform.includes("ios")) + return "iOS"; + if (platform === "android") + return "Android"; + if (platform === "darwin") + return "MacOS"; + if (platform === "win32") + return "Windows"; + if (platform === "freebsd") + return "FreeBSD"; + if (platform === "openbsd") + return "OpenBSD"; + if (platform === "linux") + return "Linux"; + if (platform) + return `Other:${platform}`; + return "Unknown"; + }; + getPlatformHeaders = () => { + return _platformHeaders ?? (_platformHeaders = getPlatformProperties()); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/request-signal.mjs +function makeCleanup(signal, listener) { + return () => signal.removeEventListener("abort", listener); +} +function registerRequestSignalCleanup(controller, signal, listener) { + cleanups.set(controller, makeCleanup(signal, listener)); +} +function armAbandonmentBackstop(body, controller) { + if (cleanups.has(controller)) + registry?.register(body, controller, controller); +} +function releaseRequestSignal(controller) { + const cleanup = cleanups.get(controller); + if (cleanup) { + cleanups.delete(controller); + registry?.unregister(controller); + cleanup(); + } +} +var cleanups, registry; +var init_request_signal = __esm({ + "node_modules/@anthropic-ai/sdk/internal/request-signal.mjs"() { + cleanups = /* @__PURE__ */ new WeakMap(); + registry = typeof globalThis.FinalizationRegistry === "function" ? new globalThis.FinalizationRegistry((controller) => releaseRequestSignal(controller)) : null; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/shims.mjs +function getDefaultFetch() { + if (typeof fetch !== "undefined") { + return fetch; + } + throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); +} +function makeReadableStream(...args) { + const ReadableStream2 = globalThis.ReadableStream; + if (typeof ReadableStream2 === "undefined") { + throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); + } + return new ReadableStream2(...args); +} +function ReadableStreamFrom(iterable) { + let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + return makeReadableStream({ + start() { + }, + async pull(controller) { + const { done, value: value2 } = await iter.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value2); + } + }, + async cancel() { + await iter.return?.(); + } + }); +} +function ReadableStreamToAsyncIterable(stream5) { + if (stream5[Symbol.asyncIterator]) + return stream5; + const reader = stream5.getReader(); return { - status, - body, - message: error.message, - messageCarriesBody + async next() { + try { + const result = await reader.read(); + if (result?.done) + reader.releaseLock(); + return result; + } catch (e) { + reader.releaseLock(); + throw e; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: void 0 }; + }, + [Symbol.asyncIterator]() { + return this; + } }; } -function extractStatus(error) { - if (typeof error.statusCode === "number") - return error.statusCode; - if (typeof error.status === "number") - return error.status; - if (typeof error.$metadata?.httpStatusCode === "number") - return error.$metadata.httpStatusCode; - if (typeof error.$response?.statusCode === "number") - return error.$response.statusCode; - return void 0; -} -function extractBody(error) { - const bodyText = pickBodyText(error); - if (bodyText === void 0) - return void 0; - const trimmed = bodyText.trim(); - if (trimmed.length === 0) - return void 0; - return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS); -} -function pickBodyText(error) { - if (typeof error.body === "string") - return error.body; - if (isPlainNonEmptyObject(error.error)) - return safeJsonStringify(error.error); - const responseBody = error.$response?.body; - if (typeof responseBody === "string") - return responseBody; - if (isReadableStreamLike(responseBody)) - return void 0; - if (isPlainNonEmptyObject(responseBody)) - return safeJsonStringify(responseBody); - return void 0; -} -function isReadableStreamLike(value2) { - return typeof value2 === "object" && value2 !== null && "pipe" in value2 && typeof value2.pipe === "function"; -} -function isPlainNonEmptyObject(value2) { - if (typeof value2 !== "object" || value2 === null) - return false; - const proto = Object.getPrototypeOf(value2); - if (proto !== Object.prototype && proto !== null) - return false; - return Object.keys(value2).length > 0; -} -function formatProviderError(norm, prefix) { - if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) { - return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message; +async function CancelReadableStream(stream5) { + if (stream5 === null || typeof stream5 !== "object") + return; + if (stream5[Symbol.asyncIterator]) { + await stream5[Symbol.asyncIterator]().return?.(); + return; } - return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`; + const reader = stream5.getReader(); + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; } -function truncateErrorText(text2, maxChars) { - if (text2.length <= maxChars) - return text2; - return `${ownedSlice(text2, 0, maxChars)}... [truncated ${text2.length - maxChars} chars]`; +var init_shims = __esm({ + "node_modules/@anthropic-ai/sdk/internal/shims.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/request-options.mjs +var FallbackEncoder; +var init_request_options = __esm({ + "node_modules/@anthropic-ai/sdk/internal/request-options.mjs"() { + FallbackEncoder = ({ headers, body }) => { + return { + bodyHeaders: { + "content-type": "application/json" + }, + body: JSON.stringify(body) + }; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs +var default_format, default_formatter, formatters, RFC1738; +var init_formats = __esm({ + "node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs"() { + default_format = "RFC3986"; + default_formatter = (v) => String(v); + formatters = { + RFC1738: (v) => String(v).replace(/%20/g, "+"), + RFC3986: default_formatter + }; + RFC1738 = "RFC1738"; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs +function is_buffer(obj2) { + if (!obj2 || typeof obj2 !== "object") { + return false; + } + return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2)); } -function safeJsonStringify(value2) { +function maybe_map(val, fn) { + if (isArray(val)) { + const mapped = []; + for (let i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +} +var has, hex_table, limit, encode; +var init_utils = __esm({ + "node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs"() { + init_formats(); + init_values(); + has = (obj2, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj2, key)); + hex_table = /* @__PURE__ */ (() => { + const array = []; + for (let i = 0; i < 256; ++i) { + array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); + } + return array; + })(); + limit = 1024; + encode = (str2, _defaultEncoder, charset, _kind, format) => { + if (str2.length === 0) { + return str2; + } + let string2 = str2; + if (typeof str2 === "symbol") { + string2 = Symbol.prototype.toString.call(str2); + } else if (typeof str2 !== "string") { + string2 = String(str2); + } + if (charset === "iso-8859-1") { + return escape(string2).replace(/%u[0-9a-f]{4}/gi, function($0) { + return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; + }); + } + let out = ""; + for (let j = 0; j < string2.length; j += limit) { + const segment = string2.length >= limit ? string2.slice(j, j + limit) : string2; + const arr2 = []; + for (let i = 0; i < segment.length; ++i) { + let c = segment.charCodeAt(i); + if (c === 45 || // - + c === 46 || // . + c === 95 || // _ + c === 126 || // ~ + c >= 48 && c <= 57 || // 0-9 + c >= 65 && c <= 90 || // a-z + c >= 97 && c <= 122 || // A-Z + format === RFC1738 && (c === 40 || c === 41)) { + arr2[arr2.length] = segment.charAt(i); + continue; + } + if (c < 128) { + arr2[arr2.length] = hex_table[c]; + continue; + } + if (c < 2048) { + arr2[arr2.length] = hex_table[192 | c >> 6] + hex_table[128 | c & 63]; + continue; + } + if (c < 55296 || c >= 57344) { + arr2[arr2.length] = hex_table[224 | c >> 12] + hex_table[128 | c >> 6 & 63] + hex_table[128 | c & 63]; + continue; + } + i += 1; + c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); + arr2[arr2.length] = hex_table[240 | c >> 18] + hex_table[128 | c >> 12 & 63] + hex_table[128 | c >> 6 & 63] + hex_table[128 | c & 63]; + } + out += arr2.join(""); + } + return out; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs +function is_non_nullish_primitive(v) { + return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; +} +function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder6, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + let obj2 = object; + let tmp_sc = sideChannel; + let step = 0; + let find_flag = false; + while ((tmp_sc = tmp_sc.get(sentinel)) !== void 0 && !find_flag) { + const pos = tmp_sc.get(object); + step += 1; + if (typeof pos !== "undefined") { + if (pos === step) { + throw new RangeError("Cyclic object value"); + } else { + find_flag = true; + } + } + if (typeof tmp_sc.get(sentinel) === "undefined") { + step = 0; + } + } + if (typeof filter === "function") { + obj2 = filter(prefix, obj2); + } else if (obj2 instanceof Date) { + obj2 = serializeDate?.(obj2); + } else if (generateArrayPrefix === "comma" && isArray(obj2)) { + obj2 = maybe_map(obj2, function(value2) { + if (value2 instanceof Date) { + return serializeDate?.(value2); + } + return value2; + }); + } + if (obj2 === null) { + if (strictNullHandling) { + return encoder6 && !encodeValuesOnly ? ( + // @ts-expect-error + encoder6(prefix, defaults.encoder, charset, "key", format) + ) : prefix; + } + obj2 = ""; + } + if (is_non_nullish_primitive(obj2) || is_buffer(obj2)) { + if (encoder6) { + const key_value = encodeValuesOnly ? prefix : encoder6(prefix, defaults.encoder, charset, "key", format); + return [ + formatter?.(key_value) + "=" + // @ts-expect-error + formatter?.(encoder6(obj2, defaults.encoder, charset, "value", format)) + ]; + } + return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; + } + const values = []; + if (typeof obj2 === "undefined") { + return values; + } + let obj_keys; + if (generateArrayPrefix === "comma" && isArray(obj2)) { + if (encodeValuesOnly && encoder6) { + obj2 = maybe_map(obj2, encoder6); + } + obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; + } else if (isArray(filter)) { + obj_keys = filter; + } else { + const keys = Object.keys(obj2); + obj_keys = sort ? keys.sort(sort) : keys; + } + const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); + const adjusted_prefix = commaRoundTrip && isArray(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; + if (allowEmptyArrays && isArray(obj2) && obj2.length === 0) { + return adjusted_prefix + "[]"; + } + for (let j = 0; j < obj_keys.length; ++j) { + const key = obj_keys[j]; + const value2 = ( + // @ts-ignore + typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj2[key] + ); + if (skipNulls && value2 === null) { + continue; + } + const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + const key_prefix = isArray(obj2) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); + sideChannel.set(object, step); + const valueSideChannel = /* @__PURE__ */ new WeakMap(); + valueSideChannel.set(sentinel, sideChannel); + push_to_array(values, inner_stringify( + value2, + key_prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + // @ts-ignore + generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj2) ? null : encoder6, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + return values; +} +function normalize_stringify_options(opts = defaults) { + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + const charset = opts.charset || defaults.charset; + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + let format = default_format; + if (typeof opts.format !== "undefined") { + if (!has(formatters, opts.format)) { + throw new TypeError("Unknown format option provided."); + } + format = opts.format; + } + const formatter = formatters[format]; + let filter = defaults.filter; + if (typeof opts.filter === "function" || isArray(opts.filter)) { + filter = opts.filter; + } + let arrayFormat; + if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + const allowDots = typeof opts.allowDots === "undefined" ? !!opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix, + // @ts-ignore + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter, + format, + formatter, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls, + // @ts-ignore + sort: typeof opts.sort === "function" ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling + }; +} +function stringify(object, opts = {}) { + let obj2 = object; + const options = normalize_stringify_options(opts); + let obj_keys; + let filter; + if (typeof options.filter === "function") { + filter = options.filter; + obj2 = filter("", obj2); + } else if (isArray(options.filter)) { + filter = options.filter; + obj_keys = filter; + } + const keys = []; + if (typeof obj2 !== "object" || obj2 === null) { + return ""; + } + const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; + const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; + if (!obj_keys) { + obj_keys = Object.keys(obj2); + } + if (options.sort) { + obj_keys.sort(options.sort); + } + const sideChannel = /* @__PURE__ */ new WeakMap(); + for (let i = 0; i < obj_keys.length; ++i) { + const key = obj_keys[i]; + if (options.skipNulls && obj2[key] === null) { + continue; + } + push_to_array(keys, inner_stringify( + obj2[key], + key, + // @ts-expect-error + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + const joined = keys.join(options.delimiter); + let prefix = options.addQueryPrefix === true ? "?" : ""; + if (options.charsetSentinel) { + if (options.charset === "iso-8859-1") { + prefix += "utf8=%26%2310003%3B&"; + } else { + prefix += "utf8=%E2%9C%93&"; + } + } + return joined.length > 0 ? prefix + joined : ""; +} +var array_prefix_generators, push_to_array, toISOString, defaults, sentinel; +var init_stringify = __esm({ + "node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs"() { + init_utils(); + init_formats(); + init_values(); + array_prefix_generators = { + brackets(prefix) { + return String(prefix) + "[]"; + }, + comma: "comma", + indices(prefix, key) { + return String(prefix) + "[" + key + "]"; + }, + repeat(prefix) { + return String(prefix); + } + }; + push_to_array = function(arr2, value_or_array) { + Array.prototype.push.apply(arr2, isArray(value_or_array) ? value_or_array : [value_or_array]); + }; + defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", + charset: "utf-8", + charsetSentinel: false, + delimiter: "&", + encode: true, + encodeDotInKeys: false, + encoder: encode, + encodeValuesOnly: false, + format: default_format, + formatter: default_formatter, + /** @deprecated */ + indices: false, + serializeDate(date) { + return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date); + }, + skipNulls: false, + strictNullHandling: false + }; + sentinel = {}; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +function stringifyQuery(query) { + return stringify(query, { arrayFormat: "brackets" }); +} +var init_query = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/query.mjs"() { + init_stringify(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +var node_browser_exports = {}; +__export(node_browser_exports, { + child_process: () => child_process, + crypto: () => crypto2, + fs: () => fs, + os: () => os, + path: () => path, + stream: () => stream, + util: () => util +}); +function unavailable(module) { + return new Proxy({}, { + get(_target, property) { + if (typeof property === "symbol") + return void 0; + throw new AnthropicError(`\`${module}.${property}\` is not available in this environment; it needs a Node.js-compatible runtime`); + } + }); +} +var child_process, crypto2, fs, os, path, stream, util; +var init_node_browser = __esm({ + "node_modules/@anthropic-ai/sdk/internal/node.browser.mjs"() { + init_error(); + child_process = /* @__PURE__ */ unavailable("child_process"); + crypto2 = /* @__PURE__ */ unavailable("crypto"); + fs = /* @__PURE__ */ unavailable("fs"); + os = /* @__PURE__ */ unavailable("os"); + path = /* @__PURE__ */ unavailable("path"); + stream = /* @__PURE__ */ unavailable("stream"); + util = /* @__PURE__ */ unavailable("util"); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +function requireSecureTokenEndpoint(baseURL) { + if (!baseURL) + return; + let u; try { - const serialized = JSON.stringify(value2); - return serialized === void 0 ? String(value2) : serialized; + u = new URL(baseURL); + } catch (err) { + throw new WorkloadIdentityError(`Invalid token endpoint base URL "${baseURL}": ${err}`); + } + if (u.protocol === "https:") + return; + const host = u.hostname.toLowerCase().replace(/^\[|\]$/g, ""); + if (u.protocol === "http:" && (host === "localhost" || host === "127.0.0.1" || host === "::1")) { + return; + } + throw new WorkloadIdentityError(`Refusing to send credential over non-https token endpoint "${baseURL}"`); +} +async function parseTokenResponse(resp, requestId) { + const text2 = await readLimitedText(resp); + let data; + try { + data = JSON.parse(text2); } catch { - return String(value2); + throw new WorkloadIdentityError(`Token endpoint returned non-JSON response (status ${resp.status})`, resp.status, redactSensitive(text2), requestId); + } + if (!data.access_token) { + throw new WorkloadIdentityError(`Token endpoint response missing access_token: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + if (data.token_type && data.token_type.toLowerCase() !== "bearer") { + throw new WorkloadIdentityError(`Token endpoint response: unsupported token_type "${data.token_type}" (want Bearer)`, resp.status, redactSensitive(data), requestId); + } + return data; +} +function redactSensitive(body) { + if (body == null) + return body; + if (typeof body === "string") { + let parsed; + try { + parsed = JSON.parse(body); + } catch { + if (body.length <= MAX_ERROR_BODY_CHARS) + return body; + return body.slice(0, MAX_ERROR_BODY_CHARS) + `... <${body.length - MAX_ERROR_BODY_CHARS} more chars>`; + } + return JSON.stringify(redactSensitive(parsed)); + } + if (typeof body === "object" && !Array.isArray(body)) { + const out = {}; + for (const [k, v] of Object.entries(body)) { + if (SAFE_ERROR_KEYS.has(k)) + out[k] = v; + } + return out; + } + return null; +} +async function checkCredentialsFileSafety(path5, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) { + if (typeof process === "undefined" || process.platform === "win32") + return; + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + let resolved = path5; + let st; + try { + resolved = await fs3.promises.realpath(path5); + st = await fs3.promises.stat(resolved); + } catch { + return; + } + const mode = st.mode & 511; + if (mode & 18) { + throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-writable (mode 0o${mode.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${resolved}\`.`); + } + if (mode & 36) { + throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-readable (mode 0o${mode.toString(8)}); run \`chmod 600 ${resolved}\` before retrying.`); + } + if (typeof process.getuid === "function" && st.uid !== process.getuid()) { + onWarn(`credentials file at ${resolved} is owned by uid ${st.uid} (current process uid ${process.getuid()}); verify this is intentional.`); } } -var MAX_PROVIDER_ERROR_BODY_CHARS; -var init_error_body = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/error-body.js"() { - init_text(); - MAX_PROVIDER_ERROR_BODY_CHARS = 4e3; +async function writeCredentialsFileAtomic(targetPath, data) { + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const dir = path5.dirname(targetPath); + await fs3.promises.mkdir(dir, { recursive: true, mode: 448 }); + const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`; + try { + const fh = await fs3.promises.open(tmpPath, "w", 384); + try { + await fh.writeFile(JSON.stringify(data, null, 2)); + await fh.sync(); + } finally { + await fh.close(); + } + await fs3.promises.rename(tmpPath, targetPath); + } catch (err) { + await fs3.promises.unlink(tmpPath).catch(() => { + }); + throw err; + } + try { + const dirFh = await fs3.promises.open(dir, "r"); + try { + await dirFh.sync(); + } finally { + await dirFh.close(); + } + } catch { + } +} +async function readLimitedText(resp) { + if (!resp.body) { + return ""; + } + const reader = resp.body.getReader(); + const chunks = []; + let received = 0; + for (; ; ) { + const { done, value: value2 } = await reader.read(); + if (done) + break; + if (received + value2.length > MAX_TOKEN_RESPONSE_BYTES) { + const remaining = MAX_TOKEN_RESPONSE_BYTES - received; + if (remaining > 0) + chunks.push(value2.subarray(0, remaining)); + await reader.cancel(); + break; + } + chunks.push(value2); + received += value2.length; + } + let merged; + if (chunks.length === 1) { + merged = chunks[0]; + } else { + merged = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0)); + let offset = 0; + for (const c of chunks) { + merged.set(c, offset); + offset += c.length; + } + } + return new TextDecoder("utf-8").decode(merged); +} +var GRANT_TYPE_JWT_BEARER, GRANT_TYPE_REFRESH_TOKEN, TOKEN_ENDPOINT, OAUTH_API_BETA_HEADER, FEDERATION_BETA_HEADER, ADVISORY_REFRESH_THRESHOLD_IN_SECONDS, MANDATORY_REFRESH_THRESHOLD_IN_SECONDS, ADVISORY_REFRESH_BACKOFF_IN_SECONDS, MAX_TOKEN_RESPONSE_BYTES, MAX_ERROR_BODY_CHARS, SAFE_ERROR_KEYS, WorkloadIdentityError; +var init_types = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs"() { + init_error(); + GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer"; + GRANT_TYPE_REFRESH_TOKEN = "refresh_token"; + TOKEN_ENDPOINT = "/v1/oauth/token"; + OAUTH_API_BETA_HEADER = "oauth-2025-04-20"; + FEDERATION_BETA_HEADER = "oidc-federation-2026-04-01"; + ADVISORY_REFRESH_THRESHOLD_IN_SECONDS = 120; + MANDATORY_REFRESH_THRESHOLD_IN_SECONDS = 30; + ADVISORY_REFRESH_BACKOFF_IN_SECONDS = 5; + MAX_TOKEN_RESPONSE_BYTES = 1 << 20; + MAX_ERROR_BODY_CHARS = 2e3; + SAFE_ERROR_KEYS = /* @__PURE__ */ new Set(["error", "error_description", "error_uri"]); + WorkloadIdentityError = class extends AnthropicError { + constructor(message, statusCode = null, body = null, requestId = null) { + super(message); + this.statusCode = statusCode; + this.body = body; + this.requestId = requestId; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/time.mjs +function nowAsSeconds() { + return Math.floor(Date.now() / 1e3); +} +var init_time = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/time.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs +var TokenCache; +var init_token_cache = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs"() { + init_types(); + init_time(); + TokenCache = class { + constructor(provider2, onAdvisoryRefreshError) { + this.cached = null; + this.pendingRefresh = null; + this.nextForce = false; + this.lastAdvisoryError = 0; + this.provider = provider2; + this.onAdvisoryRefreshError = onAdvisoryRefreshError; + } + async getToken() { + const force = this.nextForce; + this.nextForce = false; + const cached = this.cached; + if (force || cached == null) { + const token2 = await this.refresh(force); + return token2.token; + } + if (cached.expiresAt == null) { + return cached.token; + } + const remaining = cached.expiresAt - nowAsSeconds(); + if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) { + return cached.token; + } + if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { + this.backgroundRefresh(); + return cached.token; + } + const token = await this.refresh(); + return token.token; + } + /** + * Clears the cached token and marks the next {@link getToken} as a forced + * refresh, so the underlying provider bypasses any on-disk freshness check. + * Called after a 401 — the server has just told us the token is bad even + * if its `expires_at` still looks fresh. + */ + invalidate() { + this.cached = null; + this.nextForce = true; + } + /** + * Mandatory refresh. Joins any in-flight refresh unless forced — a forced + * refresh must not coalesce into a non-forced one that may re-serve the + * same stale disk token. + */ + refresh(force = false) { + if (this.pendingRefresh && !force) { + return this.pendingRefresh; + } + return this.doRefresh(force); + } + /** + * Advisory background refresh. Shares the same in-flight promise as + * mandatory refreshes for deduplication, but swallows errors so the + * stale cached token keeps being served. Backs off for + * {@link ADVISORY_REFRESH_BACKOFF_IN_SECONDS} after a failure so an + * outage during the advisory window doesn't hammer the token endpoint. + */ + backgroundRefresh() { + if (this.pendingRefresh) { + return; + } + if (nowAsSeconds() - this.lastAdvisoryError < ADVISORY_REFRESH_BACKOFF_IN_SECONDS) { + return; + } + this.doRefresh().catch((err) => { + this.lastAdvisoryError = nowAsSeconds(); + this.onAdvisoryRefreshError?.(err); + }); + } + /** + * Core refresh. Sets {@link pendingRefresh} so concurrent callers + * (both advisory and mandatory) coalesce into a single provider call. + */ + doRefresh(force = false) { + this.pendingRefresh = this.provider(force ? { forceRefresh: true } : void 0).then((token) => { + this.cached = token; + this.pendingRefresh = null; + return token; + }, (err) => { + this.pendingRefresh = null; + throw err; + }); + return this.pendingRefresh; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +var readEnv; +var init_env = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/env.mjs"() { + readEnv = (env) => { + if (typeof globalThis.process !== "undefined") { + return globalThis.process.env?.[env]?.trim() || void 0; + } + if (typeof globalThis.Deno !== "undefined") { + return globalThis.Deno.env?.get?.(env)?.trim() || void 0; + } + return void 0; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +function concatBytes(buffers) { + let length = 0; + for (const buffer of buffers) { + length += buffer.length; + } + const output = new Uint8Array(length); + let index = 0; + for (const buffer of buffers) { + output.set(buffer, index); + index += buffer.length; + } + return output; +} +function encodeUTF8(str2) { + let encoder6; + return (encodeUTF8_ ?? (encoder6 = new globalThis.TextEncoder(), encodeUTF8_ = encoder6.encode.bind(encoder6)))(str2); +} +function decodeUTF8(bytes2) { + let decoder5; + return (decodeUTF8_ ?? (decoder5 = new globalThis.TextDecoder(), decodeUTF8_ = decoder5.decode.bind(decoder5)))(bytes2); +} +var encodeUTF8_, decodeUTF8_; +var init_bytes = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +var fromBase64; +var init_base64 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs"() { + init_error(); + fromBase64 = (str2) => { + if (typeof globalThis.Buffer !== "undefined") { + const buf = globalThis.Buffer.from(str2, "base64"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + if (typeof atob !== "undefined") { + const bstr = atob(str2); + const buf = new Uint8Array(bstr.length); + for (let i = 0; i < bstr.length; i++) { + buf[i] = bstr.charCodeAt(i); + } + return buf; + } + throw new AnthropicError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined"); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +function noop() { +} +function makeLogFn(fnLevel, logger, logLevel) { + if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) { + return noop; + } else { + return logger[fnLevel].bind(logger); + } +} +function filterLogger(logger, logLevel) { + const cachedLogger = cachedLoggers.get(logger); + if (cachedLogger && cachedLogger[0] === logLevel) { + return cachedLogger[1]; + } + const levelLogger = { + error: makeLogFn("error", logger, logLevel), + warn: makeLogFn("warn", logger, logLevel), + info: makeLogFn("info", logger, logLevel), + debug: makeLogFn("debug", logger, logLevel) + }; + cachedLoggers.set(logger, [logLevel, levelLogger]); + return levelLogger; +} +function loggerFor(client) { + const logger = client.logger; + const logLevel = client.logLevel ?? "off"; + if (!logger) { + return noopLogger; + } + return filterLogger(logger, logLevel); +} +function defaultLogger() { + const envLevel = readEnv("ANTHROPIC_LOG"); + if (!cachedDefaultLogger || envLevel !== lastEnvLevel) { + lastEnvLevel = envLevel; + cachedDefaultLogger = filterLogger(console, parseLogLevel(envLevel, "process.env['ANTHROPIC_LOG']", filterLogger(console, defaultLogLevel)) ?? defaultLogLevel); + } + return cachedDefaultLogger; +} +function debugLogRequestDetails(logger, message, details) { + if (logger.debug === noop) { + return; + } + logger.debug(message, formatRequestDetails(details)); +} +var defaultLogLevel, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, lastEnvLevel, cachedDefaultLogger, formatRequestDetails; +var init_log = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/log.mjs"() { + init_values(); + init_env(); + defaultLogLevel = "warn"; + levelNumbers = { + off: 0, + error: 200, + warn: 300, + info: 400, + debug: 500 + }; + parseLogLevel = (maybeLevel, sourceName, logger) => { + if (!maybeLevel) { + return void 0; + } + if (hasOwn(levelNumbers, maybeLevel)) { + return maybeLevel; + } + logger.warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`); + return void 0; + }; + noopLogger = { + error: noop, + warn: noop, + info: noop, + debug: noop + }; + cachedLoggers = /* @__PURE__ */ new WeakMap(); + formatRequestDetails = (details) => { + if (details.options) { + details.options = { ...details.options }; + delete details.options["headers"]; + } + if (details.headers) { + details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value2]) => [ + name, + name.toLowerCase() === "authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value2 + ])); + } + if ("retryOfRequestLogID" in details) { + if (details.retryOfRequestLogID) { + details.retryOf = details.retryOfRequestLogID; + } + delete details.retryOfRequestLogID; + } + return details; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +var uuid4; +var init_uuid = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs"() { + uuid4 = function() { + const { crypto: crypto3 } = globalThis; + if (crypto3?.randomUUID) { + uuid4 = crypto3.randomUUID.bind(crypto3); + return crypto3.randomUUID(); + } + const u8 = new Uint8Array(1); + const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils.mjs +var init_utils2 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils.mjs"() { + init_values(); + init_base64(); + init_env(); + init_log(); + init_uuid(); + init_sleep(); + init_query(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/credentials.mjs +function validateProfileName(name) { + if (!name) { + throw new Error("profile name is empty"); + } + if (name === "." || name === "..") { + throw new Error(`profile name "${name}" is not allowed`); + } + if (name.includes("/") || name.includes("\\")) { + throw new Error(`profile name "${name}" must not contain path separators`); + } + if (!PROFILE_NAME_PATTERN.test(name)) { + throw new Error(`profile name "${name}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`); + } +} +var CREDENTIALS_FILE_VERSION, PROFILE_NAME_PATTERN, loadConfigWithSource, getCredentialsPath, getRootConfigPath, supportsLocalConfigFiles, getActiveProfileName; +var init_credentials = __esm({ + "node_modules/@anthropic-ai/sdk/core/credentials.mjs"() { + init_detect_platform(); + init_utils2(); + CREDENTIALS_FILE_VERSION = "1.0"; + PROFILE_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/; + loadConfigWithSource = async (profile) => { + var _a6, _b; + const rootConfigPath = await getRootConfigPath(); + if (rootConfigPath === null) { + return null; + } + const profileName = profile ?? await getActiveProfileName(); + if (profileName === null) { + return null; + } + validateProfileName(profileName); + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const configPath = path5.join(rootConfigPath, "configs", `${profileName}.json`); + let configRaw; + try { + configRaw = await fs3.promises.readFile(configPath, "utf-8"); + } catch (err) { + if (err?.code !== "ENOENT") { + throw new Error(`failed to read config file ${configPath}: ${err}`); + } + configRaw = null; + } + if (configRaw === null) { + const organizationId = readEnv("ANTHROPIC_ORGANIZATION_ID"); + const identityTokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + const federationRuleId = readEnv("ANTHROPIC_FEDERATION_RULE_ID"); + if (federationRuleId && organizationId) { + return { + fromFile: false, + config: { + organization_id: organizationId, + // A defaulted-but-empty CI variable (`ANTHROPIC_WORKSPACE_ID=""`) is + // treated as unset — readEnv coerces empty to undefined, and the body + // builder's truthy check skips it — so `"workspace_id": ""` never goes + // on the wire. + workspace_id: readEnv("ANTHROPIC_WORKSPACE_ID"), + base_url: readEnv("ANTHROPIC_BASE_URL"), + authentication: { + type: "oidc_federation", + federation_rule_id: federationRuleId, + service_account_id: readEnv("ANTHROPIC_SERVICE_ACCOUNT_ID"), + identity_token: identityTokenFile ? { source: "file", path: identityTokenFile } : void 0, + scope: readEnv("ANTHROPIC_SCOPE") + } + } + }; + } + return null; + } + let config; + try { + config = JSON.parse(configRaw); + } catch (err) { + throw new Error(`failed to parse config file ${configPath}: ${err}`); + } + if (!config.authentication) { + throw new Error(`config file ${configPath} is missing "authentication"`); + } + const authType = config.authentication.type; + if (authType !== "oidc_federation" && authType !== "user_oauth") { + throw new Error(`authentication.type "${authType}" is not a known authentication type`); + } + config.organization_id ?? (config.organization_id = readEnv("ANTHROPIC_ORGANIZATION_ID")); + config.workspace_id ?? (config.workspace_id = readEnv("ANTHROPIC_WORKSPACE_ID")); + config.base_url ?? (config.base_url = readEnv("ANTHROPIC_BASE_URL")); + (_a6 = config.authentication).scope ?? (_a6.scope = readEnv("ANTHROPIC_SCOPE")); + if (config.authentication.type === "oidc_federation") { + if (!config.authentication.identity_token) { + const identityTokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + if (identityTokenFile) { + config.authentication.identity_token = { + source: "file", + path: identityTokenFile + }; + } + } + if (!config.authentication.federation_rule_id) { + config.authentication.federation_rule_id = readEnv("ANTHROPIC_FEDERATION_RULE_ID") ?? ""; + } + (_b = config.authentication).service_account_id ?? (_b.service_account_id = readEnv("ANTHROPIC_SERVICE_ACCOUNT_ID")); + } + return { config, fromFile: true }; + }; + getCredentialsPath = async (config, profile) => { + if (config?.authentication.credentials_path) { + return config.authentication.credentials_path; + } + const rootConfigPath = await getRootConfigPath(); + if (!rootConfigPath) { + return null; + } + const profileName = profile ?? await getActiveProfileName(); + if (!profileName) { + return null; + } + validateProfileName(profileName); + const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + return path5.join(rootConfigPath, "credentials", `${profileName}.json`); + }; + getRootConfigPath = async () => { + if (!supportsLocalConfigFiles()) { + return null; + } + const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const configDir = readEnv("ANTHROPIC_CONFIG_DIR"); + if (configDir) { + return configDir; + } + const os2 = getPlatformHeaders()["X-Stainless-OS"]; + if (os2 === "Windows") { + const appData = readEnv("APPDATA"); + if (appData) { + return path5.join(appData, "Anthropic"); + } + const userProfile = readEnv("USERPROFILE"); + if (userProfile) { + return path5.join(userProfile, "AppData", "Roaming", "Anthropic"); + } + return null; + } + const xdgConfigHome = readEnv("XDG_CONFIG_HOME"); + if (xdgConfigHome) { + return path5.join(xdgConfigHome, "anthropic"); + } + const home = readEnv("HOME"); + if (home) { + return path5.join(home, ".config", "anthropic"); + } + return null; + }; + supportsLocalConfigFiles = () => { + const runtime = getPlatformHeaders()["X-Stainless-Runtime"]; + return runtime === "node" || runtime === "deno"; + }; + getActiveProfileName = async () => { + const rootConfigPath = await getRootConfigPath(); + if (!rootConfigPath) { + return null; + } + const profileName = readEnv("ANTHROPIC_PROFILE"); + if (profileName) { + return profileName; + } + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const filePath = path5.join(rootConfigPath, "active_config"); + try { + return (await fs3.promises.readFile(filePath, "utf-8")).trim() || "default"; + } catch (err) { + if (err?.code !== "ENOENT") { + throw new Error(`failed to read ${filePath}: ${err}`); + } + return "default"; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +function identityTokenFromFile(path5) { + if (!path5) { + throw new AnthropicError("Identity token file path is empty"); + } + return async () => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + let content; + try { + content = await fs3.promises.readFile(path5, "utf-8"); + } catch (err) { + throw new AnthropicError(`Failed to read identity token file at ${path5}: ${err}`); + } + const token = content.trim(); + if (!token) { + throw new AnthropicError(`Identity token file at ${path5} is empty`); + } + return token; + }; +} +function identityTokenFromValue(token) { + if (!token) { + throw new AnthropicError("Identity token value is empty"); + } + return () => token; +} +var init_identity_token = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs +function oidcFederationProvider(config) { + return async () => { + requireSecureTokenEndpoint(config.baseURL); + const jwt = await config.identityTokenProvider(); + if (jwt.length > 16 * 1024) { + throw new WorkloadIdentityError(`Identity token is ${Math.ceil(jwt.length / 1024)} KiB, exceeds the 16 KiB assertion limit`); + } + const body = { + grant_type: GRANT_TYPE_JWT_BEARER, + assertion: jwt, + federation_rule_id: config.federationRuleId, + organization_id: config.organizationId + }; + if (config.serviceAccountId) { + body["service_account_id"] = config.serviceAccountId; + } + if (config.workspaceId) { + body["workspace_id"] = config.workspaceId; + } + const url = `${config.baseURL}${TOKEN_ENDPOINT}`; + let resp; + try { + resp = await config.fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + "anthropic-beta": `${OAUTH_API_BETA_HEADER},${FEDERATION_BETA_HEADER}`, + "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION} oidcFederationProvider` + }, + body: JSON.stringify(body) + }); + } catch (err) { + throw new WorkloadIdentityError(`Failed to reach token endpoint ${url}: ${err}`); + } + const requestId = resp.headers.get("Request-Id"); + if (!resp.ok) { + const text2 = await resp.text().catch(() => ""); + const redacted = redactSensitive(text2); + let hint = ""; + if (resp.status === 401) { + const hintMiddle = config.workspaceId ? "" : "If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "; + hint = ` Ensure your federation rule matches your identity token. ${hintMiddle}View your authentication events in the Workload identity page of Claude Console for more details.`; + } + throw new WorkloadIdentityError(`Token exchange failed with status ${resp.status}${requestId ? ` (request-id ${requestId})` : ""}: ${redacted}${hint}`, resp.status, redacted, requestId); + } + const data = await parseTokenResponse(resp, requestId); + const expiresIn = Number(data.expires_in); + if (!Number.isFinite(expiresIn)) { + throw new WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + return { + token: data.access_token, + expiresAt: nowAsSeconds() + expiresIn + }; + }; +} +var init_oidc_federation = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs"() { + init_types(); + init_time(); + init_version2(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +function userOAuthProvider(config) { + return async (opts) => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning); + let raw; + try { + raw = await fs3.promises.readFile(config.credentialsPath, "utf-8"); + } catch (err) { + throw new WorkloadIdentityError(`Credentials file not found at ${config.credentialsPath}: ${err}`); + } + let creds; + try { + creds = JSON.parse(raw); + } catch (err) { + throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} is not valid JSON: ${err}`); + } + const accessToken = creds.access_token; + if (!accessToken) { + throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} must include 'access_token'`); + } + const expiresAt = creds.expires_at; + if (!opts?.forceRefresh && (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS)) { + return { token: accessToken, expiresAt: expiresAt ?? null }; + } + const refreshToken = creds.refresh_token; + if (!config.clientId || !refreshToken) { + throw new WorkloadIdentityError(`Access token at ${config.credentialsPath} has expired and no refresh is available (client_id ${config.clientId ? "set" : "empty"}, refresh_token ${refreshToken ? "set" : "empty"})`); + } + requireSecureTokenEndpoint(config.baseURL); + const body = { + grant_type: GRANT_TYPE_REFRESH_TOKEN, + refresh_token: refreshToken, + client_id: config.clientId + }; + const url = `${config.baseURL}${TOKEN_ENDPOINT}`; + let resp; + try { + resp = await config.fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + "anthropic-beta": OAUTH_API_BETA_HEADER, + "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION} userOAuthProvider` + }, + body: JSON.stringify(body) + }); + } catch (err) { + throw new WorkloadIdentityError(`User OAuth refresh failed to reach token endpoint: ${err}`); + } + const requestId = resp.headers.get("Request-Id"); + if (!resp.ok) { + const text2 = await resp.text().catch(() => ""); + throw new WorkloadIdentityError(`User OAuth refresh failed (HTTP ${resp.status}): ${redactSensitive(text2)}`, resp.status, redactSensitive(text2), requestId); + } + const data = await parseTokenResponse(resp, requestId); + const expiresIn = Number(data.expires_in); + if (!Number.isFinite(expiresIn)) { + throw new WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + const newExpiresAt = nowAsSeconds() + expiresIn; + const newRefreshToken = data.refresh_token || refreshToken; + await writeCredentialsFileAtomic(config.credentialsPath, { + ...creds, + version: CREDENTIALS_FILE_VERSION, + type: "oauth_token", + access_token: data.access_token, + expires_at: newExpiresAt, + refresh_token: newRefreshToken + }); + return { token: data.access_token, expiresAt: newExpiresAt }; + }; +} +var init_user_oauth = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs"() { + init_credentials(); + init_types(); + init_time(); + init_version2(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +function resolveCredentialsFromConfig(config, options) { + const credentialsPath = config.authentication.credentials_path ?? null; + const effectiveBaseURL = (config.base_url || options.baseURL).replace(/\/+$/, ""); + const provider2 = buildProvider(config, credentialsPath, effectiveBaseURL, options); + const extraHeaders = {}; + if (config.workspace_id && config.authentication.type === "user_oauth") { + extraHeaders["anthropic-workspace-id"] = config.workspace_id; + } + return { provider: provider2, extraHeaders, baseURL: config.base_url || void 0 }; +} +async function defaultCredentials(options, profile) { + const loaded = await loadConfigWithSource(profile); + if (!loaded) { + return null; + } + const { config, fromFile } = loaded; + const withPath = config.authentication.credentials_path || !fromFile ? config : { + ...config, + authentication: { + ...config.authentication, + credentials_path: await getCredentialsPath(config, profile) ?? void 0 + } + }; + return resolveCredentialsFromConfig(withPath, options); +} +function buildProvider(config, credentialsPath, baseURL, options) { + switch (config.authentication.type) { + case "oidc_federation": { + const auth = config.authentication; + const identityProvider = resolveIdentityTokenProvider(auth); + if (!identityProvider) { + throw new WorkloadIdentityError("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)"); + } + if (!auth.federation_rule_id) { + throw new WorkloadIdentityError("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence)."); + } + if (!config.organization_id) { + throw new WorkloadIdentityError("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)"); + } + const exchange = oidcFederationProvider({ + identityTokenProvider: identityProvider, + federationRuleId: auth.federation_rule_id, + organizationId: config.organization_id, + serviceAccountId: auth.service_account_id, + workspaceId: config.workspace_id, + baseURL, + fetch: options.fetch, + userAgent: options.userAgent + }); + if (credentialsPath) { + return cachedExchangeProvider(exchange, credentialsPath, options.onCacheWriteError, options.onSafetyWarning); + } + return exchange; + } + case "user_oauth": { + if (!credentialsPath) { + throw new WorkloadIdentityError("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)"); + } + return userOAuthProvider({ + credentialsPath, + clientId: config.authentication.client_id, + baseURL, + fetch: options.fetch, + userAgent: options.userAgent, + onSafetyWarning: options.onSafetyWarning + }); + } + default: { + const t = config.authentication.type; + throw new WorkloadIdentityError(`authentication.type "${t}" is not a known authentication type`); + } + } +} +function resolveIdentityTokenProvider(auth) { + if (auth.identity_token) { + const source = auth.identity_token.source; + if (source !== "file") { + throw new WorkloadIdentityError(`identity_token.source "${source}" is not supported by this SDK version (only "file")`); + } + if (!auth.identity_token.path) { + throw new WorkloadIdentityError(`identity_token.source "file" requires a non-empty path`); + } + return identityTokenFromFile(auth.identity_token.path); + } + const tokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + if (tokenFile) { + return identityTokenFromFile(tokenFile); + } + const tokenValue = readEnv("ANTHROPIC_IDENTITY_TOKEN"); + if (tokenValue) { + return identityTokenFromValue(tokenValue); + } + return null; +} +function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) { + return async (opts) => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + await checkCredentialsFileSafety(credentialsPath, onSafetyWarning); + let existing; + try { + const raw = await fs3.promises.readFile(credentialsPath, "utf-8"); + existing = JSON.parse(raw); + const token = existing?.["access_token"]; + if (token && !opts?.forceRefresh) { + const expiresAt = existing?.["expires_at"]; + if (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { + return { token, expiresAt: expiresAt ?? null }; + } + } + } catch (err) { + const code = err?.code; + if (code !== "ENOENT" && !(err instanceof SyntaxError)) { + onCacheWriteError?.(err); + } + } + const result = await exchange(opts); + try { + await writeCredentialsFileAtomic(credentialsPath, { + ...existing ?? {}, + version: CREDENTIALS_FILE_VERSION, + type: "oauth_token", + access_token: result.token, + expires_at: result.expiresAt + }); + } catch (err) { + onCacheWriteError?.(err); + } + return result; + }; +} +var init_credential_chain = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs"() { + init_env(); + init_credentials(); + init_types(); + init_time(); + init_identity_token(); + init_oidc_federation(); + init_user_oauth(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +function findNewlineIndex(buffer, startIndex) { + const newline = 10; + const carriage = 13; + for (let i = startIndex ?? 0; i < buffer.length; i++) { + if (buffer[i] === newline) { + return { preceding: i, index: i + 1, carriage: false }; + } + if (buffer[i] === carriage) { + return { preceding: i, index: i + 1, carriage: true }; + } + } + return null; +} +var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex, LineDecoder; +var init_line = __esm({ + "node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs"() { + init_tslib(); + init_bytes(); + LineDecoder = /* @__PURE__ */ (() => { + class LineDecoder3 { + constructor() { + _LineDecoder_buffer.set(this, void 0); + _LineDecoder_carriageReturnIndex.set(this, void 0); + __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + } + decode(chunk) { + if (chunk == null) { + return []; + } + const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? encodeUTF8(chunk) : chunk; + __classPrivateFieldSet(this, _LineDecoder_buffer, concatBytes([__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), binaryChunk]), "f"); + const lines2 = []; + let patternIndex; + while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { + if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) { + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); + continue; + } + if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { + lines2.push(decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1))); + __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + continue; + } + const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; + const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, endIndex)); + lines2.push(line); + __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(patternIndex.index), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + } + return lines2; + } + flush() { + if (!__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { + return []; + } + return this.decode("\n"); + } + } + _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); + LineDecoder3.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); + LineDecoder3.NEWLINE_REGEXP = /\r\n|[\n\r]/g; + return LineDecoder3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/streaming.mjs +async function* _iterSSEMessages(response, controller) { + if (!response.body) { + controller.abort(); + if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { + throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); + } + throw new AnthropicError(`Attempted to iterate over a response with no body`); + } + const sseDecoder = new SSEDecoder(); + const lineDecoder = new LineDecoder(); + const iter = ReadableStreamToAsyncIterable(response.body); + for await (const chunk of iter) { + for (const line of lineDecoder.decode(chunk)) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; + } + } + for (const line of lineDecoder.flush()) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; + } +} +function partition(str2, delimiter) { + const index = str2.indexOf(delimiter); + if (index !== -1) { + return [str2.substring(0, index), delimiter, str2.substring(index + delimiter.length)]; + } + return [str2, "", ""]; +} +var _Stream_client, Stream, SSEDecoder; +var init_streaming = __esm({ + "node_modules/@anthropic-ai/sdk/core/streaming.mjs"() { + init_tslib(); + init_error(); + init_shims(); + init_line(); + init_shims(); + init_errors(); + init_values(); + init_bytes(); + init_log(); + init_error(); + init_request_signal(); + Stream = /* @__PURE__ */ (() => { + class Stream3 { + constructor(iterator, controller, client) { + this.iterator = iterator; + _Stream_client.set(this, void 0); + this.controller = controller; + __classPrivateFieldSet(this, _Stream_client, client, "f"); + } + /** + * Iterate the raw Server-Sent Events from `response` — `{event, data, raw}` + * objects, before any JSON parsing or event-name filtering. + * + * This reads `response.body` directly (not a clone), so the response is + * consumed. Use this in middleware that fully replaces the stream body; for + * read-only observation of parsed events, use `ctx.parse()` instead. + */ + static rawEvents(response, controller = new AbortController()) { + return _iterSSEMessages(response, controller); + } + static fromSSEResponse(response, controller, client) { + let consumed = false; + const logger = client ? loggerFor(client) : console; + async function* iterator() { + if (consumed) { + throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const sse of _iterSSEMessages(response, controller)) { + if (sse.event === "completion") { + try { + yield JSON.parse(sse.data); + } catch (e) { + logger.error(`Could not parse message into JSON:`, sse.data); + logger.error(`From chunk:`, sse.raw); + throw e; + } + } + if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop" || sse.event === "message" || sse.event === "user.message" || sse.event === "user.interrupt" || sse.event === "user.tool_confirmation" || sse.event === "user.custom_tool_result" || sse.event === "user.tool_result" || sse.event === "agent.message" || sse.event === "agent.thinking" || sse.event === "agent.tool_use" || sse.event === "agent.tool_result" || sse.event === "agent.mcp_tool_use" || sse.event === "agent.mcp_tool_result" || sse.event === "agent.custom_tool_use" || sse.event === "agent.thread_context_compacted" || sse.event === "session.status_running" || sse.event === "session.status_idle" || sse.event === "session.status_rescheduled" || sse.event === "session.status_terminated" || sse.event === "session.error" || sse.event === "session.deleted" || sse.event === "session.updated" || sse.event === "span.model_request_start" || sse.event === "span.model_request_end" || sse.event === "span.outcome_evaluation_start" || sse.event === "span.outcome_evaluation_ongoing" || sse.event === "span.outcome_evaluation_end" || sse.event === "user.define_outcome" || sse.event === "agent.thread_message_received" || sse.event === "agent.thread_message_sent" || sse.event === "agent.session_thread_message_received" || sse.event === "agent.session_thread_message_sent" || sse.event === "session.thread_created" || sse.event === "session.thread_status_created" || sse.event === "session.thread_status_running" || sse.event === "session.thread_status_idle" || sse.event === "session.thread_status_rescheduled" || sse.event === "session.thread_status_terminated" || sse.event === "event_start" || sse.event === "event_delta" || sse.event === "system.message") { + try { + yield JSON.parse(sse.data); + } catch (e) { + logger.error(`Could not parse message into JSON:`, sse.data); + logger.error(`From chunk:`, sse.raw); + throw e; + } + } + if (sse.event === "ping") { + continue; + } + if (sse.event === "error") { + const body = safeJSON(sse.data) ?? sse.data; + const type = body?.error?.type; + throw new APIError(void 0, body, void 0, response.headers, type); + } + } + done = true; + } catch (e) { + if (isAbortError(e)) + return; + throw e; + } finally { + if (!done) + controller.abort(); + releaseRequestSignal(controller); + } + } + return new Stream3(iterator, controller, client); + } + /** + * Generates a Stream from a newline-separated ReadableStream + * where each item is a JSON value. + */ + static fromReadableStream(readableStream, controller, client) { + let consumed = false; + async function* iterLines() { + const lineDecoder = new LineDecoder(); + const iter = ReadableStreamToAsyncIterable(readableStream); + for await (const chunk of iter) { + for (const line of lineDecoder.decode(chunk)) { + yield line; + } + } + for (const line of lineDecoder.flush()) { + yield line; + } + } + async function* iterator() { + if (consumed) { + throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const line of iterLines()) { + if (done) + continue; + if (line) + yield JSON.parse(line); + } + done = true; + } catch (e) { + if (isAbortError(e)) + return; + throw e; + } finally { + if (!done) + controller.abort(); + releaseRequestSignal(controller); + } + } + return new Stream3(iterator, controller, client); + } + [(_Stream_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + return this.iterator(); + } + /** + * Splits the stream into two streams which can be + * independently read from at different speeds. + */ + tee() { + const left = []; + const right = []; + const iterator = this.iterator(); + const teeIterator = (queue2) => { + return { + next: () => { + if (queue2.length === 0) { + const result = iterator.next(); + left.push(result); + right.push(result); + } + return queue2.shift(); + } + }; + }; + return [ + new Stream3(() => teeIterator(left), this.controller, __classPrivateFieldGet(this, _Stream_client, "f")), + new Stream3(() => teeIterator(right), this.controller, __classPrivateFieldGet(this, _Stream_client, "f")) + ]; + } + /** + * Converts this stream to a newline-separated ReadableStream of + * JSON stringified values in the stream + * which can be turned back into a Stream with `Stream.fromReadableStream()`. + */ + toReadableStream() { + const self = this; + let iter; + return makeReadableStream({ + async start() { + iter = self[Symbol.asyncIterator](); + }, + async pull(ctrl) { + try { + const { value: value2, done } = await iter.next(); + if (done) + return ctrl.close(); + const bytes2 = encodeUTF8(JSON.stringify(value2) + "\n"); + ctrl.enqueue(bytes2); + } catch (err) { + ctrl.error(err); + } + }, + async cancel() { + await iter.return?.(); + } + }); + } + } + return Stream3; + })(); + SSEDecoder = class { + constructor() { + this.event = null; + this.data = []; + this.chunks = []; + } + decode(line) { + if (line.endsWith("\r")) { + line = line.substring(0, line.length - 1); + } + if (!line) { + if (!this.event && !this.data.length) + return null; + const sse = { + event: this.event, + data: this.data.join("\n"), + raw: this.chunks + }; + this.event = null; + this.data = []; + this.chunks = []; + return sse; + } + this.chunks.push(line); + if (line.startsWith(":")) { + return null; + } + let [fieldname, _, value2] = partition(line, ":"); + if (value2.startsWith(" ")) { + value2 = value2.substring(1); + } + if (fieldname === "event") { + this.event = value2; + } else if (fieldname === "data") { + this.data.push(value2); + } + return null; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/parse.mjs +async function defaultParseResponse(client, props) { + const { response, requestLogID, retryOfRequestLogID, startTime } = props; + const body = await (async () => { + if (props.options.stream) { + loggerFor(client).debug("response", response.status, response.url, response.headers, response.body); + return Stream.fromSSEResponse(response, props.controller, client); + } + if (response.status === 204) { + return null; + } + if (props.options.__binaryResponse) { + return response; + } + const contentType = response.headers.get("content-type"); + const mediaType = contentType?.split(";")[0]?.trim(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + const contentLength = response.headers.get("content-length"); + if (contentLength === "0") { + return void 0; + } + const json = await response.json(); + return addResponseIDs(json, response); + } + const text2 = await response.text(); + return text2; + })().finally(() => { + if (!props.options.stream && !props.options.__binaryResponse) { + releaseRequestSignal(props.controller); + } + }); + debugLogRequestDetails(loggerFor(client), `[${requestLogID}] response parsed`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + body, + durationMs: Date.now() - startTime + }); + return body; +} +function addResponseIDs(value2, response) { + if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) { + return value2; + } + return Object.defineProperties(value2, { + _request_id: { value: response.headers.get("request-id"), enumerable: false }, + _workspace_id: { value: response.headers.get("anthropic-workspace-id"), enumerable: false } + }); +} +var init_parse = __esm({ + "node_modules/@anthropic-ai/sdk/internal/parse.mjs"() { + init_streaming(); + init_log(); + init_request_signal(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/middleware.mjs +function isFetchOriginError(err) { + return typeof err === "object" && err !== null && fetchOriginErrors.has(err); +} +function isRetryableError(err) { + const seen = /* @__PURE__ */ new Set(); + while (typeof err === "object" && err !== null && !seen.has(err)) { + seen.add(err); + if (isFetchOriginError(err) || isAbortError(err) || err instanceof APIConnectionError || err instanceof RetryableError) { + return true; + } + err = err.cause; + } + return false; +} +function wrapFetchWithMiddleware(fetchFn, middleware, options, client) { + return async (url, init = {}) => { + if (middleware.length === 0) { + return fetchFn.call(void 0, url, init); + } + const headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); + const response = await applyMiddleware(fetchFn, middleware, options, client)({ + ...init, + headers, + url: typeof url === "string" ? url : url instanceof URL ? url.href : url.url + }); + if (response.bodyUsed || response.body?.locked) { + throw new AnthropicError("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it"); + } + return response; + }; +} +function createMiddlewareContext(options, client) { + const cache = /* @__PURE__ */ new WeakMap(); + return { + options, + // Resolved per chain, so changes to the client's `logLevel`/`logger` + // apply to subsequent requests. + logger: client ? loggerFor(client) : defaultLogger(), + parse(response) { + if (options?.stream && response.ok) { + return parseMiddlewareResponse(response, options, client); + } + let parsed = cache.get(response); + if (!parsed) { + parsed = parseMiddlewareResponse(response, options, client); + cache.set(response, parsed); + } + return parsed; + } + }; +} +async function parseMiddlewareResponse(response, options, client) { + if (response.bodyUsed || response.body?.locked) { + throw new AnthropicError("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()"); + } + if (options?.stream && response.ok) { + return Stream.fromSSEResponse(response.clone(), new AbortController(), client); + } + if (response.status === 204) { + return null; + } + if (options?.__binaryResponse) { + return response; + } + const contentType = response.headers.get("content-type"); + const mediaType = contentType?.split(";")[0]?.trim(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + if (response.headers.get("content-length") === "0") { + return void 0; + } + return addResponseIDs(await response.clone().json(), response); + } + return await response.clone().text(); +} +function applyMiddleware(fetchFn, middleware, options, client) { + let next = async ({ url, ...init }) => { + try { + return await fetchFn.call(void 0, url, init); + } catch (err) { + const error = castToError(err); + fetchOriginErrors.add(error); + throw error; + } + }; + const ctx = createMiddlewareContext(options, client); + for (let i = middleware.length - 1; i >= 0; i--) { + const mw = middleware[i]; + const nextInner = next; + next = async (request2) => mw(request2, nextInner, ctx); + } + return next; +} +var fetchOriginErrors; +var init_middleware = __esm({ + "node_modules/@anthropic-ai/sdk/core/middleware.mjs"() { + init_errors(); + init_parse(); + init_log(); + init_error(); + init_streaming(); + fetchOriginErrors = /* @__PURE__ */ new WeakSet(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/api-promise.mjs +var _APIPromise_client, APIPromise; +var init_api_promise = __esm({ + "node_modules/@anthropic-ai/sdk/core/api-promise.mjs"() { + init_tslib(); + init_parse(); + APIPromise = /* @__PURE__ */ (() => { + class APIPromise3 extends Promise { + constructor(client, responsePromise, parseResponse2 = defaultParseResponse) { + super((resolve2) => { + resolve2(null); + }); + this.responsePromise = responsePromise; + this.parseResponse = parseResponse2; + _APIPromise_client.set(this, void 0); + __classPrivateFieldSet(this, _APIPromise_client, client, "f"); + } + _thenUnwrap(transform) { + return new APIPromise3(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addResponseIDs(transform(await this.parseResponse(client, props), props), props.response)); + } + /** + * Gets the raw `Response` instance instead of parsing the response + * data. + * + * If you want to parse the response body but still get the `Response` + * instance, you can use {@link withResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + asResponse() { + return this.responsePromise.then((p) => p.response); + } + /** + * Gets the parsed response data, the raw `Response` instance and the ID of the request, + * returned via the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * If you just want to get the raw `Response` instance without parsing it, + * you can use {@link asResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + async withResponse() { + const [data, response] = await Promise.all([this.parse(), this.asResponse()]); + return { + data, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + parse() { + if (!this.parsedPromise) { + this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); + } + return this.parsedPromise; + } + then(onfulfilled, onrejected) { + return this.parse().then(onfulfilled, onrejected); + } + catch(onrejected) { + return this.parse().catch(onrejected); + } + finally(onfinally) { + return this.parse().finally(onfinally); + } + } + _APIPromise_client = /* @__PURE__ */ new WeakMap(); + return APIPromise3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/pagination.mjs +var _AbstractPage_client, AbstractPage, PagePromise, Page, PageCursor, BidirectionalPageCursor; +var init_pagination = __esm({ + "node_modules/@anthropic-ai/sdk/core/pagination.mjs"() { + init_tslib(); + init_error(); + init_parse(); + init_api_promise(); + init_values(); + AbstractPage = /* @__PURE__ */ (() => { + class AbstractPage3 { + constructor(client, response, body, options) { + _AbstractPage_client.set(this, void 0); + __classPrivateFieldSet(this, _AbstractPage_client, client, "f"); + this.options = options; + this.response = response; + this.body = body; + } + hasNextPage() { + const items = this.getPaginatedItems(); + if (!items.length) + return false; + return this.nextPageRequestOptions() != null; + } + async getNextPage() { + const nextOptions = this.nextPageRequestOptions(); + if (!nextOptions) { + throw new AnthropicError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); + } + return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + } + async *iterPages() { + let page3 = this; + yield page3; + while (page3.hasNextPage()) { + page3 = await page3.getNextPage(); + yield page3; + } + } + async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + for await (const page3 of this.iterPages()) { + for (const item of page3.getPaginatedItems()) { + yield item; + } + } + } + } + return AbstractPage3; + })(); + PagePromise = /* @__PURE__ */ (() => { + class PagePromise3 extends APIPromise { + constructor(client, request2, Page3) { + super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse(client2, props), props.options)); + } + /** + * Allow auto-paginating iteration on an unawaited list call, eg: + * + * for await (const item of client.items.list()) { + * console.log(item) + * } + */ + async *[Symbol.asyncIterator]() { + const page3 = await this; + for await (const item of page3) { + yield item; + } + } + } + return PagePromise3; + })(); + Page = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.has_more = body.has_more || false; + this.first_id = body.first_id || null; + this.last_id = body.last_id || null; + } + getPaginatedItems() { + return this.data ?? []; + } + hasNextPage() { + if (this.has_more === false) { + return false; + } + return super.hasNextPage(); + } + nextPageRequestOptions() { + if (this.options.query?.["before_id"]) { + const first_id = this.first_id; + if (!first_id) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + before_id: first_id + } + }; + } + const cursor = this.last_id; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + after_id: cursor + } + }; + } + }; + PageCursor = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.next_page = body.next_page || null; + } + getPaginatedItems() { + return this.data ?? []; + } + nextPageRequestOptions() { + const cursor = this.next_page; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + page: cursor + } + }; + } + }; + BidirectionalPageCursor = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.next_page = body.next_page || null; + this.prev_page = body.prev_page || null; + } + getPaginatedItems() { + return this.data ?? []; + } + nextPageRequestOptions() { + const cursor = this.next_page; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + page: cursor + } + }; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/uploads.mjs +function makeFile(fileBits, fileName, options) { + checkFileSupport(); + return new File(fileBits, fileName ?? "", options); +} +function getName(value2, stripPath) { + const val = typeof value2 === "object" && value2 !== null && ("name" in value2 && value2.name && String(value2.name) || "url" in value2 && value2.url && String(value2.url) || "filename" in value2 && value2.filename && String(value2.filename) || "path" in value2 && value2.path && String(value2.path)) || ""; + return stripPath ? val.split(/[\\/]/).pop() || void 0 : val; +} +function supportsFormData(fetchObject) { + const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; + const cached = supportsFormDataMap.get(fetch2); + if (cached) + return cached; + const promise = (async () => { + try { + const FetchResponse = "Response" in fetch2 ? fetch2.Response : (await fetch2("data:,")).constructor; + const data = new FormData(); + if (data.toString() === await new FetchResponse(data).text()) { + return false; + } + return true; + } catch { + return true; + } + })(); + supportsFormDataMap.set(fetch2, promise); + return promise; +} +var checkFileSupport, isAsyncIterable, multipartFormRequestOptions, supportsFormDataMap, createForm, addFormValue; +var init_uploads = __esm({ + "node_modules/@anthropic-ai/sdk/internal/uploads.mjs"() { + init_shims(); + checkFileSupport = () => { + if (typeof File === "undefined") { + const { process: process2 } = globalThis; + const isOldNode = typeof process2?.versions?.node === "string" && parseInt(process2.versions.node.split(".")) < 20; + throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : "")); + } + }; + isAsyncIterable = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; + multipartFormRequestOptions = async (opts, fetch2, stripFilenames = true) => { + return { ...opts, body: await createForm(opts.body, fetch2, stripFilenames) }; + }; + supportsFormDataMap = /* @__PURE__ */ new WeakMap(); + createForm = async (body, fetch2, stripFilenames = true) => { + if (!await supportsFormData(fetch2)) { + throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); + } + const form = new FormData(); + await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue(form, key, value2, stripFilenames))); + return form; + }; + addFormValue = async (form, key, value2, stripFilenames) => { + if (value2 === void 0) + return; + if (value2 == null) { + throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); + } + if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean") { + form.append(key, String(value2)); + } else if (value2 instanceof Response) { + let options = {}; + const contentType = value2.headers.get("Content-Type"); + if (contentType) { + options = { type: contentType }; + } + form.append(key, makeFile([await value2.blob()], getName(value2, stripFilenames), options)); + } else if (isAsyncIterable(value2)) { + form.append(key, makeFile([await new Response(ReadableStreamFrom(value2)).blob()], getName(value2, stripFilenames))); + } else if (value2 instanceof Blob) { + const isFile = typeof File !== "undefined" && value2 instanceof File; + const name = isFile ? value2.name : getName(value2, stripFilenames); + form.append(key, makeFile([value2], name, { type: value2.type })); + } else if (Array.isArray(value2)) { + await Promise.all(value2.map((entry2) => addFormValue(form, key + "[]", entry2, stripFilenames))); + } else if (typeof value2.then === "function") { + throw new TypeError(`Received a Promise for "${key}"; await it first, e.g. \`await toFile(...)\``); + } else if (value2 instanceof ArrayBuffer || ArrayBuffer.isView(value2)) { + throw new TypeError(`Received ${value2.constructor.name} for "${key}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``); + } else if (typeof value2 === "object") { + await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop, stripFilenames))); + } else { + throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/to-file.mjs +async function toFile(value2, name, options) { + checkFileSupport(); + value2 = await value2; + name || (name = value2 instanceof File ? value2.name : getName(value2, true)); + if (isFileLike(value2)) { + if (value2 instanceof File && name == null && options == null) { + return value2; + } + return makeFile([await value2.arrayBuffer()], name ?? value2.name, { + type: value2.type, + lastModified: value2.lastModified, + ...options + }); + } + if (isResponseLike(value2)) { + const blob = await value2.blob(); + name || (name = new URL(value2.url).pathname.split(/[\\/]/).pop()); + return makeFile(await getBytes(blob), name, options); + } + const parts = await getBytes(value2); + if (!options?.type) { + const type = parts.find((part) => typeof part === "object" && "type" in part && part.type); + if (typeof type === "string") { + options = { ...options, type }; + } + } + return makeFile(parts, name, options); +} +async function getBytes(value2) { + let parts = []; + if (typeof value2 === "string" || ArrayBuffer.isView(value2) || // includes Uint8Array, Buffer, etc. + value2 instanceof ArrayBuffer) { + parts.push(value2); + } else if (isBlobLike(value2)) { + parts.push(value2 instanceof Blob ? value2 : await value2.arrayBuffer()); + } else if (isAsyncIterable(value2)) { + for await (const chunk of value2) { + parts.push(...await getBytes(chunk)); + } + } else { + const constructor = value2?.constructor?.name; + throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError(value2)}`); + } + return parts; +} +function propsForError(value2) { + if (typeof value2 !== "object" || value2 === null) + return ""; + const props = Object.getOwnPropertyNames(value2); + return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; +} +var isBlobLike, isFileLike, isResponseLike; +var init_to_file = __esm({ + "node_modules/@anthropic-ai/sdk/internal/to-file.mjs"() { + init_uploads(); + init_uploads(); + isBlobLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; + isFileLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike(value2); + isResponseLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; + } +}); + +// node_modules/@anthropic-ai/sdk/core/uploads.mjs +var init_uploads2 = __esm({ + "node_modules/@anthropic-ai/sdk/core/uploads.mjs"() { + init_to_file(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/shared.mjs +var init_shared = __esm({ + "node_modules/@anthropic-ai/sdk/resources/shared.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/core/resource.mjs +var APIResource; +var init_resource = __esm({ + "node_modules/@anthropic-ai/sdk/core/resource.mjs"() { + APIResource = class { + constructor(client) { + this._client = client; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/headers.mjs +function* iterateHeaders(headers) { + if (!headers) + return; + if (brand_privateNullableHeaders in headers) { + const { values, nulls } = headers; + yield* values.entries(); + for (const name of nulls) { + yield [name, null]; + } + return; + } + let shouldClear = false; + let iter; + if (headers instanceof Headers) { + iter = headers.entries(); + } else if (isReadonlyArray(headers)) { + iter = headers; + } else { + shouldClear = true; + iter = Object.entries(headers ?? {}); + } + for (let row of iter) { + const name = row[0]; + if (typeof name !== "string") + throw new TypeError("expected header name to be a string"); + const values = isReadonlyArray(row[1]) ? row[1] : [row[1]]; + let didClear = false; + for (const value2 of values) { + if (value2 === void 0) + continue; + if (shouldClear && !didClear) { + didClear = true; + yield [name, clearSentinel]; + } + yield [name, value2]; + } + } +} +var brand_privateNullableHeaders, clearSentinel, APPEND_HEADERS, appendHeaderValue, buildHeaders; +var init_headers = __esm({ + "node_modules/@anthropic-ai/sdk/internal/headers.mjs"() { + init_values(); + brand_privateNullableHeaders = /* @__PURE__ */ Symbol.for("brand.privateNullableHeaders"); + clearSentinel = /* @__PURE__ */ Symbol("clear"); + APPEND_HEADERS = /* @__PURE__ */ new Set(["x-stainless-helper"]); + appendHeaderValue = (existing, addition) => { + const tokens = existing ? existing.split(",").map((t) => t.trim()).filter(Boolean) : []; + for (const tok of addition.split(",").map((t) => t.trim())) { + if (tok && !tokens.includes(tok)) + tokens.push(tok); + } + return tokens.join(", "); + }; + buildHeaders = (newHeaders) => { + const targetHeaders = new Headers(); + const nullHeaders = /* @__PURE__ */ new Set(); + for (const headers of newHeaders) { + const seenHeaders = /* @__PURE__ */ new Set(); + for (const [name, value2] of iterateHeaders(headers)) { + const lowerName = name.toLowerCase(); + if (APPEND_HEADERS.has(lowerName)) { + if (value2 === clearSentinel) + continue; + if (value2 === null) { + targetHeaders.delete(name); + nullHeaders.add(lowerName); + } else { + targetHeaders.set(name, appendHeaderValue(targetHeaders.get(name), value2)); + nullHeaders.delete(lowerName); + } + continue; + } + if (value2 === clearSentinel || !seenHeaders.has(lowerName)) { + targetHeaders.delete(name); + seenHeaders.add(lowerName); + if (value2 === clearSentinel) + continue; + } + if (value2 === null) { + targetHeaders.delete(name); + nullHeaders.add(lowerName); + } else { + targetHeaders.append(name, value2); + nullHeaders.delete(lowerName); + } + } + } + return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders }; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +function encodeURIPath(str2) { + return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); +} +var EMPTY, createPathTagFunction, path2; +var init_path = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() { + init_error(); + EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + createPathTagFunction = (pathEncoder = encodeURIPath) => function path5(statics, ...params) { + if (statics.length === 1) + return statics[0]; + let postPath = false; + const invalidSegments = []; + const path6 = statics.reduce((previousValue, currentValue, index) => { + if (/[?#]/.test(currentValue)) { + postPath = true; + } + const value2 = params[index]; + let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value2); + if (index !== params.length && (value2 == null || typeof value2 === "object" && // handle values from other realms + value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY) ?? EMPTY)?.toString)) { + encoded = value2 + ""; + invalidSegments.push({ + start: previousValue.length + currentValue.length, + length: encoded.length, + error: `Value of type ${Object.prototype.toString.call(value2).slice(8, -1)} is not a valid path parameter` + }); + } + return previousValue + currentValue + (index === params.length ? "" : encoded); + }, ""); + const pathOnly = path6.split(/[?#]/, 1)[0]; + const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; + let match; + while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { + invalidSegments.push({ + start: match.index, + length: match[0].length, + error: `Value "${match[0]}" can't be safely passed as a path parameter` + }); + } + invalidSegments.sort((a, b) => a.start - b.start); + if (invalidSegments.length > 0) { + let lastEnd = 0; + const underline = invalidSegments.reduce((acc, segment) => { + const spaces = " ".repeat(segment.start - lastEnd); + const arrows = "^".repeat(segment.length); + lastEnd = segment.start + segment.length; + return acc + spaces + arrows; + }, ""); + throw new AnthropicError(`Path parameters result in path with invalid segments: +${invalidSegments.map((e) => e.error).join("\n")} +${path6} +${underline}`); + } + return path6; + }; + path2 = /* @__PURE__ */ createPathTagFunction(encodeURIPath); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +var DeploymentRuns; +var init_deployment_runs = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + DeploymentRuns = class extends APIResource { + /** + * Get Deployment Run + * + * @example + * ```ts + * const betaManagedAgentsDeploymentRun = + * await client.beta.deploymentRuns.retrieve( + * 'deployment_run_id', + * ); + * ``` + */ + retrieve(deploymentRunID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/deployment_runs/${deploymentRunID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Deployment Runs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsDeploymentRun of client.beta.deploymentRuns.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/deployment_runs?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +var Deployments; +var init_deployments = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Deployments = class extends APIResource { + /** + * Create Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.create({ + * agent: 'string', + * environment_id: 'x', + * initial_events: [ + * { + * content: [ + * { + * text: 'Where is my order #1234?', + * type: 'text', + * }, + * ], + * type: 'user.message', + * }, + * ], + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/deployments?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.retrieve( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + retrieve(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/deployments/${deploymentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.update( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + update(deploymentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/deployments/${deploymentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Deployments + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsDeployment of client.beta.deployments.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/deployments?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.archive( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + archive(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Pause Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.pause( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + pause(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/pause?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Run Deployment Now + * + * @example + * ```ts + * const betaManagedAgentsDeploymentRun = + * await client.beta.deployments.run( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + run(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/run?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Unpause Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.unpause( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + unpause(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/unpause?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +var Dreams; +var init_dreams = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Dreams = class extends APIResource { + /** + * Start an asynchronous job that uses past sessions to produce a reorganized + * version of a memory store and get back the dream to poll for the result. + * + * By default the dream writes its result to a new memory store and doesn't change + * the input memory store. The response has `status` set to `pending` and an empty + * `outputs` array. Poll the dream until `status` is `completed`, `failed`, or + * `canceled`. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#create-a-dream) + * to learn more about creating dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.create({ + * inputs: [{ memory_store_id: 'x', type: 'memory_store' }], + * model: 'string', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/dreams?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get a dream by ID to check its status, output memory store, and token usage. + * + * Archived dreams are returned too. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#track-progress) + * for how to poll a dream and what each status means. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.retrieve( + * 'dream_id', + * ); + * ``` + */ + retrieve(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/dreams/${dreamID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List the dreams in the workspace, newest first. + * + * Archived dreams are left out unless `include_archived` is `true`. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#list-dreams) + * for how to page through dreams. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaDream of client.beta.dreams.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/dreams?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Hide a `completed`, `failed`, or `canceled` dream from the default list of + * dreams. + * + * Archiving a `pending` or `running` dream returns a 400 error, so cancel it + * first. Archiving an archived dream returns it unchanged. An archived dream can + * still be fetched by ID. Archiving can't be undone. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#archive-a-dream) + * to learn more about archiving dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.archive( + * 'dream_id', + * ); + * ``` + */ + archive(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/dreams/${dreamID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stop a `pending` or `running` dream. + * + * The response shows `status` as `canceled`, unless the dream reached `completed` + * or `failed` first. `usage` can keep changing after the response. Canceling a + * `canceled` dream returns it unchanged. Canceling a `completed` or `failed` dream + * returns a 400 error. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#cancel-a-dream) + * to learn more about canceling dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.cancel( + * 'dream_id', + * ); + * ``` + */ + cancel(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/dreams/${dreamID}/cancel?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs +function helperHeader(value2) { + return { [STAINLESS_HELPER_HEADER]: value2 }; +} +function wasCreatedByStainlessHelper(value2) { + return typeof value2 === "object" && value2 !== null && SDK_HELPER_SYMBOL in value2; +} +function collectStainlessHelpers(tools, messages) { + const helpers = /* @__PURE__ */ new Set(); + if (tools) { + for (const tool of tools) { + if (wasCreatedByStainlessHelper(tool)) { + helpers.add(tool[SDK_HELPER_SYMBOL]); + } + } + } + if (messages) { + for (const message of messages) { + if (wasCreatedByStainlessHelper(message)) { + helpers.add(message[SDK_HELPER_SYMBOL]); + } + const content = message.content; + if (Array.isArray(content)) { + for (const block of content) { + if (wasCreatedByStainlessHelper(block)) { + helpers.add(block[SDK_HELPER_SYMBOL]); + } + const definition = block?.tool?.definition; + if (wasCreatedByStainlessHelper(definition)) { + helpers.add(definition[SDK_HELPER_SYMBOL]); + } + } + } + } + } + return Array.from(helpers); +} +function stainlessHelperHeader(tools, messages) { + const helpers = collectStainlessHelpers(tools, messages); + if (helpers.length === 0) + return {}; + return { [STAINLESS_HELPER_HEADER]: helpers.join(", ") }; +} +function stainlessHelperHeaderFromFile(file2) { + if (wasCreatedByStainlessHelper(file2)) { + return { [STAINLESS_HELPER_HEADER]: file2[SDK_HELPER_SYMBOL] }; + } + return {}; +} +var STAINLESS_HELPER_HEADER, STAINLESS_HELPER_METHOD_HEADER, SDK_HELPER_SYMBOL; +var init_stainless_helper_header = __esm({ + "node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs"() { + STAINLESS_HELPER_HEADER = "x-stainless-helper"; + STAINLESS_HELPER_METHOD_HEADER = "x-stainless-helper-method"; + SDK_HELPER_SYMBOL = /* @__PURE__ */ Symbol("anthropic.sdk.stainlessHelper"); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +var Files; +var init_files = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/files.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_stainless_helper_header(); + init_uploads(); + init_path(); + Files = class extends APIResource { + /** + * List Files + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFileMetadata of client.beta.files.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/files?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete File + * + * @example + * ```ts + * const betaDeletedFile = await client.beta.files.delete( + * 'file_id', + * ); + * ``` + */ + delete(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/files/${fileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Download File + * + * @example + * ```ts + * const response = await client.beta.files.download( + * 'file_id', + * ); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}/content?beta=true`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + /** + * Get File Metadata + * + * @example + * ```ts + * const betaFileMetadata = + * await client.beta.files.retrieveMetadata('file_id'); + * ``` + */ + retrieveMetadata(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Upload File + * + * @example + * ```ts + * const betaFileMetadata = await client.beta.files.upload({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + upload(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/files?beta=true", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + stainlessHelperHeaderFromFile(body.file), + options?.headers + ]) + }, this._client)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +var Models; +var init_models2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/models.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Models = class extends APIResource { + /** + * Get a specific model. + * + * The Models API response can be used to determine information about a specific + * model or resolve a model alias to a model ID. + * + * @example + * ```ts + * const betaModelInfo = await client.beta.models.retrieve( + * 'model_id', + * ); + * ``` + */ + retrieve(modelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/models/${modelID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List available models. + * + * The Models API response can be used to determine which models are available for + * use in the API. More recently released models are listed first. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaModelInfo of client.beta.models.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/models?beta=true", Page, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +var UserProfiles; +var init_user_profiles = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + UserProfiles = class extends APIResource { + /** + * Create User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.create(); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/user_profiles?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.retrieve( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + retrieve(userProfileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/user_profiles/${userProfileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.update( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + update(userProfileID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/user_profiles/${userProfileID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List User Profiles + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaUserProfile of client.beta.userProfiles.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/user_profiles?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Create Enrollment URL + * + * @example + * ```ts + * const betaUserProfileEnrollmentURL = + * await client.beta.userProfiles.createEnrollmentURL( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + createEnrollmentURL(userProfileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@stablelib/base64/lib/base64.js +var require_base64 = __commonJS({ + "node_modules/@stablelib/base64/lib/base64.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p]; + }; + return extendStatics(d, b); + }; + return function(d, b) { + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + var INVALID_BYTE = 256; + var Coder = ( + /** @class */ + (function() { + function Coder2(_paddingCharacter) { + if (_paddingCharacter === void 0) { + _paddingCharacter = "="; + } + this._paddingCharacter = _paddingCharacter; + } + Coder2.prototype.encodedLength = function(length) { + if (!this._paddingCharacter) { + return (length * 8 + 5) / 6 | 0; + } + return (length + 2) / 3 * 4 | 0; + }; + Coder2.prototype.encode = function(data) { + var out = ""; + var i = 0; + for (; i < data.length - 2; i += 3) { + var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2]; + out += this._encodeByte(c >>> 3 * 6 & 63); + out += this._encodeByte(c >>> 2 * 6 & 63); + out += this._encodeByte(c >>> 1 * 6 & 63); + out += this._encodeByte(c >>> 0 * 6 & 63); + } + var left = data.length - i; + if (left > 0) { + var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0); + out += this._encodeByte(c >>> 3 * 6 & 63); + out += this._encodeByte(c >>> 2 * 6 & 63); + if (left === 2) { + out += this._encodeByte(c >>> 1 * 6 & 63); + } else { + out += this._paddingCharacter || ""; + } + out += this._paddingCharacter || ""; + } + return out; + }; + Coder2.prototype.maxDecodedLength = function(length) { + if (!this._paddingCharacter) { + return (length * 6 + 7) / 8 | 0; + } + return length / 4 * 3 | 0; + }; + Coder2.prototype.decodedLength = function(s) { + return this.maxDecodedLength(s.length - this._getPaddingLength(s)); + }; + Coder2.prototype.decode = function(s) { + if (s.length === 0) { + return new Uint8Array(0); + } + var paddingLength = this._getPaddingLength(s); + var length = s.length - paddingLength; + var out = new Uint8Array(this.maxDecodedLength(length)); + var op2 = 0; + var i = 0; + var haveBad = 0; + var v0 = 0, v1 = 0, v2 = 0, v3 = 0; + for (; i < length - 4; i += 4) { + v0 = this._decodeChar(s.charCodeAt(i + 0)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + v2 = this._decodeChar(s.charCodeAt(i + 2)); + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op2++] = v0 << 2 | v1 >>> 4; + out[op2++] = v1 << 4 | v2 >>> 2; + out[op2++] = v2 << 6 | v3; + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + haveBad |= v2 & INVALID_BYTE; + haveBad |= v3 & INVALID_BYTE; + } + if (i < length - 1) { + v0 = this._decodeChar(s.charCodeAt(i)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + out[op2++] = v0 << 2 | v1 >>> 4; + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + } + if (i < length - 2) { + v2 = this._decodeChar(s.charCodeAt(i + 2)); + out[op2++] = v1 << 4 | v2 >>> 2; + haveBad |= v2 & INVALID_BYTE; + } + if (i < length - 3) { + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op2++] = v2 << 6 | v3; + haveBad |= v3 & INVALID_BYTE; + } + if (haveBad !== 0) { + throw new Error("Base64Coder: incorrect characters for decoding"); + } + return out; + }; + Coder2.prototype._encodeByte = function(b) { + var result = b; + result += 65; + result += 25 - b >>> 8 & 0 - 65 - 26 + 97; + result += 51 - b >>> 8 & 26 - 97 - 52 + 48; + result += 61 - b >>> 8 & 52 - 48 - 62 + 43; + result += 62 - b >>> 8 & 62 - 43 - 63 + 47; + return String.fromCharCode(result); + }; + Coder2.prototype._decodeChar = function(c) { + var result = INVALID_BYTE; + result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62; + result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63; + result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; + result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; + result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; + return result; + }; + Coder2.prototype._getPaddingLength = function(s) { + var paddingLength = 0; + if (this._paddingCharacter) { + for (var i = s.length - 1; i >= 0; i--) { + if (s[i] !== this._paddingCharacter) { + break; + } + paddingLength++; + } + if (s.length < 4 || paddingLength > 2) { + throw new Error("Base64Coder: incorrect padding"); + } + } + return paddingLength; + }; + return Coder2; + })() + ); + exports.Coder = Coder; + var stdCoder = new Coder(); + function encode3(data) { + return stdCoder.encode(data); + } + exports.encode = encode3; + function decode(s) { + return stdCoder.decode(s); + } + exports.decode = decode; + var URLSafeCoder = ( + /** @class */ + (function(_super) { + __extends(URLSafeCoder2, _super); + function URLSafeCoder2() { + return _super !== null && _super.apply(this, arguments) || this; + } + URLSafeCoder2.prototype._encodeByte = function(b) { + var result = b; + result += 65; + result += 25 - b >>> 8 & 0 - 65 - 26 + 97; + result += 51 - b >>> 8 & 26 - 97 - 52 + 48; + result += 61 - b >>> 8 & 52 - 48 - 62 + 45; + result += 62 - b >>> 8 & 62 - 45 - 63 + 95; + return String.fromCharCode(result); + }; + URLSafeCoder2.prototype._decodeChar = function(c) { + var result = INVALID_BYTE; + result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62; + result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63; + result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; + result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; + result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; + return result; + }; + return URLSafeCoder2; + })(Coder) + ); + exports.URLSafeCoder = URLSafeCoder; + var urlSafeCoder = new URLSafeCoder(); + function encodeURLSafe(data) { + return urlSafeCoder.encode(data); + } + exports.encodeURLSafe = encodeURLSafe; + function decodeURLSafe(s) { + return urlSafeCoder.decode(s); + } + exports.decodeURLSafe = decodeURLSafe; + exports.encodedLength = function(length) { + return stdCoder.encodedLength(length); + }; + exports.maxDecodedLength = function(length) { + return stdCoder.maxDecodedLength(length); + }; + exports.decodedLength = function(s) { + return stdCoder.decodedLength(s); + }; + } +}); + +// node_modules/fast-sha256/sha256.js +var require_sha256 = __commonJS({ + "node_modules/fast-sha256/sha256.js"(exports, module) { + (function(root, factory) { + var exports2 = {}; + factory(exports2); + var sha256 = exports2["default"]; + for (var k in exports2) { + sha256[k] = exports2[k]; + } + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = sha256; + } else if (typeof define === "function" && define.amd) { + define(function() { + return sha256; + }); + } else { + root.sha256 = sha256; + } + })(exports, function(exports2) { + "use strict"; + exports2.__esModule = true; + exports2.digestLength = 32; + exports2.blockSize = 64; + var K = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + function hashBlocks(w, v, p, pos, len) { + var a, b, c, d, e, f, g, h, u, i, j, t1, t2; + while (len >= 64) { + a = v[0]; + b = v[1]; + c = v[2]; + d = v[3]; + e = v[4]; + f = v[5]; + g = v[6]; + h = v[7]; + for (i = 0; i < 16; i++) { + j = pos + i * 4; + w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255; + } + for (i = 16; i < 64; i++) { + u = w[i - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0); + } + for (i = 0; i < 64; i++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + v[0] += a; + v[1] += b; + v[2] += c; + v[3] += d; + v[4] += e; + v[5] += f; + v[6] += g; + v[7] += h; + pos += 64; + len -= 64; + } + return pos; + } + var Hash = ( + /** @class */ + (function() { + function Hash2() { + this.digestLength = exports2.digestLength; + this.blockSize = exports2.blockSize; + this.state = new Int32Array(8); + this.temp = new Int32Array(64); + this.buffer = new Uint8Array(128); + this.bufferLength = 0; + this.bytesHashed = 0; + this.finished = false; + this.reset(); + } + Hash2.prototype.reset = function() { + this.state[0] = 1779033703; + this.state[1] = 3144134277; + this.state[2] = 1013904242; + this.state[3] = 2773480762; + this.state[4] = 1359893119; + this.state[5] = 2600822924; + this.state[6] = 528734635; + this.state[7] = 1541459225; + this.bufferLength = 0; + this.bytesHashed = 0; + this.finished = false; + return this; + }; + Hash2.prototype.clean = function() { + for (var i = 0; i < this.buffer.length; i++) { + this.buffer[i] = 0; + } + for (var i = 0; i < this.temp.length; i++) { + this.temp[i] = 0; + } + this.reset(); + }; + Hash2.prototype.update = function(data, dataLength) { + if (dataLength === void 0) { + dataLength = data.length; + } + if (this.finished) { + throw new Error("SHA256: can't update because hash was finished."); + } + var dataPos = 0; + this.bytesHashed += dataLength; + if (this.bufferLength > 0) { + while (this.bufferLength < 64 && dataLength > 0) { + this.buffer[this.bufferLength++] = data[dataPos++]; + dataLength--; + } + if (this.bufferLength === 64) { + hashBlocks(this.temp, this.state, this.buffer, 0, 64); + this.bufferLength = 0; + } + } + if (dataLength >= 64) { + dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength); + dataLength %= 64; + } + while (dataLength > 0) { + this.buffer[this.bufferLength++] = data[dataPos++]; + dataLength--; + } + return this; + }; + Hash2.prototype.finish = function(out) { + if (!this.finished) { + var bytesHashed = this.bytesHashed; + var left = this.bufferLength; + var bitLenHi = bytesHashed / 536870912 | 0; + var bitLenLo = bytesHashed << 3; + var padLength = bytesHashed % 64 < 56 ? 64 : 128; + this.buffer[left] = 128; + for (var i = left + 1; i < padLength - 8; i++) { + this.buffer[i] = 0; + } + this.buffer[padLength - 8] = bitLenHi >>> 24 & 255; + this.buffer[padLength - 7] = bitLenHi >>> 16 & 255; + this.buffer[padLength - 6] = bitLenHi >>> 8 & 255; + this.buffer[padLength - 5] = bitLenHi >>> 0 & 255; + this.buffer[padLength - 4] = bitLenLo >>> 24 & 255; + this.buffer[padLength - 3] = bitLenLo >>> 16 & 255; + this.buffer[padLength - 2] = bitLenLo >>> 8 & 255; + this.buffer[padLength - 1] = bitLenLo >>> 0 & 255; + hashBlocks(this.temp, this.state, this.buffer, 0, padLength); + this.finished = true; + } + for (var i = 0; i < 8; i++) { + out[i * 4 + 0] = this.state[i] >>> 24 & 255; + out[i * 4 + 1] = this.state[i] >>> 16 & 255; + out[i * 4 + 2] = this.state[i] >>> 8 & 255; + out[i * 4 + 3] = this.state[i] >>> 0 & 255; + } + return this; + }; + Hash2.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; + }; + Hash2.prototype._saveState = function(out) { + for (var i = 0; i < this.state.length; i++) { + out[i] = this.state[i]; + } + }; + Hash2.prototype._restoreState = function(from, bytesHashed) { + for (var i = 0; i < this.state.length; i++) { + this.state[i] = from[i]; + } + this.bytesHashed = bytesHashed; + this.finished = false; + this.bufferLength = 0; + }; + return Hash2; + })() + ); + exports2.Hash = Hash; + var HMAC = ( + /** @class */ + (function() { + function HMAC2(key) { + this.inner = new Hash(); + this.outer = new Hash(); + this.blockSize = this.inner.blockSize; + this.digestLength = this.inner.digestLength; + var pad = new Uint8Array(this.blockSize); + if (key.length > this.blockSize) { + new Hash().update(key).finish(pad).clean(); + } else { + for (var i = 0; i < key.length; i++) { + pad[i] = key[i]; + } + } + for (var i = 0; i < pad.length; i++) { + pad[i] ^= 54; + } + this.inner.update(pad); + for (var i = 0; i < pad.length; i++) { + pad[i] ^= 54 ^ 92; + } + this.outer.update(pad); + this.istate = new Uint32Array(8); + this.ostate = new Uint32Array(8); + this.inner._saveState(this.istate); + this.outer._saveState(this.ostate); + for (var i = 0; i < pad.length; i++) { + pad[i] = 0; + } + } + HMAC2.prototype.reset = function() { + this.inner._restoreState(this.istate, this.inner.blockSize); + this.outer._restoreState(this.ostate, this.outer.blockSize); + return this; + }; + HMAC2.prototype.clean = function() { + for (var i = 0; i < this.istate.length; i++) { + this.ostate[i] = this.istate[i] = 0; + } + this.inner.clean(); + this.outer.clean(); + }; + HMAC2.prototype.update = function(data) { + this.inner.update(data); + return this; + }; + HMAC2.prototype.finish = function(out) { + if (this.outer.finished) { + this.outer.finish(out); + } else { + this.inner.finish(out); + this.outer.update(out, this.digestLength).finish(out); + } + return this; + }; + HMAC2.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; + }; + return HMAC2; + })() + ); + exports2.HMAC = HMAC; + function hash(data) { + var h = new Hash().update(data); + var digest = h.digest(); + h.clean(); + return digest; + } + exports2.hash = hash; + exports2["default"] = hash; + function hmac(key, data) { + var h = new HMAC(key).update(data); + var digest = h.digest(); + h.clean(); + return digest; + } + exports2.hmac = hmac; + function fillBuffer(buffer, hmac2, info, counter) { + var num2 = counter[0]; + if (num2 === 0) { + throw new Error("hkdf: cannot expand more"); + } + hmac2.reset(); + if (num2 > 1) { + hmac2.update(buffer); + } + if (info) { + hmac2.update(info); + } + hmac2.update(counter); + hmac2.finish(buffer); + counter[0]++; + } + var hkdfSalt = new Uint8Array(exports2.digestLength); + function hkdf(key, salt, info, length) { + if (salt === void 0) { + salt = hkdfSalt; + } + if (length === void 0) { + length = 32; + } + var counter = new Uint8Array([1]); + var okm = hmac(salt, key); + var hmac_ = new HMAC(okm); + var buffer = new Uint8Array(hmac_.digestLength); + var bufpos = buffer.length; + var out = new Uint8Array(length); + for (var i = 0; i < length; i++) { + if (bufpos === buffer.length) { + fillBuffer(buffer, hmac_, info, counter); + bufpos = 0; + } + out[i] = buffer[bufpos++]; + } + hmac_.clean(); + buffer.fill(0); + counter.fill(0); + return out; + } + exports2.hkdf = hkdf; + function pbkdf2(password, salt, iterations, dkLen) { + var prf = new HMAC(password); + var len = prf.digestLength; + var ctr = new Uint8Array(4); + var t = new Uint8Array(len); + var u = new Uint8Array(len); + var dk = new Uint8Array(dkLen); + for (var i = 0; i * len < dkLen; i++) { + var c = i + 1; + ctr[0] = c >>> 24 & 255; + ctr[1] = c >>> 16 & 255; + ctr[2] = c >>> 8 & 255; + ctr[3] = c >>> 0 & 255; + prf.reset(); + prf.update(salt); + prf.update(ctr); + prf.finish(u); + for (var j = 0; j < len; j++) { + t[j] = u[j]; + } + for (var j = 2; j <= iterations; j++) { + prf.reset(); + prf.update(u).finish(u); + for (var k = 0; k < len; k++) { + t[k] ^= u[k]; + } + } + for (var j = 0; j < len && i * len + j < dkLen; j++) { + dk[i * len + j] = t[j]; + } + } + for (var i = 0; i < len; i++) { + t[i] = u[i] = 0; + } + for (var i = 0; i < 4; i++) { + ctr[i] = 0; + } + prf.clean(); + return dk; + } + exports2.pbkdf2 = pbkdf2; + }); + } +}); + +// node_modules/standardwebhooks/dist/timing_safe_equal.js +var require_timing_safe_equal = __commonJS({ + "node_modules/standardwebhooks/dist/timing_safe_equal.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.timingSafeEqual = timingSafeEqual; + function assert(expr, msg = "") { + if (!expr) { + throw new Error(msg); + } + } + function timingSafeEqual(a, b) { + if (a.byteLength !== b.byteLength) { + return false; + } + if (!(a instanceof DataView)) { + a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a); + } + if (!(b instanceof DataView)) { + b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b); + } + assert(a instanceof DataView); + assert(b instanceof DataView); + const length = a.byteLength; + let out = 0; + let i = -1; + while (++i < length) { + out |= a.getUint8(i) ^ b.getUint8(i); + } + return out === 0; + } + } +}); + +// node_modules/standardwebhooks/dist/index.js +var require_dist = __commonJS({ + "node_modules/standardwebhooks/dist/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Webhook = exports.WebhookVerificationError = void 0; + var base64 = require_base64(); + var sha256 = require_sha256(); + var timing_safe_equal_1 = require_timing_safe_equal(); + var WEBHOOK_TOLERANCE_IN_SECONDS = 5 * 60; + var ExtendableError = class _ExtendableError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _ExtendableError.prototype); + this.name = "ExtendableError"; + this.stack = new Error(message).stack; + } + }; + var WebhookVerificationError = class _WebhookVerificationError extends ExtendableError { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _WebhookVerificationError.prototype); + this.name = "WebhookVerificationError"; + } + }; + exports.WebhookVerificationError = WebhookVerificationError; + var Webhook2 = class _Webhook { + constructor(secret, options) { + if ((options === null || options === void 0 ? void 0 : options.format) === "raw") { + if (secret instanceof Uint8Array) { + this.key = secret; + } else { + this.key = Uint8Array.from(secret, (c) => c.charCodeAt(0)); + } + } else { + if (typeof secret !== "string") { + throw new Error("Expected secret to be of type string"); + } + if (secret.startsWith(_Webhook.prefix)) { + secret = secret.substring(_Webhook.prefix.length); + } + this.key = base64.decode(secret); + } + if (this.key.length === 0) { + throw new Error("Secret can't be empty."); + } + } + verify(payload, headers, options) { + var _a6; + const jsonParse = (_a6 = options === null || options === void 0 ? void 0 : options.jsonParse) !== null && _a6 !== void 0 ? _a6 : true; + const normalizedHeaders = {}; + for (const key of Object.keys(headers)) { + normalizedHeaders[key.toLowerCase()] = headers[key]; + } + const msgId = normalizedHeaders["webhook-id"]; + const msgSignature = normalizedHeaders["webhook-signature"]; + const msgTimestamp = normalizedHeaders["webhook-timestamp"]; + if (!msgSignature || !msgId || !msgTimestamp) { + throw new WebhookVerificationError("Missing required headers"); + } + const timestamp2 = this.verifyTimestamp(msgTimestamp); + const computedSignature = this.sign(msgId, timestamp2, payload); + const expectedSignature = computedSignature.split(",")[1]; + const passedSignatures = msgSignature.split(" "); + const encoder6 = new globalThis.TextEncoder(); + for (const versionedSignature of passedSignatures) { + const [version, signature] = versionedSignature.split(","); + if (version !== "v1") { + continue; + } + if ((0, timing_safe_equal_1.timingSafeEqual)(encoder6.encode(signature), encoder6.encode(expectedSignature))) { + const payloadString = payload.toString(); + if (payloadString === "") { + return void 0; + } + if (jsonParse) { + return JSON.parse(payloadString); + } else { + return void 0; + } + } + } + throw new WebhookVerificationError("No matching signature found"); + } + sign(msgId, timestamp2, payload) { + if (typeof payload === "string") { + } else if (payload.constructor.name === "Buffer") { + payload = payload.toString(); + } else { + throw new Error("Expected payload to be of type string or Buffer."); + } + const encoder6 = new TextEncoder(); + const timestampNumber = Math.floor(timestamp2.getTime() / 1e3); + const toSign = encoder6.encode(`${msgId}.${timestampNumber}.${payload}`); + const expectedSignature = base64.encode(sha256.hmac(this.key, toSign)); + return `v1,${expectedSignature}`; + } + verifyTimestamp(timestampHeader) { + const now = Math.floor(Date.now() / 1e3); + const timestamp2 = parseInt(timestampHeader, 10); + if (Number.isNaN(timestamp2)) { + throw new WebhookVerificationError("Invalid Signature Headers"); + } + if (now - timestamp2 > WEBHOOK_TOLERANCE_IN_SECONDS) { + throw new WebhookVerificationError("Message timestamp too old"); + } + if (timestamp2 > now + WEBHOOK_TOLERANCE_IN_SECONDS) { + throw new WebhookVerificationError("Message timestamp too new"); + } + return new Date(timestamp2 * 1e3); + } + }; + exports.Webhook = Webhook2; + Webhook2.prefix = "whsec_"; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +var import_standardwebhooks, Webhooks; +var init_webhooks = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs"() { + init_resource(); + import_standardwebhooks = __toESM(require_dist(), 1); + Webhooks = class extends APIResource { + /** + * Parses a webhook payload into an event without verifying its signature. Prefer + * `unwrap()` unless you have already verified the signature yourself. + */ + parseUnverified(body) { + return JSON.parse(body); + } + /** + * Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and + * `webhook-signature` headers using your webhook signing key, then parses the + * payload into an event. Fails if the signature is missing or invalid. + */ + unwrap(body, options) { + const headers = options?.headers; + if (headers == null) + throw new Error("Webhook headers are required in order to verify the signature"); + const keyStr = options.key === void 0 ? this._client.webhookKey : options.key; + if (!keyStr) + throw new Error("Webhook key must not be null or empty in order to unwrap"); + const wh = new import_standardwebhooks.Webhook(keyStr); + wh.verify(body, headers); + return JSON.parse(body); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs +var Versions; +var init_versions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Versions = class extends APIResource { + /** + * List Agent Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsAgent of client.beta.agents.versions.list( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * )) { + * // ... + * } + * ``` + */ + list(agentID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/agents/${agentID}/versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs +var Agents; +var init_agents = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs"() { + init_resource(); + init_versions(); + init_versions(); + init_pagination(); + init_headers(); + init_path(); + Agents = /* @__PURE__ */ (() => { + class Agents3 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions(this._client); + } + /** + * Create Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.create({ + * model: 'claude-opus-5', + * name: 'My First Agent', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/agents?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.retrieve( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * ); + * ``` + */ + retrieve(agentID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.get(path2`/v1/agents/${agentID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.update( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * { description: 'updated' }, + * ); + * ``` + */ + update(agentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/agents/${agentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Agents + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsAgent of client.beta.agents.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/agents?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.archive( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * ); + * ``` + */ + archive(agentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/agents/${agentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Agents3.Versions = Versions; + return Agents3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs +function linkAbort(external, controller) { + if (!external) + return () => { + }; + if (external.aborted) { + controller.abort(); + return () => { + }; + } + const onAbort = () => controller.abort(); + external.addEventListener("abort", onAbort); + return () => external.removeEventListener("abort", onAbort); +} +var init_abort2 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs +function isStatus(e, code) { + return e instanceof APIError && e.status === code; +} +function is4xx(e) { + return e instanceof APIError && typeof e.status === "number" && e.status >= 400 && e.status < 500; +} +function isFatal4xx(e) { + return is4xx(e) && !isStatus(e, 408) && !isStatus(e, 409) && !isStatus(e, 429); +} +function backoff(attempt, baseMs, capMs) { + return Math.min(baseMs * 2 ** attempt, capMs); +} +function jitter(lowMs, highMs) { + return lowMs + Math.random() * (highMs - lowMs); +} +function applyJitter(ms) { + return ms * (1 - Math.random() * 0.25); +} +var init_backoff = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/helper-client.mjs +function copyClientForHelper(client, { authToken, helper }) { + if (!authToken) { + throw new AnthropicError(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(authToken)}`); + } + const internal = client; + const parentDefaults = internal._options.defaultHeaders; + const parentAuthExtraHeaders = internal._authState?.extraHeaders; + const inheritedAuthExtraHeaders = parentAuthExtraHeaders ? Object.fromEntries(Object.entries(parentAuthExtraHeaders).filter(([name]) => { + const lower = name.toLowerCase(); + return lower !== "authorization" && lower !== "x-api-key"; + })) : void 0; + const defaultHeaders = buildHeaders([ + inheritedAuthExtraHeaders, + parentDefaults, + { [STAINLESS_HELPER_HEADER]: helper } + ]); + return client.withOptions({ + apiKey: null, + authToken, + baseURL: client.baseURL, + credentials: void 0, + defaultHeaders + }); +} +var init_helper_client = __esm({ + "node_modules/@anthropic-ai/sdk/lib/helper-client.mjs"() { + init_error(); + init_headers(); + init_stainless_helper_header(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +function backoff2(attempt) { + return backoff(attempt, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS); +} +function defaultWorkerId() { + const env = globalThis.process?.env; + const host = env?.["HOSTNAME"]; + return host ? `${host}-${uuid4()}` : uuid4(); +} +var _WorkPoller_runnerClient, _WorkPoller_consumed, _WorkPoller_controller, _WorkPoller_detachExternal, _WorkPoller_autoStop, _WorkPoller_drain, _WorkPoller_blockMs, _WorkPoller_reclaimOlderThanMs, _WorkPoller_requestOpts, _IdleLog_log, _IdleLog_environmentId, _IdleLog_idleSince, _IdleLog_lastReport, POLL_BLOCK_MS, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS, IDLE_REPORT_INTERVAL_MS, WorkPoller, IdleLog; +var init_poller = __esm({ + "node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_sleep(); + init_uuid(); + init_abort2(); + init_headers(); + init_backoff(); + init_helper_client(); + POLL_BLOCK_MS = 999; + POLL_BACKOFF_BASE_MS = 1e3; + POLL_BACKOFF_CAP_MS = 6e4; + IDLE_REPORT_INTERVAL_MS = 3e5; + WorkPoller = /* @__PURE__ */ (() => { + class WorkPoller2 { + constructor(opts) { + _WorkPoller_runnerClient.set(this, void 0); + _WorkPoller_consumed.set(this, false); + _WorkPoller_controller.set(this, void 0); + _WorkPoller_detachExternal.set(this, void 0); + _WorkPoller_autoStop.set(this, void 0); + _WorkPoller_drain.set(this, void 0); + _WorkPoller_blockMs.set(this, void 0); + _WorkPoller_reclaimOlderThanMs.set(this, void 0); + _WorkPoller_requestOpts.set(this, void 0); + this.client = opts.client; + this.environmentId = opts.environmentId; + this.environmentKey = opts.environmentKey; + this.workerId = opts.workerId ?? defaultWorkerId(); + __classPrivateFieldSet(this, _WorkPoller_runnerClient, copyClientForHelper(opts.client, { + authToken: opts.environmentKey, + helper: "environments-work-poller" + }), "f"); + __classPrivateFieldSet(this, _WorkPoller_autoStop, opts.autoStop ?? true, "f"); + __classPrivateFieldSet(this, _WorkPoller_drain, opts.drain ?? false, "f"); + __classPrivateFieldSet(this, _WorkPoller_blockMs, opts.blockMs === void 0 ? POLL_BLOCK_MS : opts.blockMs, "f"); + __classPrivateFieldSet(this, _WorkPoller_reclaimOlderThanMs, opts.reclaimOlderThanMs ?? null, "f"); + __classPrivateFieldSet(this, _WorkPoller_requestOpts, opts.requestOptions, "f"); + __classPrivateFieldSet(this, _WorkPoller_controller, new AbortController(), "f"); + __classPrivateFieldSet(this, _WorkPoller_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet(this, _WorkPoller_controller, "f")), "f"); + } + /** Read-only view of this iterator's abort signal. */ + get signal() { + return __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal; + } + /** Abort the iterator. The current `for await` will exit cleanly. */ + abort() { + __classPrivateFieldGet(this, _WorkPoller_controller, "f").abort(); + } + async *[(_WorkPoller_runnerClient = /* @__PURE__ */ new WeakMap(), _WorkPoller_consumed = /* @__PURE__ */ new WeakMap(), _WorkPoller_controller = /* @__PURE__ */ new WeakMap(), _WorkPoller_detachExternal = /* @__PURE__ */ new WeakMap(), _WorkPoller_autoStop = /* @__PURE__ */ new WeakMap(), _WorkPoller_drain = /* @__PURE__ */ new WeakMap(), _WorkPoller_blockMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_reclaimOlderThanMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_requestOpts = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + if (__classPrivateFieldGet(this, _WorkPoller_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed WorkPoller"); + } + __classPrivateFieldSet(this, _WorkPoller_consumed, true, "f"); + const log = loggerFor(this.client); + log.info("poller starting", { + component: "work-poller", + environment_id: this.environmentId + }); + const idle = new IdleLog(log, this.environmentId); + try { + let attempt = 0; + while (!__classPrivateFieldGet(this, _WorkPoller_controller, "f").signal.aborted) { + let work; + try { + work = await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.poll(this.environmentId, { + "Anthropic-Worker-ID": this.workerId, + ...__classPrivateFieldGet(this, _WorkPoller_blockMs, "f") !== null ? { block_ms: __classPrivateFieldGet(this, _WorkPoller_blockMs, "f") } : {}, + ...__classPrivateFieldGet(this, _WorkPoller_reclaimOlderThanMs, "f") !== null ? { reclaim_older_than_ms: __classPrivateFieldGet(this, _WorkPoller_reclaimOlderThanMs, "f") } : {} + }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal }); + } catch (e) { + if (__classPrivateFieldGet(this, _WorkPoller_controller, "f").signal.aborted) + return; + if (isFatal4xx(e)) { + log.error("poll failed permanently, stopping poller", { error: String(e) }); + throw e; + } + const wait = applyJitter(backoff2(attempt)); + log.warn("poll failed, backing off", { error: String(e), backoff_ms: wait }); + attempt++; + await sleep(wait, __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal); + continue; + } + attempt = 0; + if (work == null) { + if (__classPrivateFieldGet(this, _WorkPoller_drain, "f")) + return; + idle.onEmptyPoll(); + await sleep(jitter(1e3, 3e3), __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal); + continue; + } + idle.onClaim(); + log.info("claimed work", { + component: "work-poller", + environment_id: this.environmentId, + work_id: work.id, + work_type: work.data.type + }); + try { + await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.ack(work.id, { environment_id: work.environment_id }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal }); + } catch (e) { + log.error("ack failed", { work_id: work.id, error: String(e) }); + continue; + } + try { + yield work; + } finally { + if (__classPrivateFieldGet(this, _WorkPoller_autoStop, "f")) { + try { + await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.stop(work.id, { environment_id: work.environment_id }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]) }); + } catch (e) { + if (!isStatus(e, 409)) + log.warn("stop failed", { work_id: work.id, error: String(e) }); + } + } + } + } + } finally { + __classPrivateFieldGet(this, _WorkPoller_detachExternal, "f").call(this); + } + } + } + return WorkPoller2; + })(); + IdleLog = /* @__PURE__ */ (() => { + class IdleLog2 { + constructor(log, environmentId) { + _IdleLog_log.set(this, void 0); + _IdleLog_environmentId.set(this, void 0); + _IdleLog_idleSince.set(this, void 0); + _IdleLog_lastReport.set(this, 0); + __classPrivateFieldSet(this, _IdleLog_log, log, "f"); + __classPrivateFieldSet(this, _IdleLog_environmentId, environmentId, "f"); + } + onEmptyPoll() { + const now = Date.now(); + const fields = { component: "work-poller", environment_id: __classPrivateFieldGet(this, _IdleLog_environmentId, "f") }; + if (__classPrivateFieldGet(this, _IdleLog_idleSince, "f") === void 0) { + __classPrivateFieldSet(this, _IdleLog_idleSince, __classPrivateFieldSet(this, _IdleLog_lastReport, now, "f"), "f"); + __classPrivateFieldGet(this, _IdleLog_log, "f").info("idle; polling for work", fields); + } else if (now - __classPrivateFieldGet(this, _IdleLog_lastReport, "f") >= IDLE_REPORT_INTERVAL_MS) { + __classPrivateFieldSet(this, _IdleLog_lastReport, now, "f"); + __classPrivateFieldGet(this, _IdleLog_log, "f").info(`still polling; idle for ${Math.round((now - __classPrivateFieldGet(this, _IdleLog_idleSince, "f")) / 1e3)}s`, fields); + } else { + __classPrivateFieldGet(this, _IdleLog_log, "f").debug("poll returned no work", fields); + } + } + onClaim() { + __classPrivateFieldSet(this, _IdleLog_idleSince, void 0, "f"); + } + } + _IdleLog_log = /* @__PURE__ */ new WeakMap(), _IdleLog_environmentId = /* @__PURE__ */ new WeakMap(), _IdleLog_idleSince = /* @__PURE__ */ new WeakMap(), _IdleLog_lastReport = /* @__PURE__ */ new WeakMap(); + return IdleLog2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +var _AsyncQueue_items, _AsyncQueue_waiters, _AsyncQueue_closed, AsyncQueue; +var init_async_queue = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs"() { + init_tslib(); + AsyncQueue = /* @__PURE__ */ (() => { + class AsyncQueue2 { + constructor() { + _AsyncQueue_items.set(this, []); + _AsyncQueue_waiters.set(this, []); + _AsyncQueue_closed.set(this, false); + } + /** Enqueue an item, or hand it directly to a waiting reader. Returns `false` once closed. */ + push(item) { + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f")) + return false; + const w = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").shift(); + if (w) + w({ done: false, value: item }); + else + __classPrivateFieldGet(this, _AsyncQueue_items, "f").push(item); + return true; + } + /** Mark the queue done. Idempotent; wakes every pending reader with `done: true`. */ + close() { + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f")) + return; + __classPrivateFieldSet(this, _AsyncQueue_closed, true, "f"); + while (__classPrivateFieldGet(this, _AsyncQueue_waiters, "f").length > 0) { + const w = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").shift(); + w({ done: true, value: void 0 }); + } + } + /** + * Resolve with the next item, or `done: true` once the queue is closed and + * drained. When `signal` is supplied, aborting it resolves a pending read + * with `done: true` (cancellation is pushed down here rather than handled by + * an outer `Promise.race`). + */ + next(signal) { + if (__classPrivateFieldGet(this, _AsyncQueue_items, "f").length > 0) { + return Promise.resolve({ done: false, value: __classPrivateFieldGet(this, _AsyncQueue_items, "f").shift() }); + } + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f") || signal?.aborted) { + return Promise.resolve({ done: true, value: void 0 }); + } + return new Promise((resolve2) => { + const waiter = (r) => { + signal?.removeEventListener("abort", onAbort); + resolve2(r); + }; + const onAbort = () => { + const idx = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").indexOf(waiter); + if (idx >= 0) + __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").splice(idx, 1); + resolve2({ done: true, value: void 0 }); + }; + __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").push(waiter); + signal?.addEventListener("abort", onAbort, { once: true }); + }); + } + /** Synchronously remove and return the next buffered item, or `undefined` if empty. */ + tryShift() { + return __classPrivateFieldGet(this, _AsyncQueue_items, "f").shift(); + } + } + _AsyncQueue_items = /* @__PURE__ */ new WeakMap(), _AsyncQueue_waiters = /* @__PURE__ */ new WeakMap(), _AsyncQueue_closed = /* @__PURE__ */ new WeakMap(); + return AsyncQueue2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs +var ToolError; +var init_ToolError = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs"() { + ToolError = /* @__PURE__ */ (() => { + class ToolError2 extends Error { + constructor(content) { + const message = typeof content === "string" ? content : content.map((block) => { + if (block.type === "text") + return block.text; + return `[${block.type}]`; + }).join(" "); + super(message); + this.name = "ToolError"; + this.content = content; + } + } + return ToolError2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs +function toolName(tool) { + return "name" in tool ? tool.name : "mcp_server_name" in tool ? tool.mcp_server_name : tool.type; +} +function toolErrorContent(e) { + return e instanceof ToolError ? e.content : `Error: ${e instanceof Error ? e.message : String(e)}`; +} +async function runRunnableTool(tool, rawInput, context) { + try { + const input = tool.parse ? tool.parse(rawInput) : rawInput; + const content = await tool.run(input, context); + return { content, isError: false }; + } catch (e) { + return { content: toolErrorContent(e), isError: true }; + } +} +var init_BetaRunnableTool = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs"() { + init_ToolError(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +function isEndTurnIdle(ev) { + return ev.type === "session.status_idle" && ev.stop_reason?.type === "end_turn"; +} +function buildResultEvent(ev, isError, content) { + if (ev.type === "agent.custom_tool_use") { + return { type: "user.custom_tool_result", custom_tool_use_id: ev.id, is_error: isError, content }; + } + return { type: "user.tool_result", tool_use_id: ev.id, is_error: isError, content }; +} +function toSessionContent(content) { + if (typeof content === "string") + return [{ type: "text", text: content || "(no output)" }]; + const out = content.map((b) => { + if (b.type === "text") + return { type: "text", text: b.text || "(no output)" }; + if (b.type === "image" || b.type === "document") + return b; + if (b.type === "search_result") { + return { + type: "search_result", + source: b.source, + title: b.title, + content: b.content.map((c) => ({ type: "text", text: c.text })), + citations: { enabled: b.citations?.enabled ?? false } + }; + } + return { type: "text", text: JSON.stringify(b) }; + }); + return out.length > 0 ? out : [{ type: "text", text: "(no output)" }]; +} +var _IdleClock_maxIdleMs, _IdleClock_onExpire, _IdleClock_blockers, _IdleClock_armPending, _IdleClock_timer, _SessionToolRunner_instances, _SessionToolRunner_consumed, _SessionToolRunner_controller, _SessionToolRunner_detachExternal, _SessionToolRunner_requestOpts, _SessionToolRunner_toolByName, _SessionToolRunner_logger, _SessionToolRunner_seen, _SessionToolRunner_answered, _SessionToolRunner_confirmationVerdicts, _SessionToolRunner_awaitingConfirmation, _SessionToolRunner_results, _SessionToolRunner_inFlightCount, _SessionToolRunner_sendRetryWindowMs, _SessionToolRunner_onIdle, _SessionToolRunner_idleClock, _SessionToolRunner_requestOptions, _SessionToolRunner_streamLoop, _SessionToolRunner_reconcile, _SessionToolRunner_ingestHistory, _SessionToolRunner_handleStreamEvent, _SessionToolRunner_routeToolEvent, _SessionToolRunner_noteConfirmation, _SessionToolRunner_applyVerdict, _SessionToolRunner_surfaceCall, _SessionToolRunner_execute, _SessionToolRunner_sendResult, _SessionToolRunner_drain, STREAM_BACKOFF_START_MS, STREAM_BACKOFF_CAP_MS, TOOL_TIMEOUT_MS, DRAIN_TIMEOUT_MS, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS, SEND_RETRY_WINDOW_MS, DEFAULT_MAX_IDLE_MS, IdleClock, SessionToolRunner; +var init_SessionToolRunner = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_sleep(); + init_backoff(); + init_abort2(); + init_async_queue(); + init_headers(); + init_stainless_helper_header(); + init_BetaRunnableTool(); + STREAM_BACKOFF_START_MS = 500; + STREAM_BACKOFF_CAP_MS = 1e4; + TOOL_TIMEOUT_MS = 12e4; + DRAIN_TIMEOUT_MS = 3e4; + SEND_BACKOFF_START_MS = 1e3; + SEND_BACKOFF_CAP_MS = 3e4; + SEND_RETRY_WINDOW_MS = 5 * 6e4; + DEFAULT_MAX_IDLE_MS = 6e4; + IdleClock = /* @__PURE__ */ (() => { + class IdleClock2 { + constructor(maxIdleMs, onExpire) { + _IdleClock_maxIdleMs.set(this, void 0); + _IdleClock_onExpire.set(this, void 0); + _IdleClock_blockers.set(this, /* @__PURE__ */ new Set()); + _IdleClock_armPending.set(this, false); + _IdleClock_timer.set(this, void 0); + __classPrivateFieldSet(this, _IdleClock_maxIdleMs, maxIdleMs, "f"); + __classPrivateFieldSet(this, _IdleClock_onExpire, onExpire, "f"); + } + /** + * Arm on `status_idle{end_turn}`; disarm otherwise. `user.tool_confirmation` + * is neutral: it signals neither agent activity nor an idle, and its effect + * on the clock flows through {@link block} / {@link unblock} instead — + * disarming here would discard the pending arm the verdict is about to + * settle. + */ + noteEvent(ev) { + if (ev.type === "user.tool_confirmation") + return; + if (isEndTurnIdle(ev)) + this.arm(); + else + this.disarm(); + } + /** Register gated work that must resolve before an idle countdown starts. */ + block(toolUseId) { + __classPrivateFieldGet(this, _IdleClock_blockers, "f").add(toolUseId); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) { + __classPrivateFieldSet(this, _IdleClock_armPending, true, "f"); + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, void 0, "f"); + } + } + /** + * Retire gated work (a no-op for ids never blocked); applies a pending arm — + * with a fresh full `maxIdleMs` window — once the last blocker retires. + */ + unblock(toolUseId) { + __classPrivateFieldGet(this, _IdleClock_blockers, "f").delete(toolUseId); + if (__classPrivateFieldGet(this, _IdleClock_blockers, "f").size === 0 && __classPrivateFieldGet(this, _IdleClock_armPending, "f")) + this.arm(); + } + /** + * (Re)start the idle countdown — or, while blockers are outstanding, hold + * the arm pending instead. Stopping then would drop a held call when its + * verdict later arrives, or cut the runner off before a released call's + * result can drive the next turn. + */ + arm() { + if (__classPrivateFieldGet(this, _IdleClock_maxIdleMs, "f") <= 0) + return; + if (__classPrivateFieldGet(this, _IdleClock_blockers, "f").size > 0) { + __classPrivateFieldSet(this, _IdleClock_armPending, true, "f"); + return; + } + __classPrivateFieldSet(this, _IdleClock_armPending, false, "f"); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, setTimeout(__classPrivateFieldGet(this, _IdleClock_onExpire, "f"), __classPrivateFieldGet(this, _IdleClock_maxIdleMs, "f")), "f"); + } + /** + * Cancel the idle countdown and any pending arm. Blockers persist — they + * track real outstanding work, retired only by {@link unblock}. + */ + disarm() { + __classPrivateFieldSet(this, _IdleClock_armPending, false, "f"); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) { + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, void 0, "f"); + } + } + } + _IdleClock_maxIdleMs = /* @__PURE__ */ new WeakMap(), _IdleClock_onExpire = /* @__PURE__ */ new WeakMap(), _IdleClock_blockers = /* @__PURE__ */ new WeakMap(), _IdleClock_armPending = /* @__PURE__ */ new WeakMap(), _IdleClock_timer = /* @__PURE__ */ new WeakMap(); + return IdleClock2; + })(); + SessionToolRunner = /* @__PURE__ */ (() => { + class SessionToolRunner2 { + constructor(sessionId, opts) { + _SessionToolRunner_instances.add(this); + _SessionToolRunner_consumed.set(this, false); + _SessionToolRunner_controller.set(this, void 0); + _SessionToolRunner_detachExternal.set(this, void 0); + _SessionToolRunner_requestOpts.set(this, void 0); + _SessionToolRunner_toolByName.set(this, void 0); + _SessionToolRunner_logger.set(this, void 0); + _SessionToolRunner_seen.set(this, /* @__PURE__ */ new Set()); + _SessionToolRunner_answered.set(this, /* @__PURE__ */ new Set()); + _SessionToolRunner_confirmationVerdicts.set(this, /* @__PURE__ */ new Map()); + _SessionToolRunner_awaitingConfirmation.set(this, /* @__PURE__ */ new Map()); + _SessionToolRunner_results.set(this, new AsyncQueue()); + _SessionToolRunner_inFlightCount.set(this, 0); + _SessionToolRunner_sendRetryWindowMs.set(this, SEND_RETRY_WINDOW_MS); + _SessionToolRunner_onIdle.set(this, null); + _SessionToolRunner_idleClock.set(this, void 0); + this.client = opts.client; + this.sessionId = sessionId; + this.tools = opts.tools; + this.maxIdleMs = opts.maxIdleMs ?? DEFAULT_MAX_IDLE_MS; + __classPrivateFieldSet(this, _SessionToolRunner_logger, loggerFor(opts.client), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_toolByName, new Map(opts.tools.map((t) => [toolName(t), t])), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_controller, new AbortController(), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet(this, _SessionToolRunner_controller, "f")), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_requestOpts, opts.requestOptions, "f"); + __classPrivateFieldSet(this, _SessionToolRunner_idleClock, new IdleClock(this.maxIdleMs, () => { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session idle after end_turn; stopping", { + component: "session-tool-runner", + session_id: this.sessionId, + max_idle_ms: this.maxIdleMs + }); + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + }), "f"); + } + /** Read-only view of this runner's abort signal. */ + get signal() { + return __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal; + } + /** Abort the runner. Background tasks will wind down and `for await` will exit cleanly. */ + abort() { + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + } + /** + * @internal + * `EnvironmentWorker` keeps this equal to the lease TTL each heartbeat + * reports; applies to a send already retrying. + */ + _setSendRetryWindow(ms) { + __classPrivateFieldSet(this, _SessionToolRunner_sendRetryWindowMs, ms, "f"); + } + async *[(_SessionToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_controller = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_detachExternal = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_requestOpts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_toolByName = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_logger = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_seen = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_answered = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_confirmationVerdicts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_awaitingConfirmation = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_results = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_inFlightCount = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_sendRetryWindowMs = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_onIdle = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_idleClock = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + if (__classPrivateFieldGet(this, _SessionToolRunner_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed SessionToolRunner"); + } + __classPrivateFieldSet(this, _SessionToolRunner_consumed, true, "f"); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session tool runner starting", { + component: "session-tool-runner", + session_id: this.sessionId + }); + const streamPromise = __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_streamLoop).call(this).catch((e) => { + if (!__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal.aborted) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("stream loop failed", { error: String(e) }); + } + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + }); + try { + while (true) { + const next = await __classPrivateFieldGet(this, _SessionToolRunner_results, "f").next(__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal); + if (next.done) + break; + yield next.value; + } + await streamPromise; + let pending; + while ((pending = __classPrivateFieldGet(this, _SessionToolRunner_results, "f").tryShift()) !== void 0) { + yield pending; + } + } finally { + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + await streamPromise; + try { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_drain).call(this); + } catch (e) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("drain failed", { error: String(e) }); + } + __classPrivateFieldGet(this, _SessionToolRunner_results, "f").close(); + for (const t of this.tools) { + try { + await t.close?.(); + } catch (e) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("tool.close failed", { tool: toolName(t), error: String(e) }); + } + } + __classPrivateFieldGet(this, _SessionToolRunner_detachExternal, "f").call(this); + } + } + } + _SessionToolRunner_requestOptions = function _SessionToolRunner_requestOptions2() { + return { + ...__classPrivateFieldGet(this, _SessionToolRunner_requestOpts, "f"), + headers: buildHeaders([helperHeader("session-tool-runner"), __classPrivateFieldGet(this, _SessionToolRunner_requestOpts, "f")?.headers]), + signal: __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal + }; + }, _SessionToolRunner_streamLoop = // ===== event stream ===== + async function _SessionToolRunner_streamLoop2() { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + let backoff3 = STREAM_BACKOFF_START_MS; + while (!ctrl.signal.aborted) { + try { + const stream5 = await this.client.beta.sessions.events.stream(this.sessionId, {}, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_reconcile).call(this); + for await (const ev of stream5) { + backoff3 = STREAM_BACKOFF_START_MS; + if (await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_handleStreamEvent).call(this, ev)) + return; + } + } catch (e) { + ctrl.signal.throwIfAborted(); + if (isFatal4xx(e)) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("permanent stream failure, shutting down", { error: String(e) }); + ctrl.abort(); + throw e; + } + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("stream disconnected, reconnecting", { + error: String(e), + backoff_ms: backoff3 + }); + } + ctrl.signal.throwIfAborted(); + await sleep(backoff3, ctrl.signal); + backoff3 = Math.min(backoff3 * 2, STREAM_BACKOFF_CAP_MS); + } + }, _SessionToolRunner_reconcile = /** + * Read full history before dispatching so a `tool_use` whose result appears + * later in the same history is not re-executed. Runs after the live stream is + * already attached (see {@link SessionToolRunner.#streamLoop}). + */ + async function _SessionToolRunner_reconcile2() { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + const pending = []; + let lastWasEndTurn = false; + try { + for await (const ev of this.client.beta.sessions.events.list(this.sessionId, { limit: 1e3 }, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this))) { + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_ingestHistory).call(this, ev, pending); + lastWasEndTurn = isEndTurnIdle(ev); + } + } catch (e) { + ctrl.signal.throwIfAborted(); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("reconcile list failed", { error: String(e) }); + for (const ev of pending) + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").delete(ev.id); + return; + } + const unanswered = pending.filter((ev) => !__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + for (const ev of unanswered) + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); + for (const held2 of [...__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").values()]) { + const verdict = __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").get(held2.id); + if (verdict !== void 0) + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held2, verdict); + } + const outstanding = unanswered.filter((ev) => !__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id) && !__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)); + if (lastWasEndTurn && outstanding.length === 0) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").arm(); + else + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + }, _SessionToolRunner_ingestHistory = function _SessionToolRunner_ingestHistory2(ev, pending) { + if (ev.type === "agent.tool_use" || ev.type === "agent.custom_tool_use") { + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").add(ev.id); + if (!__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)) + pending.push(ev); + } else if (ev.type === "user.tool_result") { + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); + } else if (ev.type === "user.custom_tool_result") { + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); + } else if (ev.type === "user.tool_confirmation") { + if (!__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.tool_use_id)) + __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); + } + }, _SessionToolRunner_handleStreamEvent = /** Returns true when the runner should exit. */ + async function _SessionToolRunner_handleStreamEvent2(ev) { + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").noteEvent(ev); + switch (ev.type) { + case "agent.tool_use": + case "agent.custom_tool_use": + if (!__classPrivateFieldGet(this, _SessionToolRunner_seen, "f").has(ev.id)) { + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").add(ev.id); + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); + } + return false; + case "user.tool_confirmation": + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_noteConfirmation).call(this, ev); + return false; + case "user.tool_result": + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); + return false; + case "user.custom_tool_result": + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); + return false; + case "session.status_terminated": + case "session.deleted": + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session terminated", { + component: "session-tool-runner", + session_id: this.sessionId + }); + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + return true; + default: + return false; + } + }, _SessionToolRunner_routeToolEvent = // ===== confirmation gating (always_ask tools) ===== + /** + * Dispatch `ev`, honoring its evaluated permission. A call the server gated + * (`evaluated_permission == "ask"`) is held until its `user.tool_confirmation` + * arrives. Fails closed: only an explicit `allow` verdict releases a gated + * call; a server-side `deny` overrides any recorded verdict; an unrecognized + * permission is held like `ask` and an unrecognized verdict is denied. + */ + async function _SessionToolRunner_routeToolEvent2(ev) { + const permission = ev.evaluated_permission; + const verdict = permission === "deny" ? "deny" : __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").get(ev.id); + if (verdict === void 0) { + if (permission === void 0 || permission === "allow") { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, void 0); + } else if (!__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call awaiting confirmation; holding", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").set(ev.id, ev); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").block(ev.id); + } + return; + } + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, ev, verdict); + }, _SessionToolRunner_noteConfirmation = /** Record an allow/deny verdict and release the held call it gates, if any. */ + async function _SessionToolRunner_noteConfirmation2(ev) { + __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); + const held2 = __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").get(ev.tool_use_id); + if (held2 === void 0) + return; + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held2, ev.result); + }, _SessionToolRunner_applyVerdict = /** + * Dispatch or resolve a gated call according to its verdict. + * + * The idle-clock blocker accounting lives here: a denial retires the held + * call's blocker, while an allow keeps one on the call — taking it now if the + * verdict was already known when the call was routed, so it was never held — + * until `#execute` has finished with it. The countdown must not run over + * gated work that is still in flight. + */ + async function _SessionToolRunner_applyVerdict2(ev, verdict) { + const wasHeld = __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").delete(ev.id); + if (verdict === "allow") { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call confirmed", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + if (!wasHeld) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").block(ev.id); + try { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, "allow"); + } finally { + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); + } + return; + } + if (wasHeld) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call denied; not executing", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + toolUseId: ev.id, + name: ev.name, + isError: false, + posted: false, + confirmation: "deny" + }); + }, _SessionToolRunner_surfaceCall = function _SessionToolRunner_surfaceCall2(call) { + __classPrivateFieldGet(this, _SessionToolRunner_results, "f").push(call); + }, _SessionToolRunner_execute = // ===== tool execution ===== + async function _SessionToolRunner_execute2(ev, confirmation) { + var _a6, _b; + if (__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)) + return; + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("executing tool", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldSet(this, _SessionToolRunner_inFlightCount, (_a6 = __classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f"), _a6++, _a6), "f"); + try { + const tool = __classPrivateFieldGet(this, _SessionToolRunner_toolByName, "f").get(ev.name); + if (!tool) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + toolUseId: ev.id, + name: ev.name, + isError: false, + posted: false, + confirmation + }); + return; + } + let content; + let isError; + const toolCtrl = new AbortController(); + const detachTool = linkAbort(__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal, toolCtrl); + const timer = setTimeout(() => toolCtrl.abort(), TOOL_TIMEOUT_MS); + try { + const outcome = await runRunnableTool(tool, ev.input, { + toolUse: ev, + toolUseBlock: ev, + signal: toolCtrl.signal + }); + content = outcome.content; + isError = outcome.isError; + } finally { + clearTimeout(timer); + detachTool(); + } + const result = buildResultEvent(ev, isError, toSessionContent(content)); + const posted = await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_sendResult).call(this, result, ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + result, + toolUseId: ev.id, + name: ev.name, + isError, + posted, + confirmation + }); + } finally { + __classPrivateFieldSet(this, _SessionToolRunner_inFlightCount, (_b = __classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f"), _b--, _b), "f"); + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") === 0) + __classPrivateFieldGet(this, _SessionToolRunner_onIdle, "f")?.call(this); + } + }, _SessionToolRunner_sendResult = async function _SessionToolRunner_sendResult2(result, toolUseId) { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + const start = Date.now(); + let lastErr; + let attempt = 0; + while (true) { + attempt++; + ctrl.signal.throwIfAborted(); + try { + await this.client.beta.sessions.events.send(this.sessionId, { events: [result] }, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(toolUseId); + return true; + } catch (e) { + lastErr = e; + if (isFatal4xx(e)) + break; + const remainingMs = __classPrivateFieldGet(this, _SessionToolRunner_sendRetryWindowMs, "f") - (Date.now() - start); + if (remainingMs <= 0) + break; + const waitMs = Math.min(applyJitter(backoff(attempt - 1, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS)), remainingMs); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("tool result send failed; retrying", { + tool_use_id: toolUseId, + attempt, + backoff_ms: waitMs, + error: String(e) + }); + await sleep(waitMs, ctrl.signal); + } + } + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("failed to send tool result", { + tool_use_id: toolUseId, + attempts: attempt, + error: String(lastErr) + }); + return false; + }, _SessionToolRunner_drain = /** Wait (bounded) for in-flight tool executions to finish during teardown. */ + async function _SessionToolRunner_drain2() { + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") === 0) + return; + await Promise.race([new Promise((r) => __classPrivateFieldSet(this, _SessionToolRunner_onIdle, r, "f")), sleep(DRAIN_TIMEOUT_MS)]); + __classPrivateFieldSet(this, _SessionToolRunner_onIdle, null, "f"); + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") > 0) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("drain timeout exceeded"); + } + }; + return SessionToolRunner2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs +function checkMemorySyncInterval(ms, option) { + if (!(ms >= MIN_MEMORY_SYNC_INTERVAL_MS)) { + throw new AnthropicError(`${option} must be at least ${MIN_MEMORY_SYNC_INTERVAL_MS}ms (got ${ms}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`); + } +} +var DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS; +var init_sync_interval = __esm({ + "node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs"() { + init_error(); + DEFAULT_MEMORY_SYNC_INTERVAL_MS = 15e3; + MIN_MEMORY_SYNC_INTERVAL_MS = 5e3; + } +}); + +// node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +var node_browser_exports2 = {}; +__export(node_browser_exports2, { + BashSession: () => BashSession, + BashTimeoutError: () => BashTimeoutError, + DEFAULT_MEMORY_SYNC_INTERVAL_MS: () => DEFAULT_MEMORY_SYNC_INTERVAL_MS, + MARKER_PATH: () => MARKER_PATH, + MEMORY_FLUSH_TIMEOUT_MS: () => MEMORY_FLUSH_TIMEOUT_MS, + MIN_MEMORY_SYNC_INTERVAL_MS: () => MIN_MEMORY_SYNC_INTERVAL_MS, + SessionMemoryError: () => SessionMemoryError, + SessionMemoryStores: () => SessionMemoryStores, + betaAgentToolset20260401: () => betaAgentToolset20260401, + betaBashTool: () => betaBashTool, + betaEditTool: () => betaEditTool, + betaGlobTool: () => betaGlobTool, + betaGrepTool: () => betaGrepTool, + betaReadTool: () => betaReadTool, + betaWriteTool: () => betaWriteTool, + extractSkillArchive: () => extractSkillArchive, + resolvePath: () => resolvePath, + setupSkills: () => setupSkills +}); +function nodeOnly(name) { + throw new AnthropicError(`${name} requires Node.js or a Node-compatible runtime`); +} +function setupSkills(_ctx) { + return nodeOnly("setupSkills"); +} +function extractSkillArchive(_resp, _dest) { + return nodeOnly("extractSkillArchive"); +} +function betaAgentToolset20260401(_ctx) { + return nodeOnly("betaAgentToolset20260401"); +} +function resolvePath(_ctx, _p) { + return nodeOnly("resolvePath"); +} +function betaBashTool(_ctx) { + return nodeOnly("betaBashTool"); +} +function betaReadTool(_ctx) { + return nodeOnly("betaReadTool"); +} +function betaWriteTool(_ctx) { + return nodeOnly("betaWriteTool"); +} +function betaEditTool(_ctx) { + return nodeOnly("betaEditTool"); +} +function betaGlobTool(_ctx) { + return nodeOnly("betaGlobTool"); +} +function betaGrepTool(_ctx) { + return nodeOnly("betaGrepTool"); +} +var MEMORY_FLUSH_TIMEOUT_MS, MARKER_PATH, SessionMemoryError, SessionMemoryStores, BashTimeoutError, BashSession; +var init_node_browser2 = __esm({ + "node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs"() { + init_error(); + init_sync_interval(); + MEMORY_FLUSH_TIMEOUT_MS = 3e4; + MARKER_PATH = ".anthropic-memory-store"; + SessionMemoryError = class extends AnthropicError { + constructor(message, cause) { + super(message); + this.name = "SessionMemoryError"; + if (cause !== void 0) + this.cause = cause; + } + }; + SessionMemoryStores = class { + constructor(_client, _opts) { + nodeOnly("SessionMemoryStores"); + } + get roots() { + return nodeOnly("SessionMemoryStores"); + } + get readOnlyRoots() { + return nodeOnly("SessionMemoryStores"); + } + download(_session) { + return nodeOnly("SessionMemoryStores"); + } + finish() { + return nodeOnly("SessionMemoryStores"); + } + /** @internal */ + syncAll(_final) { + return nodeOnly("SessionMemoryStores"); + } + syncIfDue() { + return nodeOnly("SessionMemoryStores"); + } + flushWrites(_signal) { + return nodeOnly("SessionMemoryStores"); + } + dispose() { + return nodeOnly("SessionMemoryStores"); + } + }; + BashTimeoutError = class extends AnthropicError { + constructor(timeoutMs) { + super(`bash command timed out after ${timeoutMs}ms`); + this.name = "BashTimeoutError"; + this.timeoutMs = timeoutMs; + } + }; + BashSession = class { + constructor(_dir, _env) { + nodeOnly("BashSession"); + } + get closed() { + return nodeOnly("BashSession"); + } + exec(_command, _opts = {}) { + return nodeOnly("BashSession"); + } + close() { + nodeOnly("BashSession"); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +function hasMemoryStore(session) { + return session.resources.some((r) => r.type === "memory_store"); +} +function sessionsTokenFromSecret(secret) { + if (!secret) + return null; + let parsed; + try { + const normalized = secret.replace(/-/g, "+").replace(/_/g, "/"); + const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "="); + parsed = JSON.parse(decodeUTF8(fromBase64(padded))); + } catch { + return null; + } + if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) + return null; + const token = parsed.sessions_token; + return typeof token === "string" && token !== "" ? token : null; +} +async function withTimeout(p, ms) { + let timer; + try { + return await Promise.race([ + p.then(() => false, () => false), + new Promise((resolve2) => { + timer = setTimeout(() => resolve2(true), ms); + }) + ]); + } finally { + if (timer !== void 0) + clearTimeout(timer); + } +} +async function forceStop(client, work, log, requestOptions) { + try { + await client.beta.environments.work.stop( + work.id, + { environment_id: work.environment_id, force: true }, + // Caller's headers pass through; the helper-tag header is on the scoped + // sub-client's default_headers via copyClientForHelper, so no per-call + // re-stamping needed. + { ...requestOptions, headers: buildHeaders([requestOptions?.headers]) } + ); + } catch (e) { + if (!isStatus(e, 409)) { + log.error("force-stop on exit failed", { work_id: work.id, error: String(e) }); + } + } +} +function serverLeaseState(e) { + let node = e instanceof APIError ? e.error : void 0; + for (const key of ["error", "details", "current_state"]) { + if (!isObj(node)) + return {}; + node = node[key]; + } + return isObj(node) ? node : {}; +} +async function heartbeatLoop(client, work, lease, logger, requestOptions, onLeaseTtl) { + let intervalMs = HEARTBEAT_DEFAULT_MS; + let ttlMs = HEARTBEAT_TTL_DEFAULT_MS; + let lastSuccessMs = Date.now(); + let last = NO_HEARTBEAT_SENTINEL; + const beat = async () => { + const beatCtrl = new AbortController(); + const detach = linkAbort(lease.signal, beatCtrl); + const cutoff = setTimeout(() => beatCtrl.abort(), intervalMs); + try { + const resp = await client.beta.environments.work.heartbeat(work.id, { environment_id: work.environment_id, expected_last_heartbeat: last }, { ...requestOptions, headers: buildHeaders([requestOptions?.headers]), signal: beatCtrl.signal }); + lastSuccessMs = Date.now(); + last = resp.last_heartbeat; + if (resp.ttl_seconds > 0) { + ttlMs = resp.ttl_seconds * 1e3; + intervalMs = Math.max(1e3, Math.min(ttlMs / 2, HEARTBEAT_DEFAULT_MS)); + onLeaseTtl?.(ttlMs); + } + if (resp.state === "stopping" || resp.state === "stopped") { + logger.info("heartbeat signals shutdown", { work_id: work.id, state: resp.state }); + lease.finish("control_plane_stop"); + } + if (!resp.lease_extended) { + logger.warn("lease not extended, shutting down", { work_id: work.id }); + lease.finish("control_plane_stop"); + } + } catch (e) { + lease.signal.throwIfAborted(); + if (isStatus(e, 412)) { + const server = serverLeaseState(e); + logger.error("lease lost: heartbeat precondition failed", { + work_id: work.id, + server_state: server["state"], + server_ttl_seconds: server["ttl_seconds"], + server_last_heartbeat: server["last_heartbeat"] + }); + lease.finish("lease_lost"); + return; + } + if (isFatal4xx(e)) { + logger.error("permanent heartbeat failure", { work_id: work.id, error: String(e) }); + lease.finish("heartbeat_rejected"); + throw e; + } + if (Date.now() - lastSuccessMs > ttlMs) { + logger.error("lease assumed lost: no successful heartbeat in ttl", { + work_id: work.id, + ttl_ms: ttlMs, + error: String(e) + }); + lease.finish("assumed_lost"); + return; + } + logger.warn("transient heartbeat failure", { work_id: work.id, error: String(e) }); + } finally { + clearTimeout(cutoff); + detach(); + } + }; + await beat(); + while (!lease.signal.aborted) { + await sleep(intervalMs, lease.signal); + lease.signal.throwIfAborted(); + await beat(); + } +} +var _EnvironmentWorker_instances, _EnvironmentWorker_signal, _EnvironmentWorker_handleItem, _Lease_ctrl, _Lease_endReason, HEARTBEAT_DEFAULT_MS, HEARTBEAT_TTL_DEFAULT_MS, NO_HEARTBEAT_SENTINEL, EnvironmentWorker, Lease; +var init_worker = __esm({ + "node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_base64(); + init_bytes(); + init_env(); + init_sleep(); + init_backoff(); + init_abort2(); + init_values(); + init_headers(); + init_SessionToolRunner(); + init_poller(); + init_helper_client(); + init_sync_interval(); + HEARTBEAT_DEFAULT_MS = 3e4; + HEARTBEAT_TTL_DEFAULT_MS = 9e4; + NO_HEARTBEAT_SENTINEL = "NO_HEARTBEAT"; + EnvironmentWorker = /* @__PURE__ */ (() => { + class EnvironmentWorker2 { + constructor(opts) { + _EnvironmentWorker_instances.add(this); + _EnvironmentWorker_signal.set(this, void 0); + if (opts.unrestrictedPaths !== void 0) { + throw new AnthropicError("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory."); + } + this.client = opts.client; + this.environmentId = opts.environmentId; + this.environmentKey = opts.environmentKey; + this.tools = opts.tools; + this.workdir = opts.workdir ?? process.cwd(); + this.maxFileBytes = opts.maxFileBytes; + this.maxIdleMs = opts.maxIdleMs; + if (opts.memorySyncIntervalMs != null) { + checkMemorySyncInterval(opts.memorySyncIntervalMs, "memorySyncIntervalMs"); + } + this.memorySyncIntervalMs = opts.memorySyncIntervalMs; + this.memorySyncDeletions = opts.memorySyncDeletions ?? "enabled"; + this.workerId = opts.workerId; + this.requestOptions = opts.requestOptions; + __classPrivateFieldSet(this, _EnvironmentWorker_signal, opts.signal, "f"); + } + /** + * Poll the environment and service each claimed session until the supplied + * signal (or the one passed to the constructor) aborts. Throws if + * `environmentId` / `environmentKey` were not provided to the constructor. + */ + async run(signal) { + const { environmentId, environmentKey } = this; + if (environmentId === void 0 || environmentKey === void 0) { + throw new AnthropicError("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work"); + } + const externalSignal = signal ?? __classPrivateFieldGet(this, _EnvironmentWorker_signal, "f"); + const poller = new WorkPoller({ + client: this.client, + environmentId, + environmentKey, + ...this.workerId !== void 0 ? { workerId: this.workerId } : {}, + ...externalSignal ? { signal: externalSignal } : {}, + ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, + // The per-item handler stops or releases every work item on exit; let it + // be the single owner of `work.stop` rather than double-posting from the + // poller. + autoStop: false + }); + for await (const work of poller) { + try { + await __classPrivateFieldGet(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, poller.signal); + } catch (e) { + if (poller.signal?.aborted) + throw e; + loggerFor(this.client).error("work item failed", { work_id: work.id, error: String(e) }); + } + } + } + /** + * Service a single, already-claimed work item without the poll loop: build the + * per-session {@link AgentToolContext} (workdir from this worker's options), + * download the session agent's skills (`setupSkills`), run a + * {@link SessionToolRunner} for the session while heartbeating the work-item + * lease, and force-stop the work item on exit (whether the runner finishes + * normally, throws, or the control plane signals shutdown). The one + * exception is a lost lease: the item then belongs to the queue or another + * worker and is left alone. + * + * Use this when something else does the claiming — e.g. a `worker poll + * --on-work` script that hands an already-claimed item to a fresh process. The + * work id / environment id / session id each fall back to `ANTHROPIC_WORK_ID` / + * `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that + * command sets) when not passed; the environment key resolves from this + * option, then the worker's own `environmentKey`, then + * `ANTHROPIC_ENVIRONMENT_KEY`, and is needed only when the work item's + * `secret` yields no sessions token — a host that receives only the + * per-item secret runs without ever holding the key. With no arguments + * inside that command it just works. Throws a clear error naming the first + * required value still missing after resolution, and — rather than ever + * running unauthenticated — when neither a sessions token nor an + * environment key resolved. Throws `SessionMemoryError` when the + * session has memory stores attached but they cannot be mounted — the work + * item carried no sessions token (unless `memorySyncIntervalMs` turned + * memory off), or a store failed to download. + * + * `workSecret` is the work item's per-item `secret` payload from the poll + * response, falling back to `ANTHROPIC_WORK_SECRET`; unlike the others it is + * optional — when present, the sessions token extracted from it is preferred + * as the Bearer credential for this item's heartbeat / force-stop / session + * calls; when absent (or undecodable) those calls use the environment key. + */ + async handleItem(opts) { + const workId = opts?.workId ?? readEnv("ANTHROPIC_WORK_ID"); + const environmentId = opts?.environmentId ?? readEnv("ANTHROPIC_ENVIRONMENT_ID"); + const sessionId = opts?.sessionId ?? readEnv("ANTHROPIC_SESSION_ID"); + const environmentKey = (opts?.environmentKey ?? this.environmentKey ?? readEnv("ANTHROPIC_ENVIRONMENT_KEY")) || void 0; + const workSecret = opts?.workSecret || readEnv("ANTHROPIC_WORK_SECRET") || null; + if (!workId) { + throw new AnthropicError("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID"); + } + if (!environmentId) { + throw new AnthropicError("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID"); + } + if (!sessionId) { + throw new AnthropicError("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID"); + } + if (!environmentKey && !workSecret) { + throw new AnthropicError("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY"); + } + const work = { + id: workId, + environment_id: environmentId, + secret: workSecret, + data: { type: "session", id: sessionId } + }; + await __classPrivateFieldGet(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, opts?.signal ?? __classPrivateFieldGet(this, _EnvironmentWorker_signal, "f")); + } + } + _EnvironmentWorker_signal = /* @__PURE__ */ new WeakMap(), _EnvironmentWorker_instances = /* @__PURE__ */ new WeakSet(), _EnvironmentWorker_handleItem = /** + * The per-item body shared by {@link EnvironmentWorker.run}'s poll loop and + * {@link EnvironmentWorker.handleItem}: run a {@link SessionToolRunner} for the + * work item's session while heartbeating its lease, force-stopping on exit + * unless the lease was lost. Non-session work items are ignored. + * + * When the poll response carried a per-item `secret` (a short-lived payload + * scoped to this work item), the sessions token extracted from it is + * preferred over `environmentKey` as the Bearer credential for those + * per-item calls; a missing/undecodable secret falls back to + * `environmentKey` unchanged. + */ + async function _EnvironmentWorker_handleItem2(work, environmentKey, externalSignal) { + const log = loggerFor(this.client); + const sessionsToken = sessionsTokenFromSecret(work.secret); + const itemCredential = sessionsToken ?? environmentKey; + if (itemCredential === void 0) { + throw new AnthropicError("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)"); + } + if (work.secret && sessionsToken === null) { + log.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key", { work_id: work.id }); + } + const sessionClient = copyClientForHelper(this.client, { + authToken: itemCredential, + helper: "environments-worker" + }); + const sessionId = work.data.id; + const ctrl = new AbortController(); + const detachExternal = linkAbort(externalSignal, ctrl); + const lease = new Lease(ctrl); + const agentToolset = await Promise.resolve().then(() => (init_node_browser2(), node_browser_exports2)); + let leaseTtlMs; + let runner; + const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => { + leaseTtlMs = ttlMs; + runner?._setSendRetryWindow(ttlMs); + }).catch((e) => { + if (!ctrl.signal.aborted) + log.error("heartbeat loop failed", { work_id: work.id, error: String(e) }); + ctrl.abort(); + }); + let cleanupSkills = async () => { + }; + let stores; + let cleanEnd = false; + try { + if (work.data.type !== "session") { + log.debug("skipping non-session work item", { work_id: work.id, type: work.data.type }); + return; + } + const session = await sessionClient.beta.sessions.retrieve(sessionId); + if (sessionsToken === null && this.memorySyncIntervalMs !== null && hasMemoryStore(session)) { + throw new agentToolset.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${work.id}, session_id=${sessionId}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`); + } + const ctx = { + workdir: this.workdir, + // The scoped sub-client, not the parent: the skill download + // `setupSkills` performs for this session rides the same per-item + // credential as every other per-item call. + client: sessionClient, + session, + ...this.maxFileBytes !== void 0 ? { maxFileBytes: this.maxFileBytes } : {} + }; + try { + cleanupSkills = await agentToolset.setupSkills(ctx); + } catch (e) { + log.warn("skill setup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); + } + if (sessionsToken !== null && this.memorySyncIntervalMs !== null) { + stores = new agentToolset.SessionMemoryStores(sessionClient, { + workdir: this.workdir, + ...this.memorySyncIntervalMs !== void 0 ? { syncIntervalMs: this.memorySyncIntervalMs } : {}, + syncDeletions: this.memorySyncDeletions + }); + await stores.download(session); + ctx.allowedRoots = stores.roots; + ctx.readOnlyRoots = stores.readOnlyRoots; + } else { + log.debug("memory stores disabled for this item", { work_id: work.id }); + } + const tools = typeof this.tools === "function" ? this.tools(ctx) : this.tools ?? agentToolset.betaAgentToolset20260401(ctx); + runner = new SessionToolRunner(sessionId, { + client: sessionClient, + tools, + ...this.maxIdleMs !== void 0 ? { maxIdleMs: this.maxIdleMs } : {}, + ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, + signal: ctrl.signal + }); + if (leaseTtlMs !== void 0) + runner._setSendRetryWindow(leaseTtlMs); + for await (const _ of runner) { + if (stores) + await stores.syncIfDue(); + } + cleanEnd = !ctrl.signal.aborted; + } finally { + try { + await cleanupSkills().catch((e) => { + log.warn("skill cleanup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); + }); + } finally { + if (stores) { + const boundMs = agentToolset.MEMORY_FLUSH_TIMEOUT_MS; + if (cleanEnd) { + const finishCutOff = await withTimeout(stores.finish(), boundMs); + if (finishCutOff) { + log.warn(`final memory sync cut off after ${boundMs}ms; the flush that follows still uploads changed files`, { session_id: sessionId, work_id: work.id }); + } + } + const flushBound = new AbortController(); + const flushCutOff = await withTimeout(stores.flushWrites(flushBound.signal), boundMs); + if (flushCutOff) { + flushBound.abort(); + log.warn(`memory flush cut off after ${boundMs}ms; changed files it had not uploaded yet are not saved`, { session_id: sessionId, work_id: work.id }); + } + await stores.dispose().catch((e) => { + log.warn("memory store cleanup failed", { + session_id: sessionId, + work_id: work.id, + error: String(e) + }); + }); + } + } + lease.finish("runner_done"); + detachExternal(); + await heartbeatPromise; + if (lease.lost) { + log.info("lease lost; released without stopping it", { session_id: sessionId, work_id: work.id }); + } else { + await forceStop(sessionClient, work, log, this.requestOptions); + } + } + }; + return EnvironmentWorker2; + })(); + Lease = /* @__PURE__ */ (() => { + class Lease2 { + constructor(ctrl) { + _Lease_ctrl.set(this, void 0); + _Lease_endReason.set(this, void 0); + __classPrivateFieldSet(this, _Lease_ctrl, ctrl, "f"); + } + get signal() { + return __classPrivateFieldGet(this, _Lease_ctrl, "f").signal; + } + finish(reason) { + __classPrivateFieldSet(this, _Lease_endReason, __classPrivateFieldGet(this, _Lease_endReason, "f") ?? reason, "f"); + __classPrivateFieldGet(this, _Lease_ctrl, "f").abort(); + } + /** True once the item belongs to the queue or another worker. */ + get lost() { + return __classPrivateFieldGet(this, _Lease_endReason, "f") === "lease_lost" || __classPrivateFieldGet(this, _Lease_endReason, "f") === "assumed_lost"; + } + } + _Lease_ctrl = /* @__PURE__ */ new WeakMap(), _Lease_endReason = /* @__PURE__ */ new WeakMap(); + return Lease2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +var Work; +var init_work = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + init_poller(); + init_worker(); + Work = /* @__PURE__ */ (() => { + class Work2 extends APIResource { + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Retrieve detailed information about a specific work item. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.retrieve('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + retrieve(workID, params, options) { + const { environment_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/environments/${environment_id}/work/${workID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Update work item metadata with merge semantics. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.update('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * metadata: { foo: 'string' }, + * }); + * ``` + */ + update(workID, params, options) { + const { environment_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * List work items in an environment. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSelfHostedWork of client.beta.environments.work.list( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * )) { + * // ... + * } + * ``` + */ + list(environmentID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/environments/${environmentID}/work?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' + * and removing it from the queue. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.ack('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + ack(workID, params, options) { + const { environment_id, betas } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/ack?beta=true`, { + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Record a heartbeat for a work item to maintain the lease. + * + * @example + * ```ts + * const betaSelfHostedWorkHeartbeatResponse = + * await client.beta.environments.work.heartbeat('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + heartbeat(workID, params, options) { + const { environment_id, desired_ttl_seconds, expected_last_heartbeat, betas } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/heartbeat?beta=true`, { + query: { desired_ttl_seconds, expected_last_heartbeat }, + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Long poll for work items in the queue. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.poll( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + poll(environmentID, params = {}, options) { + const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}/work/poll?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...anthropicWorkerID != null ? { "Anthropic-Worker-ID": anthropicWorkerID } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get statistics about the work queue for an environment. + * + * @example + * ```ts + * const betaSelfHostedWorkQueueStats = + * await client.beta.environments.work.stats( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + stats(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}/work/stats?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Stop a work item, initiating graceful or forced shutdown. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.stop('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + stop(workID, params, options) { + const { environment_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/stop?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Continuously claim work from a self-hosted environment, ack each item, + * and yield it. Posts `stop` automatically when the consumer's loop body + * returns or when iteration ends. + * + * @example + * ```ts + * for await (const work of client.beta.environments.work.poller({ + * environmentId, + * environmentKey, + * })) { + * if (work.data.type !== 'session') continue; + * // ...service the work... + * } + * ``` + */ + poller(opts) { + return new WorkPoller({ ...opts, client: this._client }); + } + worker(opts) { + return new EnvironmentWorker({ ...opts, client: this._client }); + } + } + Work2.WorkPoller = WorkPoller; + Work2.EnvironmentWorker = EnvironmentWorker; + return Work2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +var Environments; +var init_environments = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs"() { + init_resource(); + init_work(); + init_work(); + init_pagination(); + init_headers(); + init_path(); + Environments = /* @__PURE__ */ (() => { + class Environments3 extends APIResource { + constructor() { + super(...arguments); + this.work = new Work(this._client); + } + /** + * Create a new environment with the specified configuration. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.create({ + * name: 'python-data-analysis', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/environments?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a specific environment by ID. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.retrieve( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + retrieve(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update an existing environment's configuration. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.update( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + update(environmentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environmentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List environments with pagination support. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaEnvironment of client.beta.environments.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/environments?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete an environment by ID. Returns a confirmation of the deletion. + * + * @example + * ```ts + * const betaEnvironmentDeleteResponse = + * await client.beta.environments.delete( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + delete(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/environments/${environmentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive an environment by ID. Archived environments cannot be used to create new + * sessions. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.archive( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + archive(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/environments/${environmentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Environments3.Work = Work; + return Environments3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +var Memories; +var init_memories = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Memories = class extends APIResource { + /** + * Create a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.create( + * 'memory_store_id', + * { content: 'content', path: 'xx' }, + * ); + * ``` + */ + create(memoryStoreID, params, options) { + const { view: view2, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, { + query: { view: view2 }, + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.retrieve( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + retrieve(memoryID, params, options) { + const { memory_store_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.update( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + update(memoryID, params, options) { + const { memory_store_id, view: view2, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query: { view: view2 }, + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memories + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryListItem of client.beta.memoryStores.memories.list( + * 'memory_store_id', + * )) { + * // ... + * } + * ``` + */ + list(memoryStoreID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a memory + * + * @example + * ```ts + * const betaManagedAgentsDeletedMemory = + * await client.beta.memoryStores.memories.delete( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + delete(memoryID, params, options) { + const { memory_store_id, expected_content_sha256, betas, workspace_id } = params; + return this._client.delete(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query: { expected_content_sha256 }, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +var MemoryVersions; +var init_memory_versions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + MemoryVersions = class extends APIResource { + /** + * Retrieve a memory version + * + * @example + * ```ts + * const betaManagedAgentsMemoryVersion = + * await client.beta.memoryStores.memoryVersions.retrieve( + * 'memory_version_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + retrieve(memoryVersionID, params, options) { + const { memory_store_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memory versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryVersion of client.beta.memoryStores.memoryVersions.list( + * 'memory_store_id', + * )) { + * // ... + * } + * ``` + */ + list(memoryStoreID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Redact a memory version + * + * @example + * ```ts + * const betaManagedAgentsMemoryVersion = + * await client.beta.memoryStores.memoryVersions.redact( + * 'memory_version_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + redact(memoryVersionID, params, options) { + const { memory_store_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +var MemoryStores; +var init_memory_stores = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs"() { + init_resource(); + init_memories(); + init_memories(); + init_memory_versions(); + init_memory_versions(); + init_pagination(); + init_headers(); + init_path(); + MemoryStores = /* @__PURE__ */ (() => { + class MemoryStores2 extends APIResource { + constructor() { + super(...arguments); + this.memories = new Memories(this._client); + this.memoryVersions = new MemoryVersions(this._client); + } + /** + * Create a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.create({ name: 'x' }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/memory_stores?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.retrieve( + * 'memory_store_id', + * ); + * ``` + */ + retrieve(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.update('memory_store_id'); + * ``` + */ + update(memoryStoreID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memory stores + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryStore of client.beta.memoryStores.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/memory_stores?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a memory store + * + * @example + * ```ts + * const betaManagedAgentsDeletedMemoryStore = + * await client.beta.memoryStores.delete('memory_store_id'); + * ``` + */ + delete(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.archive('memory_store_id'); + * ``` + */ + archive(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + MemoryStores2.Memories = Memories; + MemoryStores2.MemoryVersions = MemoryVersions; + return MemoryStores2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/error.mjs +var init_error2 = __esm({ + "node_modules/@anthropic-ai/sdk/error.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +var JSONLDecoder; +var init_jsonl = __esm({ + "node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs"() { + init_error(); + init_shims(); + init_line(); + JSONLDecoder = /* @__PURE__ */ (() => { + class JSONLDecoder2 { + constructor(iterator, controller) { + this.iterator = iterator; + this.controller = controller; + } + async *decoder() { + const lineDecoder = new LineDecoder(); + for await (const chunk of this.iterator) { + for (const line of lineDecoder.decode(chunk)) { + yield JSON.parse(line); + } + } + for (const line of lineDecoder.flush()) { + yield JSON.parse(line); + } + } + [Symbol.asyncIterator]() { + return this.decoder(); + } + static fromResponse(response, controller) { + if (!response.body) { + controller.abort(); + if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { + throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); + } + throw new AnthropicError(`Attempted to iterate over a response with no body`); + } + return new JSONLDecoder2(ReadableStreamToAsyncIterable(response.body), controller); + } + } + return JSONLDecoder2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +var Batches; +var init_batches = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_jsonl(); + init_error2(); + init_path(); + Batches = class extends APIResource { + /** + * Send a batch of Message creation requests. + * + * The Message Batches API can be used to process multiple Messages API requests at + * once. Once a Message Batch is created, it begins processing immediately. Batches + * can take up to 24 hours to complete. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.create({ + * requests: [ + * { + * custom_id: 'my-custom-id-1', + * params: { + * max_tokens: 1024, + * messages: [ + * { content: 'Hello, world', role: 'user' }, + * ], + * model: 'claude-opus-5', + * }, + * }, + * ], + * }); + * ``` + */ + create(params, options) { + const { betas, user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/batches?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * This endpoint is idempotent and can be used to poll for Message Batch + * completion. To access the results of a Message Batch, make a request to the + * `results_url` field in the response. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.retrieve( + * 'message_batch_id', + * ); + * ``` + */ + retrieve(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/messages/batches/${messageBatchID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List all Message Batches within a Workspace. Most recently created batches are + * returned first. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaMessageBatch of client.beta.messages.batches.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/messages/batches?beta=true", Page, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a Message Batch. + * + * Message Batches can only be deleted once they've finished processing. If you'd + * like to delete an in-progress batch, you must first cancel it. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaDeletedMessageBatch = + * await client.beta.messages.batches.delete( + * 'message_batch_id', + * ); + * ``` + */ + delete(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/messages/batches/${messageBatchID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Batches may be canceled any time before processing ends. Once cancellation is + * initiated, the batch enters a `canceling` state, at which time the system may + * complete any in-progress, non-interruptible requests before finalizing + * cancellation. + * + * The number of canceled requests is specified in `request_counts`. To determine + * which requests were canceled, check the individual results within the batch. + * Note that cancellation may not result in any canceled requests if they were + * non-interruptible. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.cancel( + * 'message_batch_id', + * ); + * ``` + */ + cancel(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Streams the results of a Message Batch as a `.jsonl` file. + * + * Each line in the file is a JSON object containing the result of a single request + * in the Message Batch. Results are not guaranteed to be in the same order as + * requests. Use the `custom_id` field to match results to requests. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatchIndividualResponse = + * await client.beta.messages.batches.results( + * 'message_batch_id', + * ); + * ``` + */ + async results(messageBatchID, params = {}, options) { + const batch = await this.retrieve(messageBatchID, params, options); + if (!batch.results_url) { + throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); + } + const { betas, workspace_id } = params ?? {}; + return this._client.get(batch.results_url, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true, + __binaryResponse: true + })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/constants.mjs +var MODEL_NONSTREAMING_TOKENS; +var init_constants = __esm({ + "node_modules/@anthropic-ai/sdk/internal/constants.mjs"() { + MODEL_NONSTREAMING_TOKENS = { + "claude-opus-4@20250514": 8192, + "anthropic.claude-opus-4-1-20250805-v1:0": 8192, + "claude-opus-4-1@20250805": 8192 + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs +function getOutputFormat(params) { + return params?.output_format ?? params?.output_config?.format; +} +function maybeParseBetaMessage(message, params, opts) { + const outputFormat = getOutputFormat(params); + if (!params || !("parse" in (outputFormat ?? {}))) { + return { + ...message, + content: message.content.map((block) => { + if (block.type === "text") { + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: null, + enumerable: false + }); + return Object.defineProperty(parsedBlock, "parsed", { + get() { + opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); + return null; + }, + enumerable: false + }); + } + return block; + }), + parsed_output: null + }; + } + return parseBetaMessage(message, params, opts); +} +function parseBetaMessage(message, params, opts) { + let firstParsedOutput = null; + const content = message.content.map((block) => { + if (block.type === "text") { + const parsedOutput = parseBetaOutputFormat(params, block.text); + if (firstParsedOutput === null) { + firstParsedOutput = parsedOutput; + } + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: parsedOutput, + enumerable: false + }); + return Object.defineProperty(parsedBlock, "parsed", { + get() { + opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); + return parsedOutput; + }, + enumerable: false + }); + } + return block; + }); + return { + ...message, + content, + parsed_output: firstParsedOutput + }; +} +function parseBetaOutputFormat(params, content) { + const outputFormat = getOutputFormat(params); + if (outputFormat?.type !== "json_schema") { + return null; + } + try { + if ("parse" in outputFormat) { + return outputFormat.parse(content); + } + return JSON.parse(content); + } catch (error) { + throw new AnthropicError(`Failed to parse structured output: ${error}`); + } +} +var init_beta_parser = __esm({ + "node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/streaming.mjs +var init_streaming2 = __esm({ + "node_modules/@anthropic-ai/sdk/streaming.mjs"() { + init_streaming(); + } +}); + +// node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +var tokenize, strip, unstrip, generate, partialParse; +var init_parser = __esm({ + "node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs"() { + tokenize = (input) => { + let current = 0; + let tokens = []; + while (current < input.length) { + let char = input[current]; + if (char === "\\") { + current++; + continue; + } + if (char === "{") { + tokens.push({ + type: "brace", + value: "{" + }); + current++; + continue; + } + if (char === "}") { + tokens.push({ + type: "brace", + value: "}" + }); + current++; + continue; + } + if (char === "[") { + tokens.push({ + type: "paren", + value: "[" + }); + current++; + continue; + } + if (char === "]") { + tokens.push({ + type: "paren", + value: "]" + }); + current++; + continue; + } + if (char === ":") { + tokens.push({ + type: "separator", + value: ":" + }); + current++; + continue; + } + if (char === ",") { + tokens.push({ + type: "delimiter", + value: "," + }); + current++; + continue; + } + if (char === '"') { + const start = current + 1; + let end = start; + let danglingQuote = false; + while (true) { + end = input.indexOf('"', end); + if (end === -1) { + danglingQuote = true; + break; + } + let backslashes = 0; + let i = end - 1; + while (i >= start && input[i] === "\\") { + backslashes++; + i--; + } + if (backslashes % 2 === 0) + break; + end++; + } + if (danglingQuote) { + current = input.length; + } else { + tokens.push({ + type: "string", + value: input.slice(start, end) + }); + current = end + 1; + } + continue; + } + let WHITESPACE = /\s/; + if (char && WHITESPACE.test(char)) { + current++; + continue; + } + let NUMBERS = /[0-9]/; + if (char && NUMBERS.test(char) || char === "-" || char === ".") { + let value2 = ""; + if (char === "-") { + value2 += char; + char = input[++current]; + } + while (char && (NUMBERS.test(char) || char === "." || // exponent marker, e.g. `1e10` or `1.5E-9` + char === "e" || char === "E" || // exponent sign, only valid immediately after the exponent marker + (char === "-" || char === "+") && (value2[value2.length - 1] === "e" || value2[value2.length - 1] === "E"))) { + value2 += char; + char = input[++current]; + } + tokens.push({ + type: "number", + value: value2, + unterminated: current === input.length + }); + continue; + } + let LETTERS = /[a-z]/i; + if (char && LETTERS.test(char)) { + let value2 = ""; + while (char && LETTERS.test(char)) { + if (current === input.length) { + break; + } + value2 += char; + char = input[++current]; + } + if (value2 == "true" || value2 == "false" || value2 === "null") { + tokens.push({ + type: "name", + value: value2 + }); + } else { + current++; + continue; + } + continue; + } + current++; + } + return tokens; + }; + strip = (tokens) => { + let open = []; + for (const token of tokens) { + if (token.type === "brace" || token.type === "paren") { + if (token.value === "{" || token.value === "[") { + open.push(token.value); + } else { + open.pop(); + } + } + } + let innermostOpenBracket = open[open.length - 1]; + let length = tokens.length; + let JSON_NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/; + while (length > 0) { + let lastToken = tokens[length - 1]; + switch (lastToken.type) { + case "separator": + length--; + continue; + case "number": + if (lastToken.unterminated || !JSON_NUMBER.test(lastToken.value)) { + length--; + continue; + } + break; + case "string": + let tokenBeforeTheLastToken = tokens[length - 2]; + if (innermostOpenBracket === "{" && (tokenBeforeTheLastToken?.type === "delimiter" || tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{")) { + length--; + continue; + } + break; + case "delimiter": + length--; + break; + } + break; + } + return tokens.slice(0, length); + }; + unstrip = (tokens) => { + let tail = []; + tokens.map((token) => { + if (token.type === "brace") { + if (token.value === "{") { + tail.push("}"); + } else { + tail.splice(tail.lastIndexOf("}"), 1); + } + } + if (token.type === "paren") { + if (token.value === "[") { + tail.push("]"); + } else { + tail.splice(tail.lastIndexOf("]"), 1); + } + } + }); + if (tail.length > 0) { + tail.reverse().map((item) => { + if (item === "}") { + tokens.push({ + type: "brace", + value: "}" + }); + } else if (item === "]") { + tokens.push({ + type: "paren", + value: "]" + }); + } + }); + } + return tokens; + }; + generate = (tokens) => { + let output = ""; + tokens.map((token) => { + switch (token.type) { + case "string": + output += '"' + token.value + '"'; + break; + default: + output += token.value; + break; + } + }); + return output; + }; + partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input))))); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs +function withLazyInput(prev, jsonBuf) { + const next = {}; + for (const key of Object.keys(prev)) { + if (key !== "input") + next[key] = prev[key]; + } + Object.defineProperty(next, JSON_BUF_PROPERTY, { value: jsonBuf, enumerable: false, writable: true }); + let input; + let parsed = false; + Object.defineProperty(next, "input", { + enumerable: true, + configurable: true, + get() { + if (!parsed) { + input = jsonBuf ? partialParse(jsonBuf) : {}; + parsed = true; + } + return input; + } + }); + return next; +} +var JSON_BUF_PROPERTY; +var init_message_stream_utils = __esm({ + "node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs"() { + init_parser(); + JSON_BUF_PROPERTY = "__json_buf"; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +function tracksToolInput(content) { + return content.type === "tool_use" || content.type === "server_tool_use" || content.type === "mcp_tool_use"; +} +var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_params, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_workspace_id, _BetaMessageStream_logger, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage, _BetaMessageStream_toolInputParseError, BetaMessageStream; +var init_BetaMessageStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_error2(); + init_errors(); + init_values(); + init_streaming2(); + init_beta_parser(); + init_message_stream_utils(); + BetaMessageStream = /* @__PURE__ */ (() => { + class BetaMessageStream2 { + constructor(params, opts) { + _BetaMessageStream_instances.add(this); + this.messages = []; + this.receivedMessages = []; + _BetaMessageStream_currentMessageSnapshot.set(this, void 0); + _BetaMessageStream_params.set(this, null); + this.controller = new AbortController(); + _BetaMessageStream_connectedPromise.set(this, void 0); + _BetaMessageStream_resolveConnectedPromise.set(this, () => { + }); + _BetaMessageStream_rejectConnectedPromise.set(this, () => { + }); + _BetaMessageStream_endPromise.set(this, void 0); + _BetaMessageStream_resolveEndPromise.set(this, () => { + }); + _BetaMessageStream_rejectEndPromise.set(this, () => { + }); + _BetaMessageStream_listeners.set(this, {}); + _BetaMessageStream_ended.set(this, false); + _BetaMessageStream_errored.set(this, false); + _BetaMessageStream_aborted.set(this, false); + _BetaMessageStream_catchingPromiseCreated.set(this, false); + _BetaMessageStream_response.set(this, void 0); + _BetaMessageStream_request_id.set(this, void 0); + _BetaMessageStream_workspace_id.set(this, void 0); + _BetaMessageStream_logger.set(this, void 0); + _BetaMessageStream_handleError.set(this, (error) => { + __classPrivateFieldSet(this, _BetaMessageStream_errored, true, "f"); + if (isAbortError(error)) { + error = new APIUserAbortError(); + } + if (error instanceof APIUserAbortError) { + __classPrivateFieldSet(this, _BetaMessageStream_aborted, true, "f"); + return this._emit("abort", error); + } + if (error instanceof AnthropicError) { + return this._emit("error", error); + } + if (error instanceof Error) { + const anthropicError = new AnthropicError(error.message); + anthropicError.cause = error; + return this._emit("error", anthropicError); + } + return this._emit("error", new AnthropicError(String(error))); + }); + __classPrivateFieldSet(this, _BetaMessageStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_rejectConnectedPromise, reject2, "f"); + }), "f"); + __classPrivateFieldSet(this, _BetaMessageStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_rejectEndPromise, reject2, "f"); + }), "f"); + __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, "f").catch(() => { + }); + __classPrivateFieldGet(this, _BetaMessageStream_endPromise, "f").catch(() => { + }); + __classPrivateFieldSet(this, _BetaMessageStream_params, params, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_logger, opts?.logger ?? console, "f"); + } + get response() { + return __classPrivateFieldGet(this, _BetaMessageStream_response, "f"); + } + get request_id() { + return __classPrivateFieldGet(this, _BetaMessageStream_request_id, "f"); + } + get workspace_id() { + return __classPrivateFieldGet(this, _BetaMessageStream_workspace_id, "f"); + } + /** + * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, + * returned vie the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * This is the same as the `APIPromise.withResponse()` method. + * + * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` + * as no `Response` is available. + */ + async withResponse() { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + const response = await __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, "f"); + if (!response) { + throw new Error("Could not resolve a `Response` object"); + } + return { + data: this, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + /** + * Intended for use on the frontend, consuming a stream produced with + * `.toReadableStream()` on the backend. + * + * Note that messages sent to the model do not appear in `.on('message')` + * in this context. + */ + static fromReadableStream(stream5) { + const runner = new BetaMessageStream2(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; + } + static createMessage(messages, params, options, { logger } = {}) { + const runner = new BetaMessageStream2(params, { logger }); + for (const message of params.messages) { + runner._addMessageParam(message); + } + __classPrivateFieldSet(runner, _BetaMessageStream_params, { ...params, stream: true }, "f"); + runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return runner; + } + _run(executor) { + executor().then(() => { + this._emitFinal(); + this._emit("end"); + }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f")); + } + _addMessageParam(message) { + this.messages.push(message); + } + _addMessage(message, emit2 = true) { + this.receivedMessages.push(message); + if (emit2) { + this._emit("message", message); + } + } + async _createMessage(messages, params, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); + const { response, data: stream5 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); + this._connected(response); + for await (const event of stream5) { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + _connected(response) { + if (this.ended) + return; + __classPrivateFieldSet(this, _BetaMessageStream_response, response, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_request_id, response?.headers.get("request-id"), "f"); + __classPrivateFieldSet(this, _BetaMessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); + __classPrivateFieldGet(this, _BetaMessageStream_resolveConnectedPromise, "f").call(this, response); + this._emit("connect"); + } + get ended() { + return __classPrivateFieldGet(this, _BetaMessageStream_ended, "f"); + } + get errored() { + return __classPrivateFieldGet(this, _BetaMessageStream_errored, "f"); + } + get aborted() { + return __classPrivateFieldGet(this, _BetaMessageStream_aborted, "f"); + } + abort() { + this.controller.abort(); + } + /** + * Adds the listener function to the end of the listeners array for the event. + * No checks are made to see if the listener has already been added. Multiple calls passing + * the same combination of event and listener will result in the listener being added, and + * called, multiple times. + * @returns this MessageStream, so that calls can be chained + */ + on(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = []); + listeners.push({ listener }); + return this; + } + /** + * Removes the specified listener from the listener array for the event. + * off() will remove, at most, one instance of a listener from the listener array. If any single + * listener has been added multiple times to the listener array for the specified event, then + * off() must be called multiple times to remove each instance. + * @returns this MessageStream, so that calls can be chained + */ + off(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event]; + if (!listeners) + return this; + const index = listeners.findIndex((l) => l.listener === listener); + if (index >= 0) + listeners.splice(index, 1); + return this; + } + /** + * Adds a one-time listener function for the event. The next time the event is triggered, + * this listener is removed and then invoked. + * @returns this MessageStream, so that calls can be chained + */ + once(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = []); + listeners.push({ listener, once: true }); + return this; + } + /** + * This is similar to `.once()`, but returns a Promise that resolves the next time + * the event is triggered, instead of calling a listener callback. + * @returns a Promise that resolves the next time given event is triggered, + * or rejects if an error is emitted. (If you request the 'error' event, + * returns a promise that resolves with the error). + * + * Example: + * + * const message = await stream.emitted('message') // rejects if the stream errors + */ + emitted(event) { + return new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + if (event !== "error") + this.once("error", reject2); + this.once(event, resolve2); + }); + } + async done() { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet(this, _BetaMessageStream_endPromise, "f"); + } + get currentMessage() { + return __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + } + /** + * @returns a promise that resolves with the the final assistant Message response, + * or rejects if an error occurred or the stream ended prematurely without producing a Message. + * If structured outputs were used, this will be a ParsedMessage with a `parsed` field. + */ + async finalMessage() { + await this.done(); + return __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this); + } + /** + * @returns a promise that resolves with the the final assistant Message's text response, concatenated + * together if there are more than one text blocks. + * Rejects if an error occurred or the stream ended prematurely without producing a Message. + */ + async finalText() { + await this.done(); + return __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalText).call(this); + } + _emit(event, ...args) { + if (__classPrivateFieldGet(this, _BetaMessageStream_ended, "f")) + return; + if (event === "end") { + __classPrivateFieldSet(this, _BetaMessageStream_ended, true, "f"); + __classPrivateFieldGet(this, _BetaMessageStream_resolveEndPromise, "f").call(this); + } + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event]; + if (listeners) { + __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); + listeners.forEach(({ listener }) => listener(...args)); + } + if (event === "abort") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + return; + } + if (event === "error") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + } + } + _emitFinal() { + const finalMessage = this.receivedMessages.at(-1); + if (finalMessage) { + this._emit("finalMessage", __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this)); + } + } + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); + this._connected(null); + const stream5 = Stream.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + [(_BetaMessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_params = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_listeners = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_ended = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_errored = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_aborted = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_response = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_request_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_logger = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_handleError = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_instances = /* @__PURE__ */ new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + return this.receivedMessages.at(-1); + }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); + if (textBlocks.length === 0) { + throw new AnthropicError("stream ended without producing a content block with type=text"); + } + return textBlocks.join(" "); + }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest2() { + if (this.ended) + return; + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); + }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent2(event) { + if (this.ended) + return; + const messageSnapshot = __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_accumulateMessage).call(this, event); + this._emit("streamEvent", event, messageSnapshot); + switch (event.type) { + case "content_block_delta": { + const content = messageSnapshot.content.at(-1); + switch (event.delta.type) { + case "text_delta": { + if (content.type === "text") { + this._emit("text", event.delta.text, content.text || ""); + } + break; + } + case "citations_delta": { + if (content.type === "text") { + this._emit("citation", event.delta.citation, content.citations ?? []); + } + break; + } + case "input_json_delta": { + if (tracksToolInput(content) && __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f").inputJson?.length) { + let jsonSnapshot; + try { + jsonSnapshot = content.input; + } catch (err) { + __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, content, err)); + break; + } + this._emit("inputJson", event.delta.partial_json, jsonSnapshot); + } + break; + } + case "thinking_delta": { + if (content.type === "thinking") { + this._emit("thinking", event.delta.thinking, content.thinking); + } + break; + } + case "signature_delta": { + if (content.type === "thinking") { + this._emit("signature", content.signature); + } + break; + } + case "compaction_delta": { + if (content.type === "compaction" && content.content) { + this._emit("compaction", content.content); + } + break; + } + default: + checkNever(event.delta); + } + break; + } + case "message_stop": { + this._addMessageParam(messageSnapshot); + this._addMessage(maybeParseBetaMessage(messageSnapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, "f") }), true); + break; + } + case "content_block_stop": { + this._emit("contentBlock", messageSnapshot.content.at(-1)); + break; + } + case "message_start": { + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); + break; + } + case "content_block_start": + case "message_delta": + break; + } + }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest2() { + if (this.ended) { + throw new AnthropicError(`stream has ended, this shouldn't happen`); + } + const snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + if (!snapshot) { + throw new AnthropicError(`request ended without sending any chunks`); + } + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); + return maybeParseBetaMessage(snapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, "f") }); + }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage2(event) { + let snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + if (event.type === "message_start") { + if (snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); + } + return event.message; + } + if (!snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); + } + switch (event.type) { + case "message_stop": + return snapshot; + case "message_delta": + snapshot.stop_reason = event.delta.stop_reason; + snapshot.stop_sequence = event.delta.stop_sequence; + snapshot.stop_details = event.delta.stop_details; + snapshot.usage.output_tokens = event.usage.output_tokens; + if (event.delta.container != null) { + snapshot.container = event.delta.container; + } + if (event.context_management != null) { + snapshot.context_management = event.context_management; + } + if (event.input_transformations != null) { + snapshot.input_transformations = event.input_transformations; + } + if (event.usage.input_tokens != null) { + snapshot.usage.input_tokens = event.usage.input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; + } + if (event.usage.server_tool_use != null) { + snapshot.usage.server_tool_use = event.usage.server_tool_use; + } + if (event.usage.iterations != null) { + snapshot.usage.iterations = event.usage.iterations; + } + if (event.usage.fallback_credit != null) { + snapshot.usage.fallback_credit = event.usage.fallback_credit; + } + if (event.usage.output_tokens_details != null) { + snapshot.usage.output_tokens_details = event.usage.output_tokens_details; + } + return snapshot; + case "content_block_start": + snapshot.content.push(event.content_block); + if (event.content_block.type === "fallback") { + snapshot.model = event.content_block.to.model; + } + return snapshot; + case "content_block_delta": { + const snapshotContent = snapshot.content.at(event.index); + switch (event.delta.type) { + case "text_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + text: (snapshotContent.text || "") + event.delta.text + }; + } + break; + } + case "citations_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + citations: [...snapshotContent.citations ?? [], event.delta.citation] + }; + } + break; + } + case "input_json_delta": { + if (snapshotContent && tracksToolInput(snapshotContent)) { + const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; + snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); + } + break; + } + case "thinking_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + thinking: snapshotContent.thinking + event.delta.thinking + }; + } + break; + } + case "signature_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + signature: event.delta.signature + }; + } + break; + } + case "compaction_delta": { + if (snapshotContent?.type === "compaction") { + const block = { ...snapshotContent, content: event.delta.content }; + if ("encrypted_content" in event.delta) { + block.encrypted_content = event.delta.encrypted_content; + } + snapshot.content[event.index] = block; + } + break; + } + default: + checkNever(event.delta); + } + return snapshot; + } + case "content_block_stop": { + const snapshotContent = snapshot.content.at(event.index); + if (snapshotContent && tracksToolInput(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { + let input; + try { + input = snapshotContent.input; + } catch (err) { + input = {}; + __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, snapshotContent, err)); + } + Object.defineProperty(snapshotContent, "input", { + value: input, + enumerable: true, + configurable: true, + writable: true + }); + } + return snapshot; + } + } + }, _BetaMessageStream_toolInputParseError = function _BetaMessageStream_toolInputParseError2(block, err) { + const jsonBuf = block[JSON_BUF_PROPERTY]; + return new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`); + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("streamEvent", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); + } else { + pushQueue.push(event); + } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; + } + toReadableStream() { + const stream5 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); + } + } + return BetaMessageStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs +var _BetaToolRunnerStream_instances, _BetaToolRunnerStream_onToolCall, _BetaToolRunnerStream_emitted, _BetaToolRunnerStream_readers, _BetaToolRunnerStream_toolCalls, _BetaToolRunnerStream_closed, _BetaToolRunnerStream_ready, _BetaToolRunnerStream_fallback, _BetaToolRunnerStream_track, _BetaToolRunnerStream_release, _BetaToolRunnerStream_removeReader, BetaToolRunnerStream; +var init_BetaToolRunnerStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_BetaMessageStream(); + BetaToolRunnerStream = /* @__PURE__ */ (() => { + class BetaToolRunnerStream2 extends BetaMessageStream { + constructor(params, onToolCall) { + super(params); + _BetaToolRunnerStream_instances.add(this); + _BetaToolRunnerStream_onToolCall.set(this, void 0); + _BetaToolRunnerStream_emitted.set(this, 0); + _BetaToolRunnerStream_readers.set(this, []); + _BetaToolRunnerStream_toolCalls.set(this, []); + _BetaToolRunnerStream_closed.set(this, void 0); + _BetaToolRunnerStream_ready.set(this, []); + _BetaToolRunnerStream_fallback.set(this, false); + __classPrivateFieldSet(this, _BetaToolRunnerStream_onToolCall, onToolCall, "f"); + } + /** The `tool_use` blocks that have finished streaming, in the model's order */ + get toolCalls() { + return __classPrivateFieldGet(this, _BetaToolRunnerStream_toolCalls, "f"); + } + /** Sends the request as `client.beta.messages.stream()` does. */ + static start(messages, params, options, onToolCall) { + const stream5 = new BetaToolRunnerStream2({ ...params, stream: true }, onToolCall); + for (const message of params.messages) { + stream5._addMessageParam(message); + } + stream5._run(() => stream5._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return stream5; + } + _emit(event, ...args) { + var _a6; + if (event !== "streamEvent" || this.ended) { + super._emit(event, ...args); + return; + } + __classPrivateFieldSet(this, _BetaToolRunnerStream_emitted, (_a6 = __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f"), _a6++, _a6), "f"); + const [streamEvent, snapshot] = args; + const block = streamEvent.type === "content_block_stop" ? snapshot.content[streamEvent.index] : void 0; + const closed = block?.type === "tool_use" ? block : void 0; + if (closed) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_toolCalls, "f").push(closed); + } + super._emit(event, ...args); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_track).call(this, streamEvent, closed); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + [(_BetaToolRunnerStream_onToolCall = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_emitted = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_readers = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_toolCalls = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_closed = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_ready = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_fallback = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + const iterator = super[Symbol.asyncIterator](); + const reader = { handled: __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f") }; + __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").push(reader); + let holdsEvent = false; + return { + next: async () => { + if (holdsEvent) { + holdsEvent = false; + reader.handled++; + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + try { + const result = await iterator.next(); + holdsEvent = !result.done; + if (result.done) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + } + return result; + } catch (error) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + throw error; + } + }, + return: async () => { + const result = iterator.return?.(); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + return await result ?? { value: void 0, done: true }; + } + }; + } + } + _BetaToolRunnerStream_track = function _BetaToolRunnerStream_track2(event, closed) { + if (__classPrivateFieldGet(this, _BetaToolRunnerStream_fallback, "f")) { + return; + } + if (event.type === "content_block_start" && event.content_block.type === "fallback") { + __classPrivateFieldSet(this, _BetaToolRunnerStream_fallback, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, void 0, "f"); + return; + } + const movedOn = event.type === "content_block_start" || event.type === "message_delta" && event.delta.stop_reason === "tool_use"; + if (__classPrivateFieldGet(this, _BetaToolRunnerStream_closed, "f") && movedOn) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f").push({ toolUse: __classPrivateFieldGet(this, _BetaToolRunnerStream_closed, "f"), event: __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f") }); + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, void 0, "f"); + } + if (closed) { + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, closed, "f"); + } + }, _BetaToolRunnerStream_release = function _BetaToolRunnerStream_release2() { + if (this.errored || this.controller.signal.aborted) { + return; + } + const handled = Math.min(__classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f"), ...__classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").map((reader) => reader.handled)); + while (__classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f")[0] && __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f")[0].event <= handled) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_onToolCall, "f").call(this, __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f").shift().toolUse); + } + }, _BetaToolRunnerStream_removeReader = function _BetaToolRunnerStream_removeReader2(reader) { + const index = __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").indexOf(reader); + if (index >= 0) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").splice(index, 1); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + }; + return BetaToolRunnerStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs +function promiseWithResolvers() { + let resolve2; + let reject2; + const promise = new Promise((res, rej) => { + resolve2 = res; + reject2 = rej; + }); + return { promise, resolve: resolve2, reject: reject2 }; +} +var init_promise = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +function rejectCompactionParam(params) { + if ("compaction" in params && params.compaction != null) { + throw new AnthropicError("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead."); + } +} +function rejectCompactionControl(params) { + if ("compactionControl" in params && params.compactionControl != null) { + throw new AnthropicError("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted."); + } +} +function rejectRunToolsEagerlyWithoutStream(params) { + if (params.runToolsEagerly && !params.stream) { + throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole."); + } +} +function rejectCompactionEdit(params) { + if (params.context_management?.edits?.some((edit) => edit.type.startsWith("compact_"))) { + throw new AnthropicError("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first."); + } +} +function withoutCompactionIncompatibleParams(params) { + const { context_management, stop_sequences, output_format, ...kept } = params; + const withoutFormat = ({ format, ...outputConfig }) => outputConfig; + if (kept.tool_choice?.type === "any" || kept.tool_choice?.type === "tool") { + delete kept.tool_choice; + } + if (kept.output_config) { + kept.output_config = withoutFormat(kept.output_config); + } + if (Array.isArray(kept.fallbacks)) { + kept.fallbacks = kept.fallbacks.map((fallback) => fallback.output_config ? { ...fallback, output_config: withoutFormat(fallback.output_config) } : fallback); + } + return kept; +} +async function generateToolResponse(runnable, available, lastMessage, requestOptions, calls) { + if (!lastMessage || lastMessage.role !== "assistant" || !lastMessage.content || typeof lastMessage.content === "string") { + return null; + } + const toolUseBlocks = lastMessage.content.filter((content) => content.type === "tool_use"); + if (toolUseBlocks.length === 0) { + return null; + } + const toolResults = await Promise.all(toolUseBlocks.map((toolUse) => { + const call = calls?.get(toolUse.id); + if (call?.status === "started") { + return call.result; + } + const result = runToolCall(runnable, available, toolUse, requestOptions); + calls?.set(toolUse.id, { status: "started", result }); + return result; + })); + return { + role: "user", + content: toolResults + }; +} +async function runToolCall(runnable, available, toolUse, requestOptions) { + const tool = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0; + if (!tool) { + return toolNotFoundResult(toolUse); + } + try { + let input = toolUse.input; + if ("parse" in tool && tool.parse) { + input = tool.parse(input); + } + const result = await tool.run(input, { + toolUse, + toolUseBlock: toolUse, + signal: requestOptions?.signal + }); + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: result + }; + } catch (error) { + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: error instanceof ToolError ? error.content : `Error: ${error instanceof Error ? error.message : String(error)}`, + is_error: true + }; + } +} +function asContentParam(content) { + return content; +} +function toolNotFoundResult(toolUse) { + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: `Error: Tool '${toolUse.name}' not found`, + is_error: true + }; +} +function applyToolChange(block, available) { + switch (block.type) { + case "tool_removal": + case "tool_addition": + applyToolReference(block, available); + break; + } +} +function applyToolReference(block, available) { + const name = changedToolName(block.tool); + if (name === void 0) + return; + if (block.type === "tool_removal") { + available.delete(name); + } else { + available.add(name); + } +} +function changedToolName(tool) { + switch (tool.type) { + case "tool_reference": + return tool.name; + case "tool_definition": + return "name" in tool.definition ? tool.definition.name : void 0; + default: + return void 0; + } +} +function determineNextStepFromStopReason(stopReason) { + if (stopReason === null) + return "stop"; + switch (stopReason) { + case "tool_use": + return "run_tools"; + case "pause_turn": + // pause_after_compaction hands the turn back before the model answers; sending it back + // unchanged continues it. + case "compaction": + return "resume"; + case "end_turn": + case "stop_sequence": + case "max_tokens": + case "model_context_window_exceeded": + case "refusal": + return "stop"; + default: + checkNever(stopReason); + return "stop"; + } +} +var _BetaToolRunner_instances, _BetaToolRunner_consumed, _BetaToolRunner_mutated, _BetaToolRunner_state, _BetaToolRunner_options, _BetaToolRunner_message, _BetaToolRunner_stream, _BetaToolRunner_toolResponse, _BetaToolRunner_completion, _BetaToolRunner_iterationCount, _BetaToolRunner_compaction, _BetaToolRunner_calls, _BetaToolRunner_lastStopReason, _BetaToolRunner_toolOverrides, _BetaToolRunner_pendingToolChanges, _BetaToolRunner_send, _BetaToolRunner_streamThatStartsTools, _BetaToolRunner_startedCallsSettled, _BetaToolRunner_compact, _BetaToolRunner_runnableTools, _BetaToolRunner_availableToolNames, _BetaToolRunner_recordRemovalsFromHistory, _BetaToolRunner_compactAfterFinalTurn, _BetaToolRunner_generateToolResponse, _BetaToolRunner_flushPendingToolChanges, _BetaToolRunner_pendingToolChangesMessage, BetaToolRunner; +var init_BetaToolRunner = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs"() { + init_tslib(); + init_ToolError(); + init_error(); + init_BetaToolRunnerStream(); + init_headers(); + init_promise(); + init_values(); + init_log(); + init_stainless_helper_header(); + BetaToolRunner = /* @__PURE__ */ (() => { + class BetaToolRunner2 { + constructor(client, params, options) { + _BetaToolRunner_instances.add(this); + this.client = client; + _BetaToolRunner_consumed.set(this, false); + _BetaToolRunner_mutated.set(this, false); + _BetaToolRunner_state.set(this, void 0); + _BetaToolRunner_options.set(this, void 0); + _BetaToolRunner_message.set(this, void 0); + _BetaToolRunner_stream.set(this, void 0); + _BetaToolRunner_toolResponse.set(this, void 0); + _BetaToolRunner_completion.set(this, void 0); + _BetaToolRunner_iterationCount.set(this, 0); + _BetaToolRunner_compaction.set(this, { status: "idle" }); + _BetaToolRunner_calls.set(this, void 0); + _BetaToolRunner_lastStopReason.set(this, null); + _BetaToolRunner_toolOverrides.set(this, /* @__PURE__ */ new Map()); + _BetaToolRunner_pendingToolChanges.set(this, []); + rejectCompactionParam(params); + rejectCompactionControl(params); + rejectRunToolsEagerlyWithoutStream(params); + __classPrivateFieldSet(this, _BetaToolRunner_state, { + params: { + // You can't clone the entire params since there are functions as handlers. + // You also don't really need to clone params.messages, but it probably will prevent a foot gun + // somewhere. + ...params, + // Not structuredClone(): it throws on a function, and a runnable tool written by value into a + // `tool_addition` block has `run`. A JSON copy is the messages as they are sent, which drops it. + messages: JSON.parse(JSON.stringify(params.messages)) + } + }, "f"); + const collected = collectStainlessHelpers(params.tools, params.messages); + __classPrivateFieldSet(this, _BetaToolRunner_options, { + ...options, + headers: buildHeaders([ + helperHeader("BetaToolRunner"), + collected.length ? { [STAINLESS_HELPER_HEADER]: collected.join(", ") } : void 0, + options?.headers + ]) + }, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); + } + async *[(_BetaToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_mutated = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_state = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_options = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_message = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_stream = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolResponse = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_completion = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_iterationCount = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_compaction = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_calls = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_lastStopReason = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolOverrides = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_pendingToolChanges = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + var _a6; + if (__classPrivateFieldGet(this, _BetaToolRunner_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed stream"); + } + __classPrivateFieldSet(this, _BetaToolRunner_consumed, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + try { + while (true) { + try { + if (__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.max_iterations && __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, "f") >= __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.max_iterations) { + break; + } + __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_flushPendingToolChanges).call(this); + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "scheduled" && determineNextStepFromStopReason(__classPrivateFieldGet(this, _BetaToolRunner_lastStopReason, "f")) !== "resume") { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").config); + continue; + } + __classPrivateFieldSet(this, _BetaToolRunner_mutated, false, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_iterationCount, (_a6 = __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, "f"), _a6++, _a6), "f"); + __classPrivateFieldSet(this, _BetaToolRunner_message, void 0, "f"); + const { max_iterations, runToolsEagerly, ...params } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, params); + if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, "f")) { + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + const nextStep = determineNextStepFromStopReason(message.stop_reason); + __classPrivateFieldSet(this, _BetaToolRunner_lastStopReason, message.stop_reason, "f"); + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push({ + role: message.role, + content: asContentParam(message.content) + }); + const { container } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + if (message.container) { + if (container == null) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.container = message.container.id; + } else if (typeof container === "object" && container.id == null) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.container = { ...container, id: message.container.id }; + } + } + if (nextStep === "stop") { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); + break; + } + if (nextStep === "resume") { + continue; + } + } else { + __classPrivateFieldSet(this, _BetaToolRunner_lastStopReason, null, "f"); + } + const toolMessage = await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.at(-1)); + if (toolMessage) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push(toolMessage); + } else if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, "f")) { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); + break; + } + } finally { + __classPrivateFieldGet(this, _BetaToolRunner_stream, "f")?.abort(); + __classPrivateFieldSet(this, _BetaToolRunner_stream, void 0, "f"); + } + } + await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); + if (!__classPrivateFieldGet(this, _BetaToolRunner_message, "f")) { + throw new AnthropicError("ToolRunner concluded without a message from the server"); + } + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").resolve(await __classPrivateFieldGet(this, _BetaToolRunner_message, "f")); + } catch (error) { + __classPrivateFieldSet(this, _BetaToolRunner_consumed, false, "f"); + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").promise.catch(() => { + }); + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").reject(error); + __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); + throw error; + } + } + setMessagesParams(paramsOrMutator) { + const params = typeof paramsOrMutator === "function" ? paramsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params) : paramsOrMutator; + rejectCompactionParam(params); + rejectRunToolsEagerlyWithoutStream(params); + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status !== "idle") { + rejectCompactionEdit(params); + } + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "in_flight" && params.messages !== __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages) { + throw new AnthropicError("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead."); + } + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params = params; + __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + } + setRequestOptions(optionsOrMutator) { + if (typeof optionsOrMutator === "function") { + __classPrivateFieldSet(this, _BetaToolRunner_options, optionsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + } else { + __classPrivateFieldSet(this, _BetaToolRunner_options, { ...__classPrivateFieldGet(this, _BetaToolRunner_options, "f"), ...optionsOrMutator }, "f"); + } + } + /** + * Get the tool response for the last message from the assistant. + * Avoids redundant tool executions by caching results. With `runToolsEagerly`, it reuses the calls of + * the reply that have started and runs the rest, including the ones `deferToolCall()` is holding, so that no + * call runs twice. + * + * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed + * + * @example + * const toolResponse = await runner.generateToolResponse(); + * if (toolResponse) { + * console.log('Tool results:', toolResponse.content); + * } + */ + async generateToolResponse(signal = __classPrivateFieldGet(this, _BetaToolRunner_options, "f").signal) { + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f") ?? this.params.messages.at(-1); + if (!message) { + return null; + } + return __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, message, signal); + } + /** + * Hold a tool call of the current reply until you are done with the reply, which is when it runs without + * streaming: at the end of the loop body, or when you call `generateToolResponse()`. + * + * With `runToolsEagerly` the runner otherwise starts each call while the reply streams, as soon as + * the model has moved on from it: when the next block starts, or the reply stops with `tool_use`. A call + * never starts before your stream listeners and any `for await` over the stream have handled that event, so + * you can call this from either once you have seen the call. The other calls of the reply still start early. + * It does nothing for a call that has started, outside the loop body, and without `runToolsEagerly`. + * + * @param toolUse - The `tool_use` block of the call, or its id + * + * @example + * for await (const stream of runner) { + * stream.on('contentBlock', (block) => { + * if (block.type === 'tool_use' && block.name === 'delete_file') { + * runner.deferToolCall(block); + * } + * }); + * await stream.finalMessage(); + * // No `delete_file` call has started yet. + * } + */ + deferToolCall(toolUse) { + const id = typeof toolUse === "string" ? toolUse : toolUse.id; + if (__classPrivateFieldGet(this, _BetaToolRunner_calls, "f") && !__classPrivateFieldGet(this, _BetaToolRunner_calls, "f").has(id)) { + __classPrivateFieldGet(this, _BetaToolRunner_calls, "f").set(id, { status: "held" }); + } + } + /** + * The tool calls of the current reply that `deferToolCall()` is holding, in the model's order, as their + * `tool_use` blocks. A call is in the list once its block has finished streaming, so read the list when you + * are done with the stream. A call that has started is not in it. It is empty without + * `runToolsEagerly`. + * + * Held calls are listed whatever the reply's `stop_reason`, because `generateToolResponse()` runs them + * whatever it is. After `max_tokens` the input of the last call can be cut off. + * + * @example + * for await (const stream of runner) { + * stream.on('contentBlock', (block) => { + * if (block.type === 'tool_use' && block.name === 'delete_file') { + * runner.deferToolCall(block); + * } + * }); + * await stream.finalMessage(); + * + * const held = runner.deferredToolCalls; + * if (held.length > 0 && !(await confirm(held))) break; + * } + */ + get deferredToolCalls() { + const stream5 = __classPrivateFieldGet(this, _BetaToolRunner_stream, "f"); + const calls = __classPrivateFieldGet(this, _BetaToolRunner_calls, "f"); + if (!(stream5 instanceof BetaToolRunnerStream) || !calls) { + return []; + } + return stream5.toolCalls.filter((toolUse) => calls.get(toolUse.id)?.status === "held"); + } + /** + * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and + * will wait for an instance to start and go to completion. + * + * @returns A promise that resolves to the final BetaMessage when the iterator completes + * + * @example + * // Start consuming the iterator + * for await (const message of runner) { + * console.log('Message:', message.content); + * } + * + * // Meanwhile, wait for completion from another part of the code + * const finalMessage = await runner.done(); + * console.log('Final response:', finalMessage.content); + */ + done() { + return __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").promise; + } + /** + * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream: + * * If the iterator has not been consumed, consume the entire iterator and return the final message from the + * assistant. + * * If the iterator has been consumed, waits for it to complete and returns the final message. + * + * @returns A promise that resolves to the final BetaMessage from the conversation + * @throws {AnthropicError} If no messages were processed during the conversation + * + * @example + * const finalMessage = await runner.runUntilDone(); + * console.log('Final response:', finalMessage.content); + */ + async runUntilDone() { + if (!__classPrivateFieldGet(this, _BetaToolRunner_consumed, "f")) { + for await (const _ of this) { + } + } + return this.done(); + } + /** + * Get the current parameters being used by the ToolRunner. + * + * @returns A readonly view of the current ToolRunnerParams + * + * @example + * const currentParams = runner.params; + * console.log('Current model:', currentParams.model); + * console.log('Message count:', currentParams.messages.length); + */ + get params() { + return __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + } + /** + * Add one or more messages to the conversation history. + * + * @param messages - One or more BetaMessageParam objects to add to the conversation + * + * @example + * runner.pushMessages( + * { role: 'user', content: 'Also, what about the weather in NYC?' } + * ); + * + * @example + * // Adding multiple messages + * runner.pushMessages( + * { role: 'user', content: 'What about NYC?' }, + * { role: 'user', content: 'And Boston?' } + * ); + */ + pushMessages(...messages) { + this.setMessagesParams((params) => ({ + ...params, + messages: [...params.messages, ...messages] + })); + } + /** + * Schedule a compaction of the conversation. Once the current turn has finished, including any tool + * calls, the runner requests a summary and replaces the message history with the compaction response, + * which is yielded like any other message. Requires the `compact-2026-09-04` beta. + * + * @param compaction - The config to send, as `messages.create()` takes it. Defaults to `{ type: 'summarize' }` + * + * @example + * for await (const message of runner) { + * if (message.usage.input_tokens > 100_000) { + * runner.compactBeforeNextTurn(); + * } + * } + */ + compactBeforeNextTurn(compaction) { + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "in_flight") { + return; + } + rejectCompactionEdit(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "scheduled", config: compaction ?? { type: "summarize" } }, "f"); + } + /** + * Give the model more tools without changing `params.tools`, which would miss the prompt cache. + * + * Each tool's whole definition is sent in a `tool_addition` block with the next request, and a + * runnable tool replaces a runnable tool of the same name straight away, even for a call already in + * the message being handled. A call that started while the reply streamed keeps the old one. A raw + * definition is only sent: the runner never runs it, and stops running a tool of the same name. + * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. + * + * @param tools - Runnable tools (for example from `betaZodTool()`) or raw tool definitions + * + * @example + * runner.addTools(queryDatabaseTool); + */ + addTools(...tools) { + for (const tool of tools) { + if ("name" in tool) { + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(tool.name, "run" in tool ? tool : null); + } + __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool }); + } + } + /** + * Take tools away from the model without changing `params.tools`, which would miss the prompt cache. + * + * The tools stop being run straight away: a call to one of them, even one in the message being + * handled, gets the same "not found" error result as a call to an unknown tool. A call that started + * while the reply streamed finishes as usual. The model is told in a `tool_removal` block with the + * next request. Use {@link addTools} to bring a tool back. + * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. + * + * @param tools - The tools to remove, or their names + * + * @example + * runner.removeTools('query_database'); + */ + removeTools(...tools) { + for (const tool of tools) { + const name = typeof tool === "string" ? tool : tool.name; + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(name, null); + __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "removal", name }); + } + } + /** + * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone() + * This allows using `await runner` instead of `await runner.runUntilDone()` + */ + then(onfulfilled, onrejected) { + return this.runUntilDone().then(onfulfilled, onrejected); + } + } + _BetaToolRunner_send = /** + * Sends one request and yields its message, or its stream when streaming. `#message` and `#stream` are set + * before the yield, so they are there while the caller handles the item; the loop aborts the stream at the + * end of the iteration. + */ + async function* _BetaToolRunner_send2(params) { + await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); + __classPrivateFieldSet(this, _BetaToolRunner_calls, void 0, "f"); + if (params.stream) { + __classPrivateFieldSet(this, _BetaToolRunner_stream, __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.runToolsEagerly ? __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_streamThatStartsTools).call(this, params) : this.client.beta.messages.stream({ ...params }, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + __classPrivateFieldSet(this, _BetaToolRunner_message, __classPrivateFieldGet(this, _BetaToolRunner_stream, "f").finalMessage(), "f"); + __classPrivateFieldGet(this, _BetaToolRunner_message, "f").catch(() => { + }); + yield __classPrivateFieldGet(this, _BetaToolRunner_stream, "f"); + } else { + __classPrivateFieldSet(this, _BetaToolRunner_message, this.client.beta.messages.create({ ...params, stream: false }, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + yield __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + } + }, _BetaToolRunner_streamThatStartsTools = function _BetaToolRunner_streamThatStartsTools2(params) { + const calls = /* @__PURE__ */ new Map(); + __classPrivateFieldSet(this, _BetaToolRunner_calls, calls, "f"); + return BetaToolRunnerStream.start(this.client.beta.messages, params, __classPrivateFieldGet(this, _BetaToolRunner_options, "f"), (toolUse) => { + if (calls.has(toolUse.id)) { + return; + } + const result = runToolCall(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), toolUse, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")); + result.catch(() => { + }); + calls.set(toolUse.id, { status: "started", result }); + }); + }, _BetaToolRunner_startedCallsSettled = /** Waits for the calls of the last streamed reply that have started, whether or not their results were sent. */ + async function _BetaToolRunner_startedCallsSettled2() { + const started = [...__classPrivateFieldGet(this, _BetaToolRunner_calls, "f")?.values() ?? []].filter((call) => call.status === "started"); + await Promise.allSettled(started.map((call) => call.result)); + }, _BetaToolRunner_compact = async function* _BetaToolRunner_compact2(compaction) { + rejectCompactionEdit(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params); + const { max_iterations, runToolsEagerly, ...requestParams } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + const params = withoutCompactionIncompatibleParams(requestParams); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "in_flight" }, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + const lastMessage = __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + try { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, { ...params, compaction }); + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + if (message.content.some((block) => block.type === "compaction" && block.content)) { + __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_recordRemovalsFromHistory).call(this); + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages = [{ role: message.role, content: message.content }]; + } else { + loggerFor(this.client).warn("Compaction produced no summary; keeping the conversation as it is."); + __classPrivateFieldSet(this, _BetaToolRunner_message, lastMessage, "f"); + } + } finally { + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); + } + }, _BetaToolRunner_runnableTools = function _BetaToolRunner_runnableTools2() { + const runnable = /* @__PURE__ */ new Map(); + for (const tool of __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.tools) { + if ("run" in tool) { + runnable.set(tool.name, tool); + } + } + for (const [name, tool] of __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f")) { + if (tool) { + runnable.set(name, tool); + } else { + runnable.delete(name); + } + } + return runnable; + }, _BetaToolRunner_availableToolNames = function _BetaToolRunner_availableToolNames2() { + const available = new Set(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()); + for (const message of [...__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages, __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)]) { + if (typeof message.content === "string") { + continue; + } + for (const block of message.content) { + if (message.role === "system") { + applyToolChange(block, available); + } else if (message.role === "assistant" && block.type === "compaction") { + for (const change of block.tool_changes ?? []) { + applyToolChange(change, available); + } + } + } + } + return available; + }, _BetaToolRunner_recordRemovalsFromHistory = function _BetaToolRunner_recordRemovalsFromHistory2() { + const available = __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this); + for (const name of __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()) { + if (!available.has(name)) { + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(name, null); + } + } + }, _BetaToolRunner_compactAfterFinalTurn = async function* _BetaToolRunner_compactAfterFinalTurn2() { + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status !== "scheduled") { + return; + } + const lastContent = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.at(-1)?.content; + if (Array.isArray(lastContent) && lastContent.some((block) => block.type === "tool_use")) { + loggerFor(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); + return; + } + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").config); + }, _BetaToolRunner_generateToolResponse = async function _BetaToolRunner_generateToolResponse2(lastMessage, signal = __classPrivateFieldGet(this, _BetaToolRunner_options, "f").signal) { + if (__classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f") !== void 0) { + return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f"); + } + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, generateToolResponse(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), lastMessage, { ...__classPrivateFieldGet(this, _BetaToolRunner_options, "f"), signal }, __classPrivateFieldGet(this, _BetaToolRunner_calls, "f")), "f"); + return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f"); + }, _BetaToolRunner_flushPendingToolChanges = function _BetaToolRunner_flushPendingToolChanges2() { + if (__classPrivateFieldGet(this, _BetaToolRunner_lastStopReason, "f") === "pause_turn" || __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").length === 0) { + return; + } + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)); + __classPrivateFieldSet(this, _BetaToolRunner_pendingToolChanges, [], "f"); + }, _BetaToolRunner_pendingToolChangesMessage = function _BetaToolRunner_pendingToolChangesMessage2() { + const content = []; + for (const change of __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f")) { + if (change.type === "removal") { + content.push({ type: "tool_removal", tool: { type: "tool_reference", name: change.name } }); + continue; + } + let definition = change.tool; + if ("run" in change.tool) { + const { run: run2, parse: parse2, close, ...rest } = change.tool; + definition = rest; + } + content.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); + } + return { role: "system", content }; + }; + return BetaToolRunner2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +function transformOutputFormat(params) { + if (!params.output_format) { + return params; + } + if (params.output_config?.format) { + throw new AnthropicError("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated)."); + } + const { output_format, ...rest } = params; + return { + ...rest, + output_config: { + ...params.output_config, + format: output_format + } + }; +} +var DEPRECATED_MODELS, MODELS_TO_WARN_WITH_THINKING_ENABLED, Messages; +var init_messages = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs"() { + init_error2(); + init_batches(); + init_resource(); + init_constants(); + init_headers(); + init_stainless_helper_header(); + init_beta_parser(); + init_BetaMessageStream(); + init_BetaToolRunner(); + init_ToolError(); + init_batches(); + DEPRECATED_MODELS = {}; + MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-mythos-preview", "claude-opus-4-6"]; + Messages = /* @__PURE__ */ (() => { + class Messages5 extends APIResource { + constructor() { + super(...arguments); + this.batches = new Batches(this._client); + } + create(params, options) { + const modifiedParams = transformOutputFormat(params); + const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; + if (body.model in DEPRECATED_MODELS) { + console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); + } + if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) && body.thinking && body.thinking.type === "enabled") { + console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); + } + let timeout = options?.timeout ?? this._client._options.timeout; + if (!body.stream && timeout == null) { + const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; + timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); + } + const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); + return this._client.post("/v1/messages?beta=true", { + body, + timeout: timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + helperHeader2, + options?.headers + ]), + stream: modifiedParams.stream ?? false + }); + } + /** + * Send a structured list of input messages with text and/or image content, along with an expected `output_format` and + * the response will be automatically parsed and available in the `parsed_output` property of the message. + * + * @example + * ```ts + * const message = await client.beta.messages.parse({ + * model: 'claude-3-5-sonnet-20241022', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'), + * }); + * + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + parse(params, options) { + options = { + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...params.betas ?? [], "structured-outputs-2025-12-15"].toString() }, + options?.headers + ]) + }; + return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console })); + } + /** + * Create a Message stream + */ + stream(body, options) { + return BetaMessageStream.createMessage(this, body, options); + } + /** + * Count the number of tokens in a Message. + * + * The Token Count API can be used to count the number of tokens in a Message, + * including tools, images, and documents, without creating it. + * + * Learn more about token counting in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) + * + * @example + * ```ts + * const betaMessageTokensCount = + * await client.beta.messages.countTokens({ + * messages: [{ content: 'Hello, world', role: 'user' }], + * model: 'claude-opus-5', + * }); + * ``` + */ + countTokens(params, options) { + const modifiedParams = transformOutputFormat(params); + const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; + return this._client.post("/v1/messages/count_tokens?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "token-counting-2024-11-01"].toString(), + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + toolRunner(body, options) { + return new BetaToolRunner(this._client, body, options); + } + } + Messages5.Batches = Batches; + Messages5.BetaToolRunner = BetaToolRunner; + Messages5.ToolError = ToolError; + return Messages5; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +var APIKeys; +var init_api_keys = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs"() { + init_resource(); + init_pagination(); + init_path(); + APIKeys = class extends APIResource { + /** + * Get API Key + * + * @example + * ```ts + * const betaAPIKey = + * await client.beta.organization.apiKeys.retrieve( + * 'api_key_id', + * ); + * ``` + */ + retrieve(apiKeyID, options) { + return this._client.get(path2`/v1/organizations/api_keys/${apiKeyID}?beta=true`, options); + } + /** + * Update API Key + * + * @example + * ```ts + * const betaAPIKey = + * await client.beta.organization.apiKeys.update( + * 'api_key_id', + * ); + * ``` + */ + update(apiKeyID, body, options) { + return this._client.post(path2`/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options }); + } + /** + * List API Keys + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/api_keys?beta=true", Page, { + query, + ...options + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +var ComplianceSettings; +var init_compliance_settings = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs"() { + init_resource(); + ComplianceSettings = class extends APIResource { + /** + * Retrieve your organization's Compliance Settings. + * + * Compliance Settings is a singleton resource: there is exactly one per + * organization, addressed without an identifier. The `state` field reflects + * whether the Compliance API is enabled. An organization with a parent + * organization reads the state inherited from the parent's configuration. + * + * @example + * ```ts + * const betaComplianceSettings = + * await client.beta.organization.complianceSettings.retrieve(); + * ``` + */ + retrieve(options) { + return this._client.get("/v1/organizations/compliance_settings?beta=true", options); + } + /** + * Update your organization's Compliance Settings. + * + * Setting `state` to `enabled` turns on the Compliance API and begins capturing + * organization activity events. Setting it to `disabled` turns both off. `state` + * reflects whether the Compliance API is enabled. + * + * A request that sets `state` to its current value succeeds and leaves the + * resource unchanged. A `disabled` request stays in effect until a later `enabled` + * request or the organization's next provisioning action that enables Access + * Transparency: enabling Access Transparency also enables the Compliance API, + * which serves its activity events, so such provisioning (including re-runs) + * re-enables the Compliance API even after a `disabled` request. Automated + * provisioning never disables compliance settings. + * + * @example + * ```ts + * const betaComplianceSettings = + * await client.beta.organization.complianceSettings.update({ + * state: { type: 'enabled' }, + * }); + * ``` + */ + update(body, options) { + return this._client.post("/v1/organizations/compliance_settings?beta=true", { body, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +var ExternalKeys; +var init_external_keys = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs"() { + init_resource(); + init_pagination(); + init_path(); + ExternalKeys = class extends APIResource { + /** + * Create an external key config owned by the caller's organization. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.create({ + * provider_config: { + * kms_arn: + * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222', + * type: 'aws', + * }, + * }); + * ``` + */ + create(body, options) { + return this._client.post("/v1/organizations/external_keys?beta=true", { body, ...options }); + } + /** + * Retrieve a single external key config in the caller's organization by ID. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.retrieve( + * 'external_key_id', + * ); + * ``` + */ + retrieve(externalKeyID, options) { + return this._client.get(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); + } + /** + * Partially update an external key config. Omitted fields are left unchanged. + * + * `display_name` is always editable. `geo` and `provider_config` cannot be changed + * once any workspace references this config, because previously encrypted data + * requires the original key identity to decrypt. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.update( + * 'external_key_id', + * ); + * ``` + */ + update(externalKeyID, body, options) { + return this._client.post(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, { + body, + ...options + }); + } + /** + * List external key configs in the caller's organization. + * + * Results are ordered by creation time (newest first). Use the `next_page` cursor + * from the response to fetch subsequent pages. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/external_keys?beta=true", PageCursor, { + query, + ...options + }); + } + /** + * Delete an external key config. + * + * The request is rejected if any workspace still references this config. + * + * @example + * ```ts + * const externalKey = + * await client.beta.organization.externalKeys.delete( + * 'external_key_id', + * ); + * ``` + */ + delete(externalKeyID, options) { + return this._client.delete(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); + } + /** + * Validate an external key config against the customer's KMS. + * + * Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key + * and waits up to 30 seconds for the result. The response status is `success` if + * the roundtrip succeeded, or `failure` with an error message if it failed or + * timed out. + * + * @example + * ```ts + * const response = + * await client.beta.organization.externalKeys.validate( + * 'external_key_id', + * ); + * ``` + */ + validate(externalKeyID, options) { + return this._client.post(path2`/v1/organizations/external_keys/${externalKeyID}/validate?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +var Invites; +var init_invites = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Invites = class extends APIResource { + /** + * Invite a user to join the organization by email. + * + * On plans that draw members from a finite pool of purchased seats, the invite + * automatically consumes a seat from the lowest tier with availability; there is + * no seat-tier parameter. When no seat is free the request fails with a 400 error + * rather than purchasing a seat. + * + * @example + * ```ts + * const betaOrganizationInvite = + * await client.beta.organization.invites.create({ + * email: 'user@emaildomain.com', + * role: 'user', + * }); + * ``` + */ + create(body, options) { + return this._client.post("/v1/organizations/invites?beta=true", { body, ...options }); + } + /** + * Retrieve an invite by ID. + * + * @example + * ```ts + * const betaOrganizationInvite = + * await client.beta.organization.invites.retrieve( + * 'invite_id', + * ); + * ``` + */ + retrieve(inviteID, options) { + return this._client.get(path2`/v1/organizations/invites/${inviteID}?beta=true`, options); + } + /** + * List the organization's invites. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationInvite of client.beta.organization.invites.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/invites?beta=true", Page, { + query, + ...options + }); + } + /** + * Delete a pending invite. + * + * @example + * ```ts + * const invite = + * await client.beta.organization.invites.delete( + * 'invite_id', + * ); + * ``` + */ + delete(inviteID, options) { + return this._client.delete(path2`/v1/organizations/invites/${inviteID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +var RateLimits; +var init_rate_limits = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs"() { + init_resource(); + init_pagination(); + RateLimits = class extends APIResource { + /** + * List Messages API rate limits for your organization. + * + * Each entry corresponds to one rate-limit group (either a model family or an + * API-surface category such as the Files API or Message Batches) and contains the + * set of limiter values that apply to it. + * + * When `limit` is omitted, every matching entry is returned in a single page; when + * `limit` truncates the result, follow `next_page` to fetch the remaining entries. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationRateLimit of client.beta.organization.rateLimits.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +var Users; +var init_users = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Users = class extends APIResource { + /** + * Retrieve a member of the organization by user ID. + * + * @example + * ```ts + * const betaOrganizationUser = + * await client.beta.organization.users.retrieve('user_id'); + * ``` + */ + retrieve(userID, options) { + return this._client.get(path2`/v1/organizations/users/${userID}?beta=true`, options); + } + /** + * Update a member's organization role. + * + * @example + * ```ts + * const betaOrganizationUser = + * await client.beta.organization.users.update('user_id', { + * role: 'user', + * }); + * ``` + */ + update(userID, body, options) { + return this._client.post(path2`/v1/organizations/users/${userID}?beta=true`, { body, ...options }); + } + /** + * List the organization's members. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationUser of client.beta.organization.users.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/users?beta=true", Page, { + query, + ...options + }); + } + /** + * Remove a member from the organization. + * + * @example + * ```ts + * const user = await client.beta.organization.users.remove( + * 'user_id', + * ); + * ``` + */ + remove(userID, options) { + return this._client.delete(path2`/v1/organizations/users/${userID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +var Issuers; +var init_issuers = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Issuers = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Register an OIDC issuer that Anthropic will trust for workload identity + * federation in your organization. + * + * The `jwks` field controls how the issuer's signing keys are obtained and takes + * one of three shapes selected by `type`: `discovery` (resolve keys through OIDC + * discovery), `explicit_url` (fetch keys from a fixed JWKS URL), or `inline` + * (provide a static key set). When `jwks.type` is `discovery` and no + * `discovery_base` is set, the issuer URL must be publicly reachable over HTTPS so + * Anthropic can fetch the discovery document; for `explicit_url` and `inline` + * modes the issuer URL is only matched as the JWT's `iss` claim and is not + * fetched. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.create({ + * issuer_url: 'x', + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/federation_issuers?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a federation issuer by its ID (`fdis_...`). + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.retrieve( + * 'federation_issuer_id', + * ); + * ``` + */ + retrieve(federationIssuerID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Partially update a federation issuer. + * + * Setting `jwks` replaces the full JWKS shape at once. Archived issuers cannot be + * updated; this returns 400. Create a new issuer instead. + * + * Updating an issuer that backs a rule with a scope outside `workspace:developer` + * or `workspace:inference` requires a Console session. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.update( + * 'federation_issuer_id', + * ); + * ``` + */ + update(federationIssuerID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List federation issuers in your organization. + * + * Archived issuers are excluded unless `include_archived=true`. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationIssuer of client.beta.organization.federation.issuers.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a federation issuer. + * + * Idempotent; re-archiving returns the issuer with its original `archived_at`. + * Rejected with 400 if any live (non-archived) federation rule still references + * the issuer; archive those rules first (a rule's issuer cannot be changed), or + * recreate them against another issuer. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.archive( + * 'federation_issuer_id', + * ); + * ``` + */ + archive(federationIssuerID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/federation_issuers/${federationIssuerID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +var Workspaces; +var init_workspaces = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Workspaces = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List workspaces where this federation rule is enabled. + * + * Returns all workspace enablements in a single response; the `limit` and `page` + * parameters are accepted but have no effect, and `next_page` is always `null`. + * Returns explicit per-workspace enablements only; for rules with + * `applies_to_all_workspaces` or a legacy single `workspace_id`, check those + * fields on the rule itself. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationRuleWorkspace of client.beta.organization.federation.rules.workspaces.list( + * 'federation_rule_id', + * )) { + * // ... + * } + * ``` + */ + list(federationRuleID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Enable a federation rule for a workspace. + * + * Idempotent; re-enabling returns the existing enablement. The rule and workspace + * must both belong to your organization. Membership of the rule's target service + * account in this workspace is not checked at enablement: token exchange into this + * workspace is rejected unless the target is a member (it is implicitly a member + * of the default workspace). Archived rules are rejected with 400. OAuth callers + * may only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRuleWorkspace = + * await client.beta.organization.federation.rules.workspaces.add( + * 'federation_rule_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + add(federationRuleID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Disable a federation rule for a workspace. + * + * Idempotent; succeeds even if the enablement was already removed. OAuth callers + * may only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const workspace = + * await client.beta.organization.federation.rules.workspaces.remove( + * 'workspace_id', + * { federation_rule_id: 'federation_rule_id' }, + * ); + * ``` + */ + remove(workspaceID, params, options) { + const { federation_rule_id, betas } = params; + return this._client.delete(path2`/v1/organizations/federation_rules/${federation_rule_id}/workspaces/${workspaceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +var Rules; +var init_rules = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs"() { + init_resource(); + init_workspaces(); + init_workspaces(); + init_pagination(); + init_headers(); + init_path(); + Rules = /* @__PURE__ */ (() => { + class Rules2 extends APIResource { + constructor() { + super(...arguments); + this.workspaces = new Workspaces(this._client); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Create a federation rule owned by your organization. + * + * The referenced issuer and the target service account must already exist in the + * same organization; invalid references are rejected with a 400 error. The + * workspace reference is validated. Membership is not checked at rule creation: + * token exchange resolves a single enabled workspace per call and is rejected + * unless the target service account is a member of that workspace (it is + * implicitly a member of the default workspace). Rules on well-known shared + * issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, Google) must + * constrain tenant identity via an identity-bearing claim, a tenant-pinning + * subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition referencing one + * of those identity claims (e.g. `claims.repository_owner`). OAuth callers may + * only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.create({ + * issuer_id: 'issuer_id', + * match: {}, + * name: 'x', + * oauth_scope: 'x', + * target: { + * service_account_id: 'svac_01SDCCSbTxrXDpWc1phhtcfK', + * type: 'service_account', + * }, + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/federation_rules?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a federation rule by its ID (`fdrl_...`). + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.retrieve( + * 'federation_rule_id', + * ); + * ``` + */ + retrieve(federationRuleID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Partially update a federation rule. + * + * `issuer_id` is immutable. `match` and `target` are replaced as whole objects + * when set. Referenced service accounts and workspaces must exist in your + * organization; invalid references are rejected with a 400 error. Archived rules + * cannot be updated; this returns 400. Create a new rule instead. Rules on + * well-known shared issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, + * Google) must constrain tenant identity via an identity-bearing claim, a + * tenant-pinning subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition + * referencing one of those identity claims (e.g. `claims.repository_owner`). On + * these issuers the requirement is re-checked on every update; if an existing + * rule's stored match does not yet constrain tenant identity, any update (even a + * rename or description change) must also supply a conforming `match` in the same + * request. OAuth callers may only manage rules whose `oauth_scope` is + * `workspace:developer` or `workspace:inference`; other scopes require a Console + * session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.update( + * 'federation_rule_id', + * ); + * ``` + */ + update(federationRuleID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List federation rules in your organization. + * + * Optionally filter by issuer with `issuer_id`. Archived rules are excluded unless + * `include_archived=true`. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationRule of client.beta.organization.federation.rules.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/federation_rules?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a federation rule. + * + * Token exchange through this rule stops immediately. Idempotent; re-archiving + * returns the rule with its original `archived_at`. Archiving clears the rule's + * workspace targeting (`workspace_id` and `workspace_ids` are emptied). Tokens + * already minted before archive remain valid until they expire. OAuth callers may + * only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.archive( + * 'federation_rule_id', + * ); + * ``` + */ + archive(federationRuleID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + } + Rules2.Workspaces = Workspaces; + return Rules2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +var Federation; +var init_federation = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs"() { + init_resource(); + init_issuers(); + init_issuers(); + init_rules(); + init_rules(); + Federation = /* @__PURE__ */ (() => { + class Federation2 extends APIResource { + constructor() { + super(...arguments); + this.issuers = new Issuers(this._client); + this.rules = new Rules(this._client); + } + } + Federation2.Issuers = Issuers; + Federation2.Rules = Rules; + return Federation2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +var Workspaces2; +var init_workspaces2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Workspaces2 = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List the workspaces a service account is a member of. + * + * Each entry includes the service account's `workspace_role` in that workspace. + * Use `limit` and the `next_page` cursor to paginate. When the service account has + * no explicit default-workspace membership, the implicit (`implicit: true`) + * membership is returned as the first entry on the first page; with `limit=1` the + * first page may return up to 2 entries (the implicit entry plus one explicit + * membership) so a pagination cursor can be derived. Memberships are returned only + * while the service account is active. Without a `page` cursor, an archived + * service account returns an empty list. A `page` cursor that does not match an + * active membership returns a 400 invalid-request error. A cursor stops matching + * when the membership is removed, the workspace is deleted, or the service account + * is archived. Restart pagination from the first page to recover. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.serviceAccounts.workspaces.list( + * 'service_account_id', + * )) { + * // ... + * } + * ``` + */ + list(serviceAccountID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Add a service account to a workspace with the given `workspace_role`. + * + * Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed from the + * service-account side; both create the same membership. If the service account is + * already an explicit member of the workspace, its `workspace_role` is replaced + * with the value supplied here. Archived workspaces return 400. Archived service + * accounts cannot be added and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.serviceAccounts.workspaces.add( + * 'service_account_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(serviceAccountID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Remove a service account from a workspace. + * + * Mirror of + * `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`, + * addressed from the service-account side. Removal is idempotent (returns 200 even + * if the membership was already removed). A DELETE against the implicit + * default-workspace membership returns 200 but is a no-op and the membership + * persists; deleting an explicit default-workspace row reverts to the implicit + * `workspace_user` membership. Archived workspaces return 400. + * + * @example + * ```ts + * const workspace = + * await client.beta.organization.serviceAccounts.workspaces.remove( + * 'workspace_id', + * { service_account_id: 'service_account_id' }, + * ); + * ``` + */ + remove(workspaceID, params, options) { + const { service_account_id, betas } = params; + return this._client.delete(path2`/v1/organizations/service_accounts/${service_account_id}/workspaces/${workspaceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +var ServiceAccounts; +var init_service_accounts = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs"() { + init_resource(); + init_workspaces2(); + init_workspaces2(); + init_pagination(); + init_headers(); + init_path(); + ServiceAccounts = /* @__PURE__ */ (() => { + class ServiceAccounts4 extends APIResource { + constructor() { + super(...arguments); + this.workspaces = new Workspaces2(this._client); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Create a service account. + * + * A service account is a named workload identity that federation rules target. + * `organization_role` is `developer` (default) or `admin`; a rule may only be + * created or retargeted to grant `org:admin` scope when the target's + * `organization_role` is `admin`. Creating an `admin`-role service account + * requires an interactive credential (a user OAuth token or a Console session) — a + * workload may only create `developer`-role service accounts. + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.create({ + * name: 'ci-deploy-bot', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/service_accounts?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a service account by its ID (`svac_...`). + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.retrieve( + * 'service_account_id', + * ); + * ``` + */ + retrieve(serviceAccountID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Update a service account. + * + * Only `description` and `organization_role` are mutable; `name` cannot be + * changed. Archived service accounts cannot be updated; this returns 400. Setting + * `organization_role` to `admin` (even when unchanged) requires an interactive + * credential (a user OAuth token or a Console session). + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.update( + * 'service_account_id', + * ); + * ``` + */ + update(serviceAccountID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List service accounts in the caller's organization. + * + * Results are ordered by creation time, newest first. Use `limit` and the + * `next_page` cursor to paginate; set `include_archived=true` to include archived + * service accounts. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/service_accounts?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a service account. + * + * Idempotent; re-archiving returns the service account with its original + * `archived_at`. Rejected with 400 if any live (non-archived) federation rule + * still targets this service account, same as issuer archival; archive those rules + * first or change their target to another service account. + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.archive( + * 'service_account_id', + * ); + * ``` + */ + archive(serviceAccountID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + } + ServiceAccounts4.Workspaces = Workspaces2; + return ServiceAccounts4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +var Members; +var init_members = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Members = class extends APIResource { + /** + * Get Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.retrieve( + * 'user_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + retrieve(userID, params, options) { + const { workspace_id } = params; + return this._client.get(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); + } + /** + * Update Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.update( + * 'user_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + update(userID, params, options) { + const { workspace_id, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, { + body, + ...options + }); + } + /** + * List Workspace Members + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspaceMember of client.beta.organization.workspaces.members.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, query = {}, options) { + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page, { query, ...options }); + } + /** + * Create Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.add( + * 'workspace_id', + * { + * user_id: 'user_01WCz1FkmYMm4gnmykNKUu3Q', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(workspaceID, body, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, { + body, + ...options + }); + } + /** + * Delete Workspace Member + * + * @example + * ```ts + * const member = + * await client.beta.organization.workspaces.members.remove( + * 'user_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + remove(userID, params, options) { + const { workspace_id } = params; + return this._client.delete(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +var RateLimits2; +var init_rate_limits2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs"() { + init_resource(); + init_pagination(); + init_path(); + RateLimits2 = class extends APIResource { + /** + * List a workspace's rate limits. + * + * By default, returns only the groups and limiter types that have a + * workspace-level override. With `include_inherited=true`, returns every group + * with organization-level limits the workspace can see, listing for each the + * values it inherits from the organization as well as its own overrides. Each + * value's `source` says which it is. + * + * When `limit` is omitted, every matching entry is returned in a single page; when + * `limit` truncates the result, follow `next_page` to fetch the remaining entries. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspaceRateLimit of client.beta.organization.workspaces.rateLimits.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, query = {}, options) { + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +var ServiceAccounts2; +var init_service_accounts2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + ServiceAccounts2 = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a service account's membership in a workspace. + * + * Returns the membership record, including the service account's `workspace_role` + * in this workspace. Archived workspaces return 400. For the default workspace, + * returns the implicit (`implicit: true`) membership when no explicit membership + * exists; an explicitly added membership is returned with its assigned role. An + * archived service account returns 404. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.retrieve( + * 'service_account_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + retrieve(serviceAccountID, params, options) { + const { workspace_id, betas } = params; + return this._client.get(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Change a service account's role in a workspace. + * + * The new `workspace_role` replaces the current one. Only explicit memberships can + * be updated; to set a role on the implicit default-workspace membership, add the + * service account explicitly with + * `POST /workspaces/{workspace_id}/service_accounts`. Archived workspaces + * return 400. Archived service accounts cannot be updated and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.update( + * 'service_account_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + update(serviceAccountID, params, options) { + const { workspace_id, betas, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List the service accounts that are members of a workspace. + * + * Each entry includes the service account's `workspace_role`. Use `limit` and the + * `next_page` cursor to paginate. Archived workspaces return 400; use + * `GET /service_accounts/{id}/workspaces` to audit memberships of an archived + * workspace. The implicit default-workspace membership is not included in this + * list. Memberships of archived service accounts are omitted from the results. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.workspaces.serviceAccounts.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Add a service account to a workspace with the given `workspace_role`. + * + * The role determines what the service account can do in the workspace and which + * workspace-scoped permissions it can be granted when authenticating through + * federation. Every service account is already an implicit `workspace_user` member + * of the default workspace; adding it explicitly assigns a chosen role. If the + * service account is already an explicit member of the workspace, its + * `workspace_role` is replaced with the value supplied here. Archived workspaces + * return 400. Archived service accounts cannot be added and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.add( + * 'workspace_id', + * { + * service_account_id: 'service_account_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(workspaceID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Remove a service account from a workspace. + * + * Removal is idempotent (returns 200 even if the membership was already removed). + * A DELETE against the implicit default-workspace membership returns 200 but is a + * no-op and the membership persists; deleting an explicit default-workspace row + * reverts to the implicit `workspace_user` membership. Archived workspaces + * return 400. + * + * @example + * ```ts + * const serviceAccount = + * await client.beta.organization.workspaces.serviceAccounts.remove( + * 'service_account_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + remove(serviceAccountID, params, options) { + const { workspace_id, betas } = params; + return this._client.delete(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +var Workspaces3; +var init_workspaces3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs"() { + init_resource(); + init_members(); + init_members(); + init_rate_limits2(); + init_rate_limits2(); + init_service_accounts2(); + init_service_accounts2(); + init_pagination(); + init_headers(); + init_path(); + Workspaces3 = /* @__PURE__ */ (() => { + class Workspaces4 extends APIResource { + constructor() { + super(...arguments); + this.rateLimits = new RateLimits2(this._client); + this.members = new Members(this._client); + this.serviceAccounts = new ServiceAccounts2(this._client); + } + /** + * Create Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.create({ + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/workspaces?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * Get Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.retrieve( + * 'workspace_id', + * ); + * ``` + */ + retrieve(workspaceID, options) { + return this._client.get(path2`/v1/organizations/workspaces/${workspaceID}?beta=true`, options); + } + /** + * Update Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.update( + * 'workspace_id', + * ); + * ``` + */ + update(workspaceID, body, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}?beta=true`, { + body, + ...options + }); + } + /** + * List Workspaces + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspace of client.beta.organization.workspaces.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/workspaces?beta=true", Page, { + query, + ...options + }); + } + /** + * Archive Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.archive( + * 'workspace_id', + * ); + * ``` + */ + archive(workspaceID, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/archive?beta=true`, options); + } + } + Workspaces4.RateLimits = RateLimits2; + Workspaces4.Members = Members; + Workspaces4.ServiceAccounts = ServiceAccounts2; + return Workspaces4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +var Organization; +var init_organization = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs"() { + init_resource(); + init_api_keys(); + init_api_keys(); + init_compliance_settings(); + init_compliance_settings(); + init_external_keys(); + init_external_keys(); + init_invites(); + init_invites(); + init_rate_limits(); + init_rate_limits(); + init_users(); + init_users(); + init_federation(); + init_federation(); + init_service_accounts(); + init_service_accounts(); + init_workspaces3(); + init_workspaces3(); + Organization = /* @__PURE__ */ (() => { + class Organization3 extends APIResource { + constructor() { + super(...arguments); + this.apiKeys = new APIKeys(this._client); + this.externalKeys = new ExternalKeys(this._client); + this.federation = new Federation(this._client); + this.invites = new Invites(this._client); + this.serviceAccounts = new ServiceAccounts(this._client); + this.users = new Users(this._client); + this.workspaces = new Workspaces3(this._client); + this.rateLimits = new RateLimits(this._client); + this.complianceSettings = new ComplianceSettings(this._client); + } + /** + * Retrieve information about the organization associated with the authenticated + * API key. + * + * @example + * ```ts + * const betaOrganization = + * await client.beta.organization.retrieve(); + * ``` + */ + retrieve(options) { + return this._client.get("/v1/organizations/me?beta=true", options); + } + } + Organization3.APIKeys = APIKeys; + Organization3.ExternalKeys = ExternalKeys; + Organization3.Federation = Federation; + Organization3.Invites = Invites; + Organization3.ServiceAccounts = ServiceAccounts; + Organization3.Users = Users; + Organization3.Workspaces = Workspaces3; + Organization3.RateLimits = RateLimits; + Organization3.ComplianceSettings = ComplianceSettings; + return Organization3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +var Events; +var init_events = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + init_SessionToolRunner(); + Events = /* @__PURE__ */ (() => { + class Events4 extends APIResource { + /** + * List Events + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.events.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Send Events + * + * @example + * ```ts + * const betaManagedAgentsSendSessionEvents = + * await client.beta.sessions.events.send( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * { + * events: [ + * { + * content: [ + * { + * text: 'Where is my order #1234?', + * type: 'text', + * }, + * ], + * type: 'user.message', + * }, + * ], + * }, + * ); + * ``` + */ + send(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}/events?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stream Events + * + * @example + * ```ts + * const betaManagedAgentsStreamSessionEvents = + * await client.beta.sessions.events.stream( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + stream(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.get(path2`/v1/sessions/${sessionID}/events/stream?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true + }); + } + /** + * Attach to a session and dispatch every incoming `agent.tool_use` and + * `agent.custom_tool_use` event to a local tool registry, sending the matching + * result back (`user.tool_result` / `user.custom_tool_result`). The + * sessions-side counterpart to `client.beta.messages.toolRunner`: yields one + * entry per completed tool call so callers can observe each dispatch (and + * `break` to abort cleanly). + * + * @example + * ```ts + * import { betaAgentToolset20260401 } from '@anthropic-ai/sdk/tools/agent-toolset/node'; + * + * for await (const call of client.beta.sessions.events.toolRunner(work.data.id, { + * tools: [...betaAgentToolset20260401({ workdir }), myTool], + * })) { + * console.log(`${call.name} -> ${call.isError ? 'error' : 'ok'}`); + * } + * ``` + */ + toolRunner(sessionID, opts) { + return new SessionToolRunner(sessionID, { ...opts, client: this._client }); + } + } + Events4.SessionToolRunner = SessionToolRunner; + return Events4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs +var Resources; +var init_resources = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Resources = class extends APIResource { + /** + * Get Session Resource + * + * @example + * ```ts + * const resource = + * await client.beta.sessions.resources.retrieve( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + retrieve(resourceID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Session Resource + * + * @example + * ```ts + * const resource = + * await client.beta.sessions.resources.update( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { + * session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * authorization_token: 'ghp_exampletoken', + * }, + * ); + * ``` + */ + update(resourceID, params, options) { + const { session_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Session Resources + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionResource of client.beta.sessions.resources.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Session Resource + * + * @example + * ```ts + * const betaManagedAgentsDeleteSessionResource = + * await client.beta.sessions.resources.delete( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + delete(resourceID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Add Session Resource + * + * @example + * ```ts + * const betaManagedAgentsFileResource = + * await client.beta.sessions.resources.add( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * { + * file_id: 'file_011CNha8iCJcU1wXNR6q4V8w', + * type: 'file', + * }, + * ); + * ``` + */ + add(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}/resources?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +var Events2; +var init_events2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Events2 = class extends APIResource { + /** + * List Session Thread Events + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.threads.events.list( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * )) { + * // ... + * } + * ``` + */ + list(threadID, params, options) { + const { session_id, betas, workspace_id, ...query } = params; + return this._client.getAPIList(path2`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stream Session Thread Events + * + * @example + * ```ts + * const betaManagedAgentsStreamSessionThreadEvents = + * await client.beta.sessions.threads.events.stream( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + stream(threadID, params, options) { + const { session_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +var Threads; +var init_threads = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs"() { + init_resource(); + init_events2(); + init_events2(); + init_pagination(); + init_headers(); + init_path(); + Threads = /* @__PURE__ */ (() => { + class Threads4 extends APIResource { + constructor() { + super(...arguments); + this.events = new Events2(this._client); + } + /** + * Get Session Thread + * + * @example + * ```ts + * const betaManagedAgentsSessionThread = + * await client.beta.sessions.threads.retrieve( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + retrieve(threadID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Session Threads + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionThread of client.beta.sessions.threads.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Session Thread + * + * @example + * ```ts + * const betaManagedAgentsSessionThread = + * await client.beta.sessions.threads.archive( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + archive(threadID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Threads4.Events = Events2; + return Threads4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +var Sessions; +var init_sessions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs"() { + init_resource(); + init_events(); + init_events(); + init_resources(); + init_resources(); + init_threads(); + init_threads(); + init_pagination(); + init_headers(); + init_path(); + Sessions = /* @__PURE__ */ (() => { + class Sessions6 extends APIResource { + constructor() { + super(...arguments); + this.events = new Events(this._client); + this.resources = new Resources(this._client); + this.threads = new Threads(this._client); + } + /** + * Create Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.create({ + * agent: 'agent_011CZkYpogX7uDKUyvBTophP', + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/sessions?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.retrieve( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + retrieve(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/sessions/${sessionID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.update( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + update(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Sessions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSession of client.beta.sessions.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/sessions?beta=true", BidirectionalPageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Session + * + * @example + * ```ts + * const betaManagedAgentsDeletedSession = + * await client.beta.sessions.delete( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + delete(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/sessions/${sessionID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.archive( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + archive(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/sessions/${sessionID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Sessions6.Events = Events; + Sessions6.Resources = Resources; + Sessions6.Threads = Threads; + return Sessions6; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +var Versions2; +var init_versions2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Versions2 = class extends APIResource { + /** + * Create Skill Version + * + * @example + * ```ts + * const betaSkillVersion = + * await client.beta.skills.versions.create('skill_id', { + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(skillID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill Version + * + * @example + * ```ts + * const betaSkillVersion = + * await client.beta.skills.versions.retrieve('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + retrieve(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Skill Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSkillVersion of client.beta.skills.versions.list( + * 'skill_id', + * )) { + * // ... + * } + * ``` + */ + list(skillID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/skills/${skillID}/versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Skill Version + * + * @example + * ```ts + * const betaDeletedSkillVersion = + * await client.beta.skills.versions.delete('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + delete(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/skills/${skill_id}/versions/${version}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Download a skill version's content as a zip archive. + * + * @example + * ```ts + * const response = await client.beta.skills.versions.download( + * 'version', + * { skill_id: 'skill_id' }, + * ); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}/content?beta=true`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +var Skills; +var init_skills = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs"() { + init_resource(); + init_versions2(); + init_versions2(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Skills = /* @__PURE__ */ (() => { + class Skills4 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions2(this._client); + } + /** + * Create Skill + * + * @example + * ```ts + * const betaSkill = await client.beta.skills.create({ + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/skills?beta=true", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill + * + * @example + * ```ts + * const betaSkill = await client.beta.skills.retrieve( + * 'skill_id', + * ); + * ``` + */ + retrieve(skillID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/skills/${skillID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Skills + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSkill of client.beta.skills.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/skills?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Skill + * + * @example + * ```ts + * const betaDeletedSkill = await client.beta.skills.delete( + * 'skill_id', + * ); + * ``` + */ + delete(skillID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/skills/${skillID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Skills4.Versions = Versions2; + return Skills4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +var Certificates; +var init_certificates = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Certificates = class extends APIResource { + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's + * server certificate against this CA when it terminates the inner TLS session. A + * tunnel holds at most two non-archived certificates. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.create( + * 'tunnel_id', + * { ca_certificate_pem: 'ca_certificate_pem' }, + * ); + * ``` + */ + create(tunnelID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/tunnels/${tunnelID}/certificates?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Fetches a tunnel certificate by ID. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.retrieve( + * 'certificate_id', + * { tunnel_id: 'tunnel_id' }, + * ); + * ``` + */ + retrieve(certificateID, params, options) { + const { tunnel_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/tunnels/${tunnel_id}/certificates/${certificateID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Lists the certificates registered on a tunnel. Archived certificates are + * excluded unless include_archived is set. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaTunnelCertificate of client.beta.tunnels.certificates.list( + * 'tunnel_id', + * )) { + * // ... + * } + * ``` + */ + list(tunnelID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/tunnels/${tunnelID}/certificates?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Archives a tunnel certificate, removing it from the set Anthropic trusts for the + * tunnel. The certificate record is retained. Archiving the last non-archived + * certificate is permitted; the tunnel rejects MCP traffic until a new certificate + * is added. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.archive( + * 'certificate_id', + * { tunnel_id: 'tunnel_id' }, + * ); + * ``` + */ + archive(certificateID, params, options) { + const { tunnel_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/tunnels/${tunnel_id}/certificates/${certificateID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +var Tunnels; +var init_tunnels = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs"() { + init_resource(); + init_certificates(); + init_certificates(); + init_pagination(); + init_headers(); + init_path(); + Tunnels = /* @__PURE__ */ (() => { + class Tunnels2 extends APIResource { + constructor() { + super(...arguments); + this.certificates = new Certificates(this._client); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; + * it is not idempotent. The new tunnel rejects MCP traffic until at least one CA + * certificate is added. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.create(); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/tunnels?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Fetches a tunnel by ID. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.retrieve( + * 'tunnel_id', + * ); + * ``` + */ + retrieve(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/tunnels/${tunnelID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Lists tunnels. Results are ordered by creation time, newest first; archived + * tunnels are excluded unless include_archived is set. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaTunnel of client.beta.tunnels.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/tunnels?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Archives a tunnel. Archival is irreversible: every non-archived certificate on + * the tunnel is archived in the same operation, the hostname is retired and never + * re-allocated, and the tunnel token is invalidated. Retrying against an + * already-archived tunnel returns the existing record unchanged. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.archive( + * 'tunnel_id', + * ); + * ``` + */ + archive(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/tunnels/${tunnelID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Reveals a tunnel's connector token. The value is fetched live on each call; + * Anthropic does not store it. Repeated calls return the same value until the + * token is rotated. Exposed as POST so the token does not appear in intermediary + * access logs. + * + * @example + * ```ts + * const betaTunnelToken = + * await client.beta.tunnels.revealToken('tunnel_id'); + * ``` + */ + revealToken(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/tunnels/${tunnelID}/reveal_token?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Rotates a tunnel's connector token. Rotation invalidates the current token for + * new connections and returns a fresh value; established connections are not + * severed. A connector restarted after rotation must use the new value. + * + * @example + * ```ts + * const betaTunnelToken = + * await client.beta.tunnels.rotateToken('tunnel_id'); + * ``` + */ + rotateToken(tunnelID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/tunnels/${tunnelID}/rotate_token?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Tunnels2.Certificates = Certificates; + return Tunnels2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +var Credentials; +var init_credentials2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Credentials = class extends APIResource { + /** + * Create Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.create( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * { + * auth: { + * token: 'bearer_exampletoken', + * mcp_server_url: + * 'https://example-server.modelcontextprotocol.io/sse', + * type: 'static_bearer', + * }, + * }, + * ); + * ``` + */ + create(vaultID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vaultID}/credentials?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.retrieve( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + retrieve(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.update( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + update(credentialID, params, options) { + const { vault_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Credentials + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * )) { + * // ... + * } + * ``` + */ + list(vaultID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Credential + * + * @example + * ```ts + * const betaManagedAgentsDeletedCredential = + * await client.beta.vaults.credentials.delete( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + delete(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.archive( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + archive(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Validate Credential + * + * @example + * ```ts + * const betaManagedAgentsCredentialValidation = + * await client.beta.vaults.credentials.mcpOAuthValidate( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + mcpOAuthValidate(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs +var Vaults; +var init_vaults = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs"() { + init_resource(); + init_credentials2(); + init_credentials2(); + init_pagination(); + init_headers(); + init_path(); + Vaults = /* @__PURE__ */ (() => { + class Vaults3 extends APIResource { + constructor() { + super(...arguments); + this.credentials = new Credentials(this._client); + } + /** + * Create Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.create({ + * display_name: 'Example vault', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/vaults?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.retrieve( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + retrieve(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/vaults/${vaultID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.update( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + update(vaultID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vaultID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Vaults + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsVault of client.beta.vaults.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/vaults?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Vault + * + * @example + * ```ts + * const betaManagedAgentsDeletedVault = + * await client.beta.vaults.delete( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + delete(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/vaults/${vaultID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.archive( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + archive(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/vaults/${vaultID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Vaults3.Credentials = Credentials; + return Vaults3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +var Beta; +var init_beta = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs"() { + init_resource(); + init_deployment_runs(); + init_deployment_runs(); + init_deployments(); + init_deployments(); + init_dreams(); + init_dreams(); + init_files(); + init_files(); + init_models2(); + init_models2(); + init_user_profiles(); + init_user_profiles(); + init_webhooks(); + init_webhooks(); + init_agents(); + init_agents(); + init_environments(); + init_environments(); + init_memory_stores(); + init_memory_stores(); + init_messages(); + init_messages(); + init_organization(); + init_organization(); + init_sessions(); + init_sessions(); + init_skills(); + init_skills(); + init_tunnels(); + init_tunnels(); + init_vaults(); + init_vaults(); + Beta = /* @__PURE__ */ (() => { + class Beta3 extends APIResource { + constructor() { + super(...arguments); + this.models = new Models(this._client); + this.messages = new Messages(this._client); + this.agents = new Agents(this._client); + this.environments = new Environments(this._client); + this.sessions = new Sessions(this._client); + this.deployments = new Deployments(this._client); + this.deploymentRuns = new DeploymentRuns(this._client); + this.vaults = new Vaults(this._client); + this.memoryStores = new MemoryStores(this._client); + this.files = new Files(this._client); + this.skills = new Skills(this._client); + this.webhooks = new Webhooks(this._client); + this.userProfiles = new UserProfiles(this._client); + this.dreams = new Dreams(this._client); + this.tunnels = new Tunnels(this._client); + this.organization = new Organization(this._client); + } + } + Beta3.Models = Models; + Beta3.Messages = Messages; + Beta3.Agents = Agents; + Beta3.Environments = Environments; + Beta3.Sessions = Sessions; + Beta3.Deployments = Deployments; + Beta3.DeploymentRuns = DeploymentRuns; + Beta3.Vaults = Vaults; + Beta3.MemoryStores = MemoryStores; + Beta3.Files = Files; + Beta3.Skills = Skills; + Beta3.Webhooks = Webhooks; + Beta3.UserProfiles = UserProfiles; + Beta3.Dreams = Dreams; + Beta3.Tunnels = Tunnels; + Beta3.Organization = Organization; + return Beta3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/completions.mjs +var Completions; +var init_completions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/completions.mjs"() { + init_resource(); + init_headers(); + Completions = class extends APIResource { + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/complete", { + body, + timeout: this._client._options.timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: params.stream ?? false + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/files.mjs +var Files2; +var init_files2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/files.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_stainless_helper_header(); + init_uploads(); + init_path(); + Files2 = class extends APIResource { + /** + * List Files + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const fileMetadata of client.files.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/files", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete File + * + * @example + * ```ts + * const deletedFile = await client.files.delete('file_id'); + * ``` + */ + delete(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/files/${fileID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Download File + * + * @example + * ```ts + * const response = await client.files.download('file_id'); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}/content`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + /** + * Get File Metadata + * + * @example + * ```ts + * const fileMetadata = await client.files.retrieveMetadata( + * 'file_id', + * ); + * ``` + */ + retrieveMetadata(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Upload File + * + * @example + * ```ts + * const fileMetadata = await client.files.upload({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + upload(params, options) { + const { workspace_id, ...body } = params; + return this._client.post("/v1/files", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + stainlessHelperHeaderFromFile(body.file), + options?.headers + ]) + }, this._client)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/parser.mjs +function getOutputFormat2(params) { + return params?.output_config?.format; +} +function maybeParseMessage(message, params, opts) { + const outputFormat = getOutputFormat2(params); + if (!params || !("parse" in (outputFormat ?? {}))) { + return { + ...message, + content: message.content.map((block) => { + if (block.type === "text") { + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: null, + enumerable: false + }); + return parsedBlock; + } + return block; + }), + parsed_output: null + }; + } + return parseMessage(message, params, opts); +} +function parseMessage(message, params, opts) { + let firstParsedOutput = null; + const content = message.content.map((block) => { + if (block.type === "text") { + const parsedOutput = parseOutputFormat(params, block.text); + if (firstParsedOutput === null) { + firstParsedOutput = parsedOutput; + } + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: parsedOutput, + enumerable: false + }); + return parsedBlock; + } + return block; + }); + return { + ...message, + content, + parsed_output: firstParsedOutput + }; +} +function parseOutputFormat(params, content) { + const outputFormat = getOutputFormat2(params); + if (outputFormat?.type !== "json_schema") { + return null; + } + try { + if ("parse" in outputFormat) { + return outputFormat.parse(content); + } + return JSON.parse(content); + } catch (error) { + throw new AnthropicError(`Failed to parse structured output: ${error}`); + } +} +var init_parser2 = __esm({ + "node_modules/@anthropic-ai/sdk/lib/parser.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +function tracksToolInput2(content) { + return content.type === "tool_use" || content.type === "server_tool_use"; +} +var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_params, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_workspace_id, _MessageStream_logger, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage, MessageStream; +var init_MessageStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_errors(); + init_values(); + init_error2(); + init_streaming2(); + init_parser2(); + init_message_stream_utils(); + MessageStream = /* @__PURE__ */ (() => { + class MessageStream2 { + constructor(params, opts) { + _MessageStream_instances.add(this); + this.messages = []; + this.receivedMessages = []; + _MessageStream_currentMessageSnapshot.set(this, void 0); + _MessageStream_params.set(this, null); + this.controller = new AbortController(); + _MessageStream_connectedPromise.set(this, void 0); + _MessageStream_resolveConnectedPromise.set(this, () => { + }); + _MessageStream_rejectConnectedPromise.set(this, () => { + }); + _MessageStream_endPromise.set(this, void 0); + _MessageStream_resolveEndPromise.set(this, () => { + }); + _MessageStream_rejectEndPromise.set(this, () => { + }); + _MessageStream_listeners.set(this, {}); + _MessageStream_ended.set(this, false); + _MessageStream_errored.set(this, false); + _MessageStream_aborted.set(this, false); + _MessageStream_catchingPromiseCreated.set(this, false); + _MessageStream_response.set(this, void 0); + _MessageStream_request_id.set(this, void 0); + _MessageStream_workspace_id.set(this, void 0); + _MessageStream_logger.set(this, void 0); + _MessageStream_handleError.set(this, (error) => { + __classPrivateFieldSet(this, _MessageStream_errored, true, "f"); + if (isAbortError(error)) { + error = new APIUserAbortError(); + } + if (error instanceof APIUserAbortError) { + __classPrivateFieldSet(this, _MessageStream_aborted, true, "f"); + return this._emit("abort", error); + } + if (error instanceof AnthropicError) { + return this._emit("error", error); + } + if (error instanceof Error) { + const anthropicError = new AnthropicError(error.message); + anthropicError.cause = error; + return this._emit("error", anthropicError); + } + return this._emit("error", new AnthropicError(String(error))); + }); + __classPrivateFieldSet(this, _MessageStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet(this, _MessageStream_rejectConnectedPromise, reject2, "f"); + }), "f"); + __classPrivateFieldSet(this, _MessageStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet(this, _MessageStream_rejectEndPromise, reject2, "f"); + }), "f"); + __classPrivateFieldGet(this, _MessageStream_connectedPromise, "f").catch(() => { + }); + __classPrivateFieldGet(this, _MessageStream_endPromise, "f").catch(() => { + }); + __classPrivateFieldSet(this, _MessageStream_params, params, "f"); + __classPrivateFieldSet(this, _MessageStream_logger, opts?.logger ?? console, "f"); + } + get response() { + return __classPrivateFieldGet(this, _MessageStream_response, "f"); + } + get request_id() { + return __classPrivateFieldGet(this, _MessageStream_request_id, "f"); + } + get workspace_id() { + return __classPrivateFieldGet(this, _MessageStream_workspace_id, "f"); + } + /** + * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, + * returned vie the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * This is the same as the `APIPromise.withResponse()` method. + * + * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` + * as no `Response` is available. + */ + async withResponse() { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + const response = await __classPrivateFieldGet(this, _MessageStream_connectedPromise, "f"); + if (!response) { + throw new Error("Could not resolve a `Response` object"); + } + return { + data: this, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + /** + * Intended for use on the frontend, consuming a stream produced with + * `.toReadableStream()` on the backend. + * + * Note that messages sent to the model do not appear in `.on('message')` + * in this context. + */ + static fromReadableStream(stream5) { + const runner = new MessageStream2(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; + } + static createMessage(messages, params, options, { logger } = {}) { + const runner = new MessageStream2(params, { logger }); + for (const message of params.messages) { + runner._addMessageParam(message); + } + __classPrivateFieldSet(runner, _MessageStream_params, { ...params, stream: true }, "f"); + runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return runner; + } + _run(executor) { + executor().then(() => { + this._emitFinal(); + this._emit("end"); + }, __classPrivateFieldGet(this, _MessageStream_handleError, "f")); + } + _addMessageParam(message) { + this.messages.push(message); + } + _addMessage(message, emit2 = true) { + this.receivedMessages.push(message); + if (emit2) { + this._emit("message", message); + } + } + async _createMessage(messages, params, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + const { response, data: stream5 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); + this._connected(response); + for await (const event of stream5) { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + _connected(response) { + if (this.ended) + return; + __classPrivateFieldSet(this, _MessageStream_response, response, "f"); + __classPrivateFieldSet(this, _MessageStream_request_id, response?.headers.get("request-id"), "f"); + __classPrivateFieldSet(this, _MessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); + __classPrivateFieldGet(this, _MessageStream_resolveConnectedPromise, "f").call(this, response); + this._emit("connect"); + } + get ended() { + return __classPrivateFieldGet(this, _MessageStream_ended, "f"); + } + get errored() { + return __classPrivateFieldGet(this, _MessageStream_errored, "f"); + } + get aborted() { + return __classPrivateFieldGet(this, _MessageStream_aborted, "f"); + } + abort() { + this.controller.abort(); + } + /** + * Adds the listener function to the end of the listeners array for the event. + * No checks are made to see if the listener has already been added. Multiple calls passing + * the same combination of event and listener will result in the listener being added, and + * called, multiple times. + * @returns this MessageStream, so that calls can be chained + */ + on(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + listeners.push({ listener }); + return this; + } + /** + * Removes the specified listener from the listener array for the event. + * off() will remove, at most, one instance of a listener from the listener array. If any single + * listener has been added multiple times to the listener array for the specified event, then + * off() must be called multiple times to remove each instance. + * @returns this MessageStream, so that calls can be chained + */ + off(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + if (!listeners) + return this; + const index = listeners.findIndex((l) => l.listener === listener); + if (index >= 0) + listeners.splice(index, 1); + return this; + } + /** + * Adds a one-time listener function for the event. The next time the event is triggered, + * this listener is removed and then invoked. + * @returns this MessageStream, so that calls can be chained + */ + once(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + listeners.push({ listener, once: true }); + return this; + } + /** + * This is similar to `.once()`, but returns a Promise that resolves the next time + * the event is triggered, instead of calling a listener callback. + * @returns a Promise that resolves the next time given event is triggered, + * or rejects if an error is emitted. (If you request the 'error' event, + * returns a promise that resolves with the error). + * + * Example: + * + * const message = await stream.emitted('message') // rejects if the stream errors + */ + emitted(event) { + return new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + if (event !== "error") + this.once("error", reject2); + this.once(event, resolve2); + }); + } + async done() { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet(this, _MessageStream_endPromise, "f"); + } + get currentMessage() { + return __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + } + /** + * @returns a promise that resolves with the the final assistant Message response, + * or rejects if an error occurred or the stream ended prematurely without producing a Message. + * If structured outputs were used, this will be a ParsedMessage with a `parsed_output` field. + */ + async finalMessage() { + await this.done(); + return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); + } + /** + * @returns a promise that resolves with the the final assistant Message's text response, concatenated + * together if there are more than one text blocks. + * Rejects if an error occurred or the stream ended prematurely without producing a Message. + */ + async finalText() { + await this.done(); + return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); + } + _emit(event, ...args) { + if (__classPrivateFieldGet(this, _MessageStream_ended, "f")) + return; + if (event === "end") { + __classPrivateFieldSet(this, _MessageStream_ended, true, "f"); + __classPrivateFieldGet(this, _MessageStream_resolveEndPromise, "f").call(this); + } + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + if (listeners) { + __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); + listeners.forEach(({ listener }) => listener(...args)); + } + if (event === "abort") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + return; + } + if (event === "error") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + } + } + _emitFinal() { + const finalMessage = this.receivedMessages.at(-1); + if (finalMessage) { + this._emit("finalMessage", __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); + } + } + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + this._connected(null); + const stream5 = Stream.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + [(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_params = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_response = /* @__PURE__ */ new WeakMap(), _MessageStream_request_id = /* @__PURE__ */ new WeakMap(), _MessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _MessageStream_logger = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + return this.receivedMessages.at(-1); + }, _MessageStream_getFinalText = function _MessageStream_getFinalText2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); + if (textBlocks.length === 0) { + throw new AnthropicError("stream ended without producing a content block with type=text"); + } + return textBlocks.join(" "); + }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { + if (this.ended) + return; + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { + if (this.ended) + return; + const messageSnapshot = __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); + this._emit("streamEvent", event, messageSnapshot); + switch (event.type) { + case "content_block_delta": { + const content = messageSnapshot.content.at(-1); + switch (event.delta.type) { + case "text_delta": { + if (content.type === "text") { + this._emit("text", event.delta.text, content.text || ""); + } + break; + } + case "citations_delta": { + if (content.type === "text") { + this._emit("citation", event.delta.citation, content.citations ?? []); + } + break; + } + case "input_json_delta": { + if (tracksToolInput2(content) && __classPrivateFieldGet(this, _MessageStream_listeners, "f").inputJson?.length) { + this._emit("inputJson", event.delta.partial_json, content.input); + } + break; + } + case "thinking_delta": { + if (content.type === "thinking") { + this._emit("thinking", event.delta.thinking, content.thinking); + } + break; + } + case "signature_delta": { + if (content.type === "thinking") { + this._emit("signature", content.signature); + } + break; + } + default: + checkNever(event.delta); + } + break; + } + case "message_stop": { + this._addMessageParam(messageSnapshot); + this._addMessage(maybeParseMessage(messageSnapshot, __classPrivateFieldGet(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, "f") }), true); + break; + } + case "content_block_stop": { + this._emit("contentBlock", messageSnapshot.content.at(-1)); + break; + } + case "message_start": { + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); + break; + } + case "content_block_start": + case "message_delta": + break; + } + }, _MessageStream_endRequest = function _MessageStream_endRequest2() { + if (this.ended) { + throw new AnthropicError(`stream has ended, this shouldn't happen`); + } + const snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + if (!snapshot) { + throw new AnthropicError(`request ended without sending any chunks`); + } + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + return maybeParseMessage(snapshot, __classPrivateFieldGet(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, "f") }); + }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { + let snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + if (event.type === "message_start") { + if (snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); + } + return event.message; + } + if (!snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); + } + switch (event.type) { + case "message_stop": + return snapshot; + case "message_delta": + snapshot.stop_reason = event.delta.stop_reason; + snapshot.stop_sequence = event.delta.stop_sequence; + snapshot.stop_details = event.delta.stop_details; + snapshot.usage.output_tokens = event.usage.output_tokens; + if (event.delta.container != null) { + snapshot.container = event.delta.container; + } + if (event.usage.input_tokens != null) { + snapshot.usage.input_tokens = event.usage.input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; + } + if (event.usage.server_tool_use != null) { + snapshot.usage.server_tool_use = event.usage.server_tool_use; + } + if (event.usage.output_tokens_details != null) { + snapshot.usage.output_tokens_details = event.usage.output_tokens_details; + } + return snapshot; + case "content_block_start": + snapshot.content.push({ ...event.content_block }); + return snapshot; + case "content_block_delta": { + const snapshotContent = snapshot.content.at(event.index); + switch (event.delta.type) { + case "text_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + text: (snapshotContent.text || "") + event.delta.text + }; + } + break; + } + case "citations_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + citations: [...snapshotContent.citations ?? [], event.delta.citation] + }; + } + break; + } + case "input_json_delta": { + if (snapshotContent && tracksToolInput2(snapshotContent)) { + const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; + snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); + } + break; + } + case "thinking_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + thinking: snapshotContent.thinking + event.delta.thinking + }; + } + break; + } + case "signature_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + signature: event.delta.signature + }; + } + break; + } + default: + checkNever(event.delta); + } + return snapshot; + } + case "content_block_stop": { + const snapshotContent = snapshot.content.at(event.index); + if (snapshotContent && tracksToolInput2(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { + Object.defineProperty(snapshotContent, "input", { + value: snapshotContent.input, + enumerable: true, + configurable: true, + writable: true + }); + } + return snapshot; + } + } + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("streamEvent", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); + } else { + pushQueue.push(event); + } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; + } + toReadableStream() { + const stream5 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); + } + } + return MessageStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +var Batches2; +var init_batches2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_jsonl(); + init_error2(); + init_path(); + Batches2 = class extends APIResource { + /** + * Send a batch of Message creation requests. + * + * The Message Batches API can be used to process multiple Messages API requests at + * once. Once a Message Batch is created, it begins processing immediately. Batches + * can take up to 24 hours to complete. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.create({ + * requests: [ + * { + * custom_id: 'my-custom-id-1', + * params: { + * max_tokens: 1024, + * messages: [ + * { content: 'Hello, world', role: 'user' }, + * ], + * model: 'claude-opus-5', + * }, + * }, + * ], + * }); + * ``` + */ + create(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/batches", { + body, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * This endpoint is idempotent and can be used to poll for Message Batch + * completion. To access the results of a Message Batch, make a request to the + * `results_url` field in the response. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.retrieve( + * 'message_batch_id', + * ); + * ``` + */ + retrieve(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/messages/batches/${messageBatchID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List all Message Batches within a Workspace. Most recently created batches are + * returned first. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const messageBatch of client.messages.batches.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/messages/batches", Page, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete a Message Batch. + * + * Message Batches can only be deleted once they've finished processing. If you'd + * like to delete an in-progress batch, you must first cancel it. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const deletedMessageBatch = + * await client.messages.batches.delete('message_batch_id'); + * ``` + */ + delete(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/messages/batches/${messageBatchID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Batches may be canceled any time before processing ends. Once cancellation is + * initiated, the batch enters a `canceling` state, at which time the system may + * complete any in-progress, non-interruptible requests before finalizing + * cancellation. + * + * The number of canceled requests is specified in `request_counts`. To determine + * which requests were canceled, check the individual results within the batch. + * Note that cancellation may not result in any canceled requests if they were + * non-interruptible. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.cancel( + * 'message_batch_id', + * ); + * ``` + */ + cancel(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.post(path2`/v1/messages/batches/${messageBatchID}/cancel`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Streams the results of a Message Batch as a `.jsonl` file. + * + * Each line in the file is a JSON object containing the result of a single request + * in the Message Batch. Results are not guaranteed to be in the same order as + * requests. Use the `custom_id` field to match results to requests. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatchIndividualResponse = + * await client.messages.batches.results('message_batch_id'); + * ``` + */ + async results(messageBatchID, params = {}, options) { + const batch = await this.retrieve(messageBatchID, params, options); + if (!batch.results_url) { + throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); + } + const { workspace_id } = params ?? {}; + return this._client.get(batch.results_url, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true, + __binaryResponse: true + })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +var Messages2, DEPRECATED_MODELS2, MODELS_TO_WARN_WITH_THINKING_ENABLED2; +var init_messages2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs"() { + init_resource(); + init_headers(); + init_stainless_helper_header(); + init_MessageStream(); + init_parser2(); + init_batches2(); + init_batches2(); + init_constants(); + Messages2 = /* @__PURE__ */ (() => { + class Messages5 extends APIResource { + constructor() { + super(...arguments); + this.batches = new Batches2(this._client); + } + create(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + if (body.model in DEPRECATED_MODELS2) { + console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS2[body.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); + } + if (MODELS_TO_WARN_WITH_THINKING_ENABLED2.includes(body.model) && body.thinking && body.thinking.type === "enabled") { + console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); + } + let timeout = options?.timeout ?? this._client._options.timeout; + if (!body.stream && timeout == null) { + const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; + timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); + } + const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); + return this._client.post("/v1/messages", { + body, + timeout: timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + helperHeader2, + options?.headers + ]), + stream: params.stream ?? false + }); + } + /** + * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and + * the response will be automatically parsed and available in the `parsed_output` property of the message. + * + * @example + * ```ts + * const message = await client.messages.parse({ + * model: 'claude-sonnet-4-5-20250929', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_config: { + * format: zodOutputFormat(z.object({ answer: z.number() })), + * }, + * }); + * + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + parse(params, options) { + return this.create(params, options).then((message) => parseMessage(message, params, { logger: this._client.logger ?? console })); + } + /** + * Create a Message stream. + * + * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`), + * the final message will include a `parsed_output` property with the parsed content. + * + * @example + * ```ts + * const stream = client.messages.stream({ + * model: 'claude-sonnet-4-5-20250929', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_config: { + * format: zodOutputFormat(z.object({ answer: z.number() })), + * }, + * }); + * + * const message = await stream.finalMessage(); + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + stream(body, options) { + return MessageStream.createMessage(this, body, options, { logger: this._client.logger ?? console }); + } + /** + * Count the number of tokens in a Message. + * + * The Token Count API can be used to count the number of tokens in a Message, + * including tools, images, and documents, without creating it. + * + * Learn more about token counting in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) + * + * @example + * ```ts + * const messageTokensCount = + * await client.messages.countTokens({ + * messages: [{ content: 'Hello, world', role: 'user' }], + * model: 'claude-opus-5', + * }); + * ``` + */ + countTokens(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/count_tokens", { + body, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Messages5.Batches = Batches2; + return Messages5; + })(); + DEPRECATED_MODELS2 = {}; + MODELS_TO_WARN_WITH_THINKING_ENABLED2 = ["claude-mythos-preview", "claude-opus-4-6"]; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/models.mjs +var Models2; +var init_models3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/models.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Models2 = class extends APIResource { + /** + * Get a specific model. + * + * The Models API response can be used to determine information about a specific + * model or resolve a model alias to a model ID. + * + * @example + * ```ts + * const modelInfo = await client.models.retrieve('model_id'); + * ``` + */ + retrieve(modelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/models/${modelID}`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List available models. + * + * The Models API response can be used to determine which models are available for + * use in the API. More recently released models are listed first. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const modelInfo of client.models.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/models", Page, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +var Versions3; +var init_versions3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Versions3 = class extends APIResource { + /** + * Create Skill Version + * + * @example + * ```ts + * const skillVersion = await client.skills.versions.create( + * 'skill_id', + * { files: [fs.createReadStream('path/to/file')] }, + * ); + * ``` + */ + create(skillID, params, options) { + const { workspace_id, ...body } = params; + return this._client.post(path2`/v1/skills/${skillID}/versions`, multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill Version + * + * @example + * ```ts + * const skillVersion = await client.skills.versions.retrieve( + * 'version', + * { skill_id: 'skill_id' }, + * ); + * ``` + */ + retrieve(version, params, options) { + const { skill_id, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List Skill Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const skillVersion of client.skills.versions.list( + * 'skill_id', + * )) { + * // ... + * } + * ``` + */ + list(skillID, params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/skills/${skillID}/versions`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete Skill Version + * + * @example + * ```ts + * const deletedSkillVersion = + * await client.skills.versions.delete('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + delete(version, params, options) { + const { skill_id, workspace_id } = params; + return this._client.delete(path2`/v1/skills/${skill_id}/versions/${version}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +var Skills2; +var init_skills2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs"() { + init_resource(); + init_versions3(); + init_versions3(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Skills2 = /* @__PURE__ */ (() => { + class Skills4 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions3(this._client); + } + /** + * Create Skill + * + * @example + * ```ts + * const skill = await client.skills.create({ + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(params, options) { + const { workspace_id, ...body } = params; + return this._client.post("/v1/skills", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill + * + * @example + * ```ts + * const skill = await client.skills.retrieve('skill_id'); + * ``` + */ + retrieve(skillID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/skills/${skillID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List Skills + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const skill of client.skills.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/skills", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete Skill + * + * @example + * ```ts + * const deletedSkill = await client.skills.delete('skill_id'); + * ``` + */ + delete(skillID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/skills/${skillID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + } + Skills4.Versions = Versions3; + return Skills4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/index.mjs +var init_resources2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/index.mjs"() { + init_shared(); + init_beta(); + init_completions(); + init_files2(); + init_messages2(); + init_models3(); + init_skills2(); + } +}); + +// node_modules/@anthropic-ai/sdk/client.mjs +var _BaseAnthropic_instances, _a, _BaseAnthropic_encoder, _BaseAnthropic_baseURLOverridden, HUMAN_PROMPT, AI_PROMPT, BaseAnthropic, Anthropic; +var init_client = __esm({ + "node_modules/@anthropic-ai/sdk/client.mjs"() { + init_tslib(); + init_values(); + init_sleep(); + init_errors(); + init_detect_platform(); + init_request_signal(); + init_shims(); + init_request_options(); + init_query(); + init_version2(); + init_error(); + init_types(); + init_token_cache(); + init_credential_chain(); + init_middleware(); + init_pagination(); + init_uploads2(); + init_resources2(); + init_api_promise(); + init_completions(); + init_files2(); + init_models3(); + init_beta(); + init_messages2(); + init_skills2(); + init_detect_platform(); + init_headers(); + init_env(); + init_log(); + init_values(); + HUMAN_PROMPT = "\\n\\nHuman:"; + AI_PROMPT = "\\n\\nAssistant:"; + BaseAnthropic = /* @__PURE__ */ (() => { + class BaseAnthropic2 { + /** + * The active credential provider. Default credential resolution runs once + * at construction time. If it fails, the error is surfaced on every + * request and the client must be reconstructed — there is no retry path. + * + * Clones returned by {@link withOptions} share the parent's auth state + * (provider, token cache, pending resolution, and any resolution error) + * unless the caller passes an explicit `apiKey`, `authToken`, + * `credentials`, `config`, or `profile` override. + */ + get credentials() { + return this._authState.provider; + } + /** + * API Client for interfacing with the Anthropic API. + * + * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null] + * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null] + * @param {string | null | undefined} [opts.webhookKey=process.env['ANTHROPIC_WEBHOOK_SIGNING_KEY'] ?? null] + * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API. + * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. + * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. + * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. + * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. + * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. + */ + constructor({ baseURL = readEnv("ANTHROPIC_BASE_URL"), apiKey, authToken, webhookKey = readEnv("ANTHROPIC_WEBHOOK_SIGNING_KEY") ?? null, ...opts } = {}) { + _BaseAnthropic_instances.add(this); + this._requestAuthFlags = /* @__PURE__ */ new WeakMap(); + _BaseAnthropic_encoder.set(this, void 0); + if (apiKey === void 0) { + apiKey = opts.profile != null ? null : readEnv("ANTHROPIC_API_KEY") ?? null; + } + if (authToken === void 0) { + authToken = opts.profile != null ? null : readEnv("ANTHROPIC_AUTH_TOKEN") ?? null; + } + if (opts.profile != null && (opts.credentials != null || opts.config != null)) { + throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`."); + } + const options = { + apiKey, + authToken, + webhookKey, + ...opts, + baseURL: baseURL || `https://api.anthropic.com` + }; + if (!options.dangerouslyAllowBrowser && isRunningInBrowser()) { + throw new AnthropicError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n"); + } + this.baseURL = options.baseURL; + this._baseURLIsExplicit = opts.__baseURLIsExplicit ?? !!baseURL; + this.timeout = options.timeout ?? _a.DEFAULT_TIMEOUT; + this.logger = options.logger ?? console; + this.logLevel = defaultLogLevel; + this.logLevel = parseLogLevel(options.logLevel, "ClientOptions.logLevel", loggerFor(this)) ?? parseLogLevel(readEnv("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", loggerFor(this)) ?? defaultLogLevel; + this.fetchOptions = options.fetchOptions; + this.maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? 2); + this.fetch = options.fetch ?? getDefaultFetch(); + __classPrivateFieldSet(this, _BaseAnthropic_encoder, FallbackEncoder, "f"); + this.middleware = [...options.middleware ?? []]; + const customHeadersEnv = readEnv("ANTHROPIC_CUSTOM_HEADERS"); + if (customHeadersEnv) { + const parsed = {}; + for (const line of customHeadersEnv.split("\n")) { + const colon = line.indexOf(":"); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + const inherited = opts.__auth; + delete options.__auth; + delete options.__baseURLIsExplicit; + this._options = options; + this.apiKey = typeof apiKey === "string" ? apiKey : null; + this.authToken = authToken; + this.webhookKey = webhookKey; + if (inherited) { + this._authState = inherited; + if (!this._baseURLIsExplicit && inherited.baseURL) { + this.baseURL = inherited.baseURL; + } + } else { + this._authState = { provider: null, tokenCache: null, resolution: null, error: null, extraHeaders: {} }; + if (this.apiKey == null && this.authToken == null) { + const credentials = options.credentials ?? null; + if (credentials) { + this._authState.provider = credentials; + this._authState.tokenCache = this._makeTokenCache(credentials); + } else if (options.config != null) { + const result = resolveCredentialsFromConfig(options.config, this._credentialResolverOptions()); + this._authState.provider = result.provider; + this._authState.tokenCache = this._makeTokenCache(result.provider); + this._authState.extraHeaders = result.extraHeaders; + this._applyCredentialBaseURL(result.baseURL); + } else if (options.profile != null) { + this._authState.resolution = this._resolveDefaultCredentials(options.profile); + } else if (this._shouldResolveDefaultCredentials()) { + this._authState.resolution = this._resolveDefaultCredentials(); + } + } + } + } + /** + * Whether to lazily resolve auth from the default credential chain when no + * explicit auth is configured. Called once from the constructor, so + * overrides must not depend on subclass instance state. Subclasses that + * bring their own auth scheme return false so unrelated local credentials + * are never resolved or allowed to supply a base URL. + */ + _shouldResolveDefaultCredentials() { + return true; + } + /** + * Stores a profile/config-supplied base URL on the shared auth state and, if + * the caller did not pin `baseURL` via constructor option or env, adopts it + * as this client's outbound API host. Precedence: ctor opt > env > profile > + * hardcoded default. + */ + _applyCredentialBaseURL(baseURL) { + if (!baseURL) + return; + const normalized = baseURL.replace(/\/+$/, ""); + this._authState.baseURL = normalized; + if (!this._baseURLIsExplicit) { + this.baseURL = normalized; + } + } + /** + * Options bag passed into the credential chain. `baseURL` here is only the + * fallback host for the token-exchange POST when the config itself omits + * `base_url`; the chain returns the config's own `base_url` (if any) on + * {@link CredentialResult.baseURL}, which {@link _applyCredentialBaseURL} + * then adopts for outbound API requests. The two are deliberately decoupled + * so this fallback never round-trips into precedence. + */ + _credentialResolverOptions() { + return { + baseURL: this.baseURL, + fetch: this._credentialsFetch(), + userAgent: this.getUserAgent(), + onCacheWriteError: (err) => { + loggerFor(this).debug("credential cache write failed (best-effort)", err); + }, + onSafetyWarning: (msg) => { + loggerFor(this).warn(msg); + } + }; + } + /** + * A `Fetch` for first-party credential token-exchange requests (OIDC + * federation jwt-bearer grants, user-OAuth refresh grants) that routes + * through this client's middleware chain, so middleware observes token + * traffic like any other request. Only client-level middleware applies: + * a minted token is shared across requests, so attributing the exchange + * to any one request's per-request middleware would be arbitrary. For the + * same reason, `ctx.options` is undefined for these requests. + */ + _credentialsFetch() { + return wrapFetchWithMiddleware(this.fetch, this.middleware, void 0, this); + } + _makeTokenCache(provider2) { + return new TokenCache(provider2, (err) => { + loggerFor(this).debug("advisory token refresh failed; serving cached token", err); + }); + } + /** + * Create a new client instance re-using the same options given to the + * current client with optional overriding. + */ + withOptions(options) { + const overridesStructuredAuth = "credentials" in options || "config" in options || "profile" in options; + const overridesAuth = "apiKey" in options || "authToken" in options || overridesStructuredAuth; + const internal = { + ...this._options, + // Only forward baseURL when the caller (or env) explicitly chose it. + // For a non-explicit parent, this.baseURL may have been mutated to the + // profile-resolved host; pinning that as the clone's options.baseURL + // would make _options on the clone misreport caller intent and would + // leave the clone stuck on the parent's host across an auth override. + // The clone instead receives the construction-time value via + // ...this._options above and re-adopts the profile host through the + // shared _authState.baseURL + __baseURLIsExplicit=false path. + ...this._baseURLIsExplicit ? { baseURL: this.baseURL } : {}, + maxRetries: this.maxRetries, + timeout: this.timeout, + logger: this.logger, + logLevel: this.logLevel, + fetch: this.fetch, + fetchOptions: this.fetchOptions, + middleware: this.middleware, + apiKey: this.apiKey, + authToken: this.authToken, + webhookKey: this.webhookKey, + // credentials: this.credentials is a no-op when __auth is shared (the + // ctor takes the inherited path and ignores options.credentials); when + // overridesAuth is true via apiKey/authToken only, it lets the clone + // build a fresh TokenCache around the parent's provider. + credentials: this.credentials, + // When the caller passes a structured-credential override, drop inherited + // structured-credential options so only `...options` supplies them — + // otherwise an inherited `credentials`/`config`/`profile` would trip the + // mutual-exclusion check or precedence over the override. + ...overridesStructuredAuth ? { credentials: void 0, config: void 0, profile: void 0 } : {}, + ...options, + // Always set __auth so any stale value from ...this._options is + // overwritten. undefined means "build fresh auth from these options". + __auth: overridesAuth ? void 0 : this._authState, + __baseURLIsExplicit: "baseURL" in options ? true : this._baseURLIsExplicit + }; + return new this.constructor(internal); + } + /** + * Lazily resolves credentials from config files or environment variables. + * Called once from the constructor when no explicit auth is provided, or + * when an explicit `profile` was passed (in which case a missing/unresolved + * profile is surfaced as an error instead of falling through to "no auth"). + * The returned promise is stored and awaited on the first request. + */ + async _resolveDefaultCredentials(profile) { + try { + const result = await defaultCredentials(this._credentialResolverOptions(), profile); + if (result) { + this._authState.provider = result.provider; + this._authState.tokenCache = this._makeTokenCache(result.provider); + this._authState.extraHeaders = result.extraHeaders; + this._applyCredentialBaseURL(result.baseURL); + } else if (profile != null) { + throw new AnthropicError(`Profile "${profile}" could not be resolved (no /configs/${profile}.json found).`); + } + } catch (err) { + this._authState.error = err; + } finally { + this._authState.resolution = null; + } + } + defaultQuery() { + return this._options.defaultQuery; + } + validateHeaders({ values, nulls }) { + if (values.get("x-api-key") || values.get("authorization")) { + return; + } + if (this._authState.error) { + throw this._authState.error; + } + if (this._authState.tokenCache || this._authState.resolution) { + return; + } + if (this.apiKey && values.get("x-api-key")) { + return; + } + if (nulls.has("x-api-key")) { + return; + } + if (this.authToken && values.get("authorization")) { + return; + } + if (nulls.has("authorization")) { + return; + } + throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); + } + _authFlags(opts) { + let flags = this._requestAuthFlags.get(opts); + if (!flags) { + flags = { usedTokenCache: false, didRefreshFor401: false }; + this._requestAuthFlags.set(opts, flags); + } + return flags; + } + async authHeaders(opts) { + if (this._authState.resolution) { + await this._authState.resolution; + } + if (this._authState.error) { + return void 0; + } + if (this._authState.tokenCache && this.apiKey == null) { + const token = await this._authState.tokenCache.getToken(); + this._authFlags(opts).usedTokenCache = true; + return buildHeaders([{ Authorization: `Bearer ${token}` }]); + } + return buildHeaders([await this.apiKeyAuth(opts), await this.bearerAuth(opts)]); + } + async apiKeyAuth(opts) { + if (this.apiKey == null) { + return void 0; + } + return buildHeaders([{ "X-Api-Key": this.apiKey }]); + } + async bearerAuth(opts) { + if (this.authToken == null) { + return void 0; + } + return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]); + } + stringifyQuery(query) { + return stringifyQuery(query); + } + getUserAgent() { + return `Anthropic/JS ${VERSION}`; + } + makeStatusError(status, error, message, headers) { + return APIError.generate(status, error, message, headers); + } + buildURL(path5, query, defaultBaseURL) { + const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; + const url = isAbsoluteURL(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); + const defaultQuery = this.defaultQuery(); + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query }; + } + if (typeof query === "object" && query && !Array.isArray(query)) { + url.search = this.stringifyQuery(query); + } + return url.toString(); + } + _calculateNonstreamingTimeout(maxTokens) { + const defaultTimeout = 10 * 60; + const expectedTimeout = 60 * 60 * maxTokens / 128e3; + if (expectedTimeout > defaultTimeout) { + throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details"); + } + return defaultTimeout * 1e3; + } + /** + * Used as a callback for mutating the given `FinalRequestOptions` object. + */ + async prepareOptions(options) { + } + /** + * Used as a callback for mutating the given `RequestInit` object. + * + * This is useful for cases where you want to add certain headers based off of + * the request properties, e.g. `method` or `url`. + * + * Runs after all middleware (including {@link backendMiddleware}), + * immediately before each underlying fetch call, so it sees exactly what + * goes over the wire. Middleware may replay a request by calling `next()` + * more than once, so this hook can run multiple times per attempt: + * overrides must be idempotent and overwrite headers from a previous + * invocation rather than append to them. + */ + async prepareRequest(request2, { url, options }) { + if (this._authState.tokenCache && this.apiKey == null) { + const headers = request2.headers instanceof Headers ? request2.headers : new Headers(request2.headers); + for (const [k, v] of Object.entries(this._authState.extraHeaders)) { + if (!headers.has(k)) + headers.set(k, v); + } + const existing = headers.get("anthropic-beta")?.split(",").map((s) => s.trim()); + if (!existing?.includes(OAUTH_API_BETA_HEADER)) { + headers.set("anthropic-beta", [...existing ?? [], OAUTH_API_BETA_HEADER].join(",")); + } + request2.headers = headers; + } + } + /** + * Internal {@link Middleware} composed innermost in the chain — inside both + * client-level and per-request middleware, immediately around the underlying + * `fetch`. Subclasses for third-party backends override this to adapt the + * canonical Anthropic-shaped request to the backend's wire shape (URL/body + * rewriting, request signing) and to normalize the wire response back to the + * canonical shape (e.g. AWS EventStream to SSE). + * + * Running inside the user's middleware means user middleware always observes + * canonical Anthropic-shaped traffic, and the adaptation re-runs (e.g. + * re-signs) on every `next()` invocation, covering whatever the middleware + * mutated. + * + * Errors thrown here follow the middleware error policy: they propagate to + * the caller as-is — no retries, no `APIConnectionError` wrapping — unless + * retryable (see {@link Middleware}); throw a `RetryableError` to opt into + * the retry path. + */ + backendMiddleware() { + return []; + } + get(path5, opts) { + return this.methodRequest("get", path5, opts); + } + post(path5, opts) { + return this.methodRequest("post", path5, opts); + } + patch(path5, opts) { + return this.methodRequest("patch", path5, opts); + } + put(path5, opts) { + return this.methodRequest("put", path5, opts); + } + delete(path5, opts) { + return this.methodRequest("delete", path5, opts); + } + methodRequest(method2, path5, opts) { + return this.request(Promise.resolve(opts).then((opts2) => { + return { method: method2, path: path5, ...opts2 }; + })); + } + request(options, remainingRetries = null) { + return new APIPromise(this, this.makeRequest(options, remainingRetries, void 0)); + } + async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) { + const options = await optionsInput; + let maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? this.maxRetries); + if (this.isStreamBody(options.body)) { + maxRetries = 0; + } + if (retriesRemaining == null) { + retriesRemaining = maxRetries; + this._requestAuthFlags.delete(options); + } + await this.prepareOptions(options); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining + }); + const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); + const retryLogStr = retryOfRequestLogID === void 0 ? "" : `, retryOf: ${retryOfRequestLogID}`; + const startTime = Date.now(); + if (options.signal?.aborted) { + throw new APIUserAbortError(); + } + const controller = new AbortController(); + const response = await this.fetchWithTimeout(url, req, timeout, controller, options, { + requestLogID, + retryOfRequestLogID + }).catch(castToError); + const headersTime = Date.now(); + if (response instanceof globalThis.Error) { + releaseRequestSignal(controller); + const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; + if (options.signal?.aborted) { + throw new APIUserAbortError(); + } + const isTimeout = isAbortError(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); + const hasMiddleware = this.middleware.length > 0 || !!options.middleware?.length || this.backendMiddleware().length > 0; + if (hasMiddleware && !isTimeout && !isRetryableError(response)) { + loggerFor(this).info(`[${requestLogID}] middleware error (not retryable)`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] middleware error (not retryable)`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + throw response; + } + if (retriesRemaining) { + loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); + } + loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + if (isTimeout) { + throw new APIConnectionTimeoutError(); + } + if (hasMiddleware && !isFetchOriginError(response)) { + throw response; + } + throw new APIConnectionError({ cause: response }); + } + const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "request-id" || name === "anthropic-workspace-id").map(([name, value2]) => ", " + name + ": " + JSON.stringify(value2)).join(""); + const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; + if (!response.ok) { + const shouldRetry = await this.shouldRetry(response, options); + if (retriesRemaining && shouldRetry) { + const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; + await CancelReadableStream(response.body); + releaseRequestSignal(controller); + loggerFor(this).info(`${responseInfo} - ${retryMessage2}`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response error (${retryMessage2})`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + }); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers); + } + const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; + loggerFor(this).info(`${responseInfo} - ${retryMessage}`); + const errText = await response.text().catch((err2) => castToError(err2).message); + const errJSON = safeJSON(errText); + const errMessage = errJSON ? void 0 : errText; + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response error (${retryMessage})`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + message: errMessage, + durationMs: Date.now() - startTime + }); + releaseRequestSignal(controller); + const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); + throw err; + } + loggerFor(this).info(responseInfo); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response start`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + }); + armAbandonmentBackstop(response.body ?? response, controller); + return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; + } + getAPIList(path5, Page3, opts) { + return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path5, ...opts2 })) : { method: "get", path: path5, ...opts }); + } + requestAPIList(Page3, options) { + const request2 = this.makeRequest(options, null, void 0); + return new PagePromise(this, request2, Page3); + } + async fetchWithTimeout(url, init, ms, controller, requestOptions, logCtx) { + const { signal, method: method2, ...options } = init || {}; + const abort = this._makeAbort(controller); + if (signal) { + signal.addEventListener("abort", abort, { once: true }); + registerRequestSignalCleanup(controller, signal, abort); + } + const isReadableBody = globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream || typeof options.body === "object" && options.body !== null && Symbol.asyncIterator in options.body; + const fetchOptions = { + signal: controller.signal, + ...isReadableBody ? { duplex: "half" } : {}, + method: "GET", + ...options + }; + if (method2) { + fetchOptions.method = method2.toUpperCase(); + } + const baseFetch = this.fetch; + const timedFetch = async (innerUrl, innerInit) => { + const timeout = setTimeout(abort, ms); + try { + return await baseFetch.call(void 0, innerUrl, innerInit); + } finally { + clearTimeout(timeout); + } + }; + const innerFetch = requestOptions === void 0 ? timedFetch : (async (innerUrl, innerInit = {}) => { + const innerUrlStr = typeof innerUrl === "string" ? innerUrl : innerUrl instanceof URL ? innerUrl.href : innerUrl.url; + innerInit.headers = innerInit.headers instanceof Headers ? innerInit.headers : new Headers(innerInit.headers); + await this.prepareRequest(innerInit, { url: innerUrlStr, options: requestOptions }); + if (logCtx) { + debugLogRequestDetails(loggerFor(this), `[${logCtx.requestLogID}] sending request`, { + retryOfRequestLogID: logCtx.retryOfRequestLogID, + method: innerInit.method, + url: innerUrlStr, + options: requestOptions, + headers: innerInit.headers + }); + } + return timedFetch(innerUrl, innerInit); + }); + const requestMiddleware = requestOptions?.middleware; + const backendMiddleware = this.backendMiddleware(); + const allMiddleware = requestMiddleware?.length || backendMiddleware.length ? [...this.middleware, ...requestMiddleware ?? [], ...backendMiddleware] : this.middleware; + return await wrapFetchWithMiddleware(innerFetch, allMiddleware, requestOptions, this)(url, fetchOptions); + } + async shouldRetry(response, options) { + const flags = this._authFlags(options); + if (response.status === 401 && this._authState.tokenCache && flags.usedTokenCache && !flags.didRefreshFor401) { + flags.didRefreshFor401 = true; + this._authState.tokenCache.invalidate(); + return true; + } + const shouldRetryHeader = response.headers.get("x-should-retry"); + if (shouldRetryHeader === "true") + return true; + if (shouldRetryHeader === "false") + return false; + if (response.status === 408) + return true; + if (response.status === 409) + return true; + if (response.status === 429) + return true; + if (response.status >= 500) + return true; + return false; + } + async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { + let timeoutMillis; + const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); + if (retryAfterMillisHeader) { + const timeoutMs = parseFloat(retryAfterMillisHeader); + if (!Number.isNaN(timeoutMs)) { + timeoutMillis = timeoutMs; + } + } + const retryAfterHeader = responseHeaders?.get("retry-after"); + if (retryAfterHeader && !timeoutMillis) { + const timeoutSeconds = parseFloat(retryAfterHeader); + if (!Number.isNaN(timeoutSeconds)) { + timeoutMillis = timeoutSeconds * 1e3; + } else { + timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); + } + } + if (timeoutMillis === void 0 || !(timeoutMillis > 0 && timeoutMillis <= 2 ** 31 - 1)) { + const maxRetries = options.maxRetries ?? this.maxRetries; + timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); + } + await sleep(timeoutMillis, options.signal ?? void 0); + return this.makeRequest(options, retriesRemaining - 1, requestLogID); + } + calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { + const initialRetryDelay = 0.5; + const maxRetryDelay = 8; + const numRetries = maxRetries - retriesRemaining; + const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay); + const jitter2 = 1 - Math.random() * 0.25; + return sleepSeconds * jitter2 * 1e3; + } + calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) { + const maxTime = 60 * 60 * 1e3; + const defaultTime = 60 * 10 * 1e3; + const expectedTime = maxTime * maxTokens / 128e3; + if (expectedTime > defaultTime || maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens) { + throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details"); + } + return defaultTime; + } + async buildRequest(inputOptions, { retryCount = 0 } = {}) { + const options = { ...inputOptions }; + const { method: method2, path: path5, query, defaultBaseURL } = options; + if (this._authState.resolution) { + await this._authState.resolution; + } + if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) { + this.baseURL = this._authState.baseURL; + } + const url = this.buildURL(path5, query, defaultBaseURL); + if ("timeout" in options) + validatePositiveInteger("timeout", options.timeout); + options.timeout = options.timeout ?? this.timeout; + const { bodyHeaders, body } = this.buildBody({ options }); + const reqHeaders = await this.buildHeaders({ + options: inputOptions, + method: method2, + bodyHeaders, + retryCount, + timeout: options.timeout + }); + const req = { + method: method2, + headers: reqHeaders, + ...options.signal && { signal: options.signal }, + ...globalThis.ReadableStream && body instanceof globalThis.ReadableStream && { duplex: "half" }, + ...body && { body }, + ...this.fetchOptions ?? {}, + ...options.fetchOptions ?? {} + }; + return { req, url, timeout: options.timeout }; + } + async buildHeaders({ options, method: method2, bodyHeaders, retryCount, timeout }) { + const headers = buildHeaders([ + { + Accept: "application/json", + "User-Agent": this.getUserAgent(), + "X-Stainless-Retry-Count": String(retryCount), + "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)), + ...getPlatformHeaders(), + ...this._options.dangerouslyAllowBrowser ? { "anthropic-dangerous-direct-browser-access": "true" } : void 0, + "anthropic-version": "2023-06-01" + }, + await this.authHeaders(options), + this._options.defaultHeaders, + bodyHeaders, + options.headers + ]); + this.validateHeaders(headers); + return headers.values; + } + _makeAbort(controller) { + return () => controller.abort(); + } + buildBody({ options: { body, headers: rawHeaders } }) { + if (!body) { + return { bodyHeaders: void 0, body: void 0 }; + } + const headers = buildHeaders([rawHeaders]); + if ( + // Pass raw type verbatim + ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && // Preserve legacy string encoding behavior for now + headers.values.has("content-type") || // `Blob` is superset of `File` + globalThis.Blob && body instanceof globalThis.Blob || // `FormData` -> `multipart/form-data` + body instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` + body instanceof URLSearchParams || // Send chunked stream (each chunk has own `length`) + globalThis.ReadableStream && body instanceof globalThis.ReadableStream + ) { + return { bodyHeaders: void 0, body }; + } else if (this.isStreamBody(body)) { + return { bodyHeaders: void 0, body: ReadableStreamFrom(body) }; + } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { + return { + bodyHeaders: { "content-type": "application/x-www-form-urlencoded" }, + body: this.stringifyQuery(body) + }; + } else { + return __classPrivateFieldGet(this, _BaseAnthropic_encoder, "f").call(this, { body, headers }); + } + } + /** + * Whether `body` is sent as a stream, which can be read only once: + * a `ReadableStream`, an async iterable or an iterator. + */ + isStreamBody(body) { + if (globalThis.ReadableStream && body instanceof globalThis.ReadableStream) { + return true; + } + return typeof body === "object" && body !== null && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function"); + } + } + _a = BaseAnthropic2, _BaseAnthropic_encoder = /* @__PURE__ */ new WeakMap(), _BaseAnthropic_instances = /* @__PURE__ */ new WeakSet(), _BaseAnthropic_baseURLOverridden = function _BaseAnthropic_baseURLOverridden2() { + return this.baseURL !== "https://api.anthropic.com"; + }; + BaseAnthropic2.Anthropic = _a; + BaseAnthropic2.DEFAULT_TIMEOUT = 6e5; + BaseAnthropic2.AnthropicError = AnthropicError; + BaseAnthropic2.APIError = APIError; + BaseAnthropic2.APIConnectionError = APIConnectionError; + BaseAnthropic2.APIConnectionTimeoutError = APIConnectionTimeoutError; + BaseAnthropic2.APIUserAbortError = APIUserAbortError; + BaseAnthropic2.NotFoundError = NotFoundError; + BaseAnthropic2.ConflictError = ConflictError; + BaseAnthropic2.RateLimitError = RateLimitError; + BaseAnthropic2.BadRequestError = BadRequestError; + BaseAnthropic2.AuthenticationError = AuthenticationError; + BaseAnthropic2.InternalServerError = InternalServerError; + BaseAnthropic2.PermissionDeniedError = PermissionDeniedError; + BaseAnthropic2.UnprocessableEntityError = UnprocessableEntityError; + BaseAnthropic2.toFile = toFile; + BaseAnthropic2.HUMAN_PROMPT = HUMAN_PROMPT; + BaseAnthropic2.AI_PROMPT = AI_PROMPT; + return BaseAnthropic2; + })(); + Anthropic = /* @__PURE__ */ (() => { + class Anthropic2 extends BaseAnthropic { + constructor() { + super(...arguments); + this.completions = new Completions(this); + this.messages = new Messages2(this); + this.models = new Models2(this); + this.files = new Files2(this); + this.skills = new Skills2(this); + this.beta = new Beta(this); + } + } + Anthropic2.Completions = Completions; + Anthropic2.Messages = Messages2; + Anthropic2.Models = Models2; + Anthropic2.Files = Files2; + Anthropic2.Skills = Skills2; + Anthropic2.Beta = Beta; + return Anthropic2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/index.mjs +var init_sdk = __esm({ + "node_modules/@anthropic-ai/sdk/index.mjs"() { + init_client(); + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js +function getBunSandboxEnvValue(name) { + if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) { + return void 0; + } + if (procEnvCache === null) { + procEnvCache = /* @__PURE__ */ new Map(); + try { + const { readFileSync } = __require("node:fs"); + const data = readFileSync("/proc/self/environ", "utf-8"); + for (const entry2 of data.split("\0")) { + const idx = entry2.indexOf("="); + if (idx > 0) { + procEnvCache.set(entry2.slice(0, idx), entry2.slice(idx + 1)); + } + } + } catch { + } + } + return procEnvCache.get(name); +} +function getProviderEnvValue(name, env) { + return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0; +} +var procEnvCache; +var init_provider_env = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js"() { + procEnvCache = null; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +var __rewriteRelativeImportExtension2, _existsSync, _homedir, _join, dynamicImport, NODE_FS_SPECIFIER, NODE_OS_SPECIFIER, NODE_PATH_SPECIFIER, ANTHROPIC_FEDERATION_RULE_ID_ENV, ANTHROPIC_ORGANIZATION_ID_ENV, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, ANTHROPIC_WORKSPACE_ID_ENV; +var init_env_api_keys = __esm({ + "node_modules/@earendil-works/pi-ai/dist/env-api-keys.js"() { + __rewriteRelativeImportExtension2 = function(path5, preserveJsx) { + if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { + return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path5; + }; + _existsSync = null; + _homedir = null; + _join = null; + dynamicImport = (specifier) => import(__rewriteRelativeImportExtension2(specifier)); + NODE_FS_SPECIFIER = "node:fs"; + NODE_OS_SPECIFIER = "node:os"; + NODE_PATH_SPECIFIER = "node:path"; + if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) { + dynamicImport(NODE_FS_SPECIFIER).then((m) => { + _existsSync = m.existsSync; + }); + dynamicImport(NODE_OS_SPECIFIER).then((m) => { + _homedir = m.homedir; + }); + dynamicImport(NODE_PATH_SPECIFIER).then((m) => { + _join = m.join; + }); + } + ANTHROPIC_FEDERATION_RULE_ID_ENV = "ANTHROPIC_FEDERATION_RULE_ID"; + ANTHROPIC_ORGANIZATION_ID_ENV = "ANTHROPIC_ORGANIZATION_ID"; + ANTHROPIC_SERVICE_ACCOUNT_ID_ENV = "ANTHROPIC_SERVICE_ACCOUNT_ID"; + ANTHROPIC_IDENTITY_TOKEN_FILE_ENV = "ANTHROPIC_IDENTITY_TOKEN_FILE"; + ANTHROPIC_WORKSPACE_ID_ENV = "ANTHROPIC_WORKSPACE_ID"; } }); @@ -2047,20 +17044,403 @@ function headersToRecord(headers) { } return result; } -function providerHeadersToRecord(...headerSources) { - const merged = /* @__PURE__ */ new Map(); - for (const source of headerSources) { - for (const [name, value2] of Object.entries(source ?? {})) { - const normalizedName = name.toLowerCase(); - merged.delete(normalizedName); - if (value2 !== null) - merged.set(normalizedName, [name, value2]); +var init_headers2 = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/headers.js"() { + } +}); + +// node_modules/partial-json/dist/options.js +var require_options = __commonJS({ + "node_modules/partial-json/dist/options.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Allow = exports.ALL = exports.COLLECTION = exports.ATOM = exports.SPECIAL = exports.INF = exports._INFINITY = exports.INFINITY = exports.NAN = exports.BOOL = exports.NULL = exports.OBJ = exports.ARR = exports.NUM = exports.STR = void 0; + exports.STR = 1; + exports.NUM = 2; + exports.ARR = 4; + exports.OBJ = 8; + exports.NULL = 16; + exports.BOOL = 32; + exports.NAN = 64; + exports.INFINITY = 128; + exports._INFINITY = 256; + exports.INF = exports.INFINITY | exports._INFINITY; + exports.SPECIAL = exports.NULL | exports.BOOL | exports.INF | exports.NAN; + exports.ATOM = exports.STR | exports.NUM | exports.SPECIAL; + exports.COLLECTION = exports.ARR | exports.OBJ; + exports.ALL = exports.ATOM | exports.COLLECTION; + exports.Allow = { STR: exports.STR, NUM: exports.NUM, ARR: exports.ARR, OBJ: exports.OBJ, NULL: exports.NULL, BOOL: exports.BOOL, NAN: exports.NAN, INFINITY: exports.INFINITY, _INFINITY: exports._INFINITY, INF: exports.INF, SPECIAL: exports.SPECIAL, ATOM: exports.ATOM, COLLECTION: exports.COLLECTION, ALL: exports.ALL }; + exports.default = exports.Allow; + } +}); + +// node_modules/partial-json/dist/index.js +var require_dist2 = __commonJS({ + "node_modules/partial-json/dist/index.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Allow = exports.MalformedJSON = exports.PartialJSON = exports.parseJSON = exports.parse = void 0; + var options_1 = require_options(); + Object.defineProperty(exports, "Allow", { enumerable: true, get: function() { + return options_1.Allow; + } }); + __exportStar(require_options(), exports); + var PartialJSON2 = class extends Error { + }; + exports.PartialJSON = PartialJSON2; + var MalformedJSON2 = class extends Error { + }; + exports.MalformedJSON = MalformedJSON2; + function parseJSON2(jsonString, allowPartial = options_1.Allow.ALL) { + if (typeof jsonString !== "string") { + throw new TypeError(`expecting str, got ${typeof jsonString}`); + } + if (!jsonString.trim()) { + throw new Error(`${jsonString} is empty`); + } + return _parseJSON2(jsonString.trim(), allowPartial); + } + exports.parseJSON = parseJSON2; + var _parseJSON2 = (jsonString, allow) => { + const length = jsonString.length; + let index = 0; + const markPartialJSON = (msg) => { + throw new PartialJSON2(`${msg} at position ${index}`); + }; + const throwMalformedError = (msg) => { + throw new MalformedJSON2(`${msg} at position ${index}`); + }; + const parseAny = () => { + skipBlank(); + if (index >= length) + markPartialJSON("Unexpected end of input"); + if (jsonString[index] === '"') + return parseStr(); + if (jsonString[index] === "{") + return parseObj(); + if (jsonString[index] === "[") + return parseArr(); + if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) { + index += 4; + return null; + } + if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) { + index += 4; + return true; + } + if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) { + index += 5; + return false; + } + if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) { + index += 8; + return Infinity; + } + if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) { + index += 9; + return -Infinity; + } + if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) { + index += 3; + return NaN; + } + return parseNum(); + }; + const parseStr = () => { + const start = index; + let escape2 = false; + index++; + while (index < length && (jsonString[index] !== '"' || escape2 && jsonString[index - 1] === "\\")) { + escape2 = jsonString[index] === "\\" ? !escape2 : false; + index++; + } + if (jsonString.charAt(index) == '"') { + try { + return JSON.parse(jsonString.substring(start, ++index - Number(escape2))); + } catch (e) { + throwMalformedError(String(e)); + } + } else if (options_1.Allow.STR & allow) { + try { + return JSON.parse(jsonString.substring(start, index - Number(escape2)) + '"'); + } catch (e) { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); + } + } + markPartialJSON("Unterminated string literal"); + }; + const parseObj = () => { + index++; + skipBlank(); + const obj2 = {}; + try { + while (jsonString[index] !== "}") { + skipBlank(); + if (index >= length && options_1.Allow.OBJ & allow) + return obj2; + const key = parseStr(); + skipBlank(); + index++; + try { + const value2 = parseAny(); + obj2[key] = value2; + } catch (e) { + if (options_1.Allow.OBJ & allow) + return obj2; + else + throw e; + } + skipBlank(); + if (jsonString[index] === ",") + index++; + } + } catch (e) { + if (options_1.Allow.OBJ & allow) + return obj2; + else + markPartialJSON("Expected '}' at end of object"); + } + index++; + return obj2; + }; + const parseArr = () => { + index++; + const arr2 = []; + try { + while (jsonString[index] !== "]") { + arr2.push(parseAny()); + skipBlank(); + if (jsonString[index] === ",") { + index++; + } + } + } catch (e) { + if (options_1.Allow.ARR & allow) { + return arr2; + } + markPartialJSON("Expected ']' at end of array"); + } + index++; + return arr2; + }; + const parseNum = () => { + if (index === 0) { + if (jsonString === "-") + throwMalformedError("Not sure what '-' is"); + try { + return JSON.parse(jsonString); + } catch (e) { + if (options_1.Allow.NUM & allow) + try { + return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); + } catch (e2) { + } + throwMalformedError(String(e)); + } + } + const start = index; + if (jsonString[index] === "-") + index++; + while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1) + index++; + if (index == length && !(options_1.Allow.NUM & allow)) + markPartialJSON("Unterminated number literal"); + try { + return JSON.parse(jsonString.substring(start, index)); + } catch (e) { + if (jsonString.substring(start, index) === "-") + markPartialJSON("Not sure what '-' is"); + try { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); + } catch (e2) { + throwMalformedError(String(e2)); + } + } + }; + const skipBlank = () => { + while (index < length && " \n\r ".includes(jsonString[index])) { + index++; + } + }; + return parseAny(); + }; + var parse2 = parseJSON2; + exports.parse = parse2; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +function isControlCharacter(char) { + const codePoint = char.codePointAt(0); + return codePoint !== void 0 && codePoint >= 0 && codePoint <= 31; +} +function escapeControlCharacter(char) { + switch (char) { + case "\b": + return "\\b"; + case "\f": + return "\\f"; + case "\n": + return "\\n"; + case "\r": + return "\\r"; + case " ": + return "\\t"; + default: + return `\\u${char.codePointAt(0)?.toString(16).padStart(4, "0") ?? "0000"}`; + } +} +function repairJson(json) { + let repaired = ""; + let inString = false; + for (let index = 0; index < json.length; index++) { + const char = json[index]; + if (!inString) { + repaired += char; + if (char === '"') { + inString = true; + } + continue; + } + if (char === '"') { + repaired += char; + inString = false; + continue; + } + if (char === "\\") { + const nextChar = json[index + 1]; + if (nextChar === void 0) { + repaired += "\\\\"; + continue; + } + if (nextChar === "u") { + const unicodeDigits = json.slice(index + 2, index + 6); + if (/^[0-9a-fA-F]{4}$/.test(unicodeDigits)) { + repaired += `\\u${unicodeDigits}`; + index += 5; + continue; + } + } + if (VALID_JSON_ESCAPES.has(nextChar)) { + repaired += `\\${nextChar}`; + index += 1; + continue; + } + repaired += "\\\\"; + continue; + } + repaired += isControlCharacter(char) ? escapeControlCharacter(char) : char; + } + return repaired; +} +function parseJsonWithRepair(json) { + try { + return JSON.parse(json); + } catch (error) { + const repairedJson = repairJson(json); + if (repairedJson !== json) { + return JSON.parse(repairedJson); + } + throw error; + } +} +function parseToolCallArguments(json) { + if (!json?.trim()) + return { arguments: {} }; + try { + const parsed = parseJsonWithRepair(json); + if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { + throw new Error("Tool arguments must be a JSON object"); + } + return { arguments: parsed }; + } catch (error) { + return { + arguments: {}, + argumentsError: `${error instanceof Error ? error.message : String(error)} + +Received arguments: +${json}` + }; + } +} +function parseStreamingJson(partialJson) { + if (!partialJson || partialJson.trim() === "") { + return {}; + } + try { + return parseJsonWithRepair(partialJson); + } catch { + try { + const result = (0, import_partial_json.parse)(partialJson); + return result ?? {}; + } catch { + try { + const result = (0, import_partial_json.parse)(repairJson(partialJson)); + return result ?? {}; + } catch { + return {}; + } } } - return merged.size > 0 ? Object.fromEntries(merged.values()) : void 0; } -var init_headers = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/headers.js"() { +var import_partial_json, VALID_JSON_ESCAPES; +var init_json_parse = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js"() { + import_partial_json = __toESM(require_dist2(), 1); + VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]); + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js +function isValidCost(value2) { + return typeof value2 === "number" && Number.isFinite(value2) && value2 >= 0; +} +function isOpenRouterModel(model2) { + return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); +} +function applyOpenRouterReportedCost(usage, reported) { + if (!isValidCost(reported.cost)) + return; + if (reported.is_byok === false) { + usage.cost.total = reported.cost; + usage.cost.totalFromProvider = true; + return; + } + if (reported.is_byok === true) { + const details = reported.cost_details; + if (!details) + return; + let upstreamCost = details.upstream_inference_cost; + if (upstreamCost === null) { + if (!isValidCost(details.upstream_inference_prompt_cost) || !isValidCost(details.upstream_inference_completions_cost)) { + return; + } + upstreamCost = details.upstream_inference_prompt_cost + details.upstream_inference_completions_cost; + } + if (!isValidCost(upstreamCost)) + return; + usage.cost.total = reported.cost + upstreamCost; + usage.cost.totalFromProvider = true; + } +} +var init_openrouter_cost = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js"() { } }); @@ -2152,254 +17532,2248 @@ var init_provider_retry = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js -function httpError(label, response, body) { - const error = new Error(`${label} returned ${response.status}`); - error.status = response.status; - error.headers = response.headers; - error.body = body; - return error; +// node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js +function sanitizeSurrogates(text2) { + return text2.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F"; +} +function scalarValue(token) { + for (const [literal, value2] of LITERALS) + if (token === literal) + return value2; + return NUMBER.test(token) ? Number(token) : void 0; +} +function pendingScalarValue(token) { + for (const [literal, value2] of LITERALS) + if (literal.startsWith(token)) + return value2; + if (NUMBER.test(token)) + return Number(token); + const mantissa = NUMBER_WITHOUT_EXPONENT_DIGITS.exec(token); + return mantissa === null ? void 0 : Number(mantissa[1]); +} +function setSlot(container, slot, value2) { + if (slot.kind === "element") + container[slot.index] = value2; + else if (slot.kind === "member") + setMember(container, slot.key, value2); +} +function setMember(members, key, value2) { + if (key === "__proto__") { + Object.defineProperty(members, key, { value: value2, writable: true, enumerable: true, configurable: true }); + } else { + members[key] = value2; + } +} +var MAX_REPORTED_DEPTH, ROOT_SLOT, CREDIT_PER_APPEND, CREDIT_PER_CHARACTER, MAX_PENDING_SCALAR_LENGTH, NUMBER, NUMBER_WITHOUT_EXPONENT_DIGITS, LITERALS, QUOTE, BACKSLASH, StreamingJsonParser, ToolCallArgumentsStream, SIMPLE_ESCAPES; +var init_streaming_json = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js"() { + init_json_parse(); + MAX_REPORTED_DEPTH = 32; + ROOT_SLOT = { kind: "root" }; + CREDIT_PER_APPEND = 256; + CREDIT_PER_CHARACTER = 8; + MAX_PENDING_SCALAR_LENGTH = 64; + NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; + NUMBER_WITHOUT_EXPONENT_DIGITS = /^(-?(?:0|[1-9]\d*)(?:\.\d+)?)[eE][+-]?$/; + LITERALS = [ + ["true", true], + ["false", false], + ["null", null] + ]; + QUOTE = 34; + BACKSLASH = 92; + StreamingJsonParser = class { + #root = void 0; + #done = false; + #stack = []; + #string = void 0; + #scalar = ""; + #scalarSlot = void 0; + /** Sum of `size + 1` over the open path: what a fresh snapshot copies. */ + #pathCost = 0; + #credit = 0; + #dirty = false; + #snapshot = void 0; + /** Changes of the piece being read. */ + #changes = []; + /** + * Read the next piece of text; returns the changes it made, in order. Costs time linear in `text.length`. + */ + append(text2) { + this.#credit += CREDIT_PER_APPEND + CREDIT_PER_CHARACTER * text2.length; + this.#changes = []; + if (this.#string !== void 0) + this.#string.change = void 0; + let index = 0; + while (index < text2.length && !this.#done) { + const open = this.#string; + if (open !== void 0) + index = this.#readString(open, text2, index); + else if (this.#scalar !== "") + index = this.#readScalar(text2, index); + else + this.#structural(text2[index++]); + } + return this.#changes; + } + /** + * The value of the text read so far: `undefined` before a value starts, otherwise a plain JSON value that never + * changes afterwards. Returns the previous snapshot while the text read since did not change the value, or while a + * fresh copy of the open path is not yet paid for (see the module comment). + */ + snapshot() { + if (!this.#dirty) + return this.#snapshot; + const pending = this.#pendingScalar(); + const cost = this.#pathCost + (pending === void 0 ? 0 : 1); + if (cost > this.#credit) + return this.#snapshot; + this.#credit -= cost; + this.#dirty = false; + this.#snapshot = this.#copyOpenPath(pending); + return this.#snapshot; + } + /** Read string characters from `start` until the string ends or the text does; returns the next index. */ + #readString(open, text2, start) { + let runStart = start; + for (let index = start; index < text2.length; index++) { + const code = text2.charCodeAt(index); + if (open.escape !== "") { + if (this.#continueEscape(open, text2[index])) { + runStart = index + 1; + continue; + } + runStart = index; + } + if (code === QUOTE) { + if (index > runStart) + this.#appendString(open, text2.slice(runStart, index)); + this.#endString(open); + return index + 1; + } + if (code === BACKSLASH) { + if (index > runStart) + this.#appendString(open, text2.slice(runStart, index)); + open.escape = "\\"; + runStart = index + 1; + } + } + if (text2.length > runStart) + this.#appendString(open, text2.slice(runStart)); + return text2.length; + } + /** Read number or literal characters from `start` up to the next delimiter; returns the delimiter's index. */ + #readScalar(text2, start) { + let end = start; + while (end < text2.length && !isDelimiter(text2[end])) + end++; + if (end > start) { + this.#scalar += text2.slice(start, end); + if (this.#scalarSlot !== void 0) + this.#dirty = true; + } + if (end < text2.length) + this.#endScalar(); + return end; + } + /** Handle one character outside strings. */ + #structural(char) { + switch (char) { + case " ": + case " ": + case "\n": + case "\r": + return; + case '"': + this.#startString(); + return; + case "{": + case "[": + this.#openContainer(char === "{" ? {} : []); + return; + case "}": + case "]": + this.#closeContainer(); + return; + case ":": { + const frame = this.#stack.at(-1); + if (frame !== void 0 && !Array.isArray(frame.container) && frame.phase === "colon") + frame.phase = "value"; + return; + } + case ",": { + const frame = this.#stack.at(-1); + if (frame !== void 0) + frame.phase = Array.isArray(frame.container) ? "value" : "key"; + return; + } + default: + this.#scalar = char; + this.#scalarSlot = this.#valueSlot(); + if (this.#scalarSlot !== void 0) + this.#dirty = true; + } + } + /** Where a value starting now goes, or `undefined` when this position takes no value. */ + #valueSlot() { + const frame = this.#stack.at(-1); + if (frame === void 0) + return this.#root === void 0 ? ROOT_SLOT : void 0; + if (Array.isArray(frame.container)) + return { kind: "element", index: frame.container.length }; + if ((frame.phase === "value" || frame.phase === "colon") && frame.key !== void 0) { + return { kind: "member", key: frame.key }; + } + return void 0; + } + #startString() { + const frame = this.#stack.at(-1); + if (frame !== void 0 && !Array.isArray(frame.container) && (frame.phase === "key" || frame.phase === "comma")) { + this.#string = { target: "key", slot: void 0, text: "", escape: "", path: void 0, change: void 0 }; + return; + } + const slot = this.#valueSlot(); + const path5 = this.#reportedPath(slot); + this.#string = { target: "value", slot, text: "", escape: "", path: path5, change: void 0 }; + this.#place(slot, ""); + if (path5 !== void 0) + this.#string.change = this.#report({ kind: "set", path: path5, value: "" }); + } + /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ + #reportedPath(slot) { + if (slot === void 0) + return void 0; + if (slot.kind === "root") + return []; + const frame = this.#stack.at(-1); + if (!frame.reportsInside) + return void 0; + return [...frame.path, slot.kind === "member" ? slot.key : slot.index]; + } + #report(change) { + this.#changes.push(change); + return change; + } + /** Continue an escape with `char`; returns false when `char` is not part of it and must be read normally. */ + #continueEscape(open, char) { + if (open.escape === "\\") { + const decoded = SIMPLE_ESCAPES[char]; + if (decoded !== void 0) { + open.escape = ""; + this.#appendString(open, decoded); + return true; + } + if (char === "u") { + open.escape = "\\u"; + return true; + } + open.escape = ""; + this.#appendString(open, "\\"); + return false; + } + if (isHexDigit(char)) { + open.escape += char; + if (open.escape.length < 6) + return true; + const decoded = String.fromCharCode(Number.parseInt(open.escape.slice(2), 16)); + open.escape = ""; + this.#appendString(open, decoded); + return true; + } + const literal = open.escape; + open.escape = ""; + this.#appendString(open, literal); + return false; + } + #appendString(open, text2) { + open.text += text2; + if (open.target !== "value") + return; + this.#place(open.slot, open.text); + if (open.path === void 0) + return; + const change = open.change; + if (change !== void 0 && this.#changes.at(-1) === change) { + if (change.kind === "set") + change.value = change.value + text2; + else + change.text += text2; + return; + } + open.change = this.#report({ kind: "append", path: open.path, text: text2 }); + } + #endString(open) { + this.#string = void 0; + const frame = this.#stack.at(-1); + if (open.target === "key") { + if (frame === void 0) + return; + frame.key = open.text; + frame.phase = "colon"; + return; + } + this.#valueEnded(frame); + } + #endScalar() { + const token = this.#scalar; + const slot = this.#scalarSlot; + this.#scalar = ""; + this.#scalarSlot = void 0; + const value2 = scalarValue(token); + if (value2 !== void 0) { + this.#place(slot, value2); + const path5 = this.#reportedPath(slot); + if (path5 !== void 0) + this.#report({ kind: "set", path: path5, value: value2 }); + } + this.#valueEnded(this.#stack.at(-1)); + } + /** The value of the unterminated scalar at the end of the text, if it shows. */ + #pendingScalar() { + const slot = this.#scalarSlot; + const token = this.#scalar; + if (slot === void 0 || token === "" || token.length > MAX_PENDING_SCALAR_LENGTH) + return void 0; + const value2 = pendingScalarValue(token); + return value2 === void 0 ? void 0 : { slot, value: value2 }; + } + #openContainer(container) { + const slot = this.#valueSlot(); + const path5 = this.#reportedPath(slot); + this.#place(slot, container); + this.#stack.push({ + container, + slot, + path: path5, + reportsInside: path5 !== void 0 && path5.length < MAX_REPORTED_DEPTH, + size: 0, + key: void 0, + phase: Array.isArray(container) ? "value" : "key" + }); + this.#pathCost += 1; + this.#dirty = true; + if (path5 !== void 0) + this.#report({ kind: "set", path: path5, value: Array.isArray(container) ? [] : {} }); + } + #closeContainer() { + const frame = this.#stack.pop(); + if (frame === void 0) + return; + this.#pathCost -= frame.size + 1; + this.#dirty = true; + if (frame.path !== void 0 && !frame.reportsInside) { + this.#report({ kind: "set", path: frame.path, value: frame.container }); + } + this.#valueEnded(this.#stack.at(-1)); + } + /** A value in `frame`, or the root value when there is no frame, has ended. */ + #valueEnded(frame) { + if (frame === void 0) { + if (this.#root !== void 0) + this.#done = true; + return; + } + frame.phase = "comma"; + } + /** Set the value at `slot` in the open path; nothing for a value in an invalid position. */ + #place(slot, value2) { + if (slot === void 0) + return; + this.#dirty = true; + if (slot.kind === "root") { + this.#root = value2; + return; + } + const frame = this.#stack.at(-1); + if (slot.kind === "element") { + const elements = frame.container; + if (slot.index === elements.length) { + frame.size++; + this.#pathCost++; + } + elements[slot.index] = value2; + return; + } + const members = frame.container; + if (!Object.hasOwn(members, slot.key)) { + frame.size++; + this.#pathCost++; + } + setMember(members, slot.key, value2); + } + /** A fresh snapshot: copies of the open containers, innermost first, each holding the copy of its open child. */ + #copyOpenPath(pending) { + if (this.#stack.length === 0) + return pending?.slot.kind === "root" ? pending.value : this.#root; + let child; + let childSlot; + for (let depth = this.#stack.length - 1; depth >= 0; depth--) { + const frame = this.#stack[depth]; + const copy2 = Array.isArray(frame.container) ? frame.container.slice() : { ...frame.container }; + if (depth === this.#stack.length - 1 && pending !== void 0) + setSlot(copy2, pending.slot, pending.value); + if (child !== void 0 && childSlot !== void 0) + setSlot(copy2, childSlot, child); + child = copy2; + childSlot = frame.slot; + } + return childSlot?.kind === "root" ? child : this.#root; + } + }; + ToolCallArgumentsStream = class { + #text = ""; + #parser = new StreamingJsonParser(); + #snapshot = void 0; + #arguments = {}; + /** The raw argument text received so far. */ + get text() { + return this.#text; + } + /** Append a piece of argument text; returns the partial arguments, a new object whenever they changed. */ + append(delta) { + this.#text += delta; + this.#parser.append(delta); + return this.#partial(); + } + /** + * Take the provider's complete argument text. When it continues the text so far, returns the missing piece as + * `delta`; otherwise starts over with `text`. Either way returns the partial arguments of `text`. + */ + replace(text2) { + if (text2.startsWith(this.#text)) { + const delta = text2.slice(this.#text.length); + return { delta, arguments: delta === "" ? this.#partial() : this.append(delta) }; + } + this.#text = ""; + this.#parser = new StreamingJsonParser(); + return { delta: void 0, arguments: this.append(text2) }; + } + /** The final arguments: one full parse of the complete text, which reports malformed arguments. */ + finish() { + return parseToolCallArguments(this.#text); + } + #partial() { + const snapshot = this.#parser.snapshot(); + if (snapshot === this.#snapshot) + return this.#arguments; + this.#snapshot = snapshot; + this.#arguments = typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : {}; + return this.#arguments; + } + }; + SIMPLE_ESCAPES = { + '"': '"', + "\\": "\\", + "/": "/", + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: " " + }; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js +function isJsonSchemaObject(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } -function requiredNumber(label, value2, field) { - if (typeof value2 !== "number" || !Number.isFinite(value2)) { - throw new Error(`${label} returned an invalid ${field}`); +function isStructuredSchema(schema4) { + if (!isJsonSchemaObject(schema4)) + return false; + const types = typeof schema4.type === "string" ? [schema4.type] : Array.isArray(schema4.type) ? schema4.type : []; + return types.includes("object") || types.includes("array") || schema4.properties !== void 0 || schema4.items !== void 0; +} +function schemaAllowsNull(schema4) { + if (!isJsonSchemaObject(schema4)) + return false; + if (schema4.type === "null" || Array.isArray(schema4.type) && schema4.type.includes("null")) + return true; + if (schema4.const === null || Array.isArray(schema4.enum) && schema4.enum.includes(null)) + return true; + return Array.isArray(schema4.anyOf) && schema4.anyOf.some((variant) => schemaAllowsNull(variant)); +} +function makeJsonSchemaNodeStrict(schema4, isUnsupportedKeyword) { + if (!isJsonSchemaObject(schema4)) { + throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported"); } - return value2; -} -function requestHeaders(model2, apiKey, optionsHeaders, identity) { - return providerHeadersToRecord(getIdentityHeaders(model2, identity), { authorization: `Bearer ${apiKey}`, "content-type": "application/json" }, model2.headers, optionsHeaders) ?? {}; -} -async function postClassifierRequest(label, url, model2, body, options, noRetryStatuses) { - if (!options?.apiKey) - throw new Error(`No API key for provider: ${model2.provider}`); - const apiKey = options.apiKey; - let payload = body; - const transformed = await options.onPayload?.(payload, model2); - if (transformed !== void 0) - payload = transformed; - const requestFetch = options.fetch ?? globalThis.fetch; - const { response, json } = await retryProviderRequest(async () => { - const timeoutSignal = options.timeoutMs !== void 0 ? AbortSignal.timeout(options.timeoutMs) : void 0; - const signal = options.signal && timeoutSignal ? AbortSignal.any([options.signal, timeoutSignal]) : options.signal ?? timeoutSignal; - try { - const next = await requestFetch(url, { - method: "POST", - headers: requestHeaders(model2, apiKey, options.headers, options.identity), - body: JSON.stringify(payload), - signal - }); - if (!next.ok) - throw httpError(label, next, await next.text()); - return { response: next, json: await next.json() }; - } catch (error) { - if (timeoutSignal?.aborted && !options.signal?.aborted) - throw timeoutError(options.timeoutMs); - throw error; + for (const key of UNSUPPORTED_STRICT_SCHEMA_KEYS) { + if (schema4[key] !== void 0) { + throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`); } - }, { - maxRetries: options.maxRetries ?? 2, - maxRetryDelayMs: options.maxRetryDelayMs, - signal: options.signal, - noRetryStatuses - }); - await options.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - return json; -} -function tokenCount(value2) { - return typeof value2 === "number" && Number.isFinite(value2) && value2 > 0 ? value2 : 0; -} -function parseClassifierUsage(value2, model2) { - if (!isRecord(value2) || value2.input_tokens === void 0 && value2.output_tokens === void 0) - return void 0; - const input = tokenCount(value2.input_tokens); - const output = tokenCount(value2.output_tokens); - const usage = { - input, - output, - cacheRead: 0, - cacheWrite: 0, - totalTokens: input + output, - cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } - }; - calculateCost(model2, usage); - return usage; -} -var init_classifier_shared = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js"() { - init_models(); - init_headers(); - init_identity(); - init_provider_retry(); } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js -var openai_decisions_exports = {}; -__export(openai_decisions_exports, { - classify: () => classify -}); -function predicateInstructions(question) { - const meanings = [ - question.criteria.true ? `True means: ${question.criteria.true}` : "", - question.criteria.false ? `False means: ${question.criteria.false}` : "" - ].filter(Boolean); - return meanings.length > 0 ? `${question.instructions} - -${meanings.join("\n")}` : question.instructions; -} -function wireQuestion(name, question) { - if (question.type === "choice") { - return { - type: "choice", - name, - instructions: question.instructions, - choices: Object.entries(question.criteria).map(([value2, description]) => description ? { value: value2, description } : { value: value2 }) - }; - } - if (question.type === "score") { - return { - type: "score", - name, - instructions: question.instructions, - levels: question.criteria.map((label) => ({ label })) - }; - } - return { type: "predicate", name, instructions: predicateInstructions(question) }; -} -function wireInput(context) { - const state2 = JSON.stringify(context.state); - const images = context.images ?? []; - if (images.length === 0) - return state2; - if (images.length > MAX_IMAGES) { - throw new Error(`${LABEL} accepts at most ${MAX_IMAGES} images, got ${images.length}`); - } - return [ - { - role: "user", - content: [ - { type: "input_text", text: state2 }, - ...images.map((image) => ({ - type: "input_image", - image_url: `data:${image.mimeType};base64,${image.data}` - })) - ] - } - ]; -} -function choiceProbabilities(value2, id) { - if (!Array.isArray(value2)) - throw new Error(`${LABEL} returned invalid probabilities for ${id}`); - return Object.fromEntries(value2.map((entry2) => { - if (!isRecord(entry2) || typeof entry2.value !== "string") { - throw new Error(`${LABEL} returned invalid probabilities for ${id}`); - } - return [entry2.value, requiredNumber(LABEL, entry2.probability, `probability for ${id}.${entry2.value}`)]; - })); -} -function parseAnswer(id, question, answer2) { - if (answer2.type === "refusal") - throw new Error(`${LABEL} refused to answer ${id}`); - if (question.type === "choice") { - if (answer2.type !== "choice" || typeof answer2.choice !== "string") { - throw new Error(`${LABEL} did not return a choice answer for ${id}`); - } - return { - type: "choice", - choice: answer2.choice, - probabilities: choiceProbabilities(answer2.probabilities, id), - confidence: requiredNumber(LABEL, answer2.confidence, `confidence for ${id}`) - }; - } - if (question.type === "score") { - if (answer2.type !== "score") - throw new Error(`${LABEL} did not return a score answer for ${id}`); - return { - type: "score", - score: requiredNumber(LABEL, answer2.score, `score for ${id}`), - confidence: requiredNumber(LABEL, answer2.confidence, `confidence for ${id}`) - }; - } - if (answer2.type !== "predicate") - throw new Error(`${LABEL} did not return a predicate answer for ${id}`); - return { type: "bool", probability: requiredNumber(LABEL, answer2.probability, `probability for ${id}`) }; -} -function parseAnswers(value2, context) { - if (!Array.isArray(value2)) - throw new Error(`${LABEL} returned an unexpected response`); - const byName = /* @__PURE__ */ new Map(); - for (const answer2 of value2) { - if (isRecord(answer2) && typeof answer2.name === "string") - byName.set(answer2.name, answer2); - } - return Object.fromEntries(Object.entries(context.questions).map(([id, question]) => { - const answer2 = byName.get(id); - if (!answer2) - throw new Error(`${LABEL} did not return an answer for ${id}`); - return [id, parseAnswer(id, question, answer2)]; - })); -} -function errorMessage(error) { - if (error.status === 504) { - return `${LABEL} error (504): the request timed out at the gateway. Very large inputs (above roughly 600K tokens) currently exceed its time limit.`; - } - return formatProviderError(normalizeProviderError(error), `${LABEL} error`); -} -var LABEL, MAX_IMAGES, NO_RETRY_STATUSES, classify; -var init_openai_decisions = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js"() { - init_error_body(); - init_classifier_shared(); - LABEL = "OpenAI Decisions"; - MAX_IMAGES = 128; - NO_RETRY_STATUSES = [504]; - classify = async (model2, context, options) => { - const output = { - api: model2.api, - provider: model2.provider, - model: model2.id, - answers: {}, - stopReason: "stop", - timestamp: Date.now() - }; - try { - if (model2.api !== "openai-decisions") - throw new Error(`Unsupported classifier API: ${model2.api}`); - const body = await postClassifierRequest(LABEL, new URL("decisions", `${model2.baseUrl.replace(/\/+$/u, "")}/`), model2, { - model: model2.id, - input: wireInput(context), - questions: Object.entries(context.questions).map(([id, question]) => wireQuestion(id, question)) - }, options, NO_RETRY_STATUSES); - if (!isRecord(body)) - throw new Error(`${LABEL} returned an unexpected response`); - const usage = parseClassifierUsage(body.usage, model2); - if (usage) - output.usage = usage; - output.answers = parseAnswers(body.answers, context); - return output; - } catch (error) { - output.answers = {}; - output.stopReason = options?.signal?.aborted ? "aborted" : "error"; - output.errorMessage = errorMessage(error); - return output; + if (isUnsupportedKeyword) { + for (const [key, value2] of Object.entries(schema4)) { + if (isUnsupportedKeyword(key, value2)) { + throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value2)} is unsupported`); } + } + } + if (schema4.anyOf !== void 0) { + if (!Array.isArray(schema4.anyOf) || schema4.anyOf.length === 0) { + throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema"); + } + for (const variant of schema4.anyOf) { + if (isStructuredSchema(variant)) { + throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported"); + } + makeJsonSchemaNodeStrict(variant, isUnsupportedKeyword); + } + } + if (schema4.items !== void 0) { + if (Array.isArray(schema4.items)) { + throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported"); + } + makeJsonSchemaNodeStrict(schema4.items, isUnsupportedKeyword); + } + const isObjectSchema = schema4.type === "object"; + if (schema4.properties !== void 0 && !isObjectSchema) { + throw new UnsupportedStrictJsonSchemaError("properties require type object"); + } + if (!isObjectSchema) + return; + if (schema4.additionalProperties !== void 0 && schema4.additionalProperties !== false) { + throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported"); + } + if (schema4.properties !== void 0 && !isJsonSchemaObject(schema4.properties)) { + throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map"); + } + if (schema4.required !== void 0 && (!Array.isArray(schema4.required) || schema4.required.some((key) => typeof key !== "string"))) { + throw new UnsupportedStrictJsonSchemaError("object required must be a string array"); + } + const properties = schema4.properties ?? {}; + const propertyNames = Object.keys(properties); + const required = new Set(Array.isArray(schema4.required) ? schema4.required : []); + if ([...required].some((key) => !propertyNames.includes(key))) { + throw new UnsupportedStrictJsonSchemaError("required contains an unknown property"); + } + for (const [key, property] of Object.entries(properties)) { + makeJsonSchemaNodeStrict(property, isUnsupportedKeyword); + if (!required.has(key) && !schemaAllowsNull(property)) { + properties[key] = { anyOf: [property, { type: "null" }] }; + } + } + schema4.required = propertyNames; + schema4.additionalProperties = false; +} +function makeStrictJsonSchema(schema4, isUnsupportedKeyword) { + const cloned = structuredClone(schema4); + if (!isJsonSchemaObject(cloned)) { + throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); + } + makeJsonSchemaNodeStrict(cloned, isUnsupportedKeyword); + if (cloned.type !== "object") { + throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); + } + return cloned; +} +function prefersJsonSchemaStrictSampling(tool) { + const config = tool.constrainedSampling; + return !!config && config.type === "json_schema" && config.strict === "prefer"; +} +function isStrictToolLimitErrorMessage(message) { + return STRICT_TOOL_LIMIT_ERROR_MESSAGES.some((limitMessage) => message.includes(limitMessage)); +} +function getJsonSchemaToolParameters(tool, strict) { + return strict === true ? makeStrictJsonSchema(tool.parameters) : tool.parameters; +} +function getGrammarToolInput(toolName2, arguments_, inputProperty) { + const input = arguments_[inputProperty]; + if (typeof input !== "string") { + throw new Error(`Grammar tool call "${toolName2}" requires argument "${inputProperty}" to be a string.`); + } + return input; +} +function appendGrammarToolInputJsonDelta(buffer, inputProperty, inputDelta) { + if (buffer.closed) { + throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); + } + if (inputDelta.length === 0) + return void 0; + buffer.input += inputDelta; + return grammarToolInputJsonStart(buffer, inputProperty) + JSON.stringify(inputDelta).slice(1, -1); +} +function closeGrammarToolInputJson(buffer, inputProperty, finalInput) { + if (buffer.closed) { + if (finalInput === void 0 || finalInput === buffer.input) + return void 0; + throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); + } + if (finalInput !== void 0 && !finalInput.startsWith(buffer.input)) { + throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`); + } + const rest = finalInput === void 0 ? "" : finalInput.slice(buffer.input.length); + if (finalInput !== void 0) + buffer.input = finalInput; + buffer.closed = true; + return `${grammarToolInputJsonStart(buffer, inputProperty)}${JSON.stringify(rest).slice(1, -1)}"}`; +} +function grammarToolInputJsonStart(buffer, inputProperty) { + if (buffer.started) + return ""; + buffer.started = true; + return `{${JSON.stringify(inputProperty)}:"`; +} +function inferGrammarInputProperty(tool) { + const schema4 = tool.parameters; + if (schema4.type !== "object") { + throw new Error("grammar constrained sampling requires an object parameter schema"); + } + if (!Array.isArray(schema4.required) || schema4.required.length !== 1 || typeof schema4.required[0] !== "string") { + throw new Error("grammar constrained sampling requires exactly one required string property"); + } + const inputProperty = schema4.required[0]; + if (!schema4.properties?.[inputProperty]) { + throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`); + } + if (schema4.properties[inputProperty]?.type !== "string") { + throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`); + } + return inputProperty; +} +function resolveJsonSchemaStrictSampling(tool, supportsStrictMode, isUnsupportedKeyword) { + const config = tool.constrainedSampling; + if (!config || config.type !== "json_schema") + return void 0; + if (supportsStrictMode) { + try { + makeStrictJsonSchema(tool.parameters, isUnsupportedKeyword); + return true; + } catch (error) { + if (!(error instanceof UnsupportedStrictJsonSchemaError)) + throw error; + if (config.strict !== "require") + return void 0; + throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`); + } + } + if (config.strict === "require") { + throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`); + } + return void 0; +} +function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) { + const config = tool.constrainedSampling; + if (!config || config.type !== "grammar") { + return void 0; + } + if (!supportsOpenAIGrammarTools) { + return void 0; + } + const larkDefinition = config.variants.openai_lark; + const regexDefinition = config.variants.openai_regex; + const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0; + const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0; + if (!hasLarkDefinition && !hasRegexDefinition) { + throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`); + } + try { + return { + format: hasLarkDefinition ? "lark" : "regex", + definition: hasLarkDefinition ? larkDefinition : regexDefinition, + inputProperty: inferGrammarInputProperty(tool) + }; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`); + } +} +function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) { + const properties = /* @__PURE__ */ new Map(); + for (const tool of tools ?? []) { + const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools); + if (grammar) { + properties.set(tool.name, grammar.inputProperty); + } + } + return properties; +} +var UnsupportedStrictJsonSchemaError, UNSUPPORTED_STRICT_SCHEMA_KEYS, STRICT_TOOL_LIMIT_ERROR_MESSAGES; +var init_constrained_sampling = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js"() { + UnsupportedStrictJsonSchemaError = class extends Error { + }; + UNSUPPORTED_STRICT_SCHEMA_KEYS = [ + "$ref", + "$defs", + "definitions", + "allOf", + "oneOf", + "patternProperties", + "dependentSchemas", + "dependencies", + "unevaluatedProperties", + "propertyNames", + "contains", + "prefixItems", + "not", + "if", + "then", + "else" + ]; + STRICT_TOOL_LIMIT_ERROR_MESSAGES = [ + "The compiled grammar is too large", + "Too many strict tools (", + "Schemas contains too many parameters with union types (" + ]; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js +function inferCopilotInitiator(messages) { + const last = messages[messages.length - 1]; + return last && last.role !== "user" ? "agent" : "user"; +} +function hasCopilotVisionInput(messages) { + return messages.some((msg) => { + if (msg.role === "user" && Array.isArray(msg.content)) { + return msg.content.some((c) => c.type === "image"); + } + if (msg.role === "toolResult" && Array.isArray(msg.content)) { + return msg.content.some((c) => c.type === "image"); + } + return false; + }); +} +function buildCopilotDynamicHeaders(params) { + const headers = { + "X-Initiator": inferCopilotInitiator(params.messages), + "Openai-Intent": "conversation-edits" + }; + if (params.hasImages) { + headers["Copilot-Vision-Request"] = "true"; + } + return headers; +} +var init_github_copilot_headers = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js"() { + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +function calculateContextTokens(usage) { + return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite; +} +function safeJsonStringify(value2) { + try { + return JSON.stringify(value2) ?? "undefined"; + } catch { + return "[unserializable]"; + } +} +function estimateTextAndImageContentChars(content) { + if (typeof content === "string") + return content.length; + let chars = 0; + for (const block of content) + chars += block.type === "text" ? block.text.length : ESTIMATED_IMAGE_CHARS; + return chars; +} +function estimateTextTokens(text2) { + return Math.ceil(text2.length / CHARS_PER_TOKEN); +} +function estimateTextAndImageContentTokens(content) { + return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN); +} +function estimateMessageTokens(message) { + let chars = 0; + if (message.role === "system") { + return estimateTextTokens(getSystemMessageText(message)) + estimateToolsTokens(message.toolsAdded) + estimateToolsTokens(message.toolsRemoved); + } + if (message.role === "user") + return estimateTextAndImageContentTokens(message.content); + if (message.role === "toolResult") + return estimateTextAndImageContentTokens(message.content); + for (const block of message.content) { + if (block.type === "text") { + chars += block.text.length; + } else if (block.type === "thinking") { + chars += block.thinking.length; + } else { + chars += block.name.length + safeJsonStringify(block.arguments).length; + } + } + return Math.ceil(chars / CHARS_PER_TOKEN); +} +function getLastAssistantUsageInfo(messages) { + let latestPrefixTimestamp = Number.NEGATIVE_INFINITY; + let usageInfo; + for (let i = 0; i < messages.length; i++) { + const message = messages[i]; + if (message.role === "assistant") { + const assistant = message; + const usageAppliesToPrefix = assistant.timestamp >= latestPrefixTimestamp; + if (usageAppliesToPrefix && assistant.stopReason !== "aborted" && assistant.stopReason !== "error" && calculateContextTokens(assistant.usage) > 0) { + usageInfo = { usage: assistant.usage, index: i }; + } + } + latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp); + } + return usageInfo; +} +function estimateContextTokens(context) { + const messages = "messages" in context ? context.messages : context; + const usageInfo = getLastAssistantUsageInfo(messages); + if (usageInfo) { + const usageTokens = calculateContextTokens(usageInfo.usage); + let trailingTokens = 0; + for (let i = usageInfo.index + 1; i < messages.length; i++) { + trailingTokens += estimateMessageTokens(messages[i]); + } + return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index }; + } + let tokens = 0; + for (const message of messages) + tokens += estimateMessageTokens(message); + return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null }; +} +function estimateToolsTokens(tools) { + if (!tools || tools.length === 0) + return 0; + return estimateTextTokens(safeJsonStringify(tools)); +} +var CHARS_PER_TOKEN, ESTIMATED_IMAGE_CHARS; +var init_estimate = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/estimate.js"() { + init_text(); + CHARS_PER_TOKEN = 3.5; + ESTIMATED_IMAGE_CHARS = 4800; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +function clampMaxTokensToContext(model2, context, maxTokens) { + if (model2.contextWindow <= 0) + return Math.max(MIN_MAX_TOKENS, maxTokens); + const available = model2.contextWindow - estimateContextTokens(context).tokens - CONTEXT_SAFETY_TOKENS; + return Math.min(maxTokens, Math.max(MIN_MAX_TOKENS, available)); +} +function resolveSamplingParams(model2, thinkingLevel, requestParams) { + const effectiveThinkingLevel = clampThinkingLevel(model2, thinkingLevel); + const thinkingLevelParams = model2.samplingParamsByThinkingLevel?.[effectiveThinkingLevel]; + return model2.samplingParams || thinkingLevelParams || requestParams ? { ...model2.samplingParams, ...thinkingLevelParams, ...requestParams } : void 0; +} +function buildBaseOptions(model2, context, options, apiKey) { + const samplingParams = resolveSamplingParams(model2, options?.reasoning ?? "off", options?.samplingParams); + return { + temperature: options?.temperature, + samplingParams, + maxTokens: clampMaxTokensToContext(model2, context, options?.maxTokens ?? model2.maxTokens), + signal: options?.signal, + telemetry: options?.telemetry, + apiKey: apiKey || options?.apiKey, + fetch: options?.fetch, + transport: options?.transport, + cacheRetention: options?.cacheRetention, + sessionId: options?.sessionId, + headers: options?.headers, + identity: options?.identity, + onPayload: options?.onPayload, + onResponse: options?.onResponse, + onProviderStreamEvent: options?.onProviderStreamEvent, + timeoutMs: options?.timeoutMs, + websocketConnectTimeoutMs: options?.websocketConnectTimeoutMs, + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + metadata: options?.metadata, + env: options?.env + }; +} +function clampReasoning(effort) { + return effort === "xhigh" || effort === "max" ? "high" : effort; +} +function thinkingBudgetForLevel(reasoningLevel, customBudgets) { + const budgets = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets }; + const level = clampReasoning(reasoningLevel); + return budgets[level]; +} +function clampThinkingBudgetToAnswerRoom(thinkingBudget, ceiling) { + return Math.min(thinkingBudget, Math.max(0, ceiling - MIN_ANSWER_TOKENS)); +} +function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) { + let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets); + const maxTokens = baseMaxTokens === void 0 ? modelMaxTokens : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens); + if (maxTokens <= thinkingBudget) { + thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens); + } + return { maxTokens, thinkingBudget }; +} +var CONTEXT_SAFETY_TOKENS, MIN_MAX_TOKENS, MIN_ANSWER_TOKENS, DEFAULT_THINKING_BUDGETS; +var init_simple_options = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/simple-options.js"() { + init_models(); + init_estimate(); + CONTEXT_SAFETY_TOKENS = 4096; + MIN_MAX_TOKENS = 1; + MIN_ANSWER_TOKENS = 1024; + DEFAULT_THINKING_BUDGETS = { + minimal: 1024, + low: 2048, + medium: 8192, + high: 16384 + }; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +function splitErrorToolResultImages(msg) { + if (!msg.isError) + return void 0; + const images = msg.content.filter((block) => block.type === "image"); + if (images.length === 0) + return void 0; + return { + content: replaceImagesWithPlaceholder(msg.content, ERROR_TOOL_IMAGE_PLACEHOLDER), + caption: `Images from the error result of tool call ${msg.toolCallId} (${msg.toolName}):`, + images + }; +} +function replaceImagesWithPlaceholder(content, placeholder) { + const result = []; + let previousWasPlaceholder = false; + for (const block of content) { + if (block.type === "image") { + if (!previousWasPlaceholder) { + result.push({ type: "text", text: placeholder }); + } + previousWasPlaceholder = true; + continue; + } + result.push(block); + previousWasPlaceholder = block.text === placeholder; + } + return result; +} +function downgradeUnsupportedImages(messages, model2) { + if (model2.input.includes("image")) { + return messages; + } + return messages.map((msg) => { + if (msg.role === "user" && Array.isArray(msg.content)) { + return { + ...msg, + content: replaceImagesWithPlaceholder(msg.content, NON_VISION_USER_IMAGE_PLACEHOLDER) + }; + } + if (msg.role === "toolResult") { + return { + ...msg, + content: replaceImagesWithPlaceholder(msg.content, NON_VISION_TOOL_IMAGE_PLACEHOLDER) + }; + } + return msg; + }); +} +function transformMessages(messages, model2, normalizeToolCallId2) { + const toolCallIdMap = /* @__PURE__ */ new Map(); + const normalizedMessages = messages.map((msg) => msg.content == null ? { ...msg, content: [] } : msg); + const imageAwareMessages = downgradeUnsupportedImages(normalizedMessages, model2); + const transformed = imageAwareMessages.map((msg) => { + if (msg.role === "system" || msg.role === "user") { + return msg; + } + if (msg.role === "toolResult") { + const normalizedId = toolCallIdMap.get(msg.toolCallId); + if (normalizedId && normalizedId !== msg.toolCallId) { + return { ...msg, toolCallId: normalizedId }; + } + return msg; + } + if (msg.role === "assistant") { + const assistantMsg = msg; + const isSameModel = assistantMsg.provider === model2.provider && assistantMsg.api === model2.api && assistantMsg.model === model2.id; + const transformedContent = assistantMsg.content.flatMap((block) => { + if (block.type === "thinking") { + if (!isSameModel) + return []; + if (block.redacted || block.thinkingSignature) + return block; + if (!block.thinking || block.thinking.trim() === "") + return []; + return block; + } + if (block.type === "text") { + if (isSameModel) + return block; + return { + type: "text", + text: block.text + }; + } + if (block.type === "toolCall") { + const toolCall = block; + let normalizedToolCall = toolCall; + if (!isSameModel && toolCall.thoughtSignature) { + normalizedToolCall = { ...toolCall }; + delete normalizedToolCall.thoughtSignature; + } + if (!isSameModel && normalizeToolCallId2) { + const normalizedId = normalizeToolCallId2(toolCall.id, model2, assistantMsg); + if (normalizedId !== toolCall.id) { + toolCallIdMap.set(toolCall.id, normalizedId); + normalizedToolCall = { ...normalizedToolCall, id: normalizedId }; + } + } + return normalizedToolCall; + } + return block; + }); + return { + ...assistantMsg, + content: transformedContent + }; + } + return msg; + }); + const result = []; + let pendingToolCalls = []; + let existingToolResultIds = /* @__PURE__ */ new Set(); + const heldSystemMessages = []; + const closePendingToolCalls = () => { + if (pendingToolCalls.length > 0) { + for (const tc of pendingToolCalls) { + if (!existingToolResultIds.has(tc.id)) { + result.push({ + role: "toolResult", + toolCallId: tc.id, + toolName: tc.name, + content: [{ type: "text", text: "No result provided" }], + isError: true, + timestamp: Date.now() + }); + } + } + pendingToolCalls = []; + existingToolResultIds = /* @__PURE__ */ new Set(); + } + result.push(...heldSystemMessages); + heldSystemMessages.length = 0; + }; + for (let i = 0; i < transformed.length; i++) { + const msg = transformed[i]; + if (msg.role === "assistant") { + closePendingToolCalls(); + const assistantMsg = msg; + if (assistantMsg.stopReason === "error" || assistantMsg.stopReason === "aborted") { + continue; + } + const toolCalls = assistantMsg.content.filter((b) => b.type === "toolCall"); + if (toolCalls.length > 0) { + pendingToolCalls = toolCalls; + existingToolResultIds = /* @__PURE__ */ new Set(); + } + result.push(msg); + } else if (msg.role === "toolResult") { + existingToolResultIds.add(msg.toolCallId); + result.push(msg); + } else if (msg.role === "system") { + if (pendingToolCalls.length > 0) { + heldSystemMessages.push(msg); + } else { + result.push(msg); + } + } else if (msg.role === "user") { + closePendingToolCalls(); + result.push(msg); + } else { + result.push(msg); + } + } + closePendingToolCalls(); + return result; +} +var NON_VISION_USER_IMAGE_PLACEHOLDER, NON_VISION_TOOL_IMAGE_PLACEHOLDER, ERROR_TOOL_IMAGE_PLACEHOLDER; +var init_transform_messages = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js"() { + NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)"; + NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)"; + ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)"; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +var anthropic_messages_exports = {}; +__export(anthropic_messages_exports, { + stream: () => stream2, + streamSimple: () => streamSimple +}); +function resolveCacheRetention(cacheRetention, env) { + if (cacheRetention) { + return cacheRetention; + } + if (getProviderEnvValue("PI_CACHE_RETENTION", env) === "long") { + return "long"; + } + return "short"; +} +function getCacheControl(model2, cacheRetention, env) { + const retention = resolveCacheRetention(cacheRetention, env); + if (retention === "none") { + return { retention }; + } + const ttl = retention === "long" && getAnthropicCompat(model2).supportsLongCacheRetention ? "1h" : void 0; + return { + retention, + cacheControl: { type: "ephemeral", ...ttl && { ttl } } + }; +} +function convertImageBlock(image) { + return { + type: "image", + source: { + type: "base64", + media_type: image.mimeType, + data: image.data + } + }; +} +function convertContentBlocks(content) { + const hasImages = content.some((c) => c.type === "image"); + if (!hasImages) { + return sanitizeSurrogates(content.map((c) => c.text).join("\n")); + } + const blocks = content.map((block) => { + if (block.type === "text") { + return { + type: "text", + text: sanitizeSurrogates(block.text) + }; + } + return convertImageBlock(block); + }); + const hasText = blocks.some((b) => b.type === "text"); + if (!hasText) { + blocks.unshift({ + type: "text", + text: "(see attached image)" + }); + } + return blocks; +} +function shouldUseServerSideFallbackBeta(model2) { + return (model2.compat?.allowedFallbackModels?.length ?? 0) > 0; +} +function getAnthropicCompat(model2) { + const isOpenRouter2 = model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); + return { + supportsEagerToolInputStreaming: model2.compat?.supportsEagerToolInputStreaming ?? true, + supportsLongCacheRetention: model2.compat?.supportsLongCacheRetention ?? true, + sendSessionAffinityHeaders: model2.compat?.sendSessionAffinityHeaders ?? isOpenRouter2, + sessionAffinityFormat: model2.compat?.sessionAffinityFormat ?? (isOpenRouter2 ? "openrouter" : void 0), + supportsCacheControlOnTools: model2.compat?.supportsCacheControlOnTools ?? true, + supportsTemperature: model2.compat?.supportsTemperature ?? true, + allowEmptySignature: model2.compat?.allowEmptySignature ?? false, + supportsStrictTools: model2.compat?.supportsStrictTools ?? false, + supportsMidConvoSystemMessages: model2.compat?.supportsMidConvoSystemMessages ?? false, + supportsMidConvoToolChanges: model2.compat?.supportsMidConvoToolChanges ?? false + }; +} +function mergeHeaders2(...headerSources) { + const merged = {}; + for (const headers of headerSources) { + if (headers) { + Object.assign(merged, headers); + } + } + return merged; +} +function hasHeader(headers, name) { + if (!headers) + return false; + const expected = name.toLowerCase(); + for (const [key, value2] of Object.entries(headers)) { + if (key.toLowerCase() === expected && value2 !== null && value2.trim().length > 0) + return true; + } + return false; +} +function hasRequestAuth(apiKey, headers) { + return !!apiKey || hasHeader(headers, "authorization") || hasHeader(headers, "x-api-key") || hasHeader(headers, "cf-aig-authorization"); +} +function assertRequestAuth(provider2, apiKey, headers) { + if (!hasRequestAuth(apiKey, headers)) + throw new Error(`No API key for provider: ${provider2}`); +} +function getAnthropicFederation(model2, apiKey, headers, env) { + if (model2.provider !== "anthropic" || hasRequestAuth(apiKey, headers)) + return void 0; + const federationRuleId = getProviderEnvValue(ANTHROPIC_FEDERATION_RULE_ID_ENV, env); + const organizationId = getProviderEnvValue(ANTHROPIC_ORGANIZATION_ID_ENV, env); + const identityTokenFile = getProviderEnvValue(ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, env); + if (!federationRuleId || !organizationId || !identityTokenFile) + return void 0; + return { + organization_id: organizationId, + workspace_id: getProviderEnvValue(ANTHROPIC_WORKSPACE_ID_ENV, env), + authentication: { + type: "oidc_federation", + federation_rule_id: federationRuleId, + service_account_id: getProviderEnvValue(ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, env), + identity_token: { source: "file", path: identityTokenFile } + } + }; +} +function flushSseEvent(state2) { + if (!state2.event && state2.data.length === 0) { + return null; + } + const event = { + event: state2.event, + data: state2.data.join("\n"), + raw: [...state2.raw] + }; + state2.event = null; + state2.data = []; + state2.raw = []; + return event; +} +function decodeSseLine(line, state2) { + if (line === "") { + return flushSseEvent(state2); + } + state2.raw.push(line); + if (line.startsWith(":")) { + return null; + } + const delimiterIndex = line.indexOf(":"); + const fieldName = delimiterIndex === -1 ? line : line.slice(0, delimiterIndex); + let value2 = delimiterIndex === -1 ? "" : line.slice(delimiterIndex + 1); + if (value2.startsWith(" ")) { + value2 = value2.slice(1); + } + if (fieldName === "event") { + state2.event = value2; + } else if (fieldName === "data") { + state2.data.push(value2); + } + return null; +} +function nextLineBreakIndex(text2) { + const carriageReturnIndex = text2.indexOf("\r"); + const newlineIndex = text2.indexOf("\n"); + if (carriageReturnIndex === -1) { + return newlineIndex; + } + if (newlineIndex === -1) { + return carriageReturnIndex; + } + return Math.min(carriageReturnIndex, newlineIndex); +} +function consumeLine(text2) { + const lineBreakIndex = nextLineBreakIndex(text2); + if (lineBreakIndex === -1) { + return null; + } + let nextIndex = lineBreakIndex + 1; + if (text2[lineBreakIndex] === "\r" && text2[nextIndex] === "\n") { + nextIndex += 1; + } + return { + line: text2.slice(0, lineBreakIndex), + rest: text2.slice(nextIndex) + }; +} +async function* iterateSseMessages(body, signal) { + const reader = body.getReader(); + const decoder5 = new TextDecoder(); + const state2 = { event: null, data: [], raw: [] }; + let buffer = ""; + try { + while (true) { + if (signal?.aborted) { + throw new Error("Request was aborted"); + } + const { value: value2, done } = await reader.read(); + if (done) { + break; + } + buffer += decoder5.decode(value2, { stream: true }); + let consumed2 = consumeLine(buffer); + while (consumed2) { + buffer = consumed2.rest; + const event = decodeSseLine(consumed2.line, state2); + if (event) { + yield event; + } + consumed2 = consumeLine(buffer); + } + } + buffer += decoder5.decode(); + let consumed = consumeLine(buffer); + while (consumed) { + buffer = consumed.rest; + const event = decodeSseLine(consumed.line, state2); + if (event) { + yield event; + } + consumed = consumeLine(buffer); + } + if (buffer.length > 0) { + const event = decodeSseLine(buffer, state2); + if (event) { + yield event; + } + } + const trailingEvent = flushSseEvent(state2); + if (trailingEvent) { + yield trailingEvent; + } + } finally { + reader.releaseLock(); + } +} +async function* iterateAnthropicEvents(response, signal) { + if (!response.body) { + throw new Error("Attempted to iterate over an Anthropic response with no body"); + } + let sawMessageStart = false; + let sawMessageEnd = false; + for await (const sse of iterateSseMessages(response.body, signal)) { + if (sse.event === "error") { + throw new Error(sse.data); + } + if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) { + continue; + } + try { + const event = parseJsonWithRepair(sse.data); + if (event.type === "message_start") { + sawMessageStart = true; + } else if (event.type === "message_stop") { + sawMessageEnd = true; + } + yield event; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error(`Could not parse Anthropic SSE event ${sse.event}: ${message}; data=${sse.data}; raw=${sse.raw.join("\\n")}`); + } + } + if (sawMessageStart && !sawMessageEnd) { + throw new Error("Anthropic stream ended before message_stop"); + } +} +function mapThinkingLevelToEffort(model2, level) { + const mapped = level ? model2.thinkingLevelMap?.[level] : void 0; + if (typeof mapped === "string") + return mapped; + switch (level) { + case "minimal": + case "low": + return "low"; + case "medium": + return "medium"; + case "high": + return "high"; + default: + return "high"; + } +} +function isOAuthToken(apiKey) { + return apiKey.includes("sk-ant-oat"); +} +function createClient(model2, apiKey, optionsHeaders, fetch2, dynamicHeaders, sessionId, federation, identity) { + if (model2.provider === "github-copilot") { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: apiKey ?? null, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch2, + defaultHeaders: mergeHeaders2(getIdentityHeaders(model2, identity), { + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true" + }, model2.headers, dynamicHeaders, optionsHeaders) + }); + return { client: client2, isOAuthToken: false }; + } + if (apiKey && isOAuthToken(apiKey)) { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: apiKey, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch2, + defaultHeaders: mergeHeaders2({ + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "user-agent": `claude-cli/${claudeCodeVersion}`, + "x-app": "cli" + }, model2.headers, optionsHeaders) + }); + return { client: client2, isOAuthToken: true }; + } + const compat = getAnthropicCompat(model2); + const sessionAffinityHeaders = {}; + if (sessionId && compat.sendSessionAffinityHeaders) { + const header = compat.sessionAffinityFormat === "openrouter" ? "x-session-id" : "x-session-affinity"; + sessionAffinityHeaders[header] = sessionId; + } + const defaultHeaders = mergeHeaders2(getIdentityHeaders(model2, identity), { + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true" + }, sessionAffinityHeaders, model2.headers, optionsHeaders); + if (federation) { + const key = JSON.stringify([model2.baseUrl, federation]); + if (federationClient?.key !== key || federationClient.fetch !== fetch2) { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: null, + config: federation, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch2 + }); + federationClient = { key, fetch: fetch2, client: client2 }; + } + return { client: federationClient.client.withOptions({ defaultHeaders }), isOAuthToken: false }; + } + const client = new PiAnthropic({ + apiKey: apiKey ?? null, + authToken: null, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch2, + defaultHeaders + }); + return { client, isOAuthToken: false }; +} +function getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options) { + let configuredFeatures; + for (const headers of [model2.headers, options?.headers]) { + for (const [name, value2] of Object.entries(headers ?? {})) { + if (name.toLowerCase() === "anthropic-beta") + configuredFeatures = value2; + } + } + if (configuredFeatures === null) + return []; + if (configuredFeatures !== void 0) { + return [ + ...new Set(configuredFeatures.split(",").map((feature) => feature.trim()).filter((feature) => feature.length > 0)) + ]; + } + const features = []; + if (isOAuthToken2) + features.push("claude-code-20250219", "oauth-2025-04-20"); + if (shouldUseFineGrainedToolStreamingBeta(model2, context)) + features.push(FINE_GRAINED_TOOL_STREAMING_BETA); + if (model2.reasoning && options?.thinkingEnabled === true && (options.interleavedThinking ?? true) && model2.compat?.forceAdaptiveThinking !== true) { + features.push(INTERLEAVED_THINKING_BETA); + } + if (shouldUseServerSideFallbackBeta(model2)) + features.push(SERVER_SIDE_FALLBACK_BETA); + if (model2.compat?.supportsMidConvoEffort === true) { + features.push(MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA); + } + if (nativeToolChanges) + features.push(INLINE_TOOLS_BETA); + return [...new Set(features)]; +} +function buildParams(model2, context, isOAuthToken2, options, disablePreferredStrictTools = false) { + const { cacheControl } = getCacheControl(model2, options?.cacheRetention, options?.env); + const compat = getAnthropicCompat(model2); + const initialSystemMessage = getInitialSystemMessage(context.messages); + const initialSystemText = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : ""; + const transformedMessages = transformMessages(context.messages, model2, normalizeToolCallId); + const conversationMessages = initialSystemMessage ? transformedMessages.slice(1) : transformedMessages; + let hasPreferredStrictTools = false; + const convertToolDefinitions = (tools, toolCacheControl2) => { + const definitions = convertTools(tools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl2, disablePreferredStrictTools); + if (definitions.some((definition, index) => definition.strict === true && prefersJsonSchemaStrictSampling(tools[index]))) { + hasPreferredStrictTools = true; + } + return definitions; + }; + const initialTools = initialSystemMessage?.toolsAdded ?? []; + const nativeToolChanges = compat.supportsMidConvoSystemMessages && compat.supportsMidConvoToolChanges && initialTools.length > 0; + const thinkingDisabled = model2.reasoning && options?.thinkingEnabled === false && model2.thinkingLevelMap?.off !== null; + const effortMessages = model2.compat?.supportsMidConvoEffort === true && !thinkingDisabled; + const converted = convertMessages(conversationMessages, isOAuthToken2, cacheControl, compat.allowEmptySignature, effortMessages ? model2.provider : void 0, nativeToolChanges ? convertToolDefinitions : void 0); + const activeEffort = options?.effort ?? "high"; + const betaFeatures = getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options); + const params = { + model: model2.id, + messages: effortMessages ? insertThinkingLevelMessages(converted, activeEffort) : converted.messages, + max_tokens: options?.maxTokens ?? model2.maxTokens, + stream: true, + ...betaFeatures.length > 0 ? { betas: betaFeatures } : {} + }; + if (isOAuthToken2) { + params.system = [ + { + type: "text", + text: "You are Claude Code, Anthropic's official CLI for Claude.", + ...cacheControl ? { cache_control: cacheControl } : {} + } + ]; + if (initialSystemText) { + params.system.push({ + type: "text", + text: sanitizeSurrogates(initialSystemText), + ...cacheControl ? { cache_control: cacheControl } : {} + }); + } + } else if (initialSystemText) { + params.system = [ + { + type: "text", + text: sanitizeSurrogates(initialSystemText), + ...cacheControl ? { cache_control: cacheControl } : {} + } + ]; + } + if (options?.temperature !== void 0 && !options?.thinkingEnabled && model2.compat?.supportsMidConvoEffort !== true && compat.supportsTemperature) { + params.temperature = options.temperature; + } + const toolCacheControl = compat.supportsCacheControlOnTools ? cacheControl : void 0; + if (nativeToolChanges) { + params.tools = [...convertToolDefinitions(initialTools, toolCacheControl), DEFERRED_TOOL_PLACEHOLDER]; + } else { + const tools = getCurrentTools(context.messages); + if (tools.length > 0) { + params.tools = convertToolDefinitions(tools, toolCacheControl); + } + } + if (thinkingDisabled) { + params.thinking = { type: "disabled" }; + } else if (effortMessages) { + params.thinking = { + type: "adaptive", + display: options?.thinkingDisplay ?? "summarized", + block_binding: { prefix_mismatch_behavior: "drop_block" } + }; + params.output_config = { effort: "low" }; + } else if (model2.reasoning && options?.thinkingEnabled) { + const display = options.thinkingDisplay ?? "summarized"; + if (model2.compat?.forceAdaptiveThinking === true) { + params.thinking = { type: "adaptive", display }; + if (options.effort) { + params.output_config = { effort: options.effort }; + } + } else { + params.thinking = { + type: "enabled", + budget_tokens: options.thinkingBudgetTokens || 1024, + display + }; + } + } + if (options?.metadata) { + const userId = options.metadata.user_id; + if (typeof userId === "string") { + params.metadata = { user_id: userId }; + } + } + if (options?.toolChoice) { + if (typeof options.toolChoice === "string") { + params.tool_choice = { type: options.toolChoice }; + } else { + params.tool_choice = options.toolChoice; + } + } + const allowedFallbackModels = model2.compat?.allowedFallbackModels; + if (allowedFallbackModels && allowedFallbackModels.length > 0) { + params.fallbacks = allowedFallbackModels.map((fallback) => ({ model: fallback.model })); + } + return { params, hasPreferredStrictTools, providerThinkingLevel: effortMessages ? activeEffort : void 0 }; +} +function normalizeToolCallId(id) { + return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64); +} +function convertToolResult(msg, content = msg.content) { + return { + type: "tool_result", + tool_use_id: msg.toolCallId, + content: convertContentBlocks(content), + is_error: msg.isError + }; +} +function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, convertToolDefinitions) { + const params = []; + const assistantLevels = /* @__PURE__ */ new Map(); + const pendingSystemMessages = []; + const flushPendingSystemMessages = () => { + params.push(...pendingSystemMessages); + pendingSystemMessages.length = 0; + }; + for (let i = 0; i < transformedMessages.length; i++) { + const msg = transformedMessages[i]; + if (msg.role === "system") { + const text2 = renderSystemMessageUpdate(msg); + const blocks = []; + if (text2.length > 0) + blocks.push({ type: "text", text: sanitizeSurrogates(text2) }); + if (convertToolDefinitions) { + const added = msg.toolsAdded ?? []; + const redefined = new Set(added.map((tool) => tool.name)); + for (const tool of msg.toolsRemoved ?? []) { + if (redefined.has(tool.name)) + continue; + blocks.push({ + type: "tool_removal", + tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name } + }); + } + for (const definition of convertToolDefinitions(added)) { + blocks.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); + } + } + if (blocks.length > 0) + pendingSystemMessages.push({ role: "system", content: blocks }); + } else if (msg.role === "user") { + if (typeof msg.content === "string") { + if (msg.content.trim().length > 0) { + params.push({ + role: "user", + content: sanitizeSurrogates(msg.content) + }); + } + } else { + const blocks = msg.content.map((item) => { + if (item.type === "text") { + return { + type: "text", + text: sanitizeSurrogates(item.text) + }; + } else { + return convertImageBlock(item); + } + }); + const filteredBlocks = blocks.filter((b) => { + if (b.type === "text") { + return b.text.trim().length > 0; + } + return true; + }); + if (filteredBlocks.length === 0) + continue; + params.push({ + role: "user", + content: filteredBlocks + }); + } + } else if (msg.role === "assistant") { + const blocks = []; + for (const block of msg.content) { + if (block.type === "text") { + if (block.text.trim().length === 0) + continue; + blocks.push({ + type: "text", + text: sanitizeSurrogates(block.text) + }); + } else if (block.type === "thinking") { + if (block.redacted) { + blocks.push({ + type: "redacted_thinking", + data: block.thinkingSignature + }); + continue; + } + const thinkingSignature = block.thinkingSignature; + const hasThinkingSignature = !!thinkingSignature && thinkingSignature.trim().length > 0; + if (block.thinking.trim().length === 0 && !hasThinkingSignature) + continue; + if (!hasThinkingSignature) { + blocks.push(allowEmptySignature ? { + type: "thinking", + thinking: sanitizeSurrogates(block.thinking), + signature: "" + } : { + type: "text", + text: sanitizeSurrogates(block.thinking) + }); + } else { + blocks.push({ + type: "thinking", + thinking: sanitizeSurrogates(block.thinking), + signature: thinkingSignature + }); + } + } else if (block.type === "toolCall") { + blocks.push({ + type: "tool_use", + id: block.id, + name: isOAuthToken2 ? toClaudeCodeName(block.name) : block.name, + input: block.arguments ?? {} + }); + } + } + if (blocks.length === 0) + continue; + flushPendingSystemMessages(); + const messageIndex = params.length; + params.push({ + role: "assistant", + content: blocks + }); + if (managedProvider !== void 0 && msg.api === "anthropic-messages" && msg.provider === managedProvider && isAnthropicEffort(msg.providerThinkingLevel)) { + assistantLevels.set(messageIndex, msg.providerThinkingLevel); + } + } else if (msg.role === "toolResult") { + const toolResults = []; + const errorImages = []; + let j = i; + while (j < transformedMessages.length && transformedMessages[j].role === "toolResult") { + const toolMsg = transformedMessages[j]; + const split = splitErrorToolResultImages(toolMsg); + toolResults.push(convertToolResult(toolMsg, split?.content)); + if (split) { + errorImages.push({ type: "text", text: split.caption }, ...split.images.map(convertImageBlock)); + } + j++; + } + i = j - 1; + params.push({ + role: "user", + content: [...toolResults, ...errorImages] + }); + } + } + flushPendingSystemMessages(); + if (cacheControl && params.length > 0) { + const lastMessage = params[params.length - 1]; + if (lastMessage.role === "user" || lastMessage.role === "system") { + if (Array.isArray(lastMessage.content)) { + const lastBlock = lastMessage.content[lastMessage.content.length - 1]; + if (lastBlock && (lastBlock.type === "text" || lastBlock.type === "image" || lastBlock.type === "tool_result" || lastBlock.type === "tool_addition" || lastBlock.type === "tool_removal")) { + lastBlock.cache_control = cacheControl; + } + } else if (typeof lastMessage.content === "string") { + lastMessage.content = [ + { + type: "text", + text: lastMessage.content, + cache_control: cacheControl + } + ]; + } + } + } + return { messages: params, assistantLevels }; +} +function isAnthropicEffort(value2) { + return value2 === "low" || value2 === "medium" || value2 === "high" || value2 === "xhigh" || value2 === "max"; +} +function insertThinkingLevelMessages(converted, activeEffort) { + const messages = []; + for (let index = 0; index < converted.messages.length; index++) { + const historicalEffort = converted.assistantLevels.get(index); + if (historicalEffort !== void 0) { + messages.push({ role: "system", content: [], output_config: { effort: historicalEffort } }); + } + messages.push(converted.messages[index]); + } + messages.push({ role: "system", content: [], output_config: { effort: activeEffort } }); + return messages; +} +function shouldUseFineGrainedToolStreamingBeta(model2, context) { + return getCurrentTools(context.messages).length > 0 && !getAnthropicCompat(model2).supportsEagerToolInputStreaming; +} +function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl, disablePreferredStrictTools = false) { + if (!tools) + return []; + return tools.map((tool, index) => { + const strict = disablePreferredStrictTools && prefersJsonSchemaStrictSampling(tool) ? void 0 : resolveJsonSchemaStrictSampling(tool, supportsStrictTools, isAnthropicStrictUnsupportedKeyword); + const parameters = getJsonSchemaToolParameters(tool, strict); + const schema4 = parameters; + const legacyInputSchema = { + type: "object", + properties: schema4.properties ?? {}, + required: schema4.required ?? [] + }; + const inputSchema = strict === true ? { + ...parameters, + ...legacyInputSchema + } : legacyInputSchema; + return { + name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name, + description: tool.description, + ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {}, + ...strict === true ? { strict: true } : {}, + input_schema: inputSchema, + ...cacheControl && index === tools.length - 1 ? { cache_control: cacheControl } : {} + }; + }); +} +function mapStopReason(reason, stopDetails) { + switch (reason) { + case "end_turn": + return { stopReason: "stop" }; + case "max_tokens": + return { stopReason: "length" }; + case "tool_use": + return { stopReason: "toolUse" }; + case "refusal": + return { + stopReason: "error", + errorMessage: stopDetails?.explanation || `The model refused to complete the request` + }; + case "pause_turn": + return { stopReason: "stop" }; + case "stop_sequence": + return { stopReason: "stop" }; + // We don't supply stop sequences, so this should never happen + case "sensitive": + return { stopReason: "error", errorMessage: "Provider stopped with: sensitive" }; + default: + throw new Error(`Unhandled stop reason: ${reason}`); + } +} +var claudeCodeVersion, claudeCodeTools, ccToolLookup, toClaudeCodeName, fromClaudeCodeName, FINE_GRAINED_TOOL_STREAMING_BETA, INTERLEAVED_THINKING_BETA, SERVER_SIDE_FALLBACK_BETA, MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA, INLINE_TOOLS_BETA, DEFERRED_TOOL_PLACEHOLDER, PiAnthropic, federationClient, ANTHROPIC_MESSAGE_EVENTS, stream2, streamSimple, ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS, ANTHROPIC_STRICT_STRING_FORMATS, isAnthropicStrictUnsupportedKeyword; +var init_anthropic_messages = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js"() { + init_sdk(); + init_env_api_keys(); + init_models(); + init_diagnostics(); + init_event_stream(); + init_headers2(); + init_identity(); + init_json_parse(); + init_openrouter_cost(); + init_provider_env(); + init_provider_retry(); + init_sanitize_unicode(); + init_streaming_json(); + init_text(); + init_transcript(); + init_constrained_sampling(); + init_github_copilot_headers(); + init_simple_options(); + init_transform_messages(); + claudeCodeVersion = "2.1.280"; + claudeCodeTools = [ + "Read", + "Write", + "Edit", + "Bash", + "Grep", + "Glob", + "AskUserQuestion", + "EnterPlanMode", + "ExitPlanMode", + "KillShell", + "NotebookEdit", + "Skill", + "Task", + "TaskOutput", + "TodoWrite", + "WebFetch", + "WebSearch" + ]; + ccToolLookup = new Map(claudeCodeTools.map((t) => [t.toLowerCase(), t])); + toClaudeCodeName = (name) => ccToolLookup.get(name.toLowerCase()) ?? name; + fromClaudeCodeName = (name, tools) => { + if (tools && tools.length > 0) { + const lowerName = name.toLowerCase(); + const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName); + if (matchedTool) + return matchedTool.name; + } + return name; + }; + FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14"; + INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14"; + SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01"; + MID_CONVERSATION_OUTPUT_CONFIG_BETA = "mid-conversation-output-config-2026-07-01"; + THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"; + INLINE_TOOLS_BETA = "inline-tools-2026-09-15"; + DEFERRED_TOOL_PLACEHOLDER = { + name: "__pi_deferred_placeholder__", + description: "Reserved placeholder. Never available. Never call this.", + input_schema: { type: "object", properties: {}, required: [] }, + defer_loading: true + }; + PiAnthropic = class extends Anthropic { + _shouldResolveDefaultCredentials() { + return false; + } + }; + ANTHROPIC_MESSAGE_EVENTS = /* @__PURE__ */ new Set([ + "message_start", + "message_delta", + "message_stop", + "content_block_start", + "content_block_delta", + "content_block_stop" + ]); + stream2 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); + const normalizedContext = resolveTranscript(context, getAnthropicCompat(model2).supportsMidConvoSystemMessages); + const currentTools = getCurrentTools(normalizedContext.messages); + (async () => { + const output = { + role: "assistant", + content: [], + api: model2.api, + provider: model2.provider, + model: model2.id, + usage: { + input: 0, + output: 0, + cacheRead: 0, + cacheWrite: 0, + totalTokens: 0, + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } + }, + stopReason: "pending", + timestamp: Date.now() + }; + try { + let client; + let isOAuth; + let usageModel = model2; + let inputTransformations; + if (options?.client) { + client = options.client; + isOAuth = false; + } else { + const apiKey = options?.apiKey; + const federation = getAnthropicFederation(model2, apiKey, options?.headers, options?.env); + if (!federation) + assertRequestAuth(model2.provider, apiKey, options?.headers); + let copilotDynamicHeaders; + if (model2.provider === "github-copilot") { + const hasImages = hasCopilotVisionInput(normalizedContext.messages); + copilotDynamicHeaders = buildCopilotDynamicHeaders({ + messages: normalizedContext.messages, + hasImages + }); + } + const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; + const created = createClient(model2, apiKey, options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId, federation, options?.identity); + client = created.client; + isOAuth = created.isOAuthToken; + } + const requestOptions = { + ...options?.signal ? { signal: options.signal } : {}, + ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {}, + maxRetries: 0 + }; + let disablePreferredStrictTools = false; + let response; + for (; ; ) { + options?.signal?.throwIfAborted(); + const built = buildParams(model2, normalizedContext, isOAuth, options, disablePreferredStrictTools); + if (built.providerThinkingLevel) + output.providerThinkingLevel = built.providerThinkingLevel; + let params = built.params; + const nextParams = await options?.onPayload?.(params, model2); + if (nextParams !== void 0) { + params = { ...nextParams, stream: true }; + } + try { + response = await retryProviderRequest(() => client.beta.messages.create(params, requestOptions).asResponse(), { + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + signal: options?.signal + }); + break; + } catch (error) { + if (options?.signal?.aborted || disablePreferredStrictTools || !built.hasPreferredStrictTools || !(error instanceof Anthropic.APIError) || error.status !== 400 || error.type !== "invalid_request_error" || !isStrictToolLimitErrorMessage(error.message)) { + throw error; + } + disablePreferredStrictTools = true; + appendAssistantMessageDiagnostic(output, { + type: "anthropic_strict_tools_fallback", + timestamp: Date.now(), + error: { message: error.message }, + details: { reason: "strict_tool_limits_exceeded" } + }); + } + } + await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); + stream5.push({ type: "start", partial: output }); + const openBlocks = /* @__PURE__ */ new Map(); + const openBlock = (anthropicIndex) => { + const open = openBlocks.get(anthropicIndex); + return open === void 0 ? void 0 : { ...open, block: output.content[open.contentIndex] }; + }; + for await (const event of iterateAnthropicEvents(response, options?.signal)) { + await options?.onProviderStreamEvent?.(event, model2); + if (event.type === "message_start") { + output.responseId = event.message.id; + const transformations = event.message.input_transformations; + if (Array.isArray(transformations)) + inputTransformations = transformations; + const responseModel = event.message.model; + if (responseModel !== model2.id) + output.responseModel = responseModel; + const fallbackCost = responseModel === model2.id ? void 0 : model2.compat?.allowedFallbackModels?.find((fallback) => fallback.provider === model2.provider && fallback.model === responseModel)?.cost; + usageModel = fallbackCost ? { ...model2, id: responseModel, cost: fallbackCost } : model2; + output.usage.input = event.message.usage.input_tokens || 0; + output.usage.output = event.message.usage.output_tokens || 0; + output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0; + output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0; + output.usage.cacheWrite1h = event.message.usage.cache_creation?.ephemeral_1h_input_tokens || 0; + output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; + calculateCost(usageModel, output.usage); + } else if (event.type === "content_block_start") { + if (event.content_block.type === "fallback") { + if (output.content.length > 0) { + throw new Error("Anthropic performed an unsupported mid-output model fallback"); + } + continue; + } + if (event.content_block.type === "text") { + output.content.push({ type: "text", text: event.content_block.text ?? "" }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "thinking") { + output.content.push({ + type: "thinking", + thinking: event.content_block.thinking ?? "", + thinkingSignature: event.content_block.signature ?? "" + }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "redacted_thinking") { + output.content.push({ + type: "thinking", + thinking: "[Reasoning redacted]", + thinkingSignature: event.content_block.data, + redacted: true + }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "tool_use") { + output.content.push({ + type: "toolCall", + id: event.content_block.id, + name: isOAuth ? fromClaudeCodeName(event.content_block.name, currentTools) : event.content_block.name, + arguments: event.content_block.input ?? {} + }); + openBlocks.set(event.index, { + contentIndex: output.content.length - 1, + arguments: new ToolCallArgumentsStream() + }); + stream5.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output }); + } + } else if (event.type === "content_block_delta") { + const open = openBlock(event.index); + if (event.delta.type === "text_delta") { + if (open?.block.type === "text") { + open.block.text += event.delta.text; + stream5.push({ + type: "text_delta", + contentIndex: open.contentIndex, + delta: event.delta.text, + partial: output + }); + } + } else if (event.delta.type === "thinking_delta") { + if (open?.block.type === "thinking") { + open.block.thinking += event.delta.thinking; + stream5.push({ + type: "thinking_delta", + contentIndex: open.contentIndex, + delta: event.delta.thinking, + partial: output + }); + } + } else if (event.delta.type === "input_json_delta") { + if (open?.block.type === "toolCall" && open.arguments !== void 0) { + open.block.arguments = open.arguments.append(event.delta.partial_json); + stream5.push({ + type: "toolcall_delta", + contentIndex: open.contentIndex, + delta: event.delta.partial_json, + partial: output + }); + } + } else if (event.delta.type === "signature_delta") { + if (open?.block.type === "thinking") { + open.block.thinkingSignature = open.block.thinkingSignature || ""; + open.block.thinkingSignature += event.delta.signature; + } + } + } else if (event.type === "content_block_stop") { + const open = openBlock(event.index); + openBlocks.delete(event.index); + if (open) { + const { block, contentIndex: index } = open; + if (block.type === "text") { + stream5.push({ + type: "text_end", + contentIndex: index, + content: block.text, + partial: output + }); + } else if (block.type === "thinking") { + stream5.push({ + type: "thinking_end", + contentIndex: index, + content: block.thinking, + partial: output + }); + } else if (block.type === "toolCall" && open.arguments !== void 0) { + Object.assign(block, open.arguments.finish()); + stream5.push({ + type: "toolcall_end", + contentIndex: index, + toolCall: block, + partial: output + }); + } + } + } else if (event.type === "message_delta") { + const transformations = event.input_transformations; + if (Array.isArray(transformations)) + inputTransformations = transformations; + if (event.delta.stop_reason) { + output.rawStopReason = event.delta.stop_reason; + const stopReasonResult = mapStopReason(event.delta.stop_reason, event.delta.stop_details); + output.stopReason = stopReasonResult.stopReason; + if (stopReasonResult.errorMessage) { + output.errorMessage = stopReasonResult.errorMessage; + } + } + if (event.usage) { + if (event.usage.input_tokens != null) { + output.usage.input = event.usage.input_tokens; + } + if (event.usage.output_tokens != null) { + output.usage.output = event.usage.output_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + output.usage.cacheRead = event.usage.cache_read_input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + output.usage.cacheWrite = event.usage.cache_creation_input_tokens; + } + const cacheCreation = event.usage.cache_creation; + if (cacheCreation?.ephemeral_1h_input_tokens != null) { + output.usage.cacheWrite1h = cacheCreation.ephemeral_1h_input_tokens; + } + const thinkingTokens = event.usage.output_tokens_details?.thinking_tokens; + if (thinkingTokens != null) { + output.usage.reasoning = thinkingTokens; + } + } + output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; + calculateCost(usageModel, output.usage); + if (isOpenRouterModel(model2) && event.usage) { + applyOpenRouterReportedCost(output.usage, event.usage); + } + } + } + if (options?.signal?.aborted) { + throw new Error("Request was aborted"); + } + if (output.stopReason === "pending") { + throw new Error("Anthropic stream ended without a stop reason"); + } + if (output.stopReason === "aborted" || output.stopReason === "error") { + throw new Error(output.errorMessage || "An unknown error occurred"); + } + if (inputTransformations && inputTransformations.length > 0) { + appendAssistantMessageDiagnostic(output, { + type: "anthropic_input_transformations", + timestamp: Date.now(), + details: { + transformations: inputTransformations.map((transformation) => ({ + type: transformation.type ?? void 0, + path: transformation.path ?? void 0, + reason: transformation.reason ?? void 0 + })) + } + }); + } + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); + } catch (error) { + output.stopReason = options?.signal?.aborted ? "aborted" : "error"; + output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error); + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); + } + })(); + return stream5; + }; + streamSimple = (model2, context, options) => { + if (!getAnthropicFederation(model2, options?.apiKey, options?.headers, options?.env)) { + assertRequestAuth(model2.provider, options?.apiKey, options?.headers); + } + const base = { + ...buildBaseOptions(model2, context, options, options?.apiKey), + toolChoice: options?.toolChoice + }; + if (!options?.reasoning) { + return stream2(model2, context, { + ...base, + thinkingEnabled: false + }); + } + if (model2.compat?.forceAdaptiveThinking === true) { + const effort = mapThinkingLevelToEffort(model2, options.reasoning); + return stream2(model2, context, { + ...base, + thinkingEnabled: true, + effort + }); + } + const adjusted = adjustMaxTokensForThinking(base.maxTokens, model2.maxTokens, options.reasoning, options.thinkingBudgets); + const maxTokens = clampMaxTokensToContext(model2, context, adjusted.maxTokens); + return stream2(model2, context, { + ...base, + maxTokens, + thinkingEnabled: true, + thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)) + }); + }; + ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS = /* @__PURE__ */ new Set([ + "minimum", + "maximum", + "exclusiveMinimum", + "exclusiveMaximum", + "multipleOf", + "maxItems", + "uniqueItems", + "minContains", + "maxContains", + "minProperties", + "maxProperties" + ]); + ANTHROPIC_STRICT_STRING_FORMATS = /* @__PURE__ */ new Set([ + "date-time", + "time", + "date", + "duration", + "email", + "hostname", + "uri", + "ipv4", + "ipv6", + "uuid" + ]); + isAnthropicStrictUnsupportedKeyword = (key, value2) => { + if (ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS.has(key)) + return true; + if (key === "minItems") + return value2 !== 0 && value2 !== 1; + if (key === "format") + return typeof value2 !== "string" || !ANTHROPIC_STRICT_STRING_FORMATS.has(value2); + return false; }; } }); // node_modules/openai/internal/tslib.mjs -function __classPrivateFieldSet(receiver, state2, value2, kind, f) { +function __classPrivateFieldSet2(receiver, state2, value2, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -2408,26 +19782,26 @@ function __classPrivateFieldSet(receiver, state2, value2, kind, f) { throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state2.set(receiver, value2), value2; } -function __classPrivateFieldGet(receiver, state2, kind, f) { +function __classPrivateFieldGet2(receiver, state2, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); } -var init_tslib = __esm({ +var init_tslib2 = __esm({ "node_modules/openai/internal/tslib.mjs"() { } }); // node_modules/openai/internal/utils/uuid.mjs -var uuid4; -var init_uuid = __esm({ +var uuid42; +var init_uuid2 = __esm({ "node_modules/openai/internal/utils/uuid.mjs"() { - uuid4 = function() { + uuid42 = function() { const { crypto: crypto3 } = globalThis; if (crypto3?.randomUUID) { - uuid4 = crypto3.randomUUID.bind(crypto3); + uuid42 = crypto3.randomUUID.bind(crypto3); return crypto3.randomUUID(); } const u8 = new Uint8Array(1); @@ -2438,15 +19812,15 @@ var init_uuid = __esm({ }); // node_modules/openai/internal/errors.mjs -function isAbortError(err) { +function isAbortError2(err) { return typeof err === "object" && err !== null && // Spec-compliant fetch implementations ("name" in err && err.name === "AbortError" || // Expo fetch "message" in err && String(err.message).includes("FetchRequestCanceledException")); } -var castToError; -var init_errors = __esm({ +var castToError2; +var init_errors2 = __esm({ "node_modules/openai/internal/errors.mjs"() { - castToError = (err) => { + castToError2 = (err) => { if (err instanceof Error) return err; if (typeof err === "object" && err !== null) { @@ -2475,13 +19849,13 @@ var init_errors = __esm({ }); // node_modules/openai/core/error.mjs -var OpenAIError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, LengthFinishReasonError, ContentFilterFinishReasonError, InvalidWebhookSignatureError, OAuthError, SubjectTokenProviderError; -var init_error = __esm({ +var OpenAIError, APIError2, APIUserAbortError2, APIConnectionError2, APIConnectionTimeoutError2, BadRequestError2, AuthenticationError2, PermissionDeniedError2, NotFoundError2, ConflictError2, UnprocessableEntityError2, RateLimitError2, InternalServerError2, LengthFinishReasonError, ContentFilterFinishReasonError, InvalidWebhookSignatureError, OAuthError, SubjectTokenProviderError; +var init_error3 = __esm({ "node_modules/openai/core/error.mjs"() { - init_errors(); + init_errors2(); OpenAIError = class extends Error { }; - APIError = class _APIError extends OpenAIError { + APIError2 = class _APIError extends OpenAIError { constructor(status, error, message, headers) { super(`${_APIError.makeMessage(status, error, message)}`); this.status = status; @@ -2508,68 +19882,68 @@ var init_error = __esm({ } static generate(status, errorResponse, message, headers) { if (!status || !headers) { - return new APIConnectionError({ message, cause: castToError(errorResponse) }); + return new APIConnectionError2({ message, cause: castToError2(errorResponse) }); } const error = errorResponse?.["error"]; if (status === 400) { - return new BadRequestError(status, error, message, headers); + return new BadRequestError2(status, error, message, headers); } if (status === 401) { - return new AuthenticationError(status, error, message, headers); + return new AuthenticationError2(status, error, message, headers); } if (status === 403) { - return new PermissionDeniedError(status, error, message, headers); + return new PermissionDeniedError2(status, error, message, headers); } if (status === 404) { - return new NotFoundError(status, error, message, headers); + return new NotFoundError2(status, error, message, headers); } if (status === 409) { - return new ConflictError(status, error, message, headers); + return new ConflictError2(status, error, message, headers); } if (status === 422) { - return new UnprocessableEntityError(status, error, message, headers); + return new UnprocessableEntityError2(status, error, message, headers); } if (status === 429) { - return new RateLimitError(status, error, message, headers); + return new RateLimitError2(status, error, message, headers); } if (status >= 500) { - return new InternalServerError(status, error, message, headers); + return new InternalServerError2(status, error, message, headers); } return new _APIError(status, error, message, headers); } }; - APIUserAbortError = class extends APIError { + APIUserAbortError2 = class extends APIError2 { constructor({ message } = {}) { super(void 0, void 0, message || "Request was aborted.", void 0); } }; - APIConnectionError = class extends APIError { + APIConnectionError2 = class extends APIError2 { constructor({ message, cause }) { super(void 0, void 0, message || "Connection error.", void 0); if (cause) this.cause = cause; } }; - APIConnectionTimeoutError = class extends APIConnectionError { + APIConnectionTimeoutError2 = class extends APIConnectionError2 { constructor({ message } = {}) { super({ message: message ?? "Request timed out." }); } }; - BadRequestError = class extends APIError { + BadRequestError2 = class extends APIError2 { }; - AuthenticationError = class extends APIError { + AuthenticationError2 = class extends APIError2 { }; - PermissionDeniedError = class extends APIError { + PermissionDeniedError2 = class extends APIError2 { }; - NotFoundError = class extends APIError { + NotFoundError2 = class extends APIError2 { }; - ConflictError = class extends APIError { + ConflictError2 = class extends APIError2 { }; - UnprocessableEntityError = class extends APIError { + UnprocessableEntityError2 = class extends APIError2 { }; - RateLimitError = class extends APIError { + RateLimitError2 = class extends APIError2 { }; - InternalServerError = class extends APIError { + InternalServerError2 = class extends APIError2 { }; LengthFinishReasonError = class extends OpenAIError { constructor() { @@ -2586,7 +19960,7 @@ var init_error = __esm({ super(message); } }; - OAuthError = class extends APIError { + OAuthError = class extends APIError2 { constructor(status, error, headers) { let finalMessage = "OAuth2 authentication error"; let error_code = void 0; @@ -2615,36 +19989,36 @@ var init_error = __esm({ }); // node_modules/openai/internal/utils/values.mjs -function maybeObj(x) { +function maybeObj2(x) { if (typeof x !== "object") { return {}; } return x ?? {}; } -function isEmptyObj(obj2) { +function isEmptyObj2(obj2) { if (!obj2) return true; for (const _k in obj2) return false; return true; } -function hasOwn(obj2, key) { +function hasOwn2(obj2, key) { return Object.prototype.hasOwnProperty.call(obj2, key); } -function isObj(obj2) { +function isObj2(obj2) { return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); } -var startsWithSchemeRegexp, isAbsoluteURL, isArray, isReadonlyArray, validatePositiveInteger, safeJSON; -var init_values = __esm({ +var startsWithSchemeRegexp2, isAbsoluteURL2, isArray2, isReadonlyArray2, validatePositiveInteger2, safeJSON2; +var init_values2 = __esm({ "node_modules/openai/internal/utils/values.mjs"() { - init_error(); - startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; - isAbsoluteURL = (url) => { - return startsWithSchemeRegexp.test(url); + init_error3(); + startsWithSchemeRegexp2 = /^[a-z][a-z0-9+.-]*:/i; + isAbsoluteURL2 = (url) => { + return startsWithSchemeRegexp2.test(url); }; - isArray = (val) => (isArray = Array.isArray, isArray(val)); - isReadonlyArray = isArray; - validatePositiveInteger = (name, n) => { + isArray2 = (val) => (isArray2 = Array.isArray, isArray2(val)); + isReadonlyArray2 = isArray2; + validatePositiveInteger2 = (name, n) => { if (typeof n !== "number" || !Number.isInteger(n)) { throw new OpenAIError(`${name} must be an integer`); } @@ -2653,7 +20027,7 @@ var init_values = __esm({ } return n; }; - safeJSON = (text2) => { + safeJSON2 = (text2) => { try { return JSON.parse(text2); } catch (err) { @@ -2664,10 +20038,10 @@ var init_values = __esm({ }); // node_modules/openai/internal/utils/sleep.mjs -var sleep; -var init_sleep = __esm({ +var sleep2; +var init_sleep2 = __esm({ "node_modules/openai/internal/utils/sleep.mjs"() { - sleep = (ms, ...signals) => new Promise((resolve2, reject2) => { + sleep2 = (ms, ...signals) => new Promise((resolve2, reject2) => { const activeSignals = [...new Set(signals.filter((signal) => signal != null))]; let timeout; let settled = false; @@ -2779,7 +20153,7 @@ function addRequestAbortListener(signal, abort, requestSignal) { return cleanup; } var weakGlobals, finalizer, callbackOwners, subscriptions; -var init_abort2 = __esm({ +var init_abort3 = __esm({ "node_modules/openai/internal/utils/abort.mjs"() { weakGlobals = globalThis; finalizer = // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Weak references and finalizers are optional host capabilities, so probe them before constructing either. @@ -2795,22 +20169,22 @@ var init_abort2 = __esm({ }); // node_modules/openai/internal/shims.mjs -function getDefaultFetch() { +function getDefaultFetch2() { if (typeof fetch !== "undefined") { return fetch; } throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); } -function makeReadableStream(...args) { +function makeReadableStream2(...args) { const ReadableStream2 = globalThis.ReadableStream; if (typeof ReadableStream2 === "undefined") { throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); } return new ReadableStream2(...args); } -function ReadableStreamFrom(iterable) { +function ReadableStreamFrom2(iterable) { let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); - return makeReadableStream({ + return makeReadableStream2({ start() { }, async pull(controller) { @@ -2826,10 +20200,10 @@ function ReadableStreamFrom(iterable) { } }); } -function ReadableStreamToAsyncIterable(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); +function ReadableStreamToAsyncIterable2(stream5) { + if (stream5[Symbol.asyncIterator]) + return stream5; + const reader = stream5.getReader(); return { async next() { try { @@ -2853,40 +20227,40 @@ function ReadableStreamToAsyncIterable(stream4) { } }; } -async function CancelReadableStream(stream4) { - if (stream4 === null || typeof stream4 !== "object") +async function CancelReadableStream2(stream5) { + if (stream5 === null || typeof stream5 !== "object") return; - if (stream4[Symbol.asyncIterator]) { - await stream4[Symbol.asyncIterator]().return?.(); + if (stream5[Symbol.asyncIterator]) { + await stream5[Symbol.asyncIterator]().return?.(); return; } - const reader = stream4.getReader(); + const reader = stream5.getReader(); const cancelPromise = reader.cancel(); reader.releaseLock(); await cancelPromise; } -var init_shims = __esm({ +var init_shims2 = __esm({ "node_modules/openai/internal/shims.mjs"() { } }); // node_modules/openai/internal/utils/bytes.mjs -function encodeUTF8(str2) { +function encodeUTF82(str2) { let encoder6; - return (encodeUTF8_ ?? (encoder6 = new globalThis.TextEncoder(), encodeUTF8_ = encoder6.encode.bind(encoder6)))(str2); + return (encodeUTF8_2 ?? (encoder6 = new globalThis.TextEncoder(), encodeUTF8_2 = encoder6.encode.bind(encoder6)))(str2); } -function decodeUTF8(bytes2) { +function decodeUTF82(bytes2) { let decoder5; - return (decodeUTF8_ ?? (decoder5 = new globalThis.TextDecoder(), decodeUTF8_ = decoder5.decode.bind(decoder5)))(bytes2); + return (decodeUTF8_2 ?? (decoder5 = new globalThis.TextDecoder(), decodeUTF8_2 = decoder5.decode.bind(decoder5)))(bytes2); } -var encodeUTF8_, decodeUTF8_; -var init_bytes = __esm({ +var encodeUTF8_2, decodeUTF8_2; +var init_bytes2 = __esm({ "node_modules/openai/internal/utils/bytes.mjs"() { } }); // node_modules/openai/internal/decoders/line.mjs -function findNewlineIndex(buffer, start, end) { +function findNewlineIndex2(buffer, start, end) { const newline = 10; const carriage = 13; for (let i = start; i < end; i++) { @@ -2923,26 +20297,26 @@ function lineEndingLength(buffer, index) { } return 0; } -var _LineDecoder_instances, _LineDecoder_buffer, _LineDecoder_start, _LineDecoder_end, _LineDecoder_searchIndex, _LineDecoder_skipLeadingLF, _LineDecoder_append, MAX_RETAINED_BUFFER_BYTES, LineDecoder; -var init_line = __esm({ +var _LineDecoder_instances, _LineDecoder_buffer2, _LineDecoder_start, _LineDecoder_end, _LineDecoder_searchIndex, _LineDecoder_skipLeadingLF, _LineDecoder_append, MAX_RETAINED_BUFFER_BYTES, LineDecoder2; +var init_line2 = __esm({ "node_modules/openai/internal/decoders/line.mjs"() { - init_tslib(); - init_bytes(); + init_tslib2(); + init_bytes2(); MAX_RETAINED_BUFFER_BYTES = 64 * 1024; - LineDecoder = class { + LineDecoder2 = class { /** Creates a decoder with no buffered bytes or pending newline continuation. */ constructor() { _LineDecoder_instances.add(this); - _LineDecoder_buffer.set(this, void 0); + _LineDecoder_buffer2.set(this, void 0); _LineDecoder_start.set(this, void 0); _LineDecoder_end.set(this, void 0); _LineDecoder_searchIndex.set(this, void 0); _LineDecoder_skipLeadingLF.set(this, void 0); - __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); } /** * Appends a text or UTF-8 byte chunk and returns every newly completed line. @@ -2960,15 +20334,15 @@ var init_line = __esm({ if (chunk instanceof ArrayBuffer) { binaryChunk = new Uint8Array(chunk); } else if (typeof chunk === "string") { - binaryChunk = encodeUTF8(chunk); + binaryChunk = encodeUTF82(chunk); } else { binaryChunk = chunk; } if (binaryChunk.length === 0) { return []; } - if (__classPrivateFieldGet(this, _LineDecoder_skipLeadingLF, "f")) { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_skipLeadingLF, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); if (binaryChunk[0] === 10) { binaryChunk = binaryChunk.subarray(1); } @@ -2976,103 +20350,103 @@ var init_line = __esm({ return []; } } - __classPrivateFieldGet(this, _LineDecoder_instances, "m", _LineDecoder_append).call(this, binaryChunk); + __classPrivateFieldGet2(this, _LineDecoder_instances, "m", _LineDecoder_append).call(this, binaryChunk); const lines2 = []; let patternIndex; - while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), __classPrivateFieldGet(this, _LineDecoder_searchIndex, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))) != null) { - const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), patternIndex.preceding)); + while ((patternIndex = findNewlineIndex2(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), __classPrivateFieldGet2(this, _LineDecoder_searchIndex, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))) != null) { + const line = decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), patternIndex.preceding)); lines2.push(line); - __classPrivateFieldSet(this, _LineDecoder_start, patternIndex.index, "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, patternIndex.index, "f"); if (patternIndex.carriage) { - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") < __classPrivateFieldGet(this, _LineDecoder_end, "f") && __classPrivateFieldGet(this, _LineDecoder_buffer, "f")[__classPrivateFieldGet(this, _LineDecoder_start, "f")] === 10) { - __classPrivateFieldSet(this, _LineDecoder_start, __classPrivateFieldGet(this, _LineDecoder_start, "f") + 1, "f"); - } else if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, true, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") < __classPrivateFieldGet2(this, _LineDecoder_end, "f") && __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f")[__classPrivateFieldGet2(this, _LineDecoder_start, "f")] === 10) { + __classPrivateFieldSet2(this, _LineDecoder_start, __classPrivateFieldGet2(this, _LineDecoder_start, "f") + 1, "f"); + } else if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, true, "f"); } } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_start, "f"), "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_start, "f"), "f"); } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_end, "f"), "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, 0, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > MAX_RETAINED_BUFFER_BYTES) { - __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_end, "f"), "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, 0, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > MAX_RETAINED_BUFFER_BYTES) { + __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); } - } else if (lines2.length > 0 && __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > MAX_RETAINED_BUFFER_BYTES) { - const length = __classPrivateFieldGet(this, _LineDecoder_end, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"); - if (length <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > length * 4) { + } else if (lines2.length > 0 && __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > MAX_RETAINED_BUFFER_BYTES) { + const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (length <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > length * 4) { const capacity = length <= MAX_RETAINED_BUFFER_BYTES ? Math.min(Math.max(length * 2, 256), MAX_RETAINED_BUFFER_BYTES) : length * 2; const buffer = new Uint8Array(capacity); - buffer.set(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))); - __classPrivateFieldSet(this, _LineDecoder_buffer, buffer, "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, length, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, length, "f"); + buffer.set(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, buffer, "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, length, "f"); } } return lines2; } /** Emits the remaining unterminated line, or returns an empty array when idle. */ flush() { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { return []; } return this.decode("\n"); } }; - _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_start = /* @__PURE__ */ new WeakMap(), _LineDecoder_end = /* @__PURE__ */ new WeakMap(), _LineDecoder_searchIndex = /* @__PURE__ */ new WeakMap(), _LineDecoder_skipLeadingLF = /* @__PURE__ */ new WeakMap(), _LineDecoder_instances = /* @__PURE__ */ new WeakSet(), _LineDecoder_append = function _LineDecoder_append2(chunk) { - if (__classPrivateFieldGet(this, _LineDecoder_end, "f") + chunk.length > __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { - const length = __classPrivateFieldGet(this, _LineDecoder_end, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") >= __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length / 2 && length + chunk.length <= __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { - __classPrivateFieldGet(this, _LineDecoder_buffer, "f").copyWithin(0, __classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f")); + _LineDecoder_buffer2 = /* @__PURE__ */ new WeakMap(), _LineDecoder_start = /* @__PURE__ */ new WeakMap(), _LineDecoder_end = /* @__PURE__ */ new WeakMap(), _LineDecoder_searchIndex = /* @__PURE__ */ new WeakMap(), _LineDecoder_skipLeadingLF = /* @__PURE__ */ new WeakMap(), _LineDecoder_instances = /* @__PURE__ */ new WeakSet(), _LineDecoder_append = function _LineDecoder_append2(chunk) { + if (__classPrivateFieldGet2(this, _LineDecoder_end, "f") + chunk.length > __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { + const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") >= __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length / 2 && length + chunk.length <= __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { + __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").copyWithin(0, __classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f")); } else { - const capacity = Math.max(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length * 2, length + chunk.length, 256); + const capacity = Math.max(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length * 2, length + chunk.length, 256); const buffer = new Uint8Array(capacity); - buffer.set(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))); - __classPrivateFieldSet(this, _LineDecoder_buffer, buffer, "f"); + buffer.set(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, buffer, "f"); } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_searchIndex, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"), "f"); - __classPrivateFieldSet(this, _LineDecoder_end, length, "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_searchIndex, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"), "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); } - __classPrivateFieldGet(this, _LineDecoder_buffer, "f").set(chunk, __classPrivateFieldGet(this, _LineDecoder_end, "f")); - __classPrivateFieldSet(this, _LineDecoder_end, __classPrivateFieldGet(this, _LineDecoder_end, "f") + chunk.length, "f"); + __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").set(chunk, __classPrivateFieldGet2(this, _LineDecoder_end, "f")); + __classPrivateFieldSet2(this, _LineDecoder_end, __classPrivateFieldGet2(this, _LineDecoder_end, "f") + chunk.length, "f"); }; - LineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); - LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g; + LineDecoder2.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); + LineDecoder2.NEWLINE_REGEXP = /\r\n|[\n\r]/g; } }); // node_modules/openai/internal/utils/log.mjs -function noop() { +function noop2() { } -function makeLogFn(fnLevel, logger, logLevel) { - if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) { - return noop; +function makeLogFn2(fnLevel, logger, logLevel) { + if (!logger || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) { + return noop2; } else { return logger[fnLevel].bind(logger); } } -function loggerFor(client) { +function loggerFor2(client) { const logger = client.logger; const logLevel = client.logLevel ?? "off"; if (!logger) { - return noopLogger; + return noopLogger2; } - const cachedLogger = cachedLoggers.get(logger); + const cachedLogger = cachedLoggers2.get(logger); if (cachedLogger && cachedLogger[0] === logLevel) { return cachedLogger[1]; } const levelLogger = { - error: makeLogFn("error", logger, logLevel), - warn: makeLogFn("warn", logger, logLevel), - info: makeLogFn("info", logger, logLevel), - debug: makeLogFn("debug", logger, logLevel) + error: makeLogFn2("error", logger, logLevel), + warn: makeLogFn2("warn", logger, logLevel), + info: makeLogFn2("info", logger, logLevel), + debug: makeLogFn2("debug", logger, logLevel) }; - cachedLoggers.set(logger, [logLevel, levelLogger]); + cachedLoggers2.set(logger, [logLevel, levelLogger]); return levelLogger; } function isSensitiveQueryParameter(name) { @@ -3094,34 +20468,34 @@ function redactURL(value2) { } return url.href; } -var levelNumbers, parseLogLevel, noopLogger, cachedLoggers, sensitiveQueryNames, sensitiveHeaderNames, formatRequestDetails; -var init_log = __esm({ +var levelNumbers2, parseLogLevel2, noopLogger2, cachedLoggers2, sensitiveQueryNames, sensitiveHeaderNames, formatRequestDetails2; +var init_log2 = __esm({ "node_modules/openai/internal/utils/log.mjs"() { - init_values(); - levelNumbers = { + init_values2(); + levelNumbers2 = { off: 0, error: 200, warn: 300, info: 400, debug: 500 }; - parseLogLevel = (maybeLevel, sourceName, client) => { + parseLogLevel2 = (maybeLevel, sourceName, client) => { if (!maybeLevel) { return void 0; } - if (hasOwn(levelNumbers, maybeLevel)) { + if (hasOwn2(levelNumbers2, maybeLevel)) { return maybeLevel; } - loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`); + loggerFor2(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers2))}`); return void 0; }; - noopLogger = { - error: noop, - warn: noop, - info: noop, - debug: noop + noopLogger2 = { + error: noop2, + warn: noop2, + info: noop2, + debug: noop2 }; - cachedLoggers = /* @__PURE__ */ new WeakMap(); + cachedLoggers2 = /* @__PURE__ */ new WeakMap(); sensitiveQueryNames = /* @__PURE__ */ new Set([ "apikey", "accesstoken", @@ -3152,7 +20526,7 @@ var init_log = __esm({ "x-auth-token", "x-id-token" ]); - formatRequestDetails = (details) => { + formatRequestDetails2 = (details) => { if (details.options) { details.options = { ...details.options }; delete details.options["headers"]; @@ -3187,7 +20561,7 @@ var init_log = __esm({ // node_modules/openai/core/streaming.mjs function isTransportAbortError(error) { - return !(error instanceof APIError) && isAbortError(error); + return !(error instanceof APIError2) && isAbortError2(error); } function createStreamTeeQueue() { let entries2 = []; @@ -3233,7 +20607,7 @@ function createAbortableSSESource(body, signal) { const source = reader ? { next: () => reader.read(), return: () => reader.cancel() - } : ReadableStreamToAsyncIterable(body)[Symbol.asyncIterator](); + } : ReadableStreamToAsyncIterable2(body)[Symbol.asyncIterator](); const ended = { value: void 0, done: true }; let closed = false; let canceled = false; @@ -3281,7 +20655,7 @@ function createAbortableSSESource(body, signal) { } return { value: result.value, done: false }; } catch (error) { - if (signal.aborted && (isAbortError(error) || error === signal.reason)) { + if (signal.aborted && (isAbortError2(error) || error === signal.reason)) { return ended; } throw error; @@ -3345,7 +20719,7 @@ function createAbortableSSESource(body, signal) { } }; } -async function* _iterSSEMessages(response, controller) { +async function* _iterSSEMessages2(response, controller) { if (!response.body) { controller.abort(); if (globalThis.navigator !== void 0 && globalThis.navigator.product === "ReactNative") { @@ -3353,8 +20727,8 @@ async function* _iterSSEMessages(response, controller) { } throw new OpenAIError(`Attempted to iterate over a response with no body`); } - const sseDecoder = new SSEDecoder(); - const lineDecoder = new LineDecoder(); + const sseDecoder = new SSEDecoder2(); + const lineDecoder = new LineDecoder2(); const { signal } = controller; const source = createAbortableSSESource(response.body, signal); let failed = false; @@ -3395,7 +20769,7 @@ async function* _iterSSEMessages(response, controller) { } } catch (error) { failed = true; - if (!signal.aborted || !isAbortError(error) && error !== signal.reason) { + if (!signal.aborted || !isAbortError2(error) && error !== signal.reason) { throw error; } } finally { @@ -3415,7 +20789,7 @@ async function* iterSSEChunks(iterator) { if (chunk instanceof ArrayBuffer) { binaryChunk = new Uint8Array(chunk); } else if (typeof chunk === "string") { - binaryChunk = encodeUTF8(chunk); + binaryChunk = encodeUTF82(chunk); } else { binaryChunk = chunk; } @@ -3447,32 +20821,32 @@ async function* iterSSEChunks(iterator) { yield data.slice(dataStart, dataEnd); } } -function partition(str2, delimiter) { +function partition2(str2, delimiter) { const index = str2.indexOf(delimiter); if (index !== -1) { return [str2.slice(0, index), delimiter, str2.slice(index + delimiter.length)]; } return [str2, "", ""]; } -var _Stream_instances, _Stream_client, _Stream_isTeeBranch, _Stream_cancelIterator, Stream, DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES, SSEDecoder; -var init_streaming = __esm({ +var _Stream_instances, _Stream_client2, _Stream_isTeeBranch, _Stream_cancelIterator, Stream2, DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES, SSEDecoder2; +var init_streaming3 = __esm({ "node_modules/openai/core/streaming.mjs"() { - init_tslib(); - init_error(); - init_shims(); - init_line(); - init_errors(); - init_bytes(); - init_log(); - Stream = class _Stream { + init_tslib2(); + init_error3(); + init_shims2(); + init_line2(); + init_errors2(); + init_bytes2(); + init_log2(); + Stream2 = class _Stream { /** Wraps an asynchronous event iterator and the controller that owns its request. */ constructor(iterator, controller, client) { _Stream_instances.add(this); - _Stream_client.set(this, void 0); + _Stream_client2.set(this, void 0); _Stream_isTeeBranch.set(this, false); this.iterator = iterator; this.controller = controller; - __classPrivateFieldSet(this, _Stream_client, client, "f"); + __classPrivateFieldSet2(this, _Stream_client2, client, "f"); } /** * Decodes an SSE response into parsed JSON events. @@ -3483,7 +20857,7 @@ var init_streaming = __esm({ */ static fromSSEResponse(response, controller, client, synthesizeEventData) { let consumed = false; - const logger = client ? loggerFor(client) : console; + const logger = client ? loggerFor2(client) : console; async function* iterator() { if (consumed) { throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); @@ -3491,7 +20865,7 @@ var init_streaming = __esm({ consumed = true; let done = false; let receivedCompletionSentinel = false; - const messages = _iterSSEMessages(response, controller); + const messages = _iterSSEMessages2(response, controller); const closeMessages = messages.return.bind(messages); messages.return = (value2) => { if (!receivedCompletionSentinel) { @@ -3515,10 +20889,10 @@ var init_streaming = __esm({ throw new SyntaxError("Error reading response: malformed server-sent event JSON."); } if (sse.event === "error") { - throw new APIError(void 0, data?.error ?? data, void 0, response.headers); + throw new APIError2(void 0, data?.error ?? data, void 0, response.headers); } if (data && data.error) { - throw new APIError(void 0, data.error, void 0, response.headers); + throw new APIError2(void 0, data.error, void 0, response.headers); } yield synthesizeEventData ? { event: sse.event, data } : data; } else { @@ -3554,7 +20928,7 @@ var init_streaming = __esm({ static fromReadableStream(readableStream, controller, client) { let consumed = false; async function* iterLines() { - const lineDecoder = new LineDecoder(); + const lineDecoder = new LineDecoder2(); const reader = readableStream.getReader(); let closed = false; let cancelPromise; @@ -3624,7 +20998,7 @@ var init_streaming = __esm({ } done = true; } catch (e) { - if (controller.signal.aborted || isAbortError(e)) { + if (controller.signal.aborted || isAbortError2(e)) { return; } throw e; @@ -3637,7 +21011,7 @@ var init_streaming = __esm({ return new _Stream(iterator, controller, client); } /** Starts consuming this stream; attempting to consume it again throws. */ - [(_Stream_client = /* @__PURE__ */ new WeakMap(), _Stream_isTeeBranch = /* @__PURE__ */ new WeakMap(), _Stream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + [(_Stream_client2 = /* @__PURE__ */ new WeakMap(), _Stream_isTeeBranch = /* @__PURE__ */ new WeakMap(), _Stream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { return this.iterator(); } /** @@ -3671,16 +21045,16 @@ var init_streaming = __esm({ if (!queue2.canceled) { queue2.cancel(); if (left.canceled && right.canceled) { - await __classPrivateFieldGet(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iterator, controller); + await __classPrivateFieldGet2(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iterator, controller); } } return { value: void 0, done: true }; } }); const branch = (queue2) => { - const stream4 = new _Stream(() => teeIterator(queue2), controller, __classPrivateFieldGet(this, _Stream_client, "f")); - __classPrivateFieldSet(stream4, _Stream_isTeeBranch, true, "f"); - return stream4; + const stream5 = new _Stream(() => teeIterator(queue2), controller, __classPrivateFieldGet2(this, _Stream_client2, "f")); + __classPrivateFieldSet2(stream5, _Stream_isTeeBranch, true, "f"); + return stream5; }; return [branch(left), branch(right)]; } @@ -3696,8 +21070,8 @@ var init_streaming = __esm({ const { controller } = this; let iter; let cancellation; - const cancel = () => cancellation ?? (cancellation = __classPrivateFieldGet(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iter, controller)); - return makeReadableStream({ + const cancel = () => cancellation ?? (cancellation = __classPrivateFieldGet2(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iter, controller)); + return makeReadableStream2({ start: async () => { iter = this[Symbol.asyncIterator](); }, @@ -3707,7 +21081,7 @@ var init_streaming = __esm({ if (done) { return ctrl.close(); } - const bytes2 = encodeUTF8(JSON.stringify(value2) + "\n"); + const bytes2 = encodeUTF82(JSON.stringify(value2) + "\n"); ctrl.enqueue(bytes2); } catch (err) { ctrl.error(err); @@ -3721,14 +21095,14 @@ var init_streaming = __esm({ _Stream_cancelIterator = async function _Stream_cancelIterator2(iterator, controller) { const returnMethod = iterator.return; if (returnMethod) { - if (!__classPrivateFieldGet(this, _Stream_isTeeBranch, "f")) { + if (!__classPrivateFieldGet2(this, _Stream_isTeeBranch, "f")) { controller.abort(); } await Reflect.apply(returnMethod, iterator, []); } }; DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES = 3; - SSEDecoder = class { + SSEDecoder2 = class { constructor() { this.event = null; this.data = []; @@ -3756,7 +21130,7 @@ var init_streaming = __esm({ if (line.startsWith(":")) { return null; } - const [fieldname, , initialValue] = partition(line, ":"); + const [fieldname, , initialValue] = partition2(line, ":"); let value2 = initialValue; if (value2.startsWith(" ")) { value2 = value2.slice(1); @@ -3781,16 +21155,16 @@ var init_streaming = __esm({ }); // node_modules/openai/internal/parse.mjs -async function defaultParseResponse(client, props) { +async function defaultParseResponse2(client, props) { const { response, requestLogID, retryOfRequestLogID, startTime } = props; let jsonBodyLength; const body = await (async () => { if (props.options.stream) { - loggerFor(client).debug("response", response.status, response.url, response.headers, response.body); + loggerFor2(client).debug("response", response.status, response.url, response.headers, response.body); if (props.options.__streamClass) { return props.options.__streamClass.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); } - return Stream.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); + return Stream2.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); } if (response.status === 204) { return null; @@ -3820,7 +21194,7 @@ async function defaultParseResponse(client, props) { throw asAbortError(error, props.controller.signal); }); if (client.logLevel === "debug") { - loggerFor(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails({ + loggerFor2(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -3831,7 +21205,7 @@ async function defaultParseResponse(client, props) { return body; } function asAbortError(error, signal) { - if (!signal.aborted || error !== signal.reason || isAbortError(error)) { + if (!signal.aborted || error !== signal.reason || isAbortError2(error)) { return error; } const message = "This operation was aborted"; @@ -3847,24 +21221,24 @@ function addRequestID(value2, response) { enumerable: false }); } -var init_parse = __esm({ +var init_parse2 = __esm({ "node_modules/openai/internal/parse.mjs"() { - init_streaming(); - init_errors(); - init_log(); + init_streaming3(); + init_errors2(); + init_log2(); } }); // node_modules/openai/version.mjs -var VERSION; -var init_version2 = __esm({ +var VERSION2; +var init_version3 = __esm({ "node_modules/openai/version.mjs"() { - VERSION = "7.19.0"; + VERSION2 = "7.19.0"; } }); // node_modules/openai/internal/detect-platform.mjs -function getDetectedPlatform() { +function getDetectedPlatform2() { if (typeof Deno !== "undefined" && Deno.build != null) { return "deno"; } @@ -3876,7 +21250,7 @@ function getDetectedPlatform() { } return "unknown"; } -function getBrowserInfo() { +function getBrowserInfo2() { if (typeof navigator === "undefined" || !navigator) { return null; } @@ -3899,11 +21273,11 @@ function getBrowserInfo() { } return null; } -var isRunningInBrowser, getPlatformProperties, normalizeArch, normalizePlatform, _platformHeaders, getPlatformHeaders; -var init_detect_platform = __esm({ +var isRunningInBrowser2, getPlatformProperties2, normalizeArch2, normalizePlatform2, _platformHeaders2, getPlatformHeaders2; +var init_detect_platform2 = __esm({ "node_modules/openai/internal/detect-platform.mjs"() { - init_version2(); - isRunningInBrowser = () => { + init_version3(); + isRunningInBrowser2 = () => { return ( // @ts-ignore typeof window !== "undefined" && // @ts-ignore @@ -3911,14 +21285,14 @@ var init_detect_platform = __esm({ typeof navigator !== "undefined" ); }; - getPlatformProperties = () => { - const detectedPlatform = getDetectedPlatform(); + getPlatformProperties2 = () => { + const detectedPlatform = getDetectedPlatform2(); if (detectedPlatform === "deno") { return { "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION, - "X-Stainless-OS": normalizePlatform(Deno.build.os), - "X-Stainless-Arch": normalizeArch(Deno.build.arch), + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": normalizePlatform2(Deno.build.os), + "X-Stainless-Arch": normalizeArch2(Deno.build.arch), "X-Stainless-Runtime": "deno", "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" }; @@ -3926,7 +21300,7 @@ var init_detect_platform = __esm({ if (typeof EdgeRuntime !== "undefined") { return { "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION, + "X-Stainless-Package-Version": VERSION2, "X-Stainless-OS": "Unknown", "X-Stainless-Arch": `other:${EdgeRuntime}`, "X-Stainless-Runtime": "edge", @@ -3936,18 +21310,18 @@ var init_detect_platform = __esm({ if (detectedPlatform === "node") { return { "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION, - "X-Stainless-OS": normalizePlatform(globalThis.process.platform ?? "unknown"), - "X-Stainless-Arch": normalizeArch(globalThis.process.arch ?? "unknown"), + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": normalizePlatform2(globalThis.process.platform ?? "unknown"), + "X-Stainless-Arch": normalizeArch2(globalThis.process.arch ?? "unknown"), "X-Stainless-Runtime": "node", "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" }; } - const browserInfo = getBrowserInfo(); + const browserInfo = getBrowserInfo2(); if (browserInfo) { return { "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION, + "X-Stainless-Package-Version": VERSION2, "X-Stainless-OS": "Unknown", "X-Stainless-Arch": "unknown", "X-Stainless-Runtime": `browser:${browserInfo.browser}`, @@ -3956,14 +21330,14 @@ var init_detect_platform = __esm({ } return { "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION, + "X-Stainless-Package-Version": VERSION2, "X-Stainless-OS": "Unknown", "X-Stainless-Arch": "unknown", "X-Stainless-Runtime": "unknown", "X-Stainless-Runtime-Version": "unknown" }; }; - normalizeArch = (arch) => { + normalizeArch2 = (arch) => { if (arch === "x32") return "x32"; if (arch === "x86_64" || arch === "x64") @@ -3976,7 +21350,7 @@ var init_detect_platform = __esm({ return `other:${arch}`; return "unknown"; }; - normalizePlatform = (platform) => { + normalizePlatform2 = (platform) => { platform = platform.toLowerCase(); if (platform.includes("ios")) return "iOS"; @@ -3996,8 +21370,8 @@ var init_detect_platform = __esm({ return `Other:${platform}`; return "Unknown"; }; - getPlatformHeaders = () => { - return _platformHeaders ?? (_platformHeaders = getPlatformProperties()); + getPlatformHeaders2 = () => { + return _platformHeaders2 ?? (_platformHeaders2 = getPlatformProperties2()); }; } }); @@ -4021,11 +21395,11 @@ function observeJSONRequestBody(body, observer) { } }; } -var jsonRequestBodyObservers, FallbackEncoder; -var init_request_options = __esm({ +var jsonRequestBodyObservers, FallbackEncoder2; +var init_request_options2 = __esm({ "node_modules/openai/internal/request-options.mjs"() { jsonRequestBodyObservers = /* @__PURE__ */ new WeakMap(); - FallbackEncoder = ({ headers, body }) => { + FallbackEncoder2 = ({ headers, body }) => { const observers = typeof body === "object" && body !== null ? jsonRequestBodyObservers.get(body) : void 0; let encoded; if (!observers || observers.size === 0) { @@ -4057,28 +21431,28 @@ var init_request_options = __esm({ }); // node_modules/openai/internal/qs/formats.mjs -var default_format, default_formatter, formatters, RFC1738; -var init_formats = __esm({ +var default_format2, default_formatter2, formatters2, RFC17382; +var init_formats2 = __esm({ "node_modules/openai/internal/qs/formats.mjs"() { - default_format = "RFC3986"; - default_formatter = String; - formatters = { + default_format2 = "RFC3986"; + default_formatter2 = String; + formatters2 = { RFC1738: (v) => String(v).replace(/%20/g, "+"), - RFC3986: default_formatter + RFC3986: default_formatter2 }; - RFC1738 = "RFC1738"; + RFC17382 = "RFC1738"; } }); // node_modules/openai/internal/qs/utils.mjs -function is_buffer(obj2) { +function is_buffer2(obj2) { if (!obj2 || typeof obj2 !== "object") { return false; } return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2)); } -function maybe_map(val, fn) { - if (isArray(val)) { +function maybe_map2(val, fn) { + if (isArray2(val)) { const mapped = []; for (const item of val) { mapped.push(fn(item)); @@ -4087,25 +21461,25 @@ function maybe_map(val, fn) { } return fn(val); } -var cachedHas, has, hex_table, limit, encode; -var init_utils = __esm({ +var cachedHas, has2, hex_table2, limit2, encode2; +var init_utils3 = __esm({ "node_modules/openai/internal/qs/utils.mjs"() { - init_formats(); - init_values(); - has = (obj2, key) => { + init_formats2(); + init_values2(); + has2 = (obj2, key) => { const resolvedHas = cachedHas ?? Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty); cachedHas = resolvedHas; return resolvedHas(obj2, key); }; - hex_table = /* @__PURE__ */ (() => { + hex_table2 = /* @__PURE__ */ (() => { const array = []; for (let i = 0; i < 256; ++i) { array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); } return array; })(); - limit = 1024; - encode = (str2, _defaultEncoder, charset, _kind, format) => { + limit2 = 1024; + encode2 = (str2, _defaultEncoder, charset, _kind, format) => { if (str2.length === 0) { return str2; } @@ -4120,11 +21494,11 @@ var init_utils = __esm({ } let out = ""; for (let j = 0; j < string2.length; ) { - let segmentEnd = Math.min((Math.floor(j / limit) + 1) * limit, string2.length); + let segmentEnd = Math.min((Math.floor(j / limit2) + 1) * limit2, string2.length); if (segmentEnd < string2.length && string2.codePointAt(segmentEnd - 1) > 65535) { segmentEnd += 1; } - const segment = string2.length >= limit ? string2.slice(j, segmentEnd) : string2; + const segment = string2.length >= limit2 ? string2.slice(j, segmentEnd) : string2; const arr2 = []; for (let i = 0; i < segment.length; ++i) { let c = segment.charCodeAt(i); @@ -4135,25 +21509,25 @@ var init_utils = __esm({ c >= 48 && c <= 57 || // 0-9 c >= 65 && c <= 90 || // a-z c >= 97 && c <= 122 || // A-Z - format === RFC1738 && (c === 40 || c === 41)) { + format === RFC17382 && (c === 40 || c === 41)) { arr2[arr2.length] = segment.charAt(i); continue; } if (c < 128) { - arr2[arr2.length] = hex_table[c]; + arr2[arr2.length] = hex_table2[c]; continue; } if (c < 2048) { - arr2[arr2.length] = hex_table[192 | c >> 6] + hex_table[128 | c & 63]; + arr2[arr2.length] = hex_table2[192 | c >> 6] + hex_table2[128 | c & 63]; continue; } if (c < 55296 || c >= 57344) { - arr2[arr2.length] = hex_table[224 | c >> 12] + hex_table[128 | c >> 6 & 63] + hex_table[128 | c & 63]; + arr2[arr2.length] = hex_table2[224 | c >> 12] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; continue; } i += 1; c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); - arr2[arr2.length] = hex_table[240 | c >> 18] + hex_table[128 | c >> 12 & 63] + hex_table[128 | c >> 6 & 63] + hex_table[128 | c & 63]; + arr2[arr2.length] = hex_table2[240 | c >> 18] + hex_table2[128 | c >> 12 & 63] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; } out += arr2.join(""); j = segmentEnd; @@ -4164,15 +21538,15 @@ var init_utils = __esm({ }); // node_modules/openai/internal/qs/stringify.mjs -function is_non_nullish_primitive(v) { +function is_non_nullish_primitive2(v) { return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; } -function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder6, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { +function inner_stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder6, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { let obj2 = object; let tmp_sc = sideChannel; let step = 0; let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel)) !== void 0 && !find_flag) { + while ((tmp_sc = tmp_sc.get(sentinel2)) !== void 0 && !find_flag) { const pos = tmp_sc.get(object); step += 1; if (pos !== void 0) { @@ -4182,7 +21556,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al find_flag = true; } } - if (tmp_sc.get(sentinel) === void 0) { + if (tmp_sc.get(sentinel2) === void 0) { step = 0; } } @@ -4190,8 +21564,8 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al obj2 = filter(prefix, obj2); } else if (obj2 instanceof Date) { obj2 = serializeDate?.(obj2); - } else if (generateArrayPrefix === "comma" && isArray(obj2)) { - obj2 = maybe_map(obj2, (value2) => { + } else if (generateArrayPrefix === "comma" && isArray2(obj2)) { + obj2 = maybe_map2(obj2, (value2) => { if (value2 instanceof Date) { return serializeDate?.(value2); } @@ -4202,20 +21576,20 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al if (strictNullHandling) { return encoder6 && !encodeValuesOnly ? ( // @ts-expect-error - encoder6(prefix, defaults.encoder, charset, "key", format) + encoder6(prefix, defaults2.encoder, charset, "key", format) ) : prefix; } obj2 = ""; } - if (is_non_nullish_primitive(obj2) || is_buffer(obj2)) { + if (is_non_nullish_primitive2(obj2) || is_buffer2(obj2)) { if (encoder6) { const key_value = encodeValuesOnly ? prefix : ( // @ts-expect-error - encoder6(prefix, defaults.encoder, charset, "key", format) + encoder6(prefix, defaults2.encoder, charset, "key", format) ); return [ formatter?.(key_value) + "=" + // @ts-expect-error - formatter?.(encoder6(obj2, defaults.encoder, charset, "value", format)) + formatter?.(encoder6(obj2, defaults2.encoder, charset, "value", format)) ]; } return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; @@ -4225,12 +21599,12 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al return values; } let obj_keys; - if (generateArrayPrefix === "comma" && isArray(obj2)) { + if (generateArrayPrefix === "comma" && isArray2(obj2)) { if (encodeValuesOnly && encoder6) { - obj2 = maybe_map(obj2, encoder6); + obj2 = maybe_map2(obj2, encoder6); } obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; - } else if (isArray(filter)) { + } else if (isArray2(filter)) { obj_keys = filter; } else { const keys = Object.keys(obj2); @@ -4240,8 +21614,8 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al obj_keys = keys; } const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); - const adjusted_prefix = commaRoundTrip && isArray(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; - if (allowEmptyArrays && isArray(obj2) && obj2.length === 0) { + const adjusted_prefix = commaRoundTrip && isArray2(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; + if (allowEmptyArrays && isArray2(obj2) && obj2.length === 0) { return adjusted_prefix + "[]"; } for (const key of obj_keys) { @@ -4254,14 +21628,14 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al } const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; let key_prefix; - if (isArray(obj2)) { + if (isArray2(obj2)) { key_prefix = typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix; } else { key_prefix = adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); } sideChannel.set(object, step); - const valueSideChannel = new WeakMap([[sentinel, sideChannel]]); - push_to_array(values, inner_stringify( + const valueSideChannel = new WeakMap([[sentinel2, sideChannel]]); + push_to_array2(values, inner_stringify2( value2, key_prefix, generateArrayPrefix, @@ -4271,7 +21645,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al skipNulls, encodeDotInKeys, // @ts-ignore - generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj2) ? null : encoder6, + generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj2) ? null : encoder6, filter, sort, allowDots, @@ -4285,7 +21659,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al } return values; } -function normalize_stringify_options(opts = defaults) { +function normalize_stringify_options2(opts = defaults2) { if (opts.allowEmptyArrays !== void 0 && typeof opts.allowEmptyArrays !== "boolean") { throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); } @@ -4295,72 +21669,72 @@ function normalize_stringify_options(opts = defaults) { if (opts.encoder !== null && opts.encoder !== void 0 && typeof opts.encoder !== "function") { throw new TypeError("Encoder has to be a function."); } - const charset = opts.charset || defaults.charset; + const charset = opts.charset || defaults2.charset; if (opts.charset !== void 0 && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); } - let format = default_format; + let format = default_format2; if (opts.format !== void 0) { - if (!has(formatters, opts.format)) { + if (!has2(formatters2, opts.format)) { throw new TypeError("Unknown format option provided."); } format = opts.format; } - const formatter = formatters[format]; - let filter = defaults.filter; - if (typeof opts.filter === "function" || isArray(opts.filter)) { + const formatter = formatters2[format]; + let filter = defaults2.filter; + if (typeof opts.filter === "function" || isArray2(opts.filter)) { filter = opts.filter; } let arrayFormat; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { + if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators2) { arrayFormat = opts.arrayFormat; } else if ("indices" in opts) { arrayFormat = opts.indices ? "indices" : "repeat"; } else { - arrayFormat = defaults.arrayFormat; + arrayFormat = defaults2.arrayFormat; } if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); } let allowDots; if (opts.allowDots === void 0) { - allowDots = !!opts.encodeDotInKeys === true ? true : defaults.allowDots; + allowDots = !!opts.encodeDotInKeys === true ? true : defaults2.allowDots; } else { allowDots = !!opts.allowDots; } return { - addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix, + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, // @ts-ignore allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, arrayFormat, charset, - charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, commaRoundTrip: !!opts.commaRoundTrip, - delimiter: opts.delimiter === void 0 ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + delimiter: opts.delimiter === void 0 ? defaults2.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, filter, format, formatter, - serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, // @ts-ignore sort: typeof opts.sort === "function" ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling }; } -function stringify(object, opts = {}) { +function stringify2(object, opts = {}) { let obj2 = object; - const options = normalize_stringify_options(opts); + const options = normalize_stringify_options2(opts); let obj_keys; let filter; if (typeof options.filter === "function") { filter = options.filter; obj2 = filter("", obj2); - } else if (isArray(options.filter)) { + } else if (isArray2(options.filter)) { filter = options.filter; obj_keys = filter; } @@ -4368,7 +21742,7 @@ function stringify(object, opts = {}) { if (typeof obj2 !== "object" || obj2 === null) { return ""; } - const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; + const generateArrayPrefix = array_prefix_generators2[options.arrayFormat]; const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; if (!obj_keys) { obj_keys = Object.keys(obj2); @@ -4381,7 +21755,7 @@ function stringify(object, opts = {}) { if (options.skipNulls && obj2[key] === null) { continue; } - push_to_array(keys, inner_stringify( + push_to_array2(keys, inner_stringify2( obj2[key], key, // @ts-expect-error @@ -4416,13 +21790,13 @@ function stringify(object, opts = {}) { } return joined.length > 0 ? prefix + joined : ""; } -var array_prefix_generators, push_to_array, toISOString, defaults, sentinel; -var init_stringify = __esm({ +var array_prefix_generators2, push_to_array2, toISOString2, defaults2, sentinel2; +var init_stringify2 = __esm({ "node_modules/openai/internal/qs/stringify.mjs"() { - init_utils(); - init_formats(); - init_values(); - array_prefix_generators = { + init_utils3(); + init_formats2(); + init_values2(); + array_prefix_generators2 = { brackets(prefix) { return String(prefix) + "[]"; }, @@ -4434,10 +21808,10 @@ var init_stringify = __esm({ return String(prefix); } }; - push_to_array = function push_to_array2(arr2, value_or_array) { - Array.prototype.push.apply(arr2, isArray(value_or_array) ? value_or_array : [value_or_array]); + push_to_array2 = function push_to_array3(arr2, value_or_array) { + Array.prototype.push.apply(arr2, isArray2(value_or_array) ? value_or_array : [value_or_array]); }; - defaults = { + defaults2 = { addQueryPrefix: false, allowDots: false, allowEmptyArrays: false, @@ -4447,29 +21821,29 @@ var init_stringify = __esm({ delimiter: "&", encode: true, encodeDotInKeys: false, - encoder: encode, + encoder: encode2, encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, + format: default_format2, + formatter: default_formatter2, /** @deprecated */ indices: false, serializeDate(date) { - return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date); + return (toISOString2 ?? (toISOString2 = Function.prototype.call.bind(Date.prototype.toISOString)))(date); }, skipNulls: false, strictNullHandling: false }; - sentinel = {}; + sentinel2 = {}; } }); // node_modules/openai/internal/utils/query.mjs -function stringifyQuery(query) { - return stringify(query, { arrayFormat: "brackets" }); +function stringifyQuery2(query) { + return stringify2(query, { arrayFormat: "brackets" }); } -var init_query = __esm({ +var init_query2 = __esm({ "node_modules/openai/internal/utils/query.mjs"() { - init_stringify(); + init_stringify2(); } }); @@ -4478,7 +21852,7 @@ function resolveDataResidency(options) { if (options.dataResidency === null || options.dataResidency === void 0) { return void 0; } - if (hasOwn(options, "baseURL")) { + if (hasOwn2(options, "baseURL")) { throw new OpenAIError("The `dataResidency` and `baseURL` options are mutually exclusive."); } const endpoint = endpoints.get(options.dataResidency); @@ -4490,8 +21864,8 @@ function resolveDataResidency(options) { var endpoints; var init_data_residency = __esm({ "node_modules/openai/internal/data-residency.mjs"() { - init_error(); - init_values(); + init_error3(); + init_values2(); endpoints = /* @__PURE__ */ new Map([ ["global", "https://api.openai.com/v1"], ["us", "https://us.api.openai.com/v1"], @@ -4502,23 +21876,23 @@ var init_data_residency = __esm({ }); // node_modules/openai/core/api-promise.mjs -var _APIPromise_client, APIPromise; -var init_api_promise = __esm({ +var _APIPromise_client2, APIPromise2; +var init_api_promise2 = __esm({ "node_modules/openai/core/api-promise.mjs"() { - init_tslib(); - init_parse(); - APIPromise = class _APIPromise extends Promise { - constructor(client, responsePromise, parseResponse2 = defaultParseResponse) { + init_tslib2(); + init_parse2(); + APIPromise2 = class _APIPromise extends Promise { + constructor(client, responsePromise, parseResponse2 = defaultParseResponse2) { super((resolve2) => { resolve2(null); }); this.responsePromise = responsePromise; this.parseResponse = parseResponse2; - _APIPromise_client.set(this, void 0); - __classPrivateFieldSet(this, _APIPromise_client, client, "f"); + _APIPromise_client2.set(this, void 0); + __classPrivateFieldSet2(this, _APIPromise_client2, client, "f"); } _thenUnwrap(transform) { - return new _APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response)); + return new _APIPromise(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response)); } /** * Gets the raw `Response` instance instead of parsing the response @@ -4552,7 +21926,7 @@ var init_api_promise = __esm({ } parse() { if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); + this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), data)); } return this.parsedPromise; } @@ -4566,23 +21940,23 @@ var init_api_promise = __esm({ return this.parse().finally(onfinally); } }; - _APIPromise_client = /* @__PURE__ */ new WeakMap(); + _APIPromise_client2 = /* @__PURE__ */ new WeakMap(); } }); // node_modules/openai/core/pagination.mjs -var _AbstractPage_client, AbstractPage, PagePromise, Page, CursorPage, ConversationCursorPage, NextCursorPage, TokenPage; -var init_pagination = __esm({ +var _AbstractPage_client2, AbstractPage2, PagePromise2, Page2, CursorPage, ConversationCursorPage, NextCursorPage, TokenPage; +var init_pagination2 = __esm({ "node_modules/openai/core/pagination.mjs"() { - init_tslib(); - init_error(); - init_parse(); - init_api_promise(); - init_values(); - AbstractPage = class { + init_tslib2(); + init_error3(); + init_parse2(); + init_api_promise2(); + init_values2(); + AbstractPage2 = class { constructor(client, response, body, options) { - _AbstractPage_client.set(this, void 0); - __classPrivateFieldSet(this, _AbstractPage_client, client, "f"); + _AbstractPage_client2.set(this, void 0); + __classPrivateFieldSet2(this, _AbstractPage_client2, client, "f"); this.options = options; this.response = response; this.body = body; @@ -4598,7 +21972,7 @@ var init_pagination = __esm({ if (!nextOptions) { throw new OpenAIError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); } - return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + return await __classPrivateFieldGet2(this, _AbstractPage_client2, "f").requestAPIList(this.constructor, nextOptions); } async *iterPages() { let page3 = this; @@ -4608,7 +21982,7 @@ var init_pagination = __esm({ yield page3; } } - async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + async *[(_AbstractPage_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { for await (const page3 of this.iterPages()) { for (const item of page3.getPaginatedItems()) { yield item; @@ -4616,9 +21990,9 @@ var init_pagination = __esm({ } } }; - PagePromise = class extends APIPromise { + PagePromise2 = class extends APIPromise2 { constructor(client, request2, Page3) { - super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse(client2, props), props.options)); + super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse2(client2, props), props.options)); } /** * Allow auto-paginating iteration on an unawaited list call, eg: @@ -4634,7 +22008,7 @@ var init_pagination = __esm({ } } }; - Page = class extends AbstractPage { + Page2 = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4647,7 +22021,7 @@ var init_pagination = __esm({ return null; } }; - CursorPage = class extends AbstractPage { + CursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4671,13 +22045,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: id } }; } }; - ConversationCursorPage = class extends AbstractPage { + ConversationCursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4701,13 +22075,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: cursor } }; } }; - NextCursorPage = class extends AbstractPage { + NextCursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4731,13 +22105,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: cursor } }; } }; - TokenPage = class extends AbstractPage { + TokenPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4761,7 +22135,7 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), page: cursor } }; @@ -4851,8 +22225,8 @@ function isUnsafeAccessToken(accessToken) { var SUBJECT_TOKEN_TYPES, TOKEN_EXCHANGE_GRANT_TYPE, MAX_REFRESH_BUFFER_FRACTION, NATIVE_RESPONSE_PROTOTYPE, READ_NATIVE_RESPONSE_BODY, WorkloadIdentityAuth; var init_workload_identity_auth = __esm({ "node_modules/openai/auth/workload-identity-auth.mjs"() { - init_shims(); - init_error(); + init_shims2(); + init_error3(); SUBJECT_TOKEN_TYPES = { jwt: "urn:ietf:params:oauth:token-type:jwt", id: "urn:ietf:params:oauth:token-type:id_token" @@ -4886,7 +22260,7 @@ var init_workload_identity_auth = __esm({ getToken: provider2.getToken.bind(provider2) } }; - this.fetch = fetch2 ?? getDefaultFetch(); + this.fetch = fetch2 ?? getDefaultFetch2(); } /** * Returns a valid OpenAI access token, exchanging or refreshing credentials as needed. @@ -4955,7 +22329,7 @@ var init_workload_identity_auth = __esm({ if (response.status === 400 || response.status === 401 || response.status === 403) { throw new OAuthError(response.status, body2, response.headers); } - throw APIError.generate(response.status, body2, `Token exchange failed with status ${response.status}`, response.headers); + throw APIError2.generate(response.status, body2, `Token exchange failed with status ${response.status}`, response.headers); } const tokenResponse = await parseOAuthTokenResponse(response); const accessToken = typeof tokenResponse === "object" && tokenResponse !== null && "access_token" in tokenResponse ? tokenResponse.access_token : void 0; @@ -5010,17 +22384,17 @@ function assertX509APIOrigin(value2) { var X509_API_BASE_URL; var init_x509_api_origin = __esm({ "node_modules/openai/internal/auth/x509-api-origin.mjs"() { - init_error(); - init_log(); + init_error3(); + init_log2(); X509_API_BASE_URL = "https://mtls.api.openai.com/v1"; } }); // node_modules/openai/internal/headers.mjs -function* iterateHeaders(headers) { +function* iterateHeaders2(headers) { if (!headers) return; - if (brand_privateNullableHeaders in headers) { + if (brand_privateNullableHeaders2 in headers) { const { values, nulls } = headers; yield* values.entries(); for (const name of nulls) { @@ -5041,7 +22415,7 @@ function* iterateHeaders(headers) { const name = row[0]; if (typeof name !== "string") throw new TypeError("expected header name to be a string"); - const values = isReadonlyArray(row[1]) ? row[1] : [row[1]]; + const values = isReadonlyArray2(row[1]) ? row[1] : [row[1]]; let didClear = false; for (const value2 of values) { if (value2 === void 0) @@ -5054,18 +22428,18 @@ function* iterateHeaders(headers) { } } } -var brand_privateNullableHeaders, httpTokenHeaderName, buildHeaders; -var init_headers2 = __esm({ +var brand_privateNullableHeaders2, httpTokenHeaderName, buildHeaders2; +var init_headers3 = __esm({ "node_modules/openai/internal/headers.mjs"() { - init_values(); - brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders"); + init_values2(); + brand_privateNullableHeaders2 = /* @__PURE__ */ Symbol("brand.privateNullableHeaders"); httpTokenHeaderName = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - buildHeaders = (newHeaders) => { + buildHeaders2 = (newHeaders) => { const targetHeaders = new Headers(); const nullHeaders = /* @__PURE__ */ new Set(); for (const headers of newHeaders) { const seenHeaders = /* @__PURE__ */ new Set(); - for (const [name, value2] of iterateHeaders(headers)) { + for (const [name, value2] of iterateHeaders2(headers)) { if (!httpTokenHeaderName.test(name)) { throw new TypeError(`Header name must be a valid HTTP token ["${name}"]`); } @@ -5083,7 +22457,7 @@ var init_headers2 = __esm({ } } } - return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders }; + return { [brand_privateNullableHeaders2]: true, values: targetHeaders, nulls: nullHeaders }; }; } }); @@ -5194,7 +22568,7 @@ function resolveX509Transport(value2) { } var init_x509_transport_registry = __esm({ "node_modules/openai/internal/auth/x509-transport-registry.mjs"() { - init_error(); + init_error3(); init_x509_transport_state(); } }); @@ -5210,7 +22584,7 @@ function assertSafeHeaders(headers) { } function exchangeDeadline(timeout, callerSignal) { const deadline = new AbortController(); - const timer = timeout === void 0 ? void 0 : setTimeout(() => deadline.abort(new APIConnectionTimeoutError()), timeout); + const timer = timeout === void 0 ? void 0 : setTimeout(() => deadline.abort(new APIConnectionTimeoutError2()), timeout); const timerHandle = timer; if (typeof timerHandle === "object" && timerHandle !== null && "unref" in timerHandle && typeof timerHandle.unref === "function") { timerHandle.unref(); @@ -5281,7 +22655,7 @@ function assertX509FetchOptions(options) { return; } for (const name of FORBIDDEN_TRANSPORT_OPTIONS) { - if (hasOwn(options, name)) { + if (hasOwn2(options, name)) { throw new OpenAIError("X.509 workload identity cannot override its approved transport capability."); } } @@ -5292,7 +22666,7 @@ function assertX509FetchOptions(options) { } function assertX509RequestOptions(options) { assertX509FetchOptions(options); - if (options && ["body", "headers", "method", "signal"].some((name) => hasOwn(options, name))) { + if (options && ["body", "headers", "method", "signal"].some((name) => hasOwn2(options, name))) { throw new OpenAIError("X.509 workload identity cannot override its request body, headers, method, or signal through fetch options."); } } @@ -5302,15 +22676,15 @@ function snapshotX509RequestOptions(options) { assertX509RequestOptions(snapshot); return snapshot; } -var _X509WorkloadIdentityAuth_instances, _a, _X509WorkloadIdentityAuth_identityProviderId, _X509WorkloadIdentityAuth_serviceAccountId, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, _X509WorkloadIdentityAuth_organization, _X509WorkloadIdentityAuth_project, _X509WorkloadIdentityAuth_transport, _X509WorkloadIdentityAuth_refreshBufferMs, _X509WorkloadIdentityAuth_cachedToken, _X509WorkloadIdentityAuth_refresh, _X509WorkloadIdentityAuth_tokenGeneration, _X509WorkloadIdentityAuth_cancelRequestBody, _X509WorkloadIdentityAuth_assignToken, _X509WorkloadIdentityAuth_recoverRefreshFailure, _X509WorkloadIdentityAuth_fallbackToken, _X509WorkloadIdentityAuth_retireRefresh, _X509WorkloadIdentityAuth_beginRefresh, _X509WorkloadIdentityAuth_refreshToken, _X509WorkloadIdentityAuth_preflight, _X509WorkloadIdentityAuth_scope, _X509WorkloadIdentityAuth_assertTenantHeaders, FORBIDDEN_TRANSPORT_OPTIONS, headerValue, DEFAULT_REFRESH_BUFFER_MS, FAILED_REFRESH_COOLDOWN_MS, userAbortError, X509WorkloadIdentityAuth; +var _X509WorkloadIdentityAuth_instances, _a2, _X509WorkloadIdentityAuth_identityProviderId, _X509WorkloadIdentityAuth_serviceAccountId, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, _X509WorkloadIdentityAuth_organization, _X509WorkloadIdentityAuth_project, _X509WorkloadIdentityAuth_transport, _X509WorkloadIdentityAuth_refreshBufferMs, _X509WorkloadIdentityAuth_cachedToken, _X509WorkloadIdentityAuth_refresh, _X509WorkloadIdentityAuth_tokenGeneration, _X509WorkloadIdentityAuth_cancelRequestBody, _X509WorkloadIdentityAuth_assignToken, _X509WorkloadIdentityAuth_recoverRefreshFailure, _X509WorkloadIdentityAuth_fallbackToken, _X509WorkloadIdentityAuth_retireRefresh, _X509WorkloadIdentityAuth_beginRefresh, _X509WorkloadIdentityAuth_refreshToken, _X509WorkloadIdentityAuth_preflight, _X509WorkloadIdentityAuth_scope, _X509WorkloadIdentityAuth_assertTenantHeaders, FORBIDDEN_TRANSPORT_OPTIONS, headerValue, DEFAULT_REFRESH_BUFFER_MS, FAILED_REFRESH_COOLDOWN_MS, userAbortError, X509WorkloadIdentityAuth; var init_x509_workload_identity_auth = __esm({ "node_modules/openai/internal/auth/x509-workload-identity-auth.mjs"() { - init_tslib(); - init_error(); - init_headers2(); - init_shims(); - init_log(); - init_values(); + init_tslib2(); + init_error3(); + init_headers3(); + init_shims2(); + init_log2(); + init_values2(); init_x509_api_origin(); init_x509_transport_registry(); init_x509_transport_state(); @@ -5319,7 +22693,7 @@ var init_x509_workload_identity_auth = __esm({ DEFAULT_REFRESH_BUFFER_MS = 20 * 60 * 1e3; FAILED_REFRESH_COOLDOWN_MS = 1e3; userAbortError = (signal) => { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, configurable: true }); return error; }; @@ -5338,67 +22712,67 @@ var init_x509_workload_identity_auth = __esm({ _X509WorkloadIdentityAuth_cachedToken.set(this, void 0); _X509WorkloadIdentityAuth_refresh.set(this, void 0); _X509WorkloadIdentityAuth_tokenGeneration.set(this, 0); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_transport, resolveX509Transport(transport), "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_identityProviderId, identity.identityProviderId, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_serviceAccountId, identity.serviceAccountId, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, identity.refreshBufferMs, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, identity.refreshBufferSeconds, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_organization, organization, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_project, project, "f"); - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_transport, resolveX509Transport(transport), "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_identityProviderId, identity.identityProviderId, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_serviceAccountId, identity.serviceAccountId, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, identity.refreshBufferMs, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, identity.refreshBufferSeconds, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_organization, organization, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_project, project, "f"); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0) { throw new OpenAIError("X.509 workload identity cannot combine refreshBufferSeconds and refreshBufferMs."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f")) || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") < 0)) { + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f")) || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") < 0)) { throw new OpenAIError("X.509 workload identity requires a nonnegative integer refreshBufferMs."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f")) || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") < 0 || !Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3))) { + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f")) || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") < 0 || !Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3))) { throw new OpenAIError("X.509 workload identity requires a nonnegative integer refreshBufferSeconds."); } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refreshBufferMs, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") ?? DEFAULT_REFRESH_BUFFER_MS : __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") ?? DEFAULT_REFRESH_BUFFER_MS : __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3, "f"); } /** Reconstructs the immutable selectors captured before caller-owned identity mutation. */ identitySnapshot() { return { type: "x509", - identityProviderId: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), - serviceAccountId: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), + identityProviderId: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), + serviceAccountId: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") === void 0 ? {} : { refreshBufferMs: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") }, + ...__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") === void 0 ? {} : { refreshBufferMs: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") }, // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? {} : { refreshBufferSeconds: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") } + ...__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? {} : { refreshBufferSeconds: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") } }; } /** Preserves explicitly headerless requests without presenting a certificate to the issuer. */ - static shouldAuthenticate(options, defaultHeaders, requestHeaders2 = options.headers) { - return !buildHeaders([defaultHeaders, requestHeaders2]).nulls.has("authorization"); + static shouldAuthenticate(options, defaultHeaders, requestHeaders = options.headers) { + return !buildHeaders2([defaultHeaders, requestHeaders]).nulls.has("authorization"); } /** Snapshots each caller-owned header layer once while preserving nulls and precedence. */ - snapshotHeaders(defaultHeaders, requestHeaders2) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); - scope.defaultHeaders ?? (scope.defaultHeaders = buildHeaders([defaultHeaders])); - scope.requestHeaders ?? (scope.requestHeaders = buildHeaders([requestHeaders2])); + snapshotHeaders(defaultHeaders, requestHeaders) { + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + scope.defaultHeaders ?? (scope.defaultHeaders = buildHeaders2([defaultHeaders])); + scope.requestHeaders ?? (scope.requestHeaders = buildHeaders2([requestHeaders])); return this.headerSnapshots(); } /** Returns the already rendered caller headers without touching mutable inputs again. */ headerSnapshots() { - const { defaultHeaders, requestHeaders: requestHeaders2 } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); - if (!defaultHeaders || !requestHeaders2) { + const { defaultHeaders, requestHeaders } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + if (!defaultHeaders || !requestHeaders) { throw new OpenAIError("X.509 workload identity requires snapshotted request headers."); } - return { defaultHeaders, requestHeaders: requestHeaders2 }; + return { defaultHeaders, requestHeaders }; } /** Captures enrolled public tenant selectors once before certificate presentation. */ snapshotTenant(organization, project) { - if (organization !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || project !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (organization !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || project !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); scope.tenant = { organization, project }; return scope.tenant; } /** Returns the tenant selectors already approved for this logical request. */ tenantSnapshot() { - const { tenant } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { tenant } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!tenant) { throw new OpenAIError("X.509 workload identity requires snapshotted tenant selectors."); } @@ -5407,11 +22781,11 @@ var init_x509_workload_identity_auth = __esm({ /** Validates and retains the exact destination that authenticated dispatch will use. */ snapshotAPIURL(value2) { assertX509APIOrigin(value2); - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).apiURL = value2; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).apiURL = value2; } /** Reads the already-approved destination without rerendering caller-owned request options. */ requestAPIURL() { - const { apiURL } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { apiURL } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (apiURL === void 0) { throw new OpenAIError("X.509 workload identity requires a snapshotted API destination."); } @@ -5420,11 +22794,11 @@ var init_x509_workload_identity_auth = __esm({ /** Captures the exact caller settings approved for authenticated dispatch. */ snapshotRequest(signal, timeout, fetchOptions) { var _b; - (_b = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this)).request ?? (_b.request = { signal, timeout, fetchOptions }); + (_b = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this)).request ?? (_b.request = { signal, timeout, fetchOptions }); } /** Returns immutable request settings without invoking caller-owned accessors again. */ requestSnapshot() { - const { request: request2 } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { request: request2 } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!request2) { throw new OpenAIError("X.509 workload identity requires snapshotted request settings."); } @@ -5432,7 +22806,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Suspends an already-running network budget during retry-local asynchronous preparation. */ beginRequestPreparation() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (scope.deadlineArmed && scope.preparationStartedAt === void 0) { scope.preparationStartedAt = performance.now(); scope.preparationWallStartedAt = Date.now(); @@ -5440,11 +22814,11 @@ var init_x509_workload_identity_auth = __esm({ } /** Begins local request construction without charging protected hook latency to the network. */ beginRequestPlanning() { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase = "planning"; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase = "planning"; } /** Arms one absolute network deadline only after all local request preparation completes. */ beginRequestNetwork() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!scope.deadlineArmed) { scope.wallStartedAt = Date.now(); scope.monotonicStartedAt = performance.now(); @@ -5458,11 +22832,11 @@ var init_x509_workload_identity_auth = __esm({ } /** Keeps certificate authentication outside overridable request construction. */ isPlanningRequest() { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase === "planning"; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase === "planning"; } /** Approves the final overridden destination and transport before minting a bearer. */ authorizePlannedRequest(url, request2, timeout, allowHookSignal = false) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const headers = Object.getOwnPropertyDescriptor(request2, "headers"); const body = Object.getOwnPropertyDescriptor(request2, "body"); const signal = Object.getOwnPropertyDescriptor(request2, "signal"); @@ -5480,7 +22854,7 @@ var init_x509_workload_identity_auth = __esm({ if (headerValue(headers.value, "Authorization") !== null) { throw new OpenAIError("X.509 workload identity cannot use caller-supplied authorization credentials."); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers.value); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers.value); if (!allowHookSignal && (signal?.value ?? void 0) !== (this.requestSnapshot().signal ?? void 0)) { throw new OpenAIError("X.509 workload identity must preserve its approved request signal."); } @@ -5491,7 +22865,7 @@ var init_x509_workload_identity_auth = __esm({ /** Owns only SDK-created iterator adapters until authenticated dispatch takes responsibility. */ ownRequestBody(body, source) { if (body instanceof ReadableStream && body !== source) { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).materializedBody = body; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).materializedBody = body; } } /** Recognizes every one-shot upload before issuer authentication or request replay. */ @@ -5500,16 +22874,16 @@ var init_x509_workload_identity_auth = __esm({ } /** Retires abandoned upload adapters without masking or blocking their authentication failure. */ retireRequestBody() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const body = scope.materializedBody; delete scope.materializedBody; if (body) { - void __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_cancelRequestBody).call(_a, body); + void __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_cancelRequestBody).call(_a2, body); } } /** Transfers the dispatched upload while retiring any SDK-owned body replaced by a hook. */ releaseRequestBody(body) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (scope.materializedBody === body) { delete scope.materializedBody; } else { @@ -5519,21 +22893,21 @@ var init_x509_workload_identity_auth = __esm({ /** Retains caller-only cancellation separately from SDK-created deadline controllers. */ setEffectiveSignal(signal) { if (signal) { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal = signal; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal = signal; } else { - delete __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal; + delete __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal; } } /** Uses protected-hook cancellation when an authenticated attempt enters retry backoff. */ effectiveSignal() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); return scope.effectiveSignal ?? scope.request?.signal; } /** Establishes an independent scope even when concurrent requests share caller options. */ // oxlint-disable-next-line anti-slop/no-object-parameters -- Logical request owners are opaque identity tokens; their properties are never read. runRequest(operation, requestOwner) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").run(async () => { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").run(async () => { + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope) { throw new OpenAIError("X.509 workload identity requires an active certificate request scope."); } @@ -5552,16 +22926,16 @@ var init_x509_workload_identity_auth = __esm({ /** Reports whether a public request-building call already belongs to an active logical operation. */ // oxlint-disable-next-line anti-slop/no-object-parameters -- Request scope membership compares the opaque caller token by identity only. inRequest(requestOwner) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); return scope?.owner === this && scope.requestOwner === requestOwner && scope.phase !== "authorizing"; } /** Shares a cache only when the complete, privately snapshotted credential identity matches. */ matches(other) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_transport, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_identityProviderId, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_serviceAccountId, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_organization, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_project, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_refreshBufferMs, "f"); + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_transport, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_identityProviderId, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_serviceAccountId, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_organization, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_project, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_refreshBufferMs, "f"); } /** Binds deferred response parsing to the original logical request and its unchanged deadline. */ continuation() { - const { wallStartedAt, monotonicStartedAt, deadlineArmed, request: request2, requestOwner, effectiveSignal } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { wallStartedAt, monotonicStartedAt, deadlineArmed, request: request2, requestOwner, effectiveSignal } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const scope = { wallStartedAt, monotonicStartedAt, @@ -5575,7 +22949,7 @@ var init_x509_workload_identity_auth = __esm({ // Spread creates an own data property without invoking inherited setters or changing the object prototype. ...requestOwner ? { requestOwner } : {} }; - return (operation) => __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").resume(scope, async () => { + return (operation) => __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").resume(scope, async () => { try { return await operation(); } finally { @@ -5587,7 +22961,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Removes dispatched bearer material before settled request promises can retain their scope. */ releaseRequestCredentials() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); delete scope.request; delete scope.phase; delete scope.deadlineArmed; @@ -5606,28 +22980,28 @@ var init_x509_workload_identity_auth = __esm({ } /** Returns the original authentication start so response consumption shares its request deadline. */ requestStartedAt(_options) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current()?.wallStartedAt; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current()?.wallStartedAt; } /** Distinguishes issued workload credentials from independent admin or headerless requests. */ usedWorkloadToken(_options) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current()?.token !== void 0; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current()?.token !== void 0; } /** Returns the budget left after certificate authentication without starting another timeout. */ remainingTimeout(_options, timeout) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (scope === void 0) { return timeout; } const remaining = timeout - (performance.now() - scope.monotonicStartedAt); if (remaining <= 0) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } return remaining; } /** Cancels active retry timers promptly without changing public caller-abort semantics. */ async waitForRetry(duration, signal) { try { - await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").sleep(duration, signal); + await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").sleep(duration, signal); } catch (error) { if (signal?.aborted) { throw userAbortError(signal); @@ -5656,11 +23030,11 @@ var init_x509_workload_identity_auth = __esm({ if (options) { assertX509RequestOptions(context ? context.fetchOptions : options.fetchOptions); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_preflight).call(this, context); - const scope = options ? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this) : void 0; - const cached = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f"); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_preflight).call(this, context); + const scope = options ? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this) : void 0; + const cached = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f"); if (cached && performance.now() < cached.refreshAt && Date.now() < cached.wallRefreshAt) { - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, cached); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached); } const remaining = context && options ? this.remainingTimeout(options, context.timeout) : context?.timeout; const { signal, dispose } = exchangeDeadline(remaining, callerSignal); @@ -5668,43 +23042,43 @@ var init_x509_workload_identity_auth = __esm({ dispose(); throw userAbortError(callerSignal); } - const attempt = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") ?? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_beginRefresh).call(this); + const attempt = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") ?? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_beginRefresh).call(this); attempt.waiters += 1; const waiter = waitForRefresh(attempt, signal); try { const exchanged = await waiter.result; - const refreshed = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f"); + const refreshed = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f"); if (!refreshed || refreshed.accessToken !== exchanged.accessToken) { - throw new APIUserAbortError(); + throw new APIUserAbortError2(); } - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, refreshed); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, refreshed); } catch (error) { - return await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached, scope, options, context); + return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached, scope, options, context); } finally { waiter.dispose(); dispose(); attempt.waiters -= 1; - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_retireRefresh).call(this, attempt); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_retireRefresh).call(this, attempt); } } /** Invalidates only the workload-token generation actually rejected by the current request. */ invalidateToken() { - const rejected = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); - if (!rejected?.token || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f")?.accessToken !== rejected.token || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f").generation !== rejected.tokenGeneration) { + const rejected = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); + if (!rejected?.token || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f")?.accessToken !== rejected.token || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f").generation !== rejected.tokenGeneration) { return; } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_cachedToken, void 0, "f"); - const refresh = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); - refresh?.controller.abort(new APIUserAbortError()); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_cachedToken, void 0, "f"); + const refresh = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + refresh?.controller.abort(new APIUserAbortError2()); } /** Binds the minted credential to the original headers before protected request hooks run. */ bindRequest(options, request2, adminAPIKey) { if (!(request2.headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity requires the original workload authorization headers."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const { token } = scope; const security = options.__security ?? { bearerAuth: true }; let approvedAuthorization = token ? `Bearer ${token}` : null; @@ -5717,7 +23091,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Rebinds an equivalent protected-hook container without relaxing final dispatch identity checks. */ adoptRequestHeaders(request2) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const original = scope.headers; if (!(original instanceof Headers) || !(request2.headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); @@ -5736,11 +23110,11 @@ var init_x509_workload_identity_auth = __esm({ if (!(headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope || scope.headers !== headers || scope.authorization === void 0 || headerValue(headers, "Authorization") !== scope.authorization) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers); assertSafeHeaders(headers); } /** Returns a guarded final dispatcher while preserving all existing request hook object identities. */ @@ -5757,13 +23131,13 @@ var init_x509_workload_identity_auth = __esm({ assertSafeHeaders(headers); init.headers = headers; init.redirect = "manual"; - return await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").dispatch(target, init); + return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").dispatch(target, init); }; } }; - _a = X509WorkloadIdentityAuth, _X509WorkloadIdentityAuth_identityProviderId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_serviceAccountId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_organization = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_project = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_transport = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_cachedToken = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refresh = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_tokenGeneration = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_instances = /* @__PURE__ */ new WeakSet(), _X509WorkloadIdentityAuth_cancelRequestBody = async function _X509WorkloadIdentityAuth_cancelRequestBody2(body) { + _a2 = X509WorkloadIdentityAuth, _X509WorkloadIdentityAuth_identityProviderId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_serviceAccountId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_organization = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_project = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_transport = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_cachedToken = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refresh = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_tokenGeneration = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_instances = /* @__PURE__ */ new WeakSet(), _X509WorkloadIdentityAuth_cancelRequestBody = async function _X509WorkloadIdentityAuth_cancelRequestBody2(body) { try { - await CancelReadableStream(body); + await CancelReadableStream2(body); } catch { } }, _X509WorkloadIdentityAuth_assignToken = function _X509WorkloadIdentityAuth_assignToken2(scope, token) { @@ -5777,10 +23151,10 @@ var init_x509_workload_identity_auth = __esm({ if (callerSignal?.aborted) { throw userAbortError(callerSignal); } - if (attempt.controller.signal.aborted && attempt.generation !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f")) { + if (attempt.controller.signal.aborted && attempt.generation !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f")) { return await this.getToken(options, context); } - const fallback = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached, scope); + const fallback = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached, scope); if (fallback !== void 0) { return fallback; } @@ -5792,10 +23166,10 @@ var init_x509_workload_identity_auth = __esm({ } throw error; }, _X509WorkloadIdentityAuth_fallbackToken = function _X509WorkloadIdentityAuth_fallbackToken2(error, cached, scope) { - if (!cached || cached !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached.expiresAt || Date.now() >= cached.wallExpiresAt || !_a.isRetryableFailure(error)) { + if (!cached || cached !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached.expiresAt || Date.now() >= cached.wallExpiresAt || !_a2.isRetryableFailure(error)) { return void 0; } - const headers = _a.retryHeaders(error); + const headers = _a2.retryHeaders(error); const milliseconds = headers?.get("retry-after-ms"); let requested = milliseconds ? Number(milliseconds) : void 0; const retryAfter = headers?.get("retry-after"); @@ -5806,68 +23180,68 @@ var init_x509_workload_identity_auth = __esm({ const cooldown = requested !== void 0 && Number.isFinite(requested) && requested >= 0 && requested <= 6e4 ? Math.max(FAILED_REFRESH_COOLDOWN_MS, requested) : FAILED_REFRESH_COOLDOWN_MS; cached.refreshAt = Math.min(cached.expiresAt, performance.now() + cooldown); cached.wallRefreshAt = Math.min(cached.wallExpiresAt, Date.now() + cooldown); - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, cached); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached); }, _X509WorkloadIdentityAuth_retireRefresh = function _X509WorkloadIdentityAuth_retireRefresh2(attempt) { - if (attempt.waiters !== 0 || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") !== attempt) { + if (attempt.waiters !== 0 || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") !== attempt) { return; } queueMicrotask(() => { - if (attempt.waiters === 0 && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") === attempt) { - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - attempt.controller.abort(new APIUserAbortError()); + if (attempt.waiters === 0 && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") === attempt) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + attempt.controller.abort(new APIUserAbortError2()); } }); }, _X509WorkloadIdentityAuth_beginRefresh = function _X509WorkloadIdentityAuth_beginRefresh2() { const controller = new AbortController(); - const generation = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"); + const generation = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"); const attempt = { controller, generation, waiters: 0, - promise: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_refreshToken).call(this, controller, generation) + promise: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_refreshToken).call(this, controller, generation) }; - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, attempt, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, attempt, "f"); return attempt; }, _X509WorkloadIdentityAuth_refreshToken = async function _X509WorkloadIdentityAuth_refreshToken2(controller, generation) { const startedAt = performance.now(); const wallStartedAt = Date.now(); try { - const token = await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").exchange(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), controller.signal); + const token = await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").exchange(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), controller.signal); const lifetime = token.expiresIn * 1e3; const expiresAt = startedAt + lifetime; const wallExpiresAt = wallStartedAt + lifetime; if (performance.now() >= expiresAt || Date.now() >= wallExpiresAt) { throw new OpenAIError("X.509 workload identity token expired before its exchange completed."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") !== generation || controller.signal.aborted || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller !== controller) { - throw new APIUserAbortError(); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") !== generation || controller.signal.aborted || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller !== controller) { + throw new APIUserAbortError2(); } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_cachedToken, { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_cachedToken, { accessToken: token.accessToken, - generation: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"), + generation: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"), expiresAt, - refreshAt: expiresAt - Math.min(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2), + refreshAt: expiresAt - Math.min(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2), wallExpiresAt, - wallRefreshAt: wallExpiresAt - Math.min(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2) + wallRefreshAt: wallExpiresAt - Math.min(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2) }, "f"); return token; } finally { - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller === controller) { - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller === controller) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); } } }, _X509WorkloadIdentityAuth_preflight = function _X509WorkloadIdentityAuth_preflight2(context) { if (!context) { return; } - if (context.organization !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || context.project !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (context.organization !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || context.project !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } assertX509APIOrigin(context.apiURL); - const supplied = buildHeaders([context.defaultHeaders, context.requestHeaders]); - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") !== null && supplied.nulls.has("openai-organization") || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f") !== null && supplied.nulls.has("openai-project")) { + const supplied = buildHeaders2([context.defaultHeaders, context.requestHeaders]); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") !== null && supplied.nulls.has("openai-organization") || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f") !== null && supplied.nulls.has("openai-project")) { throw new OpenAIError("X.509 workload identity cannot omit its enrolled organization or project."); } for (const name of supplied.values.keys()) { @@ -5880,13 +23254,13 @@ var init_x509_workload_identity_auth = __esm({ } } }, _X509WorkloadIdentityAuth_scope = function _X509WorkloadIdentityAuth_scope2() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope || scope.owner !== this) { throw new OpenAIError("X.509 workload identity requires an active certificate request scope."); } return scope; }, _X509WorkloadIdentityAuth_assertTenantHeaders = function _X509WorkloadIdentityAuth_assertTenantHeaders2(headers) { - if (headerValue(headers, "OpenAI-Organization") !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || headerValue(headers, "OpenAI-Project") !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (headerValue(headers, "OpenAI-Organization") !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || headerValue(headers, "OpenAI-Project") !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } for (const name of Headers.prototype.keys.call(headers)) { @@ -5957,12 +23331,12 @@ function prepareProviderClone(inherited, overrides) { return provider2; } function prepareX509ClientClone(inherited, overrides, credential, currentlyX509) { - const nextIdentity = hasOwn(overrides, "workloadIdentity") ? overrides.workloadIdentity : inherited.workloadIdentity; + const nextIdentity = hasOwn2(overrides, "workloadIdentity") ? overrides.workloadIdentity : inherited.workloadIdentity; const dropping = credential !== void 0 && (overridesOrdinaryAuthentication(overrides) && overrides.workloadIdentity === void 0 || overrides.provider !== void 0); - if (credential !== void 0 && hasOwn(overrides, "workloadIdentity")) { + if (credential !== void 0 && hasOwn2(overrides, "workloadIdentity")) { delete inherited.x509Transport; } - const inheritedCredential = credential !== void 0 && !dropping && overrides.credential === void 0 && !hasOwn(overrides, "workloadIdentity") && !hasOwn(overrides, "x509Transport") ? credential : void 0; + const inheritedCredential = credential !== void 0 && !dropping && overrides.credential === void 0 && !hasOwn2(overrides, "workloadIdentity") && !hasOwn2(overrides, "x509Transport") ? credential : void 0; const nextCredential = overrides.credential === void 0 ? inheritedCredential : overrides.credential; const nextX509 = nextCredential !== void 0 || !dropping && isX509WorkloadIdentity(nextIdentity); if (currentlyX509 !== nextX509) { @@ -6000,8 +23374,8 @@ function prepareX509ClientClone(inherited, overrides, credential, currentlyX509) } var init_x509_credential_options = __esm({ "node_modules/openai/internal/auth/x509-credential-options.mjs"() { - init_error(); - init_values(); + init_error3(); + init_values2(); init_x509_workload_identity_auth(); init_x509_transport_state(); } @@ -6023,11 +23397,11 @@ function toStreamingFile(data, name, options) { ...type ? { type } : {} }; } -function makeFile(fileBits, fileName, options) { - checkFileSupport(); +function makeFile2(fileBits, fileName, options) { + checkFileSupport2(); return new File(fileBits, fileName ?? "unknown_file", options); } -function getName(value2, options) { +function getName2(value2, options) { if (typeof value2 !== "object" || value2 === null) { return void 0; } @@ -6064,9 +23438,9 @@ function isArrayBuffer(value2) { return false; } } -function supportsFormData(fetchObject) { +function supportsFormData2(fetchObject) { const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; - const cached = supportsFormDataMap.get(fetch2); + const cached = supportsFormDataMap2.get(fetch2); if (cached) { return cached; } @@ -6089,7 +23463,7 @@ function supportsFormData(fetchObject) { return true; } })(); - supportsFormDataMap.set(fetch2, promise); + supportsFormDataMap2.set(fetch2, promise); return promise; } async function* iterateMultipartBody(entries2, boundary, options, preservedFilenames) { @@ -6097,23 +23471,23 @@ async function* iterateMultipartBody(entries2, boundary, options, preservedFilen if (isUploadable(value2)) { const filename = preservedFilenames?.get(value2) ?? getStreamingFileName(value2, options); const type = getStreamingFileType(value2); - yield encodeUTF8(`--${boundary}\r + yield encodeUTF82(`--${boundary}\r `); - yield encodeUTF8(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"; filename="${escapeHeaderValue(filename)}"\r + yield encodeUTF82(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"; filename="${escapeHeaderValue(filename)}"\r Content-Type: ${type}\r \r `); yield* iterateBytes(getStreamingFileData(value2)); } else { - yield encodeUTF8(`--${boundary}\r + yield encodeUTF82(`--${boundary}\r `); - yield encodeUTF8(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"\r + yield encodeUTF82(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"\r \r ${String(value2)}`); } - yield encodeUTF8("\r\n"); + yield encodeUTF82("\r\n"); } - yield encodeUTF8(`--${boundary}--\r + yield encodeUTF82(`--${boundary}--\r `); } function* iterateFormEntries(body) { @@ -6153,7 +23527,7 @@ function getStreamingFileName(value2, options) { } return options.stripFilenames === false ? normalizeFilenamePath(name) : basename(name) ?? "unknown_file"; } - return getName(value2, { stripFilename: options.stripFilenames }) ?? "unknown_file"; + return getName2(value2, { stripFilename: options.stripFilenames }) ?? "unknown_file"; } function getStreamingFileType(value2) { let type; @@ -6184,7 +23558,7 @@ function getStreamingFileData(value2) { } async function* iterateBytes(value2) { if (typeof value2 === "string") { - yield encodeUTF8(value2); + yield encodeUTF82(value2); } else if (ArrayBuffer.isView(value2)) { yield new Uint8Array(value2.buffer, value2.byteOffset, value2.byteLength); } else if (isArrayBuffer(value2)) { @@ -6198,10 +23572,10 @@ async function* iterateBytes(value2) { yield new Uint8Array(await value2.arrayBuffer()); } } else if (isReadableStream(value2)) { - for await (const chunk of ReadableStreamToAsyncIterable(value2)) { + for await (const chunk of ReadableStreamToAsyncIterable2(value2)) { yield* iterateBytes(chunk); } - } else if (isAsyncIterable(value2)) { + } else if (isAsyncIterable2(value2)) { for await (const chunk of value2) { yield* iterateBytes(chunk); } @@ -6215,14 +23589,14 @@ function escapeHeaderValue(value2) { return codePoint <= 31 || codePoint === 127 || character === '"' || character === "\\" ? encodeURIComponent(character) : character; }).join(""); } -var brand_privateStreamingFile, checkFileSupport, arrayBufferByteLengthGetter, isAsyncIterable, maybeMultipartFormRequestOptions, multipartFormRequestOptions, supportsFormDataMap, createForm, isBlob, isReadableStream, isStreamingFile, isUploadable, hasStreamingUploadableValue, hasUploadableValue, snapshotPreservedUploadEntries, createStreamingFormRequestOptions, addFormValue; -var init_uploads = __esm({ +var brand_privateStreamingFile, checkFileSupport2, arrayBufferByteLengthGetter, isAsyncIterable2, maybeMultipartFormRequestOptions, multipartFormRequestOptions2, supportsFormDataMap2, createForm2, isBlob, isReadableStream, isStreamingFile, isUploadable, hasStreamingUploadableValue, hasUploadableValue, snapshotPreservedUploadEntries, createStreamingFormRequestOptions, addFormValue2; +var init_uploads3 = __esm({ "node_modules/openai/internal/uploads.mjs"() { - init_headers2(); - init_shims(); - init_bytes(); + init_headers3(); + init_shims2(); + init_bytes2(); brand_privateStreamingFile = /* @__PURE__ */ Symbol("brand.privateStreamingFile"); - checkFileSupport = () => { + checkFileSupport2 = () => { if (typeof File === "undefined") { const { process: process2 } = globalThis; const isOldNode = typeof process2?.versions?.node === "string" && Number.parseInt(process2.versions.node.split("."), 10) < 20; @@ -6230,7 +23604,7 @@ var init_uploads = __esm({ } }; arrayBufferByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get; - isAsyncIterable = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; + isAsyncIterable2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; maybeMultipartFormRequestOptions = async (opts, fetch2, formOptions) => { if (!hasUploadableValue(opts.body)) { return opts; @@ -6238,29 +23612,29 @@ var init_uploads = __esm({ if (hasStreamingUploadableValue(opts.body)) { return createStreamingFormRequestOptions(opts, formOptions); } - return { ...opts, body: await createForm(opts.body, fetch2, formOptions) }; + return { ...opts, body: await createForm2(opts.body, fetch2, formOptions) }; }; - multipartFormRequestOptions = async (opts, fetch2, formOptions) => { + multipartFormRequestOptions2 = async (opts, fetch2, formOptions) => { if (hasStreamingUploadableValue(opts.body)) { return createStreamingFormRequestOptions(opts, formOptions); } - return { ...opts, body: await createForm(opts.body, fetch2, formOptions) }; + return { ...opts, body: await createForm2(opts.body, fetch2, formOptions) }; }; - supportsFormDataMap = /* @__PURE__ */ new WeakMap(); - createForm = async (body, fetch2, options = {}) => { - if (!await supportsFormData(fetch2)) { + supportsFormDataMap2 = /* @__PURE__ */ new WeakMap(); + createForm2 = async (body, fetch2, options = {}) => { + if (!await supportsFormData2(fetch2)) { throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); } const form = new FormData(); - await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue(form, key, value2, options))); + await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue2(form, key, value2, options))); return form; }; isBlob = (value2) => value2 instanceof Blob; isReadableStream = (value2) => typeof value2 === "object" && value2 !== null && "getReader" in value2 && typeof value2.getReader === "function"; isStreamingFile = (value2) => typeof value2 === "object" && value2 !== null && brand_privateStreamingFile in value2; - isUploadable = (value2) => typeof value2 === "object" && value2 !== null && (value2 instanceof Response || isAsyncIterable(value2) || isReadableStream(value2) || isStreamingFile(value2) || isBlob(value2)); + isUploadable = (value2) => typeof value2 === "object" && value2 !== null && (value2 instanceof Response || isAsyncIterable2(value2) || isReadableStream(value2) || isStreamingFile(value2) || isBlob(value2)); hasStreamingUploadableValue = (value2) => { - if (isStreamingFile(value2) || isAsyncIterable(value2) || isReadableStream(value2)) { + if (isStreamingFile(value2) || isAsyncIterable2(value2) || isReadableStream(value2)) { return true; } if (Array.isArray(value2)) { @@ -6306,14 +23680,14 @@ var init_uploads = __esm({ const preservedFilenames = options.stripFilenames === false ? /* @__PURE__ */ new WeakMap() : void 0; const multipartEntries = preservedFilenames ? snapshotPreservedUploadEntries(entries2, preservedFilenames) : entries2; const boundary = `openai-${Math.random().toString(36).slice(2)}`; - const body = ReadableStreamFrom(iterateMultipartBody(multipartEntries, boundary, options, preservedFilenames)); + const body = ReadableStreamFrom2(iterateMultipartBody(multipartEntries, boundary, options, preservedFilenames)); return { ...opts, body, - headers: buildHeaders([{ "content-type": `multipart/form-data; boundary=${boundary}` }, opts.headers]) + headers: buildHeaders2([{ "content-type": `multipart/form-data; boundary=${boundary}` }, opts.headers]) }; }; - addFormValue = async (form, key, value2, options) => { + addFormValue2 = async (form, key, value2, options) => { if (value2 === void 0) { return; } @@ -6324,11 +23698,11 @@ var init_uploads = __esm({ form.append(key, String(value2)); } else if (value2 instanceof Response) { const blob = await value2.blob(); - form.append(key, makeFile([blob], getName(value2, { stripFilename: options.stripFilenames }), { type: blob.type })); - } else if (isAsyncIterable(value2)) { - form.append(key, makeFile([await new Response(ReadableStreamFrom(value2)).blob()], getName(value2, { stripFilename: options.stripFilenames }))); + form.append(key, makeFile2([blob], getName2(value2, { stripFilename: options.stripFilenames }), { type: blob.type })); + } else if (isAsyncIterable2(value2)) { + form.append(key, makeFile2([await new Response(ReadableStreamFrom2(value2)).blob()], getName2(value2, { stripFilename: options.stripFilenames }))); } else if (isBlob(value2)) { - const filename = getName(value2, { stripFilename: options.stripFilenames }); + const filename = getName2(value2, { stripFilename: options.stripFilenames }); if (filename === void 0) { form.append(key, value2); } else { @@ -6337,7 +23711,7 @@ var init_uploads = __esm({ } else if (Array.isArray(value2)) { const entries2 = await Promise.all(value2.map(async (entry2) => { const entryForm = new FormData(); - await addFormValue(entryForm, key + "[]", entry2, options); + await addFormValue2(entryForm, key + "[]", entry2, options); return entryForm; })); for (const entryForm of entries2) { @@ -6349,7 +23723,7 @@ var init_uploads = __esm({ } } } else if (typeof value2 === "object") { - await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop, options))); + await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue2(form, `${key}[${name}]`, prop, options))); } else { throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); } @@ -6358,10 +23732,10 @@ var init_uploads = __esm({ }); // node_modules/openai/internal/to-file.mjs -async function toFile(value2, name, options) { - checkFileSupport(); +async function toFile2(value2, name, options) { + checkFileSupport2(); value2 = await value2; - if (isFileLike(value2)) { + if (isFileLike2(value2)) { const fileOptions = { ...options, type: options?.type ?? value2.type, @@ -6371,75 +23745,75 @@ async function toFile(value2, name, options) { if (canReuseNativeFile(value2, name, options)) { return value2; } - return makeFile([value2], name ?? value2.name, fileOptions); + return makeFile2([value2], name ?? value2.name, fileOptions); } - return makeFile([await value2.arrayBuffer()], name ?? value2.name, fileOptions); + return makeFile2([await value2.arrayBuffer()], name ?? value2.name, fileOptions); } - if (isResponseLike(value2)) { + if (isResponseLike2(value2)) { const blob = await value2.blob(); - name ?? (name = getName(value2)); + name ?? (name = getName2(value2)); const responseOptions = options?.type === void 0 && blob.type ? { ...options, type: blob.type } : options; - return makeFile(await getBytes(blob), name, responseOptions); + return makeFile2(await getBytes2(blob), name, responseOptions); } - const parts = await getBytes(value2); - name ?? (name = getName(value2)); + const parts = await getBytes2(value2); + name ?? (name = getName2(value2)); if (options?.type === void 0) { const typedPart = parts.find((part) => typeof part === "object" && "type" in part && !!part.type); if (typedPart) { options = { ...options, type: typedPart.type }; } } - return makeFile(parts, name, options); + return makeFile2(parts, name, options); } -async function getBytes(value2) { +async function getBytes2(value2) { const parts = []; if (typeof value2 === "string" || ArrayBuffer.isView(value2) || // includes Uint8Array, Buffer, etc. isArrayBuffer(value2)) { parts.push(value2); - } else if (isBlobLike(value2)) { + } else if (isBlobLike2(value2)) { parts.push(value2 instanceof Blob ? value2 : new Blob([await value2.arrayBuffer()], { type: value2.type })); - } else if (isAsyncIterable(value2)) { + } else if (isAsyncIterable2(value2)) { for await (const chunk of value2) { - parts.push(...await getBytes(chunk)); + parts.push(...await getBytes2(chunk)); } } else { const constructor = value2?.constructor?.name; - throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError(value2)}`); + throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError2(value2)}`); } return parts; } -function propsForError(value2) { +function propsForError2(value2) { if (typeof value2 !== "object" || value2 === null) { return ""; } const props = Object.getOwnPropertyNames(value2); return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; } -var isBlobLike, isFileLike, isResponseLike, hasFilePropertyOverrides, canReuseNativeFile; -var init_to_file = __esm({ +var isBlobLike2, isFileLike2, isResponseLike2, hasFilePropertyOverrides, canReuseNativeFile; +var init_to_file2 = __esm({ "node_modules/openai/internal/to-file.mjs"() { - init_uploads(); - isBlobLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; - isFileLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike(value2); - isResponseLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; + init_uploads3(); + isBlobLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; + isFileLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike2(value2); + isResponseLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; hasFilePropertyOverrides = (value2, options) => options?.type != null && options.type !== value2.type || options?.lastModified != null && options.lastModified !== value2.lastModified || options?.endings != null; canReuseNativeFile = (value2, name, options) => (name == null || name === value2.name) && !hasFilePropertyOverrides(value2, options); } }); // node_modules/openai/core/uploads.mjs -var init_uploads2 = __esm({ +var init_uploads4 = __esm({ "node_modules/openai/core/uploads.mjs"() { - init_uploads(); - init_to_file(); + init_uploads3(); + init_to_file2(); } }); // node_modules/openai/core/resource.mjs -var APIResource; -var init_resource = __esm({ +var APIResource2; +var init_resource2 = __esm({ "node_modules/openai/core/resource.mjs"() { - APIResource = class { + APIResource2 = class { constructor(client) { this._client = client; } @@ -6448,15 +23822,15 @@ var init_resource = __esm({ }); // node_modules/openai/internal/utils/path.mjs -function encodeURIPath(str2) { +function encodeURIPath2(str2) { return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); } -var EMPTY, createPathTagFunction, path; -var init_path = __esm({ +var EMPTY2, createPathTagFunction2, path3; +var init_path2 = __esm({ "node_modules/openai/internal/utils/path.mjs"() { - init_error(); - EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); - createPathTagFunction = (pathEncoder = encodeURIPath) => function path5(statics, ...params) { + init_error3(); + EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path5(statics, ...params) { if (statics.length === 1) { return statics[0]; } @@ -6473,7 +23847,7 @@ var init_path = __esm({ let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value2); if (index !== params.length && (value2 == null || // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Path parameters may arrive from JavaScript callers and require runtime validation before URL encoding. typeof value2 === "object" && // handle values from other realms - value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY) ?? EMPTY)?.toString)) { + value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY2) ?? EMPTY2)?.toString)) { encoded = value2 + ""; invalidSegments.push({ start: path6.length + currentValue.length, @@ -6511,18 +23885,18 @@ ${underline}`); } return path6; }; - path = /* @__PURE__ */ createPathTagFunction(encodeURIPath); + path3 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2); } }); // node_modules/openai/resources/chat/completions/messages.mjs -var Messages; -var init_messages = __esm({ +var Messages3; +var init_messages3 = __esm({ "node_modules/openai/resources/chat/completions/messages.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Messages = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Messages3 = class extends APIResource2 { /** * Get the messages in a stored chat completion. Only Chat Completions that have * been created with the `store` parameter set to `true` will be returned. @@ -6538,16 +23912,16 @@ var init_messages = __esm({ * ``` */ list(completionID, query = {}, options) { - return this._client.getAPIList(path`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } }); // node_modules/openai/error.mjs -var init_error2 = __esm({ +var init_error4 = __esm({ "node_modules/openai/error.mjs"() { - init_error(); + init_error3(); } }); @@ -6672,9 +24046,9 @@ function validateInputTools(tools) { } } } -var init_parser = __esm({ +var init_parser3 = __esm({ "node_modules/openai/lib/parser.mjs"() { - init_error2(); + init_error4(); } }); @@ -7448,8 +24822,8 @@ function createBufferedEventLedger() { var _EventStream_instances, _EventStream_connectedPromise, _EventStream_resolveConnectedPromise, _EventStream_rejectConnectedPromise, _EventStream_endPromise, _EventStream_resolveEndPromise, _EventStream_rejectEndPromise, _EventStream_listeners, _EventStream_abortListeners, _EventStream_emittedListenerRegistrations, _EventStream_pendingListenerCleanup, _EventStream_pendingBufferedEventChecks, _EventStream_listenerDispatchDepth, _EventStream_ended, _EventStream_errored, _EventStream_aborted, _EventStream_catchingPromiseCreated, _EventStream_terminalFailure, _EventStream_abortFromSignal, _EventStream_removeAbortListeners, _EventStream_onceForEmitted, _EventStream_removeEmittedListener, _EventStream_cleanupEmittedListeners, _EventStream_handleError, _EventStream_settleTerminalEvent, MAX_BUFFERED_ITERATOR_EVENTS, MAX_BUFFERED_ITERATOR_BYTES, MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS, MAX_BUFFERED_EVENT_DEPTH, bufferedJSONStringify, bufferedJSONParse, sdkOwnedBufferedEventArguments, typedArrayBufferGetter, typedArrayLengthGetter, dataViewBufferGetter, symbolDescriptionGetter, dateTimestampGetter, arrayBufferByteLengthGetter2, sharedArrayBufferByteLengthGetter, errorStackDescriptor, functionToString, objectToString, errorBrandDescriptor, nativeErrorBrand, nativeErrorConstructorSource, nativeDateConstructorSource, nativeFunctionConstructorSource, trustedIntrinsicPrototypes, trustedNativeConstructorSources, canonicalIntrinsicDescriptors, foreignErrorStackDescriptors, nativeProxyDetector, typedArrayConstructorDescriptor, blobInternalHandlePrototype, mapEntries, setValues, headersEntriesDescriptor, headersEntries, retainedStorageBrands, BUFFERED_LEDGER_ENTRY_BYTES, BUFFERED_LEDGER_NODE_BYTES, BUFFERED_LEDGER_EDGE_BYTES, BUFFERED_LEDGER_OWNER_BYTES, MAX_BUFFERED_LEDGER_RECONCILIATION_WORK, EventStream2; var init_EventStream = __esm({ "node_modules/openai/lib/EventStream.mjs"() { - init_tslib(); - init_error2(); + init_tslib2(); + init_error4(); MAX_BUFFERED_ITERATOR_EVENTS = 4096; MAX_BUFFERED_ITERATOR_BYTES = 8 * 1024 * 1024; MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS = 4096; @@ -7473,24 +24847,24 @@ var init_EventStream = __esm({ nativeDateConstructorSource = functionToString.call(Date); nativeFunctionConstructorSource = functionToString.call(Function); trustedIntrinsicPrototypes = /* @__PURE__ */ new Set([ - APIConnectionError.prototype, - APIConnectionTimeoutError.prototype, - APIError.prototype, + APIConnectionError2.prototype, + APIConnectionTimeoutError2.prototype, + APIError2.prototype, OpenAIError.prototype, - APIUserAbortError.prototype, - AuthenticationError.prototype, - BadRequestError.prototype, - ConflictError.prototype, + APIUserAbortError2.prototype, + AuthenticationError2.prototype, + BadRequestError2.prototype, + ConflictError2.prototype, ContentFilterFinishReasonError.prototype, - InternalServerError.prototype, + InternalServerError2.prototype, InvalidWebhookSignatureError.prototype, LengthFinishReasonError.prototype, - NotFoundError.prototype, + NotFoundError2.prototype, OAuthError.prototype, - PermissionDeniedError.prototype, - RateLimitError.prototype, + PermissionDeniedError2.prototype, + RateLimitError2.prototype, SubjectTokenProviderError.prototype, - UnprocessableEntityError.prototype + UnprocessableEntityError2.prototype ]); trustedNativeConstructorSources = /* @__PURE__ */ new Set(); canonicalIntrinsicDescriptors = /* @__PURE__ */ new Map(); @@ -7604,23 +24978,23 @@ var init_EventStream = __esm({ _EventStream_aborted.set(this, false); _EventStream_catchingPromiseCreated.set(this, false); _EventStream_terminalFailure.set(this, void 0); - __classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet(this, _EventStream_resolveConnectedPromise, resolve2, "f"); - __classPrivateFieldSet(this, _EventStream_rejectConnectedPromise, reject2, "f"); + __classPrivateFieldSet2(this, _EventStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet2(this, _EventStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet2(this, _EventStream_rejectConnectedPromise, reject2, "f"); }), "f"); - __classPrivateFieldSet(this, _EventStream_endPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet(this, _EventStream_resolveEndPromise, resolve2, "f"); - __classPrivateFieldSet(this, _EventStream_rejectEndPromise, reject2, "f"); + __classPrivateFieldSet2(this, _EventStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet2(this, _EventStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet2(this, _EventStream_rejectEndPromise, reject2, "f"); }), "f"); - __classPrivateFieldGet(this, _EventStream_connectedPromise, "f").catch(() => void 0); - __classPrivateFieldGet(this, _EventStream_endPromise, "f").catch(() => void 0); + __classPrivateFieldGet2(this, _EventStream_connectedPromise, "f").catch(() => void 0); + __classPrivateFieldGet2(this, _EventStream_endPromise, "f").catch(() => void 0); } _run(executor) { setTimeout(() => { let failed = false; Promise.resolve().then(executor).catch((error) => { failed = true; - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); }).then(() => { if (failed) { return; @@ -7628,7 +25002,7 @@ var init_EventStream = __esm({ try { this._emitFinal(); } catch (error) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); return; } this._emit("end"); @@ -7639,20 +25013,20 @@ var init_EventStream = __esm({ if (this.ended) { return; } - __classPrivateFieldGet(this, _EventStream_resolveConnectedPromise, "f").call(this); + __classPrivateFieldGet2(this, _EventStream_resolveConnectedPromise, "f").call(this); this._emit("connect"); } /** Whether the stream has finished successfully, failed, or been aborted. */ get ended() { - return __classPrivateFieldGet(this, _EventStream_ended, "f"); + return __classPrivateFieldGet2(this, _EventStream_ended, "f"); } /** Whether an error or user cancellation has been observed. */ get errored() { - return __classPrivateFieldGet(this, _EventStream_errored, "f"); + return __classPrivateFieldGet2(this, _EventStream_errored, "f"); } /** Whether the stream ended because its request was cancelled. */ get aborted() { - return __classPrivateFieldGet(this, _EventStream_aborted, "f"); + return __classPrivateFieldGet2(this, _EventStream_aborted, "f"); } /** * Cancels the underlying request; {@link done} and {@link events} observe cancellation. @@ -7663,7 +25037,7 @@ var init_EventStream = __esm({ } /** Creates a user-abort error retaining this runner's cancellation reason. */ _userAbortError() { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: this.controller.signal.reason, writable: true, @@ -7676,15 +25050,15 @@ var init_EventStream = __esm({ return; } if (signal.aborted) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); return; } - if (__classPrivateFieldGet(this, _EventStream_abortListeners, "f").some((registration) => registration.signal === signal)) { + if (__classPrivateFieldGet2(this, _EventStream_abortListeners, "f").some((registration) => registration.signal === signal)) { return; } - const listener = () => __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); + const listener = () => __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); signal.addEventListener("abort", listener, { once: true }); - __classPrivateFieldGet(this, _EventStream_abortListeners, "f").push({ signal, listener }); + __classPrivateFieldGet2(this, _EventStream_abortListeners, "f").push({ signal, listener }); } /** * Adds the listener function to the end of the listeners array for the event. @@ -7695,7 +25069,7 @@ var init_EventStream = __esm({ */ on(event, listener) { var _a6; - const listeners = (_a6 = __classPrivateFieldGet(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); + const listeners = (_a6 = __classPrivateFieldGet2(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); listeners.push({ listener }); return this; } @@ -7707,13 +25081,13 @@ var init_EventStream = __esm({ * @returns This stream, so that listener registration calls can be chained. */ off(event, listener) { - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; if (!listeners) { return this; } - const emittedRegistration = __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").get(listener); + const emittedRegistration = __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").get(listener); if (emittedRegistration?.event === event && !emittedRegistration.registration.removed && !emittedRegistration.registration.detached) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_removeEmittedListener).call(this, event, emittedRegistration.registration); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_removeEmittedListener).call(this, event, emittedRegistration.registration); return this; } const index = listeners.findIndex((l) => !l.removed && l.listener === listener); @@ -7729,7 +25103,7 @@ var init_EventStream = __esm({ */ once(event, listener) { var _a6; - const listeners = (_a6 = __classPrivateFieldGet(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); + const listeners = (_a6 = __classPrivateFieldGet2(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); listeners.push({ listener, once: true }); return this; } @@ -7748,7 +25122,7 @@ var init_EventStream = __esm({ */ emitted(event) { return new Promise((resolve2, reject2) => { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); + __classPrivateFieldSet2(this, _EventStream_catchingPromiseCreated, true, "f"); const onError = (error) => { this.off(event, onEvent); reject2(error); @@ -7760,9 +25134,9 @@ var init_EventStream = __esm({ resolve2(values.length > 1 ? values : values[0]); }; if (event !== "error") { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, "error", onError); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, "error", onError); } - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, event, onEvent); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, event, onEvent); }); } /** @@ -7844,7 +25218,7 @@ var init_EventStream = __esm({ const deactivateBufferedEvent = (entry2) => { entry2.active = false; if (entry2.check) { - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").delete(entry2.check); + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").delete(entry2.check); entry2.check = void 0; } }; @@ -7858,14 +25232,14 @@ var init_EventStream = __esm({ } const error = new OpenAIError(`Event stream iterator buffer limit exceeded (${MAX_BUFFERED_ITERATOR_EVENTS} events or ${MAX_BUFFERED_ITERATOR_BYTES} bytes); consume events as they arrive.`); try { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); } finally { this.controller.abort(); } return error; }; const revalidateBufferedEvent = (value2, entry2) => { - if (!entry2.active || __classPrivateFieldGet(this, _EventStream_ended, "f")) { + if (!entry2.active || __classPrivateFieldGet2(this, _EventStream_ended, "f")) { return; } const graph = inspectBufferedEventGraph(value2, MAX_BUFFERED_ITERATOR_BYTES); @@ -7908,7 +25282,7 @@ var init_EventStream = __esm({ revalidateBufferedEvent(value2, entry2); }; entry2.check = check2; - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").add(check2); + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").add(check2); } }; const onFailure = (error) => { @@ -7921,7 +25295,7 @@ var init_EventStream = __esm({ if (failure) { return; } - const terminal = __classPrivateFieldGet(this, _EventStream_terminalFailure, "f"); + const terminal = __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f"); if (!terminal) { return; } @@ -8000,35 +25374,35 @@ var init_EventStream = __esm({ } /** Resolves when the stream ends successfully or rejects when it fails or is aborted. */ async done() { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet(this, _EventStream_endPromise, "f"); + __classPrivateFieldSet2(this, _EventStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet2(this, _EventStream_endPromise, "f"); } /** Returns whether an event currently has one or more registered listeners. */ _hasListeners(event) { - return Boolean(__classPrivateFieldGet(this, _EventStream_listeners, "f")[event]?.some((listener) => !listener.removed)); + return Boolean(__classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]?.some((listener) => !listener.removed)); } /** Dispatches a stream event and performs the associated lifecycle transitions. */ _emit(event, ...args) { - if (__classPrivateFieldGet(this, _EventStream_ended, "f")) { + if (__classPrivateFieldGet2(this, _EventStream_ended, "f")) { return; } if (event === "end") { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_removeAbortListeners).call(this); - __classPrivateFieldSet(this, _EventStream_ended, true, "f"); - __classPrivateFieldGet(this, _EventStream_resolveEndPromise, "f").call(this); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_removeAbortListeners).call(this); + __classPrivateFieldSet2(this, _EventStream_ended, true, "f"); + __classPrivateFieldGet2(this, _EventStream_resolveEndPromise, "f").call(this); } - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; let dispatchError; let dispatchThrew = false; try { if (listeners) { - __classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = listeners.filter((listener) => { + __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event] = listeners.filter((listener) => { if (listener.once) { listener.detached = true; } return !listener.once && !listener.removed; }); - __classPrivateFieldSet(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") + 1, "f"); + __classPrivateFieldSet2(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") + 1, "f"); try { for (const registration of listeners) { if (!registration.removed) { @@ -8037,12 +25411,12 @@ var init_EventStream = __esm({ } } } finally { - __classPrivateFieldSet(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") - 1, "f"); - if (__classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") === 0) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); - for (const check2 of __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f")) { - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").delete(check2); - if (!__classPrivateFieldGet(this, _EventStream_ended, "f")) { + __classPrivateFieldSet2(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") - 1, "f"); + if (__classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") === 0) { + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); + for (const check2 of __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f")) { + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").delete(check2); + if (!__classPrivateFieldGet2(this, _EventStream_ended, "f")) { check2(); } } @@ -8054,7 +25428,7 @@ var init_EventStream = __esm({ dispatchThrew = true; } try { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_settleTerminalEvent).call(this, event, args, Boolean(listeners?.length)); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_settleTerminalEvent).call(this, event, args, Boolean(listeners?.length)); } catch (error) { if (!dispatchThrew) { dispatchError = error; @@ -8076,44 +25450,44 @@ var init_EventStream = __esm({ this.controller.abort(); } }, _EventStream_removeAbortListeners = function _EventStream_removeAbortListeners2() { - for (const { signal, listener } of __classPrivateFieldGet(this, _EventStream_abortListeners, "f").splice(0)) { + for (const { signal, listener } of __classPrivateFieldGet2(this, _EventStream_abortListeners, "f").splice(0)) { signal.removeEventListener("abort", listener); } }, _EventStream_onceForEmitted = function _EventStream_onceForEmitted2(event, listener) { - const previousListeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const previousListeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; const previousLength = previousListeners?.length ?? 0; this.once(event, listener); - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; const [registration] = listeners?.slice(-1) ?? []; if ((previousListeners === void 0 || listeners === previousListeners) && listeners?.length === previousLength + 1 && registration?.listener === listener && registration.once) { - __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").set(listener, { event, registration }); + __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").set(listener, { event, registration }); } }, _EventStream_removeEmittedListener = function _EventStream_removeEmittedListener2(event, registration) { if (registration.removed) { return; } registration.removed = true; - __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").delete(registration.listener); - __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f").add(event); - if (__classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") === 0) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); + __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").delete(registration.listener); + __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f").add(event); + if (__classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") === 0) { + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); } }, _EventStream_cleanupEmittedListeners = function _EventStream_cleanupEmittedListeners2() { - for (const event of __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f")) { + for (const event of __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f")) { const eventType = event; - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[eventType]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[eventType]; if (listeners) { - __classPrivateFieldGet(this, _EventStream_listeners, "f")[eventType] = listeners.filter((listener) => !listener.removed); + __classPrivateFieldGet2(this, _EventStream_listeners, "f")[eventType] = listeners.filter((listener) => !listener.removed); } } - __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f").clear(); + __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f").clear(); }, _EventStream_handleError = function _EventStream_handleError2(error) { - __classPrivateFieldSet(this, _EventStream_errored, true, "f"); + __classPrivateFieldSet2(this, _EventStream_errored, true, "f"); if (error instanceof Error && error.name === "AbortError") { error = this._userAbortError(); } - if (error instanceof APIUserAbortError) { - __classPrivateFieldSet(this, _EventStream_aborted, true, "f"); + if (error instanceof APIUserAbortError2) { + __classPrivateFieldSet2(this, _EventStream_aborted, true, "f"); return this._emit("abort", error); } if (error instanceof OpenAIError) { @@ -8128,23 +25502,23 @@ var init_EventStream = __esm({ }, _EventStream_settleTerminalEvent = function _EventStream_settleTerminalEvent2(event, args, hasListeners) { if (event === "abort") { const error = args[0]; - __classPrivateFieldSet(this, _EventStream_terminalFailure, __classPrivateFieldGet(this, _EventStream_terminalFailure, "f") ?? { kind: "abort", error }, "f"); - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { + __classPrivateFieldSet2(this, _EventStream_terminalFailure, __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f") ?? { kind: "abort", error }, "f"); + if (!__classPrivateFieldGet2(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { Promise.reject(error); } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectEndPromise, "f").call(this, error); this._emit("end"); return; } if (event === "error") { const error = args[0]; - __classPrivateFieldSet(this, _EventStream_terminalFailure, __classPrivateFieldGet(this, _EventStream_terminalFailure, "f") ?? { kind: "error", error }, "f"); - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { + __classPrivateFieldSet2(this, _EventStream_terminalFailure, __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f") ?? { kind: "error", error }, "f"); + if (!__classPrivateFieldGet2(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { Promise.reject(error); } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectEndPromise, "f").call(this, error); this._emit("end"); } }; @@ -8165,7 +25539,7 @@ function normalizeToolCallIds(chatCompletion) { for (const choice of chatCompletion.choices) { for (const toolCall of choice.message.tool_calls ?? []) { if (!toolCall.id) { - toolCall.id = `call_${uuid4()}`; + toolCall.id = `call_${uuid42()}`; } } } @@ -8214,13 +25588,13 @@ function toRequestMessage(message) { } return requestMessage; } -var _AbstractChatCompletionRunner_instances, _a2, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, _AbstractChatCompletionRunner_afterCompletionInvoked, _AbstractChatCompletionRunner_getFinalContent, _AbstractChatCompletionRunner_getFinalMessage, _AbstractChatCompletionRunner_getFinalFunctionToolCall, _AbstractChatCompletionRunner_getFinalFunctionToolCallResult, _AbstractChatCompletionRunner_calculateTotalUsage, _AbstractChatCompletionRunner_throwIfAborted, _AbstractChatCompletionRunner_validateParams, _AbstractChatCompletionRunner_stringifyFunctionCallResult, DEFAULT_MAX_CHAT_COMPLETIONS, AbstractChatCompletionRunner; +var _AbstractChatCompletionRunner_instances, _a3, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, _AbstractChatCompletionRunner_afterCompletionInvoked, _AbstractChatCompletionRunner_getFinalContent, _AbstractChatCompletionRunner_getFinalMessage, _AbstractChatCompletionRunner_getFinalFunctionToolCall, _AbstractChatCompletionRunner_getFinalFunctionToolCallResult, _AbstractChatCompletionRunner_calculateTotalUsage, _AbstractChatCompletionRunner_throwIfAborted, _AbstractChatCompletionRunner_validateParams, _AbstractChatCompletionRunner_stringifyFunctionCallResult, DEFAULT_MAX_CHAT_COMPLETIONS, AbstractChatCompletionRunner; var init_AbstractChatCompletionRunner = __esm({ "node_modules/openai/lib/AbstractChatCompletionRunner.mjs"() { - init_tslib(); - init_error2(); - init_uuid(); - init_parser(); + init_tslib2(); + init_error4(); + init_uuid2(); + init_parser3(); init_chatCompletionUtils(); init_EventStream(); init_RunnableFunction(); @@ -8235,7 +25609,7 @@ var init_AbstractChatCompletionRunner = __esm({ this.messages = []; } _addChatCompletion(chatCompletion) { - __classPrivateFieldSet(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, !this.controller.signal.aborted, "f"); + __classPrivateFieldSet2(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, !this.controller.signal.aborted, "f"); normalizeToolCallIds(chatCompletion); this._chatCompletions.push(chatCompletion); this._emit("chatCompletion", chatCompletion); @@ -8281,7 +25655,7 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalContent() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); } /** * @returns a promise that resolves with the final assistant ChatCompletionMessage response, @@ -8289,7 +25663,7 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalMessage() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); } /** * Waits for completion and returns the last function-tool call, or `undefined` @@ -8297,53 +25671,53 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalFunctionToolCall() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); } /** Waits for completion and returns the last matching function-tool result, if any. */ async finalFunctionToolCallResult() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); } /** Waits for completion and sums token usage across every chat completion in the run. */ async totalUsage() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); } /** Returns a copy of the chat completions received so far, in request order. */ allChatCompletions() { return [...this._chatCompletions]; } _emitFinal() { - if (__classPrivateFieldGet(this, _AbstractChatCompletionRunner_afterCompletionInvoked, "f")) { - __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); + if (__classPrivateFieldGet2(this, _AbstractChatCompletionRunner_afterCompletionInvoked, "f")) { + __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); } const completion = this._chatCompletions[this._chatCompletions.length - 1]; if (completion) { this._emit("finalChatCompletion", completion); } - const finalMessage = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); + const finalMessage = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); if (finalMessage) { this._emit("finalMessage", finalMessage); } - const finalContent = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); + const finalContent = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); if (finalContent) { this._emit("finalContent", finalContent); } - const finalFunctionCall = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); + const finalFunctionCall = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); if (finalFunctionCall) { this._emit("finalFunctionToolCall", finalFunctionCall); } - const finalFunctionCallResult = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); + const finalFunctionCallResult = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); if (finalFunctionCallResult != null) { this._emit("finalFunctionToolCallResult", finalFunctionCallResult); } if (this._chatCompletions.some((c) => c.usage)) { - this._emit("totalUsage", __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); + this._emit("totalUsage", __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); } } async _createChatCompletion(client, params, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(_a2, _a2, "m", _AbstractChatCompletionRunner_validateParams).call(_a2, params); + __classPrivateFieldGet2(_a3, _a3, "m", _AbstractChatCompletionRunner_validateParams).call(_a3, params); const chatCompletion = await client.chat.completions.create({ ...params, stream: false }, { ...options, signal: this.controller.signal }); this._connected(); return this._addChatCompletion(parseChatCompletion(chatCompletion, params)); @@ -8356,7 +25730,7 @@ var init_AbstractChatCompletionRunner = __esm({ } async _runTools(client, params, runner, options) { const role = "tool"; - const { tool_choice = "auto", stream: stream4, toolContext: inputToolContext, ...restParams } = params; + const { tool_choice = "auto", stream: stream5, toolContext: inputToolContext, ...restParams } = params; const toolContext = inputToolContext; const singleFunctionToCall = ( // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Chat history and tool-choice inputs can contain runtime variants that select different runner behavior. @@ -8367,9 +25741,9 @@ var init_AbstractChatCompletionRunner = __esm({ if (afterCompletion == null) { return; } - __classPrivateFieldSet(this, _AbstractChatCompletionRunner_afterCompletionInvoked, true, "f"); + __classPrivateFieldSet2(this, _AbstractChatCompletionRunner_afterCompletionInvoked, true, "f"); await afterCompletion(completion, runner); - __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); + __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); }; const inputTools = params.tools.map((tool) => { if (isAutoParsableTool(tool)) { @@ -8466,7 +25840,7 @@ var init_AbstractChatCompletionRunner = __esm({ throw error; } } - const content = __classPrivateFieldGet(_a2, _a2, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(_a2, rawContent); + const content = __classPrivateFieldGet2(_a3, _a3, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(_a3, rawContent); return { message: { role, tool_call_id, content }, functionCalled: true }; }; for (let i = 0; i < maxChatCompletions; ++i) { @@ -8476,7 +25850,7 @@ var init_AbstractChatCompletionRunner = __esm({ tools, messages: this.messages.map(toRequestMessage) }, options); - allowBufferedToolCall = this.controller.signal.aborted && __classPrivateFieldGet(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, "f"); + allowBufferedToolCall = this.controller.signal.aborted && __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, "f"); const message = chatCompletion.choices[0]?.message; if (!message) { throw new OpenAIError(`missing message in ChatCompletion response`); @@ -8521,8 +25895,8 @@ var init_AbstractChatCompletionRunner = __esm({ } } }; - _a2 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArrivedBeforeAbort = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_afterCompletionInvoked = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; + _a3 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArrivedBeforeAbort = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_afterCompletionInvoked = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { let i = this.messages.length; while (i-- > 0) { @@ -8634,8 +26008,8 @@ function parseJSON(jsonString, allowPartial = Allow.ALL) { } return _parseJSON(jsonString.trim(), allowPartial); } -var STR, NUM, ARR, OBJ, NULL, BOOL, NAN, INFINITY, MINUS_INFINITY, INF, SPECIAL, ATOM, COLLECTION, ALL, Allow, PartialJSON, MalformedJSON, _parseJSON, partialParse; -var init_parser2 = __esm({ +var STR, NUM, ARR, OBJ, NULL, BOOL, NAN, INFINITY, MINUS_INFINITY, INF, SPECIAL, ATOM, COLLECTION, ALL, Allow, PartialJSON, MalformedJSON, _parseJSON, partialParse3; +var init_parser4 = __esm({ "node_modules/openai/_vendor/partial-json-parser/parser.mjs"() { STR = 1; NUM = 2; @@ -8850,21 +26224,21 @@ var init_parser2 = __esm({ }; return parseAny(); }; - partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); + partialParse3 = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); } }); // node_modules/openai/streaming.mjs -var init_streaming2 = __esm({ +var init_streaming4 = __esm({ "node_modules/openai/streaming.mjs"() { - init_streaming(); + init_streaming3(); } }); // node_modules/openai/lib/ChatCompletionStream.mjs function parseStructuredStreamingJSON(content) { try { - return partialParse(content); + return partialParse3(content); } catch (error) { if (error instanceof MalformedJSON || error instanceof SyntaxError) { return parseResponseFormatContent({ type: "json_schema", $parseRaw: void 0 }, content); @@ -9104,7 +26478,7 @@ function assertBoundToolCallIdentity(toolCall, identity) { } } function assignOwnProperties(target, source) { - if (Object.prototype.propertyIsEnumerable.call(source, "__proto__") && !hasOwn(target, "__proto__")) { + if (Object.prototype.propertyIsEnumerable.call(source, "__proto__") && !hasOwn2(target, "__proto__")) { Object.defineProperty(target, "__proto__", { value: void 0, writable: true, @@ -9653,7 +27027,7 @@ function finalizeChatCompletion(snapshot, params, audioDoneChoiceIndexes, valida } return { ...toolRest2, - id: id3 || `call_${uuid4()}`, + id: id3 || `call_${uuid42()}`, type: type2, custom: { ...customRest, name: name2, input } }; @@ -9668,7 +27042,7 @@ function finalizeChatCompletion(snapshot, params, audioDoneChoiceIndexes, valida } return { ...toolRest, - id: id2 || `call_${uuid4()}`, + id: id2 || `call_${uuid42()}`, type, function: { ...fnRest, name, arguments: args } }; @@ -9704,14 +27078,14 @@ function assertNever(_x) { var _ChatCompletionStream_instances, _ChatCompletionStream_params, _ChatCompletionStream_rejectsUnfinishedTurns, _ChatCompletionStream_audioDoneChoiceIndexes, _ChatCompletionStream_choiceEventStates, _ChatCompletionStream_currentChatCompletionSnapshot, _ChatCompletionStream_hasAutoParseableTool, _ChatCompletionStream_partialJSONParseBudget, _ChatCompletionStream_beginRequest, _ChatCompletionStream_getChoiceEventState, _ChatCompletionStream_addChunk, _ChatCompletionStream_emitToolCallDoneEvent, _ChatCompletionStream_emitContentDoneEvents, _ChatCompletionStream_validateStructuredSnapshots, _ChatCompletionStream_endRequest, _ChatCompletionStream_accumulateChatCompletion, CHAT_COMPLETION_READABLE_STREAM_MESSAGE_PREFIX, MAX_STREAM_CHOICES, MAX_STREAM_TOOL_CALLS, MAX_PARTIAL_JSON_BYTES, MAX_PARTIAL_JSON_FRAGMENTS, MAX_PARTIAL_JSON_DEPTH, MAX_PARTIAL_JSON_PARSE_WORK, EAGER_PARTIAL_JSON_BYTES, MAX_SERIALIZED_PARSER_SCHEMA_NODES, stringifyParserSchemaValue, MAX_SERIALIZED_PARSER_SCHEMA_BYTES, MAX_SERIALIZED_PARSER_SCHEMA_DEPTH, OMITTED_SERIALIZED_PARSER_VALUE, UNSAFE_SERIALIZED_PARSER_VALUE, ChatCompletionStream; var init_ChatCompletionStream = __esm({ "node_modules/openai/lib/ChatCompletionStream.mjs"() { - init_tslib(); - init_parser2(); - init_error2(); - init_request_options(); - init_uuid(); - init_values(); - init_parser(); - init_streaming2(); + init_tslib2(); + init_parser4(); + init_error4(); + init_request_options2(); + init_uuid2(); + init_values2(); + init_parser3(); + init_streaming4(); init_AbstractChatCompletionRunner(); CHAT_COMPLETION_READABLE_STREAM_MESSAGE_PREFIX = "chat.completion.chunk.message:"; MAX_STREAM_CHOICES = 128; @@ -9739,10 +27113,10 @@ var init_ChatCompletionStream = __esm({ _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0); _ChatCompletionStream_hasAutoParseableTool.set(this, void 0); _ChatCompletionStream_partialJSONParseBudget.set(this, void 0); - __classPrivateFieldSet(this, _ChatCompletionStream_params, params, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, params, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_choiceEventStates, [], "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, false, "f"); const tools = params?.tools; const lengthDescriptor = tools && Object.getOwnPropertyDescriptor(tools, "length"); const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; @@ -9754,16 +27128,16 @@ var init_ChatCompletionStream = __esm({ } const tool = descriptor.value; if (isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) { - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, true, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, true, "f"); break; } } } - __classPrivateFieldSet(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); } /** The latest accumulated completion, or `undefined` before a chunk arrives or after finalization. */ get currentChatCompletionSnapshot() { - return __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + return __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); } /** * Intended for use on the frontend, consuming a stream produced with @@ -9772,9 +27146,9 @@ var init_ChatCompletionStream = __esm({ * Original input messages are not included in the serialized stream. Tool-result * messages explicitly serialized by a streaming tool runner are replayed. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ChatCompletionStream(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } /** Starts a streaming chat completion request and returns its event-driven helper. */ @@ -9785,55 +27159,55 @@ var init_ChatCompletionStream = __esm({ } /** Rejects unfinished turns before tool callbacks while preserving ordinary stream and replay behavior. */ _runTools(client, params, runner, options) { - __classPrivateFieldSet(this, _ChatCompletionStream_rejectsUnfinishedTurns, true, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_rejectsUnfinishedTurns, true, "f"); return super._runTools(client, params, runner, options); } async _createChatCompletion(client, params, options) { this._listenForAbort(options?.signal); const requestParams = { ...params, stream: true }; - __classPrivateFieldSet(this, _ChatCompletionStream_params, requestParams, "f"); - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, requestParams, "f"); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); const parserParams = snapshotChatCompletionParserParams(requestParams); - __classPrivateFieldSet(this, _ChatCompletionStream_params, parserParams, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, parserParams, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); const stopObserving = requestParams.tools || requestParams.response_format ? observeSerializedChatCompletionParserParams(requestParams, parserParams, (serialized) => { - __classPrivateFieldSet(this, _ChatCompletionStream_params, serialized, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, serialized, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); }) : void 0; - const stream4 = await client.chat.completions.create(requestParams, { + const stream5 = await client.chat.completions.create(requestParams, { ...options, signal: this.controller.signal }).finally(stopObserving); this._connected(); - for await (const chunk of stream4) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + for await (const chunk of stream5) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + return this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); let chatId; - for await (const item of stream4) { - if ("error" in item && hasOwn(item, "error") && typeof item.error === "object" && item.error !== null) { - throw new APIError(void 0, item.error, void 0, void 0); + for await (const item of stream5) { + if ("error" in item && hasOwn2(item, "error") && typeof item.error === "object" && item.error !== null) { + throw new APIError2(void 0, item.error, void 0, void 0); } if (isChatCompletionReadableStreamMessage(item)) { const message = getChatCompletionReadableStreamMessage(item); - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - const toolCalls = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f").choices[0]?.message.tool_calls; + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + const toolCalls = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f").choices[0]?.message.tool_calls; for (const [index, id] of message.tool_call_ids?.entries() ?? []) { const toolCall = toolCalls?.[index]; if (toolCall && id) { toolCall.id = id; } } - this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); chatId = void 0; } this._addMessage(message.message); @@ -9841,18 +27215,18 @@ var init_ChatCompletionStream = __esm({ } const chunk = item; if (chatId && chunk.id && chatId !== chunk.id) { - this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); if (chunk.id) { chatId = chunk.id; } } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + return this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } const lastChatCompletion = this._chatCompletions[this._chatCompletions.length - 1]; if (lastChatCompletion) { @@ -9865,11 +27239,11 @@ var init_ChatCompletionStream = __esm({ if (this.ended) { return; } - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) { - let state2 = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; + let state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; if (state2) { return state2; } @@ -9884,22 +27258,22 @@ var init_ChatCompletionStream = __esm({ tool_call_parse_states: /* @__PURE__ */ new Map(), tool_call_identities: /* @__PURE__ */ new Map() }; - __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state2; + __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state2; return state2; }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) { if (this.ended) { return; } const capturedChoiceFrames = /* @__PURE__ */ new WeakMap(); - const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk, capturedChoiceFrames); + const completion = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk, capturedChoiceFrames); this._emit("chunk", chunk, completion); for (const choice of chunk.choices) { const capturedChoice = capturedChoiceFrames.get(choice); const choiceSnapshot = completion.choices[capturedChoice?.index ?? choice.index]; const capturedToolCalls = capturedChoice?.tool_calls ?? []; const { delta } = choice; - const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); - const boundedSnapshot = structuredResponse || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f"); + const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); + const boundedSnapshot = structuredResponse || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f"); const messageSnapshot = boundedSnapshot ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const refusal = boundedSnapshot ? captureStructuredJSONSnapshot(messageSnapshot, "refusal") : messageSnapshot.refusal; const parseableContent = !refusal && structuredResponse; @@ -9930,18 +27304,18 @@ var init_ChatCompletionStream = __esm({ snapshot: choiceSnapshot.logprobs?.refusal ?? [] }); } - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); if (choiceSnapshot.finish_reason) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); if (state2.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); } } for (const toolCall of capturedToolCalls) { if (state2.current_tool_call_index !== toolCall.index) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); if (state2.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); } } state2.current_tool_call_index = toolCall.index; @@ -9976,11 +27350,11 @@ var init_ChatCompletionStream = __esm({ } } }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) { - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); if (state2.done_tool_calls.has(toolCallIndex)) { return; } - const messageSnapshot = __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; + const messageSnapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const toolCallSnapshot = messageSnapshot.tool_calls?.[toolCallIndex]; if (!toolCallSnapshot) { throw new Error("no tool call snapshot"); @@ -9993,13 +27367,13 @@ var init_ChatCompletionStream = __esm({ throw new Error("tool call snapshot missing `type`"); } if (toolCallSnapshot.type === "function") { - const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name); + const inputTool = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name); let parsedArguments = null; const parseable = isAutoParsableTool(inputTool) || inputTool?.function.strict === true; let argumentsSnapshot; if (parseable) { - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); } const capturedArguments = captureStructuredJSONSnapshot(toolCallSnapshot.function, "arguments"); if (typeof capturedArguments !== "string") { @@ -10027,21 +27401,21 @@ var init_ChatCompletionStream = __esm({ assertNever(toolCallSnapshot); } }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) { - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); - const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); - const boundedSnapshot = structuredResponse || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f"); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); + const boundedSnapshot = structuredResponse || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f"); const messageSnapshot = boundedSnapshot ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const refusal = boundedSnapshot ? captureStructuredJSONSnapshot(messageSnapshot, "refusal") : messageSnapshot.refusal; const parseableContent = !refusal && structuredResponse; const content = parseableContent ? captureStructuredJSONSnapshot(messageSnapshot, "content") : messageSnapshot.content; if (content != null && (content !== "" || !refusal && !messageSnapshot.tool_calls?.length && !messageSnapshot.function_call) && !state2.content_done) { - if (parseableContent && __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); + if (parseableContent && __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); } state2.content_done = true; this._emit("content.done", { content, - parsed: refusal ? null : parseResponseFormatContent(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format, parseableContent ? validateStructuredJSONSnapshot(content) : content) + parsed: refusal ? null : parseResponseFormatContent(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format, parseableContent ? validateStructuredJSONSnapshot(content) : content) }); } if (refusal && !state2.refusal_done) { @@ -10058,7 +27432,7 @@ var init_ChatCompletionStream = __esm({ } }, _ChatCompletionStream_validateStructuredSnapshots = function _ChatCompletionStream_validateStructuredSnapshots2(snapshot) { const finalJSONBudget = { bytes: 0, fragments: 0, work: 0 }; - const parseableContent = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); + const parseableContent = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); const validatedMessages = /* @__PURE__ */ new WeakMap(); const choices = captureSnapshotArray(snapshot, "choices", MAX_STREAM_CHOICES, "choice"); if (!choices) { @@ -10081,9 +27455,9 @@ var init_ChatCompletionStream = __esm({ toolCallCollection: toolCalls, toolCalls: validatedTools })); - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; if (parseableContent && !refusal && typeof content === "string") { - validateStructuredJSONSnapshot(content, finalJSONBudget, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f")); + validateStructuredJSONSnapshot(content, finalJSONBudget, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f")); } for (const [index, identity] of state2?.tool_call_identities ?? []) { const toolCall = toolCalls && captureSnapshotArrayItem(toolCalls, index); @@ -10092,7 +27466,7 @@ var init_ChatCompletionStream = __esm({ } assertBoundToolCallIdentity(toolCall, identity); } - if (!__classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { + if (!__classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { continue; } for (let toolCallIndex = 0; toolCallIndex < (toolCalls?.length ?? 0); toolCallIndex += 1) { @@ -10121,7 +27495,7 @@ var init_ChatCompletionStream = __esm({ } continue; } - if (!shouldParseToolCall(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), { + if (!shouldParseToolCall(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), { type: identity.type, function: { name: identity.name } })) { @@ -10136,7 +27510,7 @@ var init_ChatCompletionStream = __esm({ if (typeof argumentsSnapshot !== "string") { throw new OpenAIError("Chat completion stream contains an unsafe structured JSON snapshot"); } - validateStructuredJSONSnapshot(argumentsSnapshot, finalJSONBudget, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f")); + validateStructuredJSONSnapshot(argumentsSnapshot, finalJSONBudget, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f")); validatedTools.set(toolCallIndex, Object.freeze({ tool: toolCall, function: fn, @@ -10151,31 +27525,31 @@ var init_ChatCompletionStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - const snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + const snapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); if (!snapshot) { throw new OpenAIError(`request ended without sending any chunks`); } - const validatedMessages = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); - const audioDoneChoiceIndexes = __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); - return finalizeChatCompletion(snapshot, __classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), audioDoneChoiceIndexes, validatedMessages); + const validatedMessages = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + const audioDoneChoiceIndexes = __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_choiceEventStates, [], "f"); + return finalizeChatCompletion(snapshot, __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), audioDoneChoiceIndexes, validatedMessages); }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk, capturedChoiceFrames) { var _a6, _b, _c, _d, _e; - let snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + let snapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); const { choices, obfuscation: _obfuscation, ...rest } = chunk; if (!snapshot) { const newSnapshot = { ...rest, choices: [] }; - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, newSnapshot, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, newSnapshot, "f"); snapshot = newSnapshot; } else if (chunk.id) { assignOwnProperties(snapshot, rest); } - const requestedChoiceCount = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.n; + const requestedChoiceCount = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.n; const maxChoices = typeof requestedChoiceCount === "number" && Number.isSafeInteger(requestedChoiceCount) && requestedChoiceCount > 0 ? Math.min(requestedChoiceCount, MAX_STREAM_CHOICES) : MAX_STREAM_CHOICES; for (const chunkChoice of chunk.choices) { const { delta, finish_reason, index, logprobs = null, ...other } = chunkChoice; @@ -10190,7 +27564,7 @@ var init_ChatCompletionStream = __esm({ snapshot.choices[index] = newChoice; choice = newChoice; } - if (isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format) || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { + if (isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format) || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { captureStructuredJSONSnapshot(captureStructuredMessageSnapshot(choice), "refusal"); } if (logprobs) { @@ -10218,7 +27592,7 @@ var init_ChatCompletionStream = __esm({ } if (finish_reason) { choice.finish_reason = finish_reason; - if (__classPrivateFieldGet(this, _ChatCompletionStream_params, "f") && (__classPrivateFieldGet(this, _ChatCompletionStream_rejectsUnfinishedTurns, "f") || hasAutoParseableInput(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")))) { + if (__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f") && (__classPrivateFieldGet2(this, _ChatCompletionStream_rejectsUnfinishedTurns, "f") || hasAutoParseableInput(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")))) { if (finish_reason === "length") { throw new LengthFinishReasonError(); } @@ -10232,14 +27606,14 @@ var init_ChatCompletionStream = __esm({ Object.freeze(capturedToolCalls); continue; } - __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").delete(index); + __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").delete(index); const { audio, content, refusal, function_call, role, ...capturedDeltaFields } = delta; const { tool_calls: capturedToolCallDelta, ...rest2 } = capturedDeltaFields; - const tool_calls = hasOwn(capturedDeltaFields, "tool_calls") ? capturedToolCallDelta : delta.tool_calls; + const tool_calls = hasOwn2(capturedDeltaFields, "tool_calls") ? capturedToolCallDelta : delta.tool_calls; assertIsEmpty(rest2); assignOwnProperties(choice.message, rest2); if (audio?.expires_at != null && audio.id == null && audio.data == null && audio.transcript == null && content == null && refusal == null && function_call == null && role == null && tool_calls == null && Object.keys(rest2).length === 0) { - __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").add(index); + __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").add(index); } if (refusal) { choice.message.refusal = (choice.message.refusal || "") + refusal; @@ -10276,15 +27650,15 @@ var init_ChatCompletionStream = __esm({ } } if (content != null) { - if (!choice.message.refusal && isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format)) { - const eventState = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice); + if (!choice.message.refusal && isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format)) { + const eventState = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice); const parseState = eventState.content_parse_state ?? (eventState.content_parse_state = createPartialJSONParseState()); - const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"), content); + const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"), content); choice.message.content = (captureStructuredJSONSnapshot(choice.message, "content") || "") + content; if (!parseState.has_non_whitespace) { choice.message.parsed = null; - } else if (shouldParse && reservePartialJSONParse(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + } else if (shouldParse && reservePartialJSONParse(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); choice.message.parsed = parseStructuredStreamingJSON(validateStructuredJSONSnapshot(choice.message.content)); } else if (content.length > 0) { choice.message.parsed = null; @@ -10303,7 +27677,7 @@ var init_ChatCompletionStream = __esm({ let argumentsDelta = ""; const tool_call = toolCallSnapshots[index2] ?? (toolCallSnapshots[index2] = {}); const functionName = fn?.name; - const eventState = __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice) : void 0; + const eventState = __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice) : void 0; let boundIdentity = eventState?.tool_call_identities.get(index2); if (boundIdentity) { assertBoundToolCallIdentity(tool_call, boundIdentity); @@ -10334,11 +27708,11 @@ var init_ChatCompletionStream = __esm({ } if (eventState && !boundIdentity) { const identity = ownFunctionToolIdentity(tool_call); - const configuredTool = identity && __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === identity.name); + const configuredTool = identity && __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === identity.name); if (identity) { boundIdentity = { ...identity, - parseable: configuredTool !== void 0 && shouldParseToolCall(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), { + parseable: configuredTool !== void 0 && shouldParseToolCall(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), { type: identity.type, function: { name: identity.name } }) @@ -10347,9 +27721,9 @@ var init_ChatCompletionStream = __esm({ if (!boundIdentity.parseable) { const provisionalState = eventState.tool_call_parse_states.get(index2); if (provisionalState) { - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").bytes -= provisionalState.bytes; - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").fragments -= provisionalState.fragments; - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").work -= provisionalState.work; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").bytes -= provisionalState.bytes; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").fragments -= provisionalState.fragments; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").work -= provisionalState.work; eventState.tool_call_parse_states.delete(index2); } } @@ -10364,16 +27738,16 @@ var init_ChatCompletionStream = __esm({ parseState = createPartialJSONParseState(); eventState.tool_call_parse_states.set(index2, parseState); } - const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"), argumentFragment); + const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"), argumentFragment); const previousArguments = captureStructuredJSONSnapshot(functionSnapshot, "arguments"); if (typeof previousArguments !== "string") { throw new OpenAIError("Chat completion stream contains an unsafe structured JSON snapshot"); } functionSnapshot.arguments = previousArguments + argumentFragment; - if (shouldParse && boundIdentity?.parseable === true && reservePartialJSONParse(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + if (shouldParse && boundIdentity?.parseable === true && reservePartialJSONParse(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); functionSnapshot.parsed_arguments = parseStructuredStreamingJSON(validateStructuredJSONSnapshot(functionSnapshot.arguments)); - } else if (argumentFragment.length > 0 && hasOwn(functionSnapshot, "parsed_arguments")) { + } else if (argumentFragment.length > 0 && hasOwn2(functionSnapshot, "parsed_arguments")) { functionSnapshot.parsed_arguments = void 0; } } else { @@ -10396,8 +27770,8 @@ var init_ChatCompletionStream = __esm({ } /** Serializes raw completion chunks into a readable stream for transfer to another runtime. */ toReadableStream() { - const stream4 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); } }; } @@ -10408,14 +27782,14 @@ var ChatCompletionStreamingRunner; var init_ChatCompletionStreamingRunner = __esm({ "node_modules/openai/lib/ChatCompletionStreamingRunner.mjs"() { init_ChatCompletionStream(); - init_error2(); - init_streaming2(); + init_error4(); + init_streaming4(); init_chatCompletionUtils(); ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends ChatCompletionStream { /** Restores a serialized tool run, including intermediate completions and tool-result messages. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ChatCompletionStreamingRunner(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } /** Serializes completion chunks and tool-result messages for replay in another runtime. */ @@ -10447,8 +27821,8 @@ var init_ChatCompletionStreamingRunner = __esm({ this.off("message", onMessage); }; }, { onReturn: () => this.abort() }); - const stream4 = new Stream(() => iterator, this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(() => iterator, this.controller); + return stream5.toReadableStream(); } /** Starts a streaming tool loop and returns its event-driven conversation runner. */ static runTools(client, params, options) { @@ -10468,26 +27842,26 @@ var init_ChatCompletionStreamingRunner = __esm({ }); // node_modules/openai/resources/chat/completions/completions.mjs -var Completions; -var init_completions = __esm({ +var Completions2; +var init_completions2 = __esm({ "node_modules/openai/resources/chat/completions/completions.mjs"() { - init_resource(); - init_messages(); - init_messages(); - init_pagination(); - init_path(); + init_resource2(); + init_messages3(); + init_messages3(); + init_pagination2(); + init_path2(); init_ChatCompletionRunner(); init_ChatCompletionStreamingRunner(); init_ChatCompletionStream(); - init_parser(); + init_parser3(); init_ChatCompletionStreamingRunner(); init_RunnableFunction(); init_ChatCompletionStream(); init_ChatCompletionRunner(); - Completions = class extends APIResource { + Completions2 = class extends APIResource2 { constructor() { super(...arguments); - this.messages = new Messages(this._client); + this.messages = new Messages3(this._client); } create(body, options) { return this._client.post("/chat/completions", { @@ -10508,7 +27882,7 @@ var init_completions = __esm({ * ``` */ retrieve(completionID, options) { - return this._client.get(path`/chat/completions/${completionID}`, { + return this._client.get(path3`/chat/completions/${completionID}`, { ...options, __security: { bearerAuth: true } }); @@ -10527,7 +27901,7 @@ var init_completions = __esm({ * ``` */ update(completionID, body, options) { - return this._client.post(path`/chat/completions/${completionID}`, { + return this._client.post(path3`/chat/completions/${completionID}`, { body, ...options, __security: { bearerAuth: true } @@ -10563,7 +27937,7 @@ var init_completions = __esm({ * ``` */ delete(completionID, options) { - return this._client.delete(path`/chat/completions/${completionID}`, { + return this._client.delete(path3`/chat/completions/${completionID}`, { ...options, __security: { bearerAuth: true } }); @@ -10588,7 +27962,7 @@ var init_completions = __esm({ return ChatCompletionStream.createChatCompletion(this._client, body, options); } }; - Completions.Messages = Messages; + Completions2.Messages = Messages3; } }); @@ -10596,25 +27970,25 @@ var init_completions = __esm({ var Chat; var init_chat = __esm({ "node_modules/openai/resources/chat/chat.mjs"() { - init_resource(); - init_completions(); - init_completions(); - Chat = class extends APIResource { + init_resource2(); + init_completions2(); + init_completions2(); + Chat = class extends APIResource2 { constructor() { super(...arguments); - this.completions = new Completions(this._client); + this.completions = new Completions2(this._client); } }; - Chat.Completions = Completions; + Chat.Completions = Completions2; } }); // node_modules/openai/resources/chat/completions/index.mjs -var init_completions2 = __esm({ +var init_completions3 = __esm({ "node_modules/openai/resources/chat/completions/index.mjs"() { - init_completions(); - init_completions(); - init_messages(); + init_completions2(); + init_completions2(); + init_messages3(); } }); @@ -10622,12 +27996,12 @@ var init_completions2 = __esm({ var init_chat2 = __esm({ "node_modules/openai/resources/chat/index.mjs"() { init_chat(); - init_completions2(); + init_completions3(); } }); // node_modules/openai/resources/shared.mjs -var init_shared = __esm({ +var init_shared2 = __esm({ "node_modules/openai/resources/shared.mjs"() { } }); @@ -10636,10 +28010,10 @@ var init_shared = __esm({ var AdminAPIKeys; var init_admin_api_keys = __esm({ "node_modules/openai/resources/admin/organization/admin-api-keys.mjs"() { - init_resource(); - init_pagination(); - init_path(); - AdminAPIKeys = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + AdminAPIKeys = class extends APIResource2 { /** * Create an organization admin API key * @@ -10670,7 +28044,7 @@ var init_admin_api_keys = __esm({ * ``` */ retrieve(keyID, options) { - return this._client.get(path`/organization/admin_api_keys/${keyID}`, { + return this._client.get(path3`/organization/admin_api_keys/${keyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10705,7 +28079,7 @@ var init_admin_api_keys = __esm({ * ``` */ delete(keyID, options) { - return this._client.delete(path`/organization/admin_api_keys/${keyID}`, { + return this._client.delete(path3`/organization/admin_api_keys/${keyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10718,9 +28092,9 @@ var init_admin_api_keys = __esm({ var AuditLogs; var init_audit_logs = __esm({ "node_modules/openai/resources/admin/organization/audit-logs.mjs"() { - init_resource(); - init_pagination(); - AuditLogs = class extends APIResource { + init_resource2(); + init_pagination2(); + AuditLogs = class extends APIResource2 { /** * List user actions and configuration changes within this organization. * @@ -10744,13 +28118,13 @@ var init_audit_logs = __esm({ }); // node_modules/openai/resources/admin/organization/certificates.mjs -var Certificates; -var init_certificates = __esm({ +var Certificates2; +var init_certificates2 = __esm({ "node_modules/openai/resources/admin/organization/certificates.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Certificates = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Certificates2 = class extends APIResource2 { /** * Upload a certificate to the organization. This does **not** automatically * activate the certificate. @@ -10786,7 +28160,7 @@ var init_certificates = __esm({ * ``` */ retrieve(certificateID, query = {}, options) { - return this._client.get(path`/organization/certificates/${certificateID}`, { + return this._client.get(path3`/organization/certificates/${certificateID}`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -10804,7 +28178,7 @@ var init_certificates = __esm({ * ``` */ update(certificateID, body, options) { - return this._client.post(path`/organization/certificates/${certificateID}`, { + return this._client.post(path3`/organization/certificates/${certificateID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -10838,7 +28212,7 @@ var init_certificates = __esm({ * ``` */ delete(certificateID, options) { - return this._client.delete(path`/organization/certificates/${certificateID}`, { + return this._client.delete(path3`/organization/certificates/${certificateID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10859,7 +28233,7 @@ var init_certificates = __esm({ * ``` */ activate(body, options) { - return this._client.getAPIList("/organization/certificates/activate", Page, { + return this._client.getAPIList("/organization/certificates/activate", Page2, { body, method: "post", ...options, @@ -10882,7 +28256,7 @@ var init_certificates = __esm({ * ``` */ deactivate(body, options) { - return this._client.getAPIList("/organization/certificates/deactivate", Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList("/organization/certificates/deactivate", Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -10892,8 +28266,8 @@ var init_certificates = __esm({ var DataRetention; var init_data_retention = __esm({ "node_modules/openai/resources/admin/organization/data-retention.mjs"() { - init_resource(); - DataRetention = class extends APIResource { + init_resource2(); + DataRetention = class extends APIResource2 { /** * Retrieves organization data retention controls. * @@ -10932,13 +28306,13 @@ var init_data_retention = __esm({ }); // node_modules/openai/resources/admin/organization/invites.mjs -var Invites; -var init_invites = __esm({ +var Invites2; +var init_invites2 = __esm({ "node_modules/openai/resources/admin/organization/invites.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Invites = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Invites2 = class extends APIResource2 { /** * Create an invite for a user to the organization. The invite must be accepted by * the user before they have access to the organization. @@ -10971,7 +28345,7 @@ var init_invites = __esm({ * ``` */ retrieve(inviteID, options) { - return this._client.get(path`/organization/invites/${inviteID}`, { + return this._client.get(path3`/organization/invites/${inviteID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11006,7 +28380,7 @@ var init_invites = __esm({ * ``` */ delete(inviteID, options) { - return this._client.delete(path`/organization/invites/${inviteID}`, { + return this._client.delete(path3`/organization/invites/${inviteID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11019,10 +28393,10 @@ var init_invites = __esm({ var Roles; var init_roles = __esm({ "node_modules/openai/resources/admin/organization/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles = class extends APIResource2 { /** * Creates a custom role for the organization. * @@ -11052,7 +28426,7 @@ var init_roles = __esm({ * ``` */ retrieve(roleID, options) { - return this._client.get(path`/organization/roles/${roleID}`, { + return this._client.get(path3`/organization/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11068,7 +28442,7 @@ var init_roles = __esm({ * ``` */ update(roleID, body, options) { - return this._client.post(path`/organization/roles/${roleID}`, { + return this._client.post(path3`/organization/roles/${roleID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11103,7 +28477,7 @@ var init_roles = __esm({ * ``` */ delete(roleID, options) { - return this._client.delete(path`/organization/roles/${roleID}`, { + return this._client.delete(path3`/organization/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11116,10 +28490,10 @@ var init_roles = __esm({ var SpendAlerts; var init_spend_alerts = __esm({ "node_modules/openai/resources/admin/organization/spend-alerts.mjs"() { - init_resource(); - init_pagination(); - init_path(); - SpendAlerts = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + SpendAlerts = class extends APIResource2 { /** * Creates an organization spend alert. * @@ -11156,7 +28530,7 @@ var init_spend_alerts = __esm({ * ``` */ retrieve(alertID, options) { - return this._client.get(path`/organization/spend_alerts/${alertID}`, { + return this._client.get(path3`/organization/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11182,7 +28556,7 @@ var init_spend_alerts = __esm({ * ``` */ update(alertID, body, options) { - return this._client.post(path`/organization/spend_alerts/${alertID}`, { + return this._client.post(path3`/organization/spend_alerts/${alertID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11214,7 +28588,7 @@ var init_spend_alerts = __esm({ * ``` */ delete(alertID, options) { - return this._client.delete(path`/organization/spend_alerts/${alertID}`, { + return this._client.delete(path3`/organization/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11227,8 +28601,8 @@ var init_spend_alerts = __esm({ var SpendLimit; var init_spend_limit = __esm({ "node_modules/openai/resources/admin/organization/spend-limit.mjs"() { - init_resource(); - SpendLimit = class extends APIResource { + init_resource2(); + SpendLimit = class extends APIResource2 { /** * Get the organization's hard spend limit. * @@ -11287,8 +28661,8 @@ var init_spend_limit = __esm({ var Usage; var init_usage = __esm({ "node_modules/openai/resources/admin/organization/usage.mjs"() { - init_resource(); - Usage = class extends APIResource { + init_resource2(); + Usage = class extends APIResource2 { /** * Get audio speeches usage details for the organization. * @@ -11495,10 +28869,10 @@ var init_usage = __esm({ var Roles2; var init_roles2 = __esm({ "node_modules/openai/resources/admin/organization/groups/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles2 = class extends APIResource2 { /** * Assigns an organization role to a group within the organization. * @@ -11512,7 +28886,7 @@ var init_roles2 = __esm({ * ``` */ create(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}/roles`, { + return this._client.post(path3`/organization/groups/${groupID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11532,7 +28906,7 @@ var init_roles2 = __esm({ */ retrieve(roleID, params, options) { const { group_id } = params; - return this._client.get(path`/organization/groups/${group_id}/roles/${roleID}`, { + return this._client.get(path3`/organization/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11551,7 +28925,7 @@ var init_roles2 = __esm({ * ``` */ list(groupID, query = {}, options) { - return this._client.getAPIList(path`/organization/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns an organization role from a group within the organization. @@ -11567,7 +28941,7 @@ var init_roles2 = __esm({ */ delete(roleID, params, options) { const { group_id } = params; - return this._client.delete(path`/organization/groups/${group_id}/roles/${roleID}`, { + return this._client.delete(path3`/organization/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11577,13 +28951,13 @@ var init_roles2 = __esm({ }); // node_modules/openai/resources/admin/organization/groups/users.mjs -var Users; -var init_users = __esm({ +var Users2; +var init_users2 = __esm({ "node_modules/openai/resources/admin/organization/groups/users.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Users = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Users2 = class extends APIResource2 { /** * Adds a user to a group. * @@ -11597,7 +28971,7 @@ var init_users = __esm({ * ``` */ create(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}/users`, { + return this._client.post(path3`/organization/groups/${groupID}/users`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11617,7 +28991,7 @@ var init_users = __esm({ */ retrieve(userID, params, options) { const { group_id } = params; - return this._client.get(path`/organization/groups/${group_id}/users/${userID}`, { + return this._client.get(path3`/organization/groups/${group_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11636,7 +29010,7 @@ var init_users = __esm({ * ``` */ list(groupID, query = {}, options) { - return this._client.getAPIList(path`/organization/groups/${groupID}/users`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/groups/${groupID}/users`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Removes a user from a group. @@ -11652,7 +29026,7 @@ var init_users = __esm({ */ delete(userID, params, options) { const { group_id } = params; - return this._client.delete(path`/organization/groups/${group_id}/users/${userID}`, { + return this._client.delete(path3`/organization/groups/${group_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11665,17 +29039,17 @@ var init_users = __esm({ var Groups; var init_groups = __esm({ "node_modules/openai/resources/admin/organization/groups/groups.mjs"() { - init_resource(); + init_resource2(); init_roles2(); init_roles2(); - init_users(); - init_users(); - init_pagination(); - init_path(); - Groups = class extends APIResource { + init_users2(); + init_users2(); + init_pagination2(); + init_path2(); + Groups = class extends APIResource2 { constructor() { super(...arguments); - this.users = new Users(this._client); + this.users = new Users2(this._client); this.roles = new Roles2(this._client); } /** @@ -11707,7 +29081,7 @@ var init_groups = __esm({ * ``` */ retrieve(groupID, options) { - return this._client.get(path`/organization/groups/${groupID}`, { + return this._client.get(path3`/organization/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11724,7 +29098,7 @@ var init_groups = __esm({ * ``` */ update(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}`, { + return this._client.post(path3`/organization/groups/${groupID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11759,25 +29133,25 @@ var init_groups = __esm({ * ``` */ delete(groupID, options) { - return this._client.delete(path`/organization/groups/${groupID}`, { + return this._client.delete(path3`/organization/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Groups.Users = Users; + Groups.Users = Users2; Groups.Roles = Roles2; } }); // node_modules/openai/resources/admin/organization/projects/api-keys.mjs -var APIKeys; -var init_api_keys = __esm({ +var APIKeys2; +var init_api_keys2 = __esm({ "node_modules/openai/resources/admin/organization/projects/api-keys.mjs"() { - init_resource(); - init_pagination(); - init_path(); - APIKeys = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + APIKeys2 = class extends APIResource2 { /** * Retrieves an API key in the project. * @@ -11792,7 +29166,7 @@ var init_api_keys = __esm({ */ retrieve(apiKeyID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + return this._client.get(path3`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11811,7 +29185,7 @@ var init_api_keys = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes an API key from the project. @@ -11830,7 +29204,7 @@ var init_api_keys = __esm({ */ delete(apiKeyID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11840,13 +29214,13 @@ var init_api_keys = __esm({ }); // node_modules/openai/resources/admin/organization/projects/certificates.mjs -var Certificates2; -var init_certificates2 = __esm({ +var Certificates3; +var init_certificates3 = __esm({ "node_modules/openai/resources/admin/organization/projects/certificates.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Certificates2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Certificates3 = class extends APIResource2 { /** * List certificates for this project. * @@ -11861,7 +29235,7 @@ var init_certificates2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Activate certificates at the project level. @@ -11880,7 +29254,7 @@ var init_certificates2 = __esm({ * ``` */ activate(projectID, body, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates/activate`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates/activate`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deactivate certificates at the project level. You can atomically and @@ -11898,7 +29272,7 @@ var init_certificates2 = __esm({ * ``` */ deactivate(projectID, body, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates/deactivate`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates/deactivate`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -11908,9 +29282,9 @@ var init_certificates2 = __esm({ var DataRetention2; var init_data_retention2 = __esm({ "node_modules/openai/resources/admin/organization/projects/data-retention.mjs"() { - init_resource(); - init_path(); - DataRetention2 = class extends APIResource { + init_resource2(); + init_path2(); + DataRetention2 = class extends APIResource2 { /** * Retrieves project data retention controls. * @@ -11923,7 +29297,7 @@ var init_data_retention2 = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/data_retention`, { + return this._client.get(path3`/organization/projects/${projectID}/data_retention`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11941,7 +29315,7 @@ var init_data_retention2 = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/data_retention`, { + return this._client.post(path3`/organization/projects/${projectID}/data_retention`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11955,9 +29329,9 @@ var init_data_retention2 = __esm({ var HostedToolPermissions; var init_hosted_tool_permissions = __esm({ "node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs"() { - init_resource(); - init_path(); - HostedToolPermissions = class extends APIResource { + init_resource2(); + init_path2(); + HostedToolPermissions = class extends APIResource2 { /** * Returns hosted tool permissions for a project. * @@ -11970,7 +29344,7 @@ var init_hosted_tool_permissions = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/hosted_tool_permissions`, { + return this._client.get(path3`/organization/projects/${projectID}/hosted_tool_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11987,7 +29361,7 @@ var init_hosted_tool_permissions = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/hosted_tool_permissions`, { + return this._client.post(path3`/organization/projects/${projectID}/hosted_tool_permissions`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12001,9 +29375,9 @@ var init_hosted_tool_permissions = __esm({ var ModelPermissions; var init_model_permissions = __esm({ "node_modules/openai/resources/admin/organization/projects/model-permissions.mjs"() { - init_resource(); - init_path(); - ModelPermissions = class extends APIResource { + init_resource2(); + init_path2(); + ModelPermissions = class extends APIResource2 { /** * Returns model permissions for a project. * @@ -12016,7 +29390,7 @@ var init_model_permissions = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.get(path3`/organization/projects/${projectID}/model_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12034,7 +29408,7 @@ var init_model_permissions = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.post(path3`/organization/projects/${projectID}/model_permissions`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12052,7 +29426,7 @@ var init_model_permissions = __esm({ * ``` */ delete(projectID, options) { - return this._client.delete(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.delete(path3`/organization/projects/${projectID}/model_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12062,13 +29436,13 @@ var init_model_permissions = __esm({ }); // node_modules/openai/resources/admin/organization/projects/rate-limits.mjs -var RateLimits; -var init_rate_limits = __esm({ +var RateLimits3; +var init_rate_limits3 = __esm({ "node_modules/openai/resources/admin/organization/projects/rate-limits.mjs"() { - init_resource(); - init_pagination(); - init_path(); - RateLimits = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + RateLimits3 = class extends APIResource2 { /** * Returns the rate limits per model for a project. * @@ -12083,7 +29457,7 @@ var init_rate_limits = __esm({ * ``` */ listRateLimits(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Updates a project rate limit. @@ -12099,7 +29473,7 @@ var init_rate_limits = __esm({ */ updateRateLimit(rateLimitID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/rate_limits/${rateLimitID}`, { + return this._client.post(path3`/organization/projects/${project_id}/rate_limits/${rateLimitID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12113,10 +29487,10 @@ var init_rate_limits = __esm({ var Roles3; var init_roles3 = __esm({ "node_modules/openai/resources/admin/organization/projects/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles3 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles3 = class extends APIResource2 { /** * Creates a custom role for a project. * @@ -12130,7 +29504,7 @@ var init_roles3 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/projects/${projectID}/roles`, { + return this._client.post(path3`/projects/${projectID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12150,7 +29524,7 @@ var init_roles3 = __esm({ */ retrieve(roleID, params, options) { const { project_id } = params; - return this._client.get(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12169,7 +29543,7 @@ var init_roles3 = __esm({ */ update(roleID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.post(path3`/projects/${project_id}/roles/${roleID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12189,7 +29563,7 @@ var init_roles3 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/projects/${projectID}/roles`, NextCursorPage, { + return this._client.getAPIList(path3`/projects/${projectID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -12209,7 +29583,7 @@ var init_roles3 = __esm({ */ delete(roleID, params, options) { const { project_id } = params; - return this._client.delete(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12222,10 +29596,10 @@ var init_roles3 = __esm({ var SpendAlerts2; var init_spend_alerts2 = __esm({ "node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs"() { - init_resource(); - init_pagination(); - init_path(); - SpendAlerts2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + SpendAlerts2 = class extends APIResource2 { /** * Creates a project spend alert. * @@ -12247,7 +29621,7 @@ var init_spend_alerts2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/spend_alerts`, { + return this._client.post(path3`/organization/projects/${projectID}/spend_alerts`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12267,7 +29641,7 @@ var init_spend_alerts2 = __esm({ */ retrieve(alertID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.get(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12295,7 +29669,7 @@ var init_spend_alerts2 = __esm({ */ update(alertID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.post(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12315,7 +29689,7 @@ var init_spend_alerts2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a project spend alert. @@ -12331,7 +29705,7 @@ var init_spend_alerts2 = __esm({ */ delete(alertID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12344,9 +29718,9 @@ var init_spend_alerts2 = __esm({ var SpendLimit2; var init_spend_limit2 = __esm({ "node_modules/openai/resources/admin/organization/projects/spend-limit.mjs"() { - init_resource(); - init_path(); - SpendLimit2 = class extends APIResource { + init_resource2(); + init_path2(); + SpendLimit2 = class extends APIResource2 { /** * Get a project's hard spend limit. * @@ -12359,7 +29733,7 @@ var init_spend_limit2 = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.get(path3`/organization/projects/${projectID}/spend_limit`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12381,7 +29755,7 @@ var init_spend_limit2 = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.post(path3`/organization/projects/${projectID}/spend_limit`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12399,7 +29773,7 @@ var init_spend_limit2 = __esm({ * ``` */ delete(projectID, options) { - return this._client.delete(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.delete(path3`/organization/projects/${projectID}/spend_limit`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12412,10 +29786,10 @@ var init_spend_limit2 = __esm({ var Roles4; var init_roles4 = __esm({ "node_modules/openai/resources/admin/organization/projects/groups/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles4 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles4 = class extends APIResource2 { /** * Assigns a project role to a group within a project. * @@ -12430,7 +29804,7 @@ var init_roles4 = __esm({ */ create(groupID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/groups/${groupID}/roles`, { + return this._client.post(path3`/projects/${project_id}/groups/${groupID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12450,7 +29824,7 @@ var init_roles4 = __esm({ */ retrieve(roleID, params, options) { const { project_id, group_id } = params; - return this._client.get(path`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12471,7 +29845,7 @@ var init_roles4 = __esm({ */ list(groupID, params, options) { const { project_id, ...query } = params; - return this._client.getAPIList(path`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns a project role from a group within a project. @@ -12487,7 +29861,7 @@ var init_roles4 = __esm({ */ delete(roleID, params, options) { const { project_id, group_id } = params; - return this._client.delete(path`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12500,12 +29874,12 @@ var init_roles4 = __esm({ var Groups2; var init_groups2 = __esm({ "node_modules/openai/resources/admin/organization/projects/groups/groups.mjs"() { - init_resource(); + init_resource2(); init_roles4(); init_roles4(); - init_pagination(); - init_path(); - Groups2 = class extends APIResource { + init_pagination2(); + init_path2(); + Groups2 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles4(this._client); @@ -12523,7 +29897,7 @@ var init_groups2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/groups`, { + return this._client.post(path3`/organization/projects/${projectID}/groups`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12543,7 +29917,7 @@ var init_groups2 = __esm({ */ retrieve(groupID, params, options) { const { project_id, ...query } = params; - return this._client.get(path`/organization/projects/${project_id}/groups/${groupID}`, { + return this._client.get(path3`/organization/projects/${project_id}/groups/${groupID}`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -12563,7 +29937,7 @@ var init_groups2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/groups`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/groups`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Revokes a group's access to a project. @@ -12579,7 +29953,7 @@ var init_groups2 = __esm({ */ delete(groupID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/groups/${groupID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12590,12 +29964,12 @@ var init_groups2 = __esm({ }); // node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs -var APIKeys2; -var init_api_keys2 = __esm({ +var APIKeys3; +var init_api_keys3 = __esm({ "node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs"() { - init_resource(); - init_path(); - APIKeys2 = class extends APIResource { + init_resource2(); + init_path2(); + APIKeys3 = class extends APIResource2 { /** * Creates an API key for a service account in the project. * @@ -12610,25 +29984,25 @@ var init_api_keys2 = __esm({ */ create(serviceAccountID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}/api_keys`, { body, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.post(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}/api_keys`, { body, ...options, __security: { adminAPIKeyAuth: true } }); } }; } }); // node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs -var ServiceAccounts; -var init_service_accounts = __esm({ +var ServiceAccounts3; +var init_service_accounts3 = __esm({ "node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs"() { - init_resource(); - init_api_keys2(); - init_api_keys2(); - init_pagination(); - init_path(); - ServiceAccounts = class extends APIResource { + init_resource2(); + init_api_keys3(); + init_api_keys3(); + init_pagination2(); + init_path2(); + ServiceAccounts3 = class extends APIResource2 { constructor() { super(...arguments); - this.apiKeys = new APIKeys2(this._client); + this.apiKeys = new APIKeys3(this._client); } /** * Creates a new service account in the project. By default, this also returns an @@ -12644,7 +30018,7 @@ var init_service_accounts = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/service_accounts`, { + return this._client.post(path3`/organization/projects/${projectID}/service_accounts`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12664,7 +30038,7 @@ var init_service_accounts = __esm({ */ retrieve(serviceAccountID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { + return this._client.get(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12683,7 +30057,7 @@ var init_service_accounts = __esm({ */ update(serviceAccountID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.post(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Returns a list of service accounts in the project. @@ -12699,7 +30073,7 @@ var init_service_accounts = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a service account from the project. @@ -12718,10 +30092,10 @@ var init_service_accounts = __esm({ */ delete(serviceAccountID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.delete(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - ServiceAccounts.APIKeys = APIKeys2; + ServiceAccounts3.APIKeys = APIKeys3; } }); @@ -12729,10 +30103,10 @@ var init_service_accounts = __esm({ var Roles5; var init_roles5 = __esm({ "node_modules/openai/resources/admin/organization/projects/users/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles5 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles5 = class extends APIResource2 { /** * Assigns a project role to a user within a project. * @@ -12747,7 +30121,7 @@ var init_roles5 = __esm({ */ create(userID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/users/${userID}/roles`, { + return this._client.post(path3`/projects/${project_id}/users/${userID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12767,7 +30141,7 @@ var init_roles5 = __esm({ */ retrieve(roleID, params, options) { const { project_id, user_id } = params; - return this._client.get(path`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12788,7 +30162,7 @@ var init_roles5 = __esm({ */ list(userID, params, options) { const { project_id, ...query } = params; - return this._client.getAPIList(path`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns a project role from a user within a project. @@ -12804,7 +30178,7 @@ var init_roles5 = __esm({ */ delete(roleID, params, options) { const { project_id, user_id } = params; - return this._client.delete(path`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12814,15 +30188,15 @@ var init_roles5 = __esm({ }); // node_modules/openai/resources/admin/organization/projects/users/users.mjs -var Users2; -var init_users2 = __esm({ +var Users3; +var init_users3 = __esm({ "node_modules/openai/resources/admin/organization/projects/users/users.mjs"() { - init_resource(); + init_resource2(); init_roles5(); init_roles5(); - init_pagination(); - init_path(); - Users2 = class extends APIResource { + init_pagination2(); + init_path2(); + Users3 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles5(this._client); @@ -12841,7 +30215,7 @@ var init_users2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/users`, { + return this._client.post(path3`/organization/projects/${projectID}/users`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12861,7 +30235,7 @@ var init_users2 = __esm({ */ retrieve(userID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.get(path3`/organization/projects/${project_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12880,7 +30254,7 @@ var init_users2 = __esm({ */ update(userID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.post(path3`/organization/projects/${project_id}/users/${userID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12900,7 +30274,7 @@ var init_users2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/users`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/users`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a user from the project. @@ -12919,13 +30293,13 @@ var init_users2 = __esm({ */ delete(userID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Users2.Roles = Roles5; + Users3.Roles = Roles5; } }); @@ -12933,19 +30307,19 @@ var init_users2 = __esm({ var Projects; var init_projects = __esm({ "node_modules/openai/resources/admin/organization/projects/projects.mjs"() { - init_resource(); - init_api_keys(); - init_api_keys(); - init_certificates2(); - init_certificates2(); + init_resource2(); + init_api_keys2(); + init_api_keys2(); + init_certificates3(); + init_certificates3(); init_data_retention2(); init_data_retention2(); init_hosted_tool_permissions(); init_hosted_tool_permissions(); init_model_permissions(); init_model_permissions(); - init_rate_limits(); - init_rate_limits(); + init_rate_limits3(); + init_rate_limits3(); init_roles3(); init_roles3(); init_spend_alerts2(); @@ -12954,19 +30328,19 @@ var init_projects = __esm({ init_spend_limit2(); init_groups2(); init_groups2(); - init_service_accounts(); - init_service_accounts(); - init_users2(); - init_users2(); - init_pagination(); - init_path(); - Projects = class extends APIResource { + init_service_accounts3(); + init_service_accounts3(); + init_users3(); + init_users3(); + init_pagination2(); + init_path2(); + Projects = class extends APIResource2 { constructor() { super(...arguments); - this.users = new Users2(this._client); - this.serviceAccounts = new ServiceAccounts(this._client); - this.apiKeys = new APIKeys(this._client); - this.rateLimits = new RateLimits(this._client); + this.users = new Users3(this._client); + this.serviceAccounts = new ServiceAccounts3(this._client); + this.apiKeys = new APIKeys2(this._client); + this.rateLimits = new RateLimits3(this._client); this.modelPermissions = new ModelPermissions(this._client); this.hostedToolPermissions = new HostedToolPermissions(this._client); this.groups = new Groups2(this._client); @@ -12974,7 +30348,7 @@ var init_projects = __esm({ this.dataRetention = new DataRetention2(this._client); this.spendLimit = new SpendLimit2(this._client); this.spendAlerts = new SpendAlerts2(this._client); - this.certificates = new Certificates2(this._client); + this.certificates = new Certificates3(this._client); } /** * Create a new project in the organization. Projects can be created and archived, @@ -13007,7 +30381,7 @@ var init_projects = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}`, { + return this._client.get(path3`/organization/projects/${projectID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13024,7 +30398,7 @@ var init_projects = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}`, { + return this._client.post(path3`/organization/projects/${projectID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -13061,16 +30435,16 @@ var init_projects = __esm({ * ``` */ archive(projectID, options) { - return this._client.post(path`/organization/projects/${projectID}/archive`, { + return this._client.post(path3`/organization/projects/${projectID}/archive`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Projects.Users = Users2; - Projects.ServiceAccounts = ServiceAccounts; - Projects.APIKeys = APIKeys; - Projects.RateLimits = RateLimits; + Projects.Users = Users3; + Projects.ServiceAccounts = ServiceAccounts3; + Projects.APIKeys = APIKeys2; + Projects.RateLimits = RateLimits3; Projects.ModelPermissions = ModelPermissions; Projects.HostedToolPermissions = HostedToolPermissions; Projects.Groups = Groups2; @@ -13078,7 +30452,7 @@ var init_projects = __esm({ Projects.DataRetention = DataRetention2; Projects.SpendLimit = SpendLimit2; Projects.SpendAlerts = SpendAlerts2; - Projects.Certificates = Certificates2; + Projects.Certificates = Certificates3; } }); @@ -13086,10 +30460,10 @@ var init_projects = __esm({ var Roles6; var init_roles6 = __esm({ "node_modules/openai/resources/admin/organization/users/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles6 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles6 = class extends APIResource2 { /** * Assigns an organization role to a user within the organization. * @@ -13103,7 +30477,7 @@ var init_roles6 = __esm({ * ``` */ create(userID, body, options) { - return this._client.post(path`/organization/users/${userID}/roles`, { + return this._client.post(path3`/organization/users/${userID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -13123,7 +30497,7 @@ var init_roles6 = __esm({ */ retrieve(roleID, params, options) { const { user_id } = params; - return this._client.get(path`/organization/users/${user_id}/roles/${roleID}`, { + return this._client.get(path3`/organization/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13142,7 +30516,7 @@ var init_roles6 = __esm({ * ``` */ list(userID, query = {}, options) { - return this._client.getAPIList(path`/organization/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns an organization role from a user within the organization. @@ -13158,7 +30532,7 @@ var init_roles6 = __esm({ */ delete(roleID, params, options) { const { user_id } = params; - return this._client.delete(path`/organization/users/${user_id}/roles/${roleID}`, { + return this._client.delete(path3`/organization/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13168,15 +30542,15 @@ var init_roles6 = __esm({ }); // node_modules/openai/resources/admin/organization/users/users.mjs -var Users3; -var init_users3 = __esm({ +var Users4; +var init_users4 = __esm({ "node_modules/openai/resources/admin/organization/users/users.mjs"() { - init_resource(); + init_resource2(); init_roles6(); init_roles6(); - init_pagination(); - init_path(); - Users3 = class extends APIResource { + init_pagination2(); + init_path2(); + Users4 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles6(this._client); @@ -13191,7 +30565,7 @@ var init_users3 = __esm({ * ``` */ retrieve(userID, options) { - return this._client.get(path`/organization/users/${userID}`, { + return this._client.get(path3`/organization/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13206,7 +30580,7 @@ var init_users3 = __esm({ * ``` */ update(userID, body, options) { - return this._client.post(path`/organization/users/${userID}`, { + return this._client.post(path3`/organization/users/${userID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -13241,31 +30615,31 @@ var init_users3 = __esm({ * ``` */ delete(userID, options) { - return this._client.delete(path`/organization/users/${userID}`, { + return this._client.delete(path3`/organization/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Users3.Roles = Roles6; + Users4.Roles = Roles6; } }); // node_modules/openai/resources/admin/organization/organization.mjs -var Organization; -var init_organization = __esm({ +var Organization2; +var init_organization2 = __esm({ "node_modules/openai/resources/admin/organization/organization.mjs"() { - init_resource(); + init_resource2(); init_admin_api_keys(); init_admin_api_keys(); init_audit_logs(); init_audit_logs(); - init_certificates(); - init_certificates(); + init_certificates2(); + init_certificates2(); init_data_retention(); init_data_retention(); - init_invites(); - init_invites(); + init_invites2(); + init_invites2(); init_roles(); init_roles(); init_spend_alerts(); @@ -13278,37 +30652,37 @@ var init_organization = __esm({ init_groups(); init_projects(); init_projects(); - init_users3(); - init_users3(); - Organization = class extends APIResource { + init_users4(); + init_users4(); + Organization2 = class extends APIResource2 { constructor() { super(...arguments); this.auditLogs = new AuditLogs(this._client); this.adminAPIKeys = new AdminAPIKeys(this._client); this.usage = new Usage(this._client); - this.invites = new Invites(this._client); - this.users = new Users3(this._client); + this.invites = new Invites2(this._client); + this.users = new Users4(this._client); this.groups = new Groups(this._client); this.roles = new Roles(this._client); this.dataRetention = new DataRetention(this._client); this.spendLimit = new SpendLimit(this._client); this.spendAlerts = new SpendAlerts(this._client); - this.certificates = new Certificates(this._client); + this.certificates = new Certificates2(this._client); this.projects = new Projects(this._client); } }; - Organization.AuditLogs = AuditLogs; - Organization.AdminAPIKeys = AdminAPIKeys; - Organization.Usage = Usage; - Organization.Invites = Invites; - Organization.Users = Users3; - Organization.Groups = Groups; - Organization.Roles = Roles; - Organization.DataRetention = DataRetention; - Organization.SpendLimit = SpendLimit; - Organization.SpendAlerts = SpendAlerts; - Organization.Certificates = Certificates; - Organization.Projects = Projects; + Organization2.AuditLogs = AuditLogs; + Organization2.AdminAPIKeys = AdminAPIKeys; + Organization2.Usage = Usage; + Organization2.Invites = Invites2; + Organization2.Users = Users4; + Organization2.Groups = Groups; + Organization2.Roles = Roles; + Organization2.DataRetention = DataRetention; + Organization2.SpendLimit = SpendLimit; + Organization2.SpendAlerts = SpendAlerts; + Organization2.Certificates = Certificates2; + Organization2.Projects = Projects; } }); @@ -13316,16 +30690,16 @@ var init_organization = __esm({ var Admin; var init_admin = __esm({ "node_modules/openai/resources/admin/admin.mjs"() { - init_resource(); - init_organization(); - init_organization(); - Admin = class extends APIResource { + init_resource2(); + init_organization2(); + init_organization2(); + Admin = class extends APIResource2 { constructor() { super(...arguments); - this.organization = new Organization(this._client); + this.organization = new Organization2(this._client); } }; - Admin.Organization = Organization; + Admin.Organization = Organization2; } }); @@ -13333,9 +30707,9 @@ var init_admin = __esm({ var Speech; var init_speech = __esm({ "node_modules/openai/resources/audio/speech.mjs"() { - init_resource(); - init_headers2(); - Speech = class extends APIResource { + init_resource2(); + init_headers3(); + Speech = class extends APIResource2 { /** * Generates audio from the input text. * @@ -13357,7 +30731,7 @@ var init_speech = __esm({ return this._client.post("/audio/speech", { body, ...options, - headers: buildHeaders([{ Accept: "application/octet-stream" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/octet-stream" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -13370,11 +30744,11 @@ var init_speech = __esm({ var Transcriptions; var init_transcriptions = __esm({ "node_modules/openai/resources/audio/transcriptions.mjs"() { - init_resource(); - init_uploads(); - Transcriptions = class extends APIResource { + init_resource2(); + init_uploads3(); + Transcriptions = class extends APIResource2 { create(body, options) { - return this._client.post("/audio/transcriptions", multipartFormRequestOptions({ + return this._client.post("/audio/transcriptions", multipartFormRequestOptions2({ body, ...options, stream: body.stream ?? false, @@ -13390,11 +30764,11 @@ var init_transcriptions = __esm({ var Translations; var init_translations = __esm({ "node_modules/openai/resources/audio/translations.mjs"() { - init_resource(); - init_uploads(); - Translations = class extends APIResource { + init_resource2(); + init_uploads3(); + Translations = class extends APIResource2 { create(body, options) { - return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/audio/translations", multipartFormRequestOptions2({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client)); } }; } @@ -13404,14 +30778,14 @@ var init_translations = __esm({ var Audio; var init_audio = __esm({ "node_modules/openai/resources/audio/audio.mjs"() { - init_resource(); + init_resource2(); init_speech(); init_speech(); init_transcriptions(); init_transcriptions(); init_translations(); init_translations(); - Audio = class extends APIResource { + Audio = class extends APIResource2 { constructor() { super(...arguments); this.transcriptions = new Transcriptions(this._client); @@ -13426,13 +30800,13 @@ var init_audio = __esm({ }); // node_modules/openai/resources/batches.mjs -var Batches; -var init_batches = __esm({ +var Batches3; +var init_batches3 = __esm({ "node_modules/openai/resources/batches.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Batches = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Batches3 = class extends APIResource2 { /** * Creates and executes a batch from an uploaded file of requests */ @@ -13443,7 +30817,7 @@ var init_batches = __esm({ * Retrieves a batch. */ retrieve(batchID, options) { - return this._client.get(path`/batches/${batchID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/batches/${batchID}`, { ...options, __security: { bearerAuth: true } }); } /** * List your organization's batches. @@ -13461,7 +30835,7 @@ var init_batches = __esm({ * (if any) available in the output file. */ cancel(batchID, options) { - return this._client.post(path`/batches/${batchID}/cancel`, { + return this._client.post(path3`/batches/${batchID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -13474,11 +30848,11 @@ var init_batches = __esm({ var Assistants; var init_assistants = __esm({ "node_modules/openai/resources/beta/assistants.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Assistants = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Assistants = class extends APIResource2 { /** * Create an assistant with a model and instructions. * @@ -13488,7 +30862,7 @@ var init_assistants = __esm({ return this._client.post("/assistants", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13498,9 +30872,9 @@ var init_assistants = __esm({ * @deprecated */ retrieve(assistantID, options) { - return this._client.get(path`/assistants/${assistantID}`, { + return this._client.get(path3`/assistants/${assistantID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13510,10 +30884,10 @@ var init_assistants = __esm({ * @deprecated */ update(assistantID, body, options) { - return this._client.post(path`/assistants/${assistantID}`, { + return this._client.post(path3`/assistants/${assistantID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13526,7 +30900,7 @@ var init_assistants = __esm({ return this._client.getAPIList("/assistants", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13536,9 +30910,9 @@ var init_assistants = __esm({ * @deprecated */ delete(assistantID, options) { - return this._client.delete(path`/assistants/${assistantID}`, { + return this._client.delete(path3`/assistants/${assistantID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13547,12 +30921,12 @@ var init_assistants = __esm({ }); // node_modules/openai/resources/beta/realtime/sessions.mjs -var Sessions; -var init_sessions = __esm({ +var Sessions2; +var init_sessions2 = __esm({ "node_modules/openai/resources/beta/realtime/sessions.mjs"() { - init_resource(); - init_headers2(); - Sessions = class extends APIResource { + init_resource2(); + init_headers3(); + Sessions2 = class extends APIResource2 { /** * Create an ephemeral API token for use in client-side applications with the * Realtime API. Can be configured with the same session parameters as the @@ -13572,7 +30946,7 @@ var init_sessions = __esm({ return this._client.post("/realtime/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13584,9 +30958,9 @@ var init_sessions = __esm({ var TranscriptionSessions; var init_transcription_sessions = __esm({ "node_modules/openai/resources/beta/realtime/transcription-sessions.mjs"() { - init_resource(); - init_headers2(); - TranscriptionSessions = class extends APIResource { + init_resource2(); + init_headers3(); + TranscriptionSessions = class extends APIResource2 { /** * Create an ephemeral API token for use in client-side applications with the * Realtime API specifically for realtime transcriptions. Can be configured with @@ -13606,7 +30980,7 @@ var init_transcription_sessions = __esm({ return this._client.post("/realtime/transcription_sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13618,32 +30992,32 @@ var init_transcription_sessions = __esm({ var Realtime; var init_realtime = __esm({ "node_modules/openai/resources/beta/realtime/realtime.mjs"() { - init_resource(); - init_sessions(); - init_sessions(); + init_resource2(); + init_sessions2(); + init_sessions2(); init_transcription_sessions(); init_transcription_sessions(); - Realtime = class extends APIResource { + Realtime = class extends APIResource2 { constructor() { super(...arguments); - this.sessions = new Sessions(this._client); + this.sessions = new Sessions2(this._client); this.transcriptionSessions = new TranscriptionSessions(this._client); } }; - Realtime.Sessions = Sessions; + Realtime.Sessions = Sessions2; Realtime.TranscriptionSessions = TranscriptionSessions; } }); // node_modules/openai/resources/beta/agents/environments/files.mjs -var Files; -var init_files = __esm({ +var Files3; +var init_files3 = __esm({ "node_modules/openai/resources/beta/agents/environments/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Files = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Files3 = class extends APIResource2 { /** * Copies inline bytes or a Files API file into a connected execution environment. * See @@ -13663,10 +31037,10 @@ var init_files = __esm({ * ``` */ create(environmentID, body, options) { - return this._client.post(path`/agents/environments/${environmentID}/files`, { + return this._client.post(path3`/agents/environments/${environmentID}/files`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13686,10 +31060,10 @@ var init_files = __esm({ * ``` */ list(environmentID, query = {}, options) { - return this._client.getAPIList(path`/agents/environments/${environmentID}/files`, TokenPage, { + return this._client.getAPIList(path3`/agents/environments/${environmentID}/files`, TokenPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13701,11 +31075,11 @@ var init_files = __esm({ var Templates; var init_templates = __esm({ "node_modules/openai/resources/beta/agents/environments/templates.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Templates = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Templates = class extends APIResource2 { /** * Creates reusable environment configuration without returning confidential setup * commands or environment values. See @@ -13721,7 +31095,7 @@ var init_templates = __esm({ return this._client.post("/agents/environments/templates", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13739,9 +31113,9 @@ var init_templates = __esm({ * ``` */ retrieve(environmentTemplateID, options) { - return this._client.get(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.get(path3`/agents/environments/templates/${environmentTemplateID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13759,10 +31133,10 @@ var init_templates = __esm({ * ``` */ update(environmentTemplateID, body = {}, options) { - return this._client.post(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.post(path3`/agents/environments/templates/${environmentTemplateID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13782,7 +31156,7 @@ var init_templates = __esm({ return this._client.getAPIList("/agents/environments/templates", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13800,9 +31174,9 @@ var init_templates = __esm({ * ``` */ delete(environmentTemplateID, options) { - return this._client.delete(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.delete(path3`/agents/environments/templates/${environmentTemplateID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13811,20 +31185,20 @@ var init_templates = __esm({ }); // node_modules/openai/resources/beta/agents/environments/environments.mjs -var Environments; -var init_environments = __esm({ +var Environments2; +var init_environments2 = __esm({ "node_modules/openai/resources/beta/agents/environments/environments.mjs"() { - init_resource(); - init_files(); - init_files(); + init_resource2(); + init_files3(); + init_files3(); init_templates(); init_templates(); - init_headers2(); - init_path(); - Environments = class extends APIResource { + init_headers3(); + init_path2(); + Environments2 = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files(this._client); + this.files = new Files3(this._client); this.templates = new Templates(this._client); } /** @@ -13841,15 +31215,15 @@ var init_environments = __esm({ * ``` */ retrieve(environmentID, options) { - return this._client.get(path`/agents/environments/${environmentID}`, { + return this._client.get(path3`/agents/environments/${environmentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Environments.Files = Files; - Environments.Templates = Templates; + Environments2.Files = Files3; + Environments2.Templates = Templates; } }); @@ -13857,7 +31231,7 @@ var init_environments = __esm({ var _TurnState_turnID, _TurnState_turnEnded, _TurnState_eventIDs, _TurnState_calls, TurnState; var init_turn_state = __esm({ "node_modules/openai/lib/agents/turn-state.mjs"() { - init_tslib(); + init_tslib2(); TurnState = class { constructor() { _TurnState_turnID.set(this, void 0); @@ -13867,27 +31241,27 @@ var init_turn_state = __esm({ } /** Records a delivery unless its event ID is in the bounded recent window. */ accept(event) { - if (__classPrivateFieldGet(this, _TurnState_eventIDs, "f").has(event.event_id)) { + if (__classPrivateFieldGet2(this, _TurnState_eventIDs, "f").has(event.event_id)) { return false; } - if (__classPrivateFieldGet(this, _TurnState_eventIDs, "f").size === 1024) { - const oldest = __classPrivateFieldGet(this, _TurnState_eventIDs, "f").values().next(); + if (__classPrivateFieldGet2(this, _TurnState_eventIDs, "f").size === 1024) { + const oldest = __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").values().next(); if (!oldest.done) { - __classPrivateFieldGet(this, _TurnState_eventIDs, "f").delete(oldest.value); + __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").delete(oldest.value); } } - __classPrivateFieldGet(this, _TurnState_eventIDs, "f").add(event.event_id); - if (event.type === "agent.session.turn.created" && event.turn.subagent_id === null && __classPrivateFieldGet(this, _TurnState_turnID, "f") === void 0) { - __classPrivateFieldSet(this, _TurnState_turnID, event.turn_id, "f"); + __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").add(event.event_id); + if (event.type === "agent.session.turn.created" && event.turn.subagent_id === null && __classPrivateFieldGet2(this, _TurnState_turnID, "f") === void 0) { + __classPrivateFieldSet2(this, _TurnState_turnID, event.turn_id, "f"); } - if ((event.type === "agent.session.turn.completed" || event.type === "agent.session.turn.failed" || event.type === "agent.session.turn.cancelled") && __classPrivateFieldGet(this, _TurnState_turnID, "f") !== void 0 && event.turn_id === __classPrivateFieldGet(this, _TurnState_turnID, "f")) { - __classPrivateFieldSet(this, _TurnState_turnEnded, true, "f"); + if ((event.type === "agent.session.turn.completed" || event.type === "agent.session.turn.failed" || event.type === "agent.session.turn.cancelled") && __classPrivateFieldGet2(this, _TurnState_turnID, "f") !== void 0 && event.turn_id === __classPrivateFieldGet2(this, _TurnState_turnID, "f")) { + __classPrivateFieldSet2(this, _TurnState_turnEnded, true, "f"); } return true; } /** Checks session termination after updating the selected turn state. */ terminal(event) { - return event.type === "agent.session.failed" || event.type === "agent.session.idle" && __classPrivateFieldGet(this, _TurnState_turnEnded, "f"); + return event.type === "agent.session.failed" || event.type === "agent.session.idle" && __classPrivateFieldGet2(this, _TurnState_turnEnded, "f"); } /** Returns each tool call once for the full invocation, including subagent turns. */ call(event) { @@ -13896,10 +31270,10 @@ var init_turn_state = __esm({ } const call = event.item; const key = JSON.stringify([call.turn_id, call.call_id]); - if (__classPrivateFieldGet(this, _TurnState_calls, "f").has(key)) { + if (__classPrivateFieldGet2(this, _TurnState_calls, "f").has(key)) { return; } - __classPrivateFieldGet(this, _TurnState_calls, "f").add(key); + __classPrivateFieldGet2(this, _TurnState_calls, "f").add(key); return call; } }; @@ -13909,7 +31283,7 @@ var init_turn_state = __esm({ // node_modules/openai/lib/agents/agent-session-stream.mjs function isInputContent(value2) { - if (!isObj(value2)) { + if (!isObj2(value2)) { return false; } const content = value2; @@ -13921,7 +31295,7 @@ function isInputContent(value2) { } else { return false; } - return hasOwn(content, "type") && hasOwn(content, field) && typeof content[field] === "string"; + return hasOwn2(content, "type") && hasOwn2(content, field) && typeof content[field] === "string"; } function normalizedOutput(value2) { if (value2 === null) { @@ -13933,7 +31307,7 @@ function normalizedOutput(value2) { throw new OpenAIError("Tool output must be text, content, a JSON object, or null"); } function toolResult(call, value2) { - const output = isObj(value2) ? JSON.stringify(value2) : value2; + const output = isObj2(value2) ? JSON.stringify(value2) : value2; const serialized = JSON.stringify(output); if (serialized === void 0) { throw new OpenAIError("Tool output must be JSON serializable"); @@ -13955,12 +31329,12 @@ async function cancelBody(response) { var _AgentSessionStream_instances, _AgentSessionStream_consumed, _AgentSessionStream_stream, _AgentSessionStream_response, _AgentSessionStream_reading, _AgentSessionStream_sessions, _AgentSessionStream_sessionID, _AgentSessionStream_input, _AgentSessionStream_handlers, _AgentSessionStream_inputKey, _AgentSessionStream_options, _AgentSessionStream_iterate, _AgentSessionStream_result, _AgentSessionStream_checkAbort, _AgentSessionStream_abortError, _AgentSessionStream_wait, _AgentSessionStream_submit, AgentSessionStream; var init_agent_session_stream = __esm({ "node_modules/openai/lib/agents/agent-session-stream.mjs"() { - init_tslib(); + init_tslib2(); init_turn_state(); - init_error(); - init_headers2(); - init_uuid(); - init_values(); + init_error3(); + init_headers3(); + init_uuid2(); + init_values2(); AgentSessionStream = class { /** Creates an unstarted helper. Prefer client.beta.agents.sessions.stream(). */ constructor(sessions, sessionID, params, options) { @@ -13980,89 +31354,89 @@ var init_agent_session_stream = __esm({ if (params.input.length === 0) { throw new OpenAIError("input must not be empty"); } - __classPrivateFieldSet(this, _AgentSessionStream_sessions, sessions, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_sessionID, sessionID, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_input, { type: "agent.session.input.message", input }, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_handlers, new Map(Object.entries(params.toolHandlers ?? {})), "f"); - const headers = buildHeaders([options?.headers]); - __classPrivateFieldSet(this, _AgentSessionStream_inputKey, headers.nulls.has("idempotency-key") ? void 0 : headers.values.get("idempotency-key") ?? params.idempotencyKey ?? options?.idempotencyKey ?? uuid4(), "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_sessions, sessions, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_sessionID, sessionID, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_input, { type: "agent.session.input.message", input }, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_handlers, new Map(Object.entries(params.toolHandlers ?? {})), "f"); + const headers = buildHeaders2([options?.headers]); + __classPrivateFieldSet2(this, _AgentSessionStream_inputKey, headers.nulls.has("idempotency-key") ? void 0 : headers.values.get("idempotency-key") ?? params.idempotencyKey ?? options?.idempotencyKey ?? uuid42(), "f"); headers.values.delete("idempotency-key"); headers.nulls.delete("idempotency-key"); const { idempotencyKey: _key, ...rest } = options ?? {}; - __classPrivateFieldSet(this, _AgentSessionStream_options, { ...rest, headers }, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_options, { ...rest, headers }, "f"); } /** Closes local requests without cancelling the turn; an optional reason becomes the abort error's cause. */ abort(reason) { this.controller.abort(reason); - __classPrivateFieldGet(this, _AgentSessionStream_stream, "f")?.controller.abort(this.controller.signal.reason); - if (!__classPrivateFieldGet(this, _AgentSessionStream_reading, "f")) { - void cancelBody(__classPrivateFieldGet(this, _AgentSessionStream_response, "f")); + __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f")?.controller.abort(this.controller.signal.reason); + if (!__classPrivateFieldGet2(this, _AgentSessionStream_reading, "f")) { + void cancelBody(__classPrivateFieldGet2(this, _AgentSessionStream_response, "f")); } } /** Starts iteration once; use for await to ensure early exits close the connection. */ [(_AgentSessionStream_consumed = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_stream = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_response = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_reading = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_sessions = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_sessionID = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_input = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_handlers = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_inputKey = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_options = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet(this, _AgentSessionStream_consumed, "f")) { + if (__classPrivateFieldGet2(this, _AgentSessionStream_consumed, "f")) { throw new OpenAIError("An AgentSessionStream can only be consumed once"); } - __classPrivateFieldSet(this, _AgentSessionStream_consumed, true, "f"); - return __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_iterate).call(this); + __classPrivateFieldSet2(this, _AgentSessionStream_consumed, true, "f"); + return __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_iterate).call(this); } }; _AgentSessionStream_iterate = async function* _AgentSessionStream_iterate2() { - const externalSignal = __classPrivateFieldGet(this, _AgentSessionStream_options, "f").signal; + const externalSignal = __classPrivateFieldGet2(this, _AgentSessionStream_options, "f").signal; const abort = () => this.abort(externalSignal?.aborted ? externalSignal.reason : this.controller.signal.reason); externalSignal?.addEventListener("abort", abort, { once: true }); this.controller.signal.addEventListener("abort", abort, { once: true }); - const options = { ...__classPrivateFieldGet(this, _AgentSessionStream_options, "f"), signal: this.controller.signal }; + const options = { ...__classPrivateFieldGet2(this, _AgentSessionStream_options, "f"), signal: this.controller.signal }; const state2 = new TurnState(); try { if (externalSignal?.aborted) { this.abort(externalSignal.reason); } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - const session = await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").retrieve(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), options); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + const session = await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").retrieve(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), options); if (session.status !== "idle") { throw new OpenAIError("sessions.stream requires an idle session; use sessions.events.stream for active sessions"); } - const subscription = await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.stream(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), options).withResponse(); - __classPrivateFieldSet(this, _AgentSessionStream_stream, subscription.data, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_response, subscription.response, "f"); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), { - events: [__classPrivateFieldGet(this, _AgentSessionStream_input, "f")], + const subscription = await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.stream(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), options).withResponse(); + __classPrivateFieldSet2(this, _AgentSessionStream_stream, subscription.data, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_response, subscription.response, "f"); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), { + events: [__classPrivateFieldGet2(this, _AgentSessionStream_input, "f")], // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") === void 0 ? {} : { "Idempotency-Key": __classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") } + ...__classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") === void 0 ? {} : { "Idempotency-Key": __classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") } }, { ...options, - headers: buildHeaders([options.headers, { "Idempotency-Key": __classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") ?? null }]) + headers: buildHeaders2([options.headers, { "Idempotency-Key": __classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") ?? null }]) }); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - __classPrivateFieldSet(this, _AgentSessionStream_reading, true, "f"); - for await (const event of __classPrivateFieldGet(this, _AgentSessionStream_stream, "f")) { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldSet2(this, _AgentSessionStream_reading, true, "f"); + for await (const event of __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f")) { + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); if (!state2.accept(event)) { continue; } const terminal = state2.terminal(event); const pendingCall = state2.call(event); - const handler = pendingCall && __classPrivateFieldGet(this, _AgentSessionStream_handlers, "f").get(pendingCall.name); + const handler = pendingCall && __classPrivateFieldGet2(this, _AgentSessionStream_handlers, "f").get(pendingCall.name); const call = pendingCall && handler ? structuredClone(pendingCall) : void 0; if (terminal) { - __classPrivateFieldGet(this, _AgentSessionStream_stream, "f").controller.abort(); + __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f").controller.abort(); } yield event; if (terminal) { return; } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); if (!call || !handler) { continue; } - const result = await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_result).call(this, call, handler); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit).call(this, result, options); + const result = await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_result).call(this, call, handler); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit).call(this, result, options); } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); throw new OpenAIError("Session event stream ended before the turn reached idle or failed"); } finally { externalSignal?.removeEventListener("abort", abort); @@ -14072,12 +31446,12 @@ var init_agent_session_stream = __esm({ }, _AgentSessionStream_result = async function _AgentSessionStream_result2(call, handler) { try { const args = typeof call.arguments === "string" ? JSON.parse(call.arguments) : call.arguments; - if (!isObj(args)) { + if (!isObj2(args)) { throw new OpenAIError("Function arguments must be a JSON object"); } - return toolResult(call, await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => handler(args))); + return toolResult(call, await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => handler(args))); } catch { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); return { type: "agent.session.input.tool_result", turn_id: call.turn_id, @@ -14088,10 +31462,10 @@ var init_agent_session_stream = __esm({ } }, _AgentSessionStream_checkAbort = function _AgentSessionStream_checkAbort2() { if (this.controller.signal.aborted) { - throw __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this); + throw __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this); } }, _AgentSessionStream_abortError = function _AgentSessionStream_abortError2() { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: this.controller.signal.reason, writable: true, @@ -14101,11 +31475,11 @@ var init_agent_session_stream = __esm({ }, _AgentSessionStream_wait = async function _AgentSessionStream_wait2(action) { let onAbort; const aborted = new Promise((_resolve, reject2) => { - onAbort = () => reject2(__classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this)); + onAbort = () => reject2(__classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this)); this.controller.signal.addEventListener("abort", onAbort, { once: true }); }); try { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); const invoke = async () => await action(); return await Promise.race([invoke(), aborted]); } finally { @@ -14113,18 +31487,18 @@ var init_agent_session_stream = __esm({ this.controller.signal.removeEventListener("abort", onAbort); } } - }, _AgentSessionStream_submit = async function _AgentSessionStream_submit2(result, options, key = uuid4(), attempt = 0) { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + }, _AgentSessionStream_submit = async function _AgentSessionStream_submit2(result, options, key = uuid42(), attempt = 0) { + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); try { - await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), { events: [result], "Idempotency-Key": key }, options); + await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), { events: [result], "Idempotency-Key": key }, options); } catch (error) { const delay = [100, 300, 600][attempt]; - if (delay === void 0 || !(error instanceof BadRequestError) || error.code !== "invalid_request_error" || !error.error || !("message" in error.error) || error.error.message !== `Unknown pending tool call: ${result.call_id}`) { + if (delay === void 0 || !(error instanceof BadRequestError2) || error.code !== "invalid_request_error" || !error.error || !("message" in error.error) || error.error.message !== `Unknown pending tool call: ${result.call_id}`) { throw error; } let timer; try { - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => ( + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => ( // oxlint-disable-next-line promise/avoid-new -- Own the registration timer so cancellation clears it promptly. new Promise((resolve2) => { timer = setTimeout(resolve2, delay); @@ -14135,7 +31509,7 @@ var init_agent_session_stream = __esm({ clearTimeout(timer); } } - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit2).call(this, result, options, key, attempt + 1); + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit2).call(this, result, options, key, attempt + 1); } }; } @@ -14145,11 +31519,11 @@ var init_agent_session_stream = __esm({ var Artifacts; var init_artifacts = __esm({ "node_modules/openai/resources/beta/agents/sessions/artifacts.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Artifacts = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Artifacts = class extends APIResource2 { /** * Retrieves immutable metadata for one durable session artifact. See * [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts). @@ -14165,9 +31539,9 @@ var init_artifacts = __esm({ */ retrieve(artifactID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/artifacts/${artifactID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/artifacts/${artifactID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14186,10 +31560,10 @@ var init_artifacts = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/artifacts`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/artifacts`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14209,9 +31583,9 @@ var init_artifacts = __esm({ */ delete(artifactID, params, options) { const { session_id } = params; - return this._client.delete(path`/agents/sessions/${session_id}/artifacts/${artifactID}`, { + return this._client.delete(path3`/agents/sessions/${session_id}/artifacts/${artifactID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14234,9 +31608,9 @@ var init_artifacts = __esm({ */ content(artifactID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/artifacts/${artifactID}/content`, { + return this._client.get(path3`/agents/sessions/${session_id}/artifacts/${artifactID}/content`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { "OpenAI-Beta": "agents=v1", Accept: "application/octet-stream" }, options?.headers ]), @@ -14249,13 +31623,13 @@ var init_artifacts = __esm({ }); // node_modules/openai/resources/beta/agents/sessions/events.mjs -var Events; -var init_events = __esm({ +var Events3; +var init_events3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/events.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Events = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Events3 = class extends APIResource2 { /** * Submits message, cancellation, or tool-result events to a managed agent session. * Cancellation can recover a still-open turn whose backend execution has ended by @@ -14286,10 +31660,10 @@ var init_events = __esm({ */ create(sessionID, params, options) { const { "Idempotency-Key": idempotencyKey, ...body } = params; - return this._client.post(path`/agents/sessions/${sessionID}/events`, { + return this._client.post(path3`/agents/sessions/${sessionID}/events`, { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { "OpenAI-Beta": "agents=v1", Accept: "*/*", @@ -14313,9 +31687,9 @@ var init_events = __esm({ * ``` */ stream(sessionID, options) { - return this._client.get(path`/agents/sessions/${sessionID}/events`, { + return this._client.get(path3`/agents/sessions/${sessionID}/events`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1", Accept: "text/event-stream" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1", Accept: "text/event-stream" }, options?.headers]), stream: true, __security: { bearerAuth: true } }); @@ -14328,11 +31702,11 @@ var init_events = __esm({ var Items; var init_items = __esm({ "node_modules/openai/resources/beta/agents/sessions/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items = class extends APIResource2 { /** * Lists items produced by the session's root agent, including its interactions * with subagents. Each subagent has its own item history. See @@ -14349,10 +31723,10 @@ var init_items = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14364,11 +31738,11 @@ var init_items = __esm({ var Turns; var init_turns = __esm({ "node_modules/openai/resources/beta/agents/sessions/turns.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Turns = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Turns = class extends APIResource2 { /** * Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if * the turn does not belong to the session. See @@ -14385,9 +31759,9 @@ var init_turns = __esm({ */ retrieve(turnID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/turns/${turnID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/turns/${turnID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14407,10 +31781,10 @@ var init_turns = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/turns`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/turns`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14422,11 +31796,11 @@ var init_turns = __esm({ var Items2; var init_items2 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items2 = class extends APIResource2 { /** * Lists this subagent's own items across all of its turns. See * [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent). @@ -14444,10 +31818,10 @@ var init_items2 = __esm({ */ list(subagentID, params, options) { const { session_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagentID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagentID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14459,11 +31833,11 @@ var init_items2 = __esm({ var Items3; var init_items3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/turns/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items3 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items3 = class extends APIResource2 { /** * Lists items belonging to one turn of this subagent. See * [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent). @@ -14481,10 +31855,10 @@ var init_items3 = __esm({ */ list(turnID, params, options) { const { session_id, subagent_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14496,13 +31870,13 @@ var init_items3 = __esm({ var Turns2; var init_turns2 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/turns/turns.mjs"() { - init_resource(); + init_resource2(); init_items3(); init_items3(); - init_pagination(); - init_headers2(); - init_path(); - Turns2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Turns2 = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items3(this._client); @@ -14525,9 +31899,9 @@ var init_turns2 = __esm({ */ retrieve(turnID, params, options) { const { session_id, subagent_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14548,10 +31922,10 @@ var init_turns2 = __esm({ */ list(subagentID, params, options) { const { session_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagentID}/turns`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagentID}/turns`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14564,15 +31938,15 @@ var init_turns2 = __esm({ var Subagents; var init_subagents = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/subagents.mjs"() { - init_resource(); + init_resource2(); init_items2(); init_items2(); init_turns2(); init_turns2(); - init_pagination(); - init_headers2(); - init_path(); - Subagents = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Subagents = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items2(this._client); @@ -14593,9 +31967,9 @@ var init_subagents = __esm({ */ retrieve(subagentID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/subagents/${subagentID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/subagents/${subagentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14614,10 +31988,10 @@ var init_subagents = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/subagents`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/subagents`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14628,31 +32002,31 @@ var init_subagents = __esm({ }); // node_modules/openai/resources/beta/agents/sessions/sessions.mjs -var Sessions2; -var init_sessions2 = __esm({ +var Sessions3; +var init_sessions3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/sessions.mjs"() { init_agent_session_stream(); - init_resource(); + init_resource2(); init_artifacts(); init_artifacts(); - init_events(); - init_events(); + init_events3(); + init_events3(); init_items(); init_items(); init_turns(); init_turns(); init_subagents(); init_subagents(); - init_pagination(); - init_headers2(); - init_path(); - Sessions2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Sessions3 = class extends APIResource2 { constructor() { super(...arguments); this.subagents = new Subagents(this._client); this.artifacts = new Artifacts(this._client); this.items = new Items(this._client); - this.events = new Events(this._client); + this.events = new Events3(this._client); this.turns = new Turns(this._client); } /** Stream one turn on an idle session with a single input writer. See AgentSessionStream for lifecycle and tool handling. */ @@ -14663,7 +32037,7 @@ var init_sessions2 = __esm({ return this._client.post("/agents/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), stream: body.stream ?? false, __security: { bearerAuth: true } }); @@ -14679,9 +32053,9 @@ var init_sessions2 = __esm({ * ``` */ retrieve(sessionID, options) { - return this._client.get(path`/agents/sessions/${sessionID}`, { + return this._client.get(path3`/agents/sessions/${sessionID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14697,10 +32071,10 @@ var init_sessions2 = __esm({ * ``` */ update(sessionID, body = {}, options) { - return this._client.post(path`/agents/sessions/${sessionID}`, { + return this._client.post(path3`/agents/sessions/${sessionID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14721,7 +32095,7 @@ var init_sessions2 = __esm({ return this._client.getAPIList("/agents/sessions", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14739,30 +32113,30 @@ var init_sessions2 = __esm({ * ``` */ delete(sessionID, options) { - return this._client.delete(path`/agents/sessions/${sessionID}`, { + return this._client.delete(path3`/agents/sessions/${sessionID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Sessions2.Subagents = Subagents; - Sessions2.Artifacts = Artifacts; - Sessions2.Items = Items; - Sessions2.Events = Events; - Sessions2.Turns = Turns; + Sessions3.Subagents = Subagents; + Sessions3.Artifacts = Artifacts; + Sessions3.Items = Items; + Sessions3.Events = Events3; + Sessions3.Turns = Turns; } }); // node_modules/openai/resources/beta/agents/vaults/credentials.mjs -var Credentials; -var init_credentials = __esm({ +var Credentials2; +var init_credentials3 = __esm({ "node_modules/openai/resources/beta/agents/vaults/credentials.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Credentials = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Credentials2 = class extends APIResource2 { /** * Creates a vault credential. Secret values are write-only and are never returned. * See @@ -14785,10 +32159,10 @@ var init_credentials = __esm({ * ``` */ create(vaultID, body, options) { - return this._client.post(path`/vaults/${vaultID}/credentials`, { + return this._client.post(path3`/vaults/${vaultID}/credentials`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14807,9 +32181,9 @@ var init_credentials = __esm({ */ retrieve(credentialID, params, options) { const { vault_id } = params; - return this._client.get(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.get(path3`/vaults/${vault_id}/credentials/${credentialID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14832,10 +32206,10 @@ var init_credentials = __esm({ */ update(credentialID, params, options) { const { vault_id, ...body } = params; - return this._client.post(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.post(path3`/vaults/${vault_id}/credentials/${credentialID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14855,10 +32229,10 @@ var init_credentials = __esm({ * ``` */ list(vaultID, query = {}, options) { - return this._client.getAPIList(path`/vaults/${vaultID}/credentials`, CursorPage, { + return this._client.getAPIList(path3`/vaults/${vaultID}/credentials`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14877,9 +32251,9 @@ var init_credentials = __esm({ */ delete(credentialID, params, options) { const { vault_id } = params; - return this._client.delete(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.delete(path3`/vaults/${vault_id}/credentials/${credentialID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14888,19 +32262,19 @@ var init_credentials = __esm({ }); // node_modules/openai/resources/beta/agents/vaults/vaults.mjs -var Vaults; -var init_vaults = __esm({ +var Vaults2; +var init_vaults2 = __esm({ "node_modules/openai/resources/beta/agents/vaults/vaults.mjs"() { - init_resource(); - init_credentials(); - init_credentials(); - init_pagination(); - init_headers2(); - init_path(); - Vaults = class extends APIResource { + init_resource2(); + init_credentials3(); + init_credentials3(); + init_pagination2(); + init_headers3(); + init_path2(); + Vaults2 = class extends APIResource2 { constructor() { super(...arguments); - this.credentials = new Credentials(this._client); + this.credentials = new Credentials2(this._client); } /** * Creates a vault for the current project. See @@ -14915,7 +32289,7 @@ var init_vaults = __esm({ return this._client.post("/vaults", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14931,9 +32305,9 @@ var init_vaults = __esm({ * ``` */ retrieve(vaultID, options) { - return this._client.get(path`/vaults/${vaultID}`, { + return this._client.get(path3`/vaults/${vaultID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14953,7 +32327,7 @@ var init_vaults = __esm({ return this._client.getAPIList("/vaults", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14969,37 +32343,37 @@ var init_vaults = __esm({ * ``` */ delete(vaultID, options) { - return this._client.delete(path`/vaults/${vaultID}`, { + return this._client.delete(path3`/vaults/${vaultID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Vaults.Credentials = Credentials; + Vaults2.Credentials = Credentials2; } }); // node_modules/openai/resources/beta/agents/agents.mjs -var Agents; -var init_agents = __esm({ +var Agents2; +var init_agents2 = __esm({ "node_modules/openai/resources/beta/agents/agents.mjs"() { - init_resource(); - init_environments(); - init_environments(); - init_sessions2(); - init_sessions2(); - init_vaults(); - init_vaults(); - init_pagination(); - init_headers2(); - init_path(); - Agents = class extends APIResource { + init_resource2(); + init_environments2(); + init_environments2(); + init_sessions3(); + init_sessions3(); + init_vaults2(); + init_vaults2(); + init_pagination2(); + init_headers3(); + init_path2(); + Agents2 = class extends APIResource2 { constructor() { super(...arguments); - this.environments = new Environments(this._client); - this.vaults = new Vaults(this._client); - this.sessions = new Sessions2(this._client); + this.environments = new Environments2(this._client); + this.vaults = new Vaults2(this._client); + this.sessions = new Sessions3(this._client); } /** * Creates a reusable agent without storing credentials. See @@ -15016,7 +32390,7 @@ var init_agents = __esm({ return this._client.post("/agents", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15030,9 +32404,9 @@ var init_agents = __esm({ * ``` */ retrieve(agentID, options) { - return this._client.get(path`/agents/${agentID}`, { + return this._client.get(path3`/agents/${agentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15046,10 +32420,10 @@ var init_agents = __esm({ * ``` */ update(agentID, body = {}, options) { - return this._client.post(path`/agents/${agentID}`, { + return this._client.post(path3`/agents/${agentID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15069,7 +32443,7 @@ var init_agents = __esm({ return this._client.getAPIList("/agents", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15085,27 +32459,27 @@ var init_agents = __esm({ * ``` */ delete(agentID, options) { - return this._client.delete(path`/agents/${agentID}`, { + return this._client.delete(path3`/agents/${agentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Agents.Environments = Environments; - Agents.Vaults = Vaults; - Agents.Sessions = Sessions2; + Agents2.Environments = Environments2; + Agents2.Vaults = Vaults2; + Agents2.Sessions = Sessions3; } }); // node_modules/openai/resources/beta/chatkit/sessions.mjs -var Sessions3; -var init_sessions3 = __esm({ +var Sessions4; +var init_sessions4 = __esm({ "node_modules/openai/resources/beta/chatkit/sessions.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Sessions3 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Sessions4 = class extends APIResource2 { /** * Create a ChatKit session. * @@ -15122,7 +32496,7 @@ var init_sessions3 = __esm({ return this._client.post("/chatkit/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15138,9 +32512,9 @@ var init_sessions3 = __esm({ * ``` */ cancel(sessionID, options) { - return this._client.post(path`/chatkit/sessions/${sessionID}/cancel`, { + return this._client.post(path3`/chatkit/sessions/${sessionID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15149,14 +32523,14 @@ var init_sessions3 = __esm({ }); // node_modules/openai/resources/beta/chatkit/threads.mjs -var Threads; -var init_threads = __esm({ +var Threads2; +var init_threads2 = __esm({ "node_modules/openai/resources/beta/chatkit/threads.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Threads = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Threads2 = class extends APIResource2 { /** * Retrieve a ChatKit thread by its identifier. * @@ -15167,9 +32541,9 @@ var init_threads = __esm({ * ``` */ retrieve(threadID, options) { - return this._client.get(path`/chatkit/threads/${threadID}`, { + return this._client.get(path3`/chatkit/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15188,7 +32562,7 @@ var init_threads = __esm({ return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15203,9 +32577,9 @@ var init_threads = __esm({ * ``` */ delete(threadID, options) { - return this._client.delete(path`/chatkit/threads/${threadID}`, { + return this._client.delete(path3`/chatkit/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15223,10 +32597,10 @@ var init_threads = __esm({ * ``` */ listItems(threadID, query = {}, options) { - return this._client.getAPIList(path`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { + return this._client.getAPIList(path3`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15238,20 +32612,20 @@ var init_threads = __esm({ var ChatKit; var init_chatkit = __esm({ "node_modules/openai/resources/beta/chatkit/chatkit.mjs"() { - init_resource(); - init_sessions3(); - init_sessions3(); - init_threads(); - init_threads(); - ChatKit = class extends APIResource { + init_resource2(); + init_sessions4(); + init_sessions4(); + init_threads2(); + init_threads2(); + ChatKit = class extends APIResource2 { constructor() { super(...arguments); - this.sessions = new Sessions3(this._client); - this.threads = new Threads(this._client); + this.sessions = new Sessions4(this._client); + this.threads = new Threads2(this._client); } }; - ChatKit.Sessions = Sessions3; - ChatKit.Threads = Threads; + ChatKit.Sessions = Sessions4; + ChatKit.Threads = Threads2; } }); @@ -15259,11 +32633,11 @@ var init_chatkit = __esm({ var InputItems; var init_input_items = __esm({ "node_modules/openai/resources/beta/responses/input-items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - InputItems = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + InputItems = class extends APIResource2 { /** * Returns a list of input items for a given response. * @@ -15279,10 +32653,10 @@ var init_input_items = __esm({ */ list(responseID, params = {}, options) { const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path`/responses/${responseID}/input_items?beta=true`, CursorPage, { + return this._client.getAPIList(path3`/responses/${responseID}/input_items?beta=true`, CursorPage, { query, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15297,9 +32671,9 @@ var init_input_items = __esm({ var InputTokens; var init_input_tokens = __esm({ "node_modules/openai/resources/beta/responses/input-tokens.mjs"() { - init_resource(); - init_headers2(); - InputTokens = class extends APIResource { + init_resource2(); + init_headers3(); + InputTokens = class extends APIResource2 { /** * Returns input token counts of the request. * @@ -15317,7 +32691,7 @@ var init_input_tokens = __esm({ return this._client.post("/responses/input_tokens?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15332,14 +32706,14 @@ var init_input_tokens = __esm({ var Responses; var init_responses = __esm({ "node_modules/openai/resources/beta/responses/responses.mjs"() { - init_resource(); + init_resource2(); init_input_items(); init_input_items(); init_input_tokens(); init_input_tokens(); - init_headers2(); - init_path(); - Responses = class extends APIResource { + init_headers3(); + init_path2(); + Responses = class extends APIResource2 { constructor() { super(...arguments); this.inputItems = new InputItems(this._client); @@ -15350,7 +32724,7 @@ var init_responses = __esm({ return this._client.post("/responses?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15360,10 +32734,10 @@ var init_responses = __esm({ } retrieve(responseID, params = {}, options) { const { betas, ...query } = params ?? {}; - return this._client.get(path`/responses/${responseID}?beta=true`, { + return this._client.get(path3`/responses/${responseID}?beta=true`, { query, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15383,9 +32757,9 @@ var init_responses = __esm({ */ delete(responseID, params = {}, options) { const { betas } = params ?? {}; - return this._client.delete(path`/responses/${responseID}?beta=true`, { + return this._client.delete(path3`/responses/${responseID}?beta=true`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { Accept: "*/*", ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15406,9 +32780,9 @@ var init_responses = __esm({ */ cancel(responseID, params = {}, options) { const { betas } = params ?? {}; - return this._client.post(path`/responses/${responseID}/cancel?beta=true`, { + return this._client.post(path3`/responses/${responseID}/cancel?beta=true`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15436,7 +32810,7 @@ var init_responses = __esm({ return this._client.post("/responses/compact?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15450,24 +32824,24 @@ var init_responses = __esm({ }); // node_modules/openai/resources/beta/threads/messages.mjs -var Messages2; -var init_messages2 = __esm({ +var Messages4; +var init_messages4 = __esm({ "node_modules/openai/resources/beta/threads/messages.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Messages2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Messages4 = class extends APIResource2 { /** * Create a message. * * @deprecated The Assistants API is deprecated in favor of the Responses API */ create(threadID, body, options) { - return this._client.post(path`/threads/${threadID}/messages`, { + return this._client.post(path3`/threads/${threadID}/messages`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15478,9 +32852,9 @@ var init_messages2 = __esm({ */ retrieve(messageID, params, options) { const { thread_id } = params; - return this._client.get(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.get(path3`/threads/${thread_id}/messages/${messageID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15491,10 +32865,10 @@ var init_messages2 = __esm({ */ update(messageID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.post(path3`/threads/${thread_id}/messages/${messageID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15504,10 +32878,10 @@ var init_messages2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ list(threadID, query = {}, options) { - return this._client.getAPIList(path`/threads/${threadID}/messages`, CursorPage, { + return this._client.getAPIList(path3`/threads/${threadID}/messages`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15518,9 +32892,9 @@ var init_messages2 = __esm({ */ delete(messageID, params, options) { const { thread_id } = params; - return this._client.delete(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.delete(path3`/threads/${thread_id}/messages/${messageID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15532,11 +32906,11 @@ var init_messages2 = __esm({ var Steps; var init_steps = __esm({ "node_modules/openai/resources/beta/threads/runs/steps.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Steps = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Steps = class extends APIResource2 { /** * Retrieves a run step. * @@ -15544,10 +32918,10 @@ var init_steps = __esm({ */ retrieve(stepID, params, options) { const { thread_id, run_id, ...query } = params; - return this._client.get(path`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, { + return this._client.get(path3`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15558,10 +32932,10 @@ var init_steps = __esm({ */ list(runID, params, options) { const { thread_id, ...query } = params; - return this._client.getAPIList(path`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, { + return this._client.getAPIList(path3`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15570,12 +32944,12 @@ var init_steps = __esm({ }); // node_modules/openai/internal/utils/base64.mjs -var fromBase64, toFloat32Array; -var init_base64 = __esm({ +var fromBase642, toFloat32Array; +var init_base642 = __esm({ "node_modules/openai/internal/utils/base64.mjs"() { - init_error(); - init_bytes(); - fromBase64 = (str2) => { + init_error3(); + init_bytes2(); + fromBase642 = (str2) => { if (typeof globalThis.Buffer !== "undefined") { const buf = globalThis.Buffer.from(str2, "base64"); return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); @@ -15611,10 +32985,10 @@ var init_base64 = __esm({ }); // node_modules/openai/internal/utils/env.mjs -var readEnv; -var init_env = __esm({ +var readEnv2; +var init_env2 = __esm({ "node_modules/openai/internal/utils/env.mjs"() { - readEnv = (env) => { + readEnv2 = (env) => { try { if (typeof globalThis.process !== "undefined") { return globalThis.process.env?.[env]?.trim() || void 0; @@ -15631,15 +33005,15 @@ var init_env = __esm({ }); // node_modules/openai/internal/utils.mjs -var init_utils2 = __esm({ +var init_utils4 = __esm({ "node_modules/openai/internal/utils.mjs"() { - init_values(); - init_base64(); - init_env(); - init_log(); - init_uuid(); - init_sleep(); - init_query(); + init_values2(); + init_base642(); + init_env2(); + init_log2(); + init_uuid2(); + init_sleep2(); + init_query2(); } }); @@ -15735,14 +33109,14 @@ function assertValidAssistantStreamArrayDelta(accumulator, delta, kind, projecti projection.arrays.set(accumulator, projectedArray); } for (const deltaEntry of delta) { - if (!isObj(deltaEntry)) { + if (!isObj2(deltaEntry)) { throw new Error("Expected array delta entry to be an object but got an invalid value"); } const validatedIndex = getAssistantStreamDeltaIndex(deltaEntry, kind, projectedArray.baselineLength); let accumulatedEntry; if (projectedArray.entries.has(validatedIndex)) { accumulatedEntry = projectedArray.entries.get(validatedIndex); - } else if (hasOwn(accumulator, validatedIndex)) { + } else if (hasOwn2(accumulator, validatedIndex)) { accumulatedEntry = accumulator[validatedIndex]; if (accumulatedEntry === null || accumulatedEntry === void 0) { projectedArray.entries.set(validatedIndex, deltaEntry); @@ -15755,7 +33129,7 @@ function assertValidAssistantStreamArrayDelta(accumulator, delta, kind, projecti if (projectedArray.enforceSparseHoleBudget && projectedLength - projectedArray.ownEntryCount > MAX_ASSISTANT_STREAM_ARRAY_GROWTH) { throw new OpenAIError(`Assistant stream delta contains an invalid ${kind} index: ${validatedIndex}`); } - if (isObj(accumulatedEntry)) { + if (isObj2(accumulatedEntry)) { validateRecord(accumulatedEntry, deltaEntry, projection); } projectedArray.length = projectedLength; @@ -15770,7 +33144,7 @@ function assertValidAssistantStreamDeltaIndices(accumulator, delta, projection) let accumulatedValue; if (projectedValues?.has(key)) { accumulatedValue = projectedValues.get(key); - } else if (hasOwn(accumulator, key)) { + } else if (hasOwn2(accumulator, key)) { accumulatedValue = accumulator[key]; } if (accumulatedValue === null || accumulatedValue === void 0) { @@ -15781,7 +33155,7 @@ function assertValidAssistantStreamDeltaIndices(accumulator, delta, projection) projectedValues.set(key, deltaValue); continue; } - if (isObj(accumulatedValue) && isObj(deltaValue)) { + if (isObj2(accumulatedValue) && isObj2(deltaValue)) { assertValidAssistantStreamDeltaIndices(accumulatedValue, deltaValue, projection); } else if (Array.isArray(accumulatedValue) && Array.isArray(deltaValue) && !isPrimitiveAssistantStreamArrayDelta(accumulatedValue, deltaValue)) { assertValidAssistantStreamArrayDelta(accumulatedValue, deltaValue, "array", projection, assertValidAssistantStreamDeltaIndices); @@ -15789,10 +33163,10 @@ function assertValidAssistantStreamDeltaIndices(accumulator, delta, projection) } } function isAssistantStreamValueExternallyMutable(value2) { - return (isObj(value2) || Array.isArray(value2)) && externallyMutableAssistantStreamValues.has(value2); + return (isObj2(value2) || Array.isArray(value2)) && externallyMutableAssistantStreamValues.has(value2); } function markAssistantStreamValueExternallyMutable(value2) { - if (!isObj(value2) && !Array.isArray(value2) || externallyMutableAssistantStreamValues.has(value2)) { + if (!isObj2(value2) && !Array.isArray(value2) || externallyMutableAssistantStreamValues.has(value2)) { return; } externallyMutableAssistantStreamValues.add(value2); @@ -15834,11 +33208,11 @@ function applyAssistantStreamArrayDelta(accumulator, delta, applyRecord) { return; } for (const deltaEntry of delta) { - if (!isObj(deltaEntry)) { + if (!isObj2(deltaEntry)) { throw new Error("Expected array delta entry to be an object but got an invalid value"); } const index = getRequiredAssistantStreamArrayIndex(deltaEntry); - if (hasOwn(accumulator, index)) { + if (hasOwn2(accumulator, index)) { const accumulatedEntry = accumulator[index]; if (accumulatedEntry === null || accumulatedEntry === void 0) { if (externallyMutableAssistantStreamValues.has(accumulator)) { @@ -15859,7 +33233,7 @@ function applyAssistantStreamDelta(accumulator, delta) { if (key === "__proto__" || key === "constructor" || key === "prototype") { throw new OpenAIError(`Assistant stream delta contains an unsafe property: ${key}`); } - if (!hasOwn(accumulator, key)) { + if (!hasOwn2(accumulator, key)) { if (externallyMutable) { markAssistantStreamValueExternallyMutable(deltaValue); } @@ -15882,7 +33256,7 @@ function applyAssistantStreamDelta(accumulator, delta) { accumulatedValue += deltaValue; } else if (typeof accumulatedValue === "number" && typeof deltaValue === "number") { accumulatedValue += deltaValue; - } else if (isObj(accumulatedValue) && isObj(deltaValue)) { + } else if (isObj2(accumulatedValue) && isObj2(deltaValue)) { accumulatedValue = applyAssistantStreamDelta(accumulatedValue, deltaValue); } else if (Array.isArray(accumulatedValue) && Array.isArray(deltaValue)) { applyAssistantStreamArrayDelta(accumulatedValue, deltaValue, applyAssistantStreamDelta); @@ -15895,7 +33269,7 @@ function applyAssistantStreamDelta(accumulator, delta) { return accumulator; } function assertSafeAssistantStreamDelta(value2) { - if (!isObj(value2) && !Array.isArray(value2)) { + if (!isObj2(value2) && !Array.isArray(value2)) { return; } for (const [key, nestedValue] of Object.entries(value2)) { @@ -15924,8 +33298,8 @@ function createAssistantStreamArrayDeltaCommit(accumulator, delta, kind, cacheAr var MAX_ASSISTANT_STREAM_ARRAY_GROWTH, MAX_EXTERNALLY_MUTABLE_ASSISTANT_STREAM_ARRAY_LENGTH, assistantStreamArrayStates, externallyMutableAssistantStreamValues; var init_assistant_stream_delta = __esm({ "node_modules/openai/internal/assistant-stream-delta.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); MAX_ASSISTANT_STREAM_ARRAY_GROWTH = 1024; MAX_EXTERNALLY_MUTABLE_ASSISTANT_STREAM_ARRAY_LENGTH = 65536; assistantStreamArrayStates = /* @__PURE__ */ new WeakMap(); @@ -15965,11 +33339,11 @@ function assertNever2(_x) { var _AssistantStream_instances, _AssistantStream_runStepSnapshots, _AssistantStream_runStepIDOwners, _AssistantStream_activeRunStepID, _AssistantStream_messageSnapshots, _AssistantStream_messageIDOwners, _AssistantStream_messageSnapshot, _AssistantStream_activeMessageID, _AssistantStream_finalRun, _AssistantStream_currentContentIndex, _AssistantStream_currentContent, _AssistantStream_currentToolCallIndex, _AssistantStream_currentToolCall, _AssistantStream_currentEvent, _AssistantStream_currentRunSnapshot, _AssistantStream_currentRunStepSnapshot, _AssistantStream_addEvent, _AssistantStream_endRequest, _AssistantStream_validateRunStepEvent, _AssistantStream_reserveRunStepAlias, _AssistantStream_validateMessageEvent, _AssistantStream_reserveMessageAlias, _AssistantStream_handleMessage, _AssistantStream_handleRunStep, _AssistantStream_emitExposed, _AssistantStream_handleEvent, _AssistantStream_accumulateRunStep, _AssistantStream_accumulateMessage, _AssistantStream_accumulateContent, _AssistantStream_handleRun, AssistantStream; var init_AssistantStream = __esm({ "node_modules/openai/lib/AssistantStream.mjs"() { - init_tslib(); - init_streaming2(); - init_error2(); + init_tslib2(); + init_streaming4(); + init_error4(); init_EventStream(); - init_utils2(); + init_utils4(); init_assistant_stream_delta(); AssistantStream = class _AssistantStream extends EventStream2 { constructor() { @@ -16000,27 +33374,27 @@ var init_AssistantStream = __esm({ }, { onReturn: () => this.abort() }); } /** Restores an assistant stream from events serialized by `toReadableStream()`. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _AssistantStream(); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** Serializes assistant events into a readable stream for transfer to another runtime. */ toReadableStream() { - const stream4 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); } /** Submits tool outputs and starts streaming the continuation of an existing assistant run. */ static createToolAssistantStream(runId, runs, params, options) { @@ -16034,18 +33408,18 @@ var init_AssistantStream = __esm({ async _createToolAssistantStream(run2, runId, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await run2.submitToolOutputs(runId, body, { + const stream5 = await run2.submitToolOutputs(runId, body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** Creates an assistant thread and starts streaming its newly created run. */ static createThreadAssistantStream(params, thread, options) { @@ -16067,28 +33441,28 @@ var init_AssistantStream = __esm({ } /** Returns the most recent raw event, or `undefined` before any event arrives. */ currentEvent() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentEvent, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentEvent, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentEvent, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentEvent, "f"); } /** Returns the latest run snapshot, or `undefined` before a run event arrives. */ currentRun() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentRunSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentRunSnapshot, "f"); } /** Returns the message currently being accumulated, or `undefined` before message creation. */ currentMessageSnapshot() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f"); } /** Returns the run step currently being accumulated, or `undefined` before a step begins. */ currentRunStepSnapshot() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f"); } /** Waits for successful completion and returns the final snapshot of every observed run step. */ async finalRunSteps() { await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")); + return Object.values(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")); } /** * Waits for successful completion and returns the final snapshot of every observed message. @@ -16096,41 +33470,41 @@ var init_AssistantStream = __esm({ */ async finalMessages() { await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")); + return Object.values(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")); } /** Waits for completion and returns the final run, or rejects if no terminal run was received. */ async finalRun() { await this.done(); - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_finalRun, "f")) { throw new Error("Final run was not received."); } - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + return __classPrivateFieldGet2(this, _AssistantStream_finalRun, "f"); } async _createThreadAssistantStream(thread, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await thread.createAndRun(body, { ...options, signal: this.controller.signal }); + const stream5 = await thread.createAndRun(body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } async _createAssistantStream(run2, threadId, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await run2.create(threadId, body, { ...options, signal: this.controller.signal }); + const stream5 = await run2.create(threadId, body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** * Applies an assistant delta to its mutable snapshot, concatenating text and @@ -16140,7 +33514,7 @@ var init_AssistantStream = __esm({ return accumulateAssistantStreamDelta(acc, delta); } _addRun(run2) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "run", run2); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "run", run2); return run2; } async _threadAssistantStream(params, thread, options) { @@ -16168,7 +33542,7 @@ var init_AssistantStream = __esm({ case "thread.message.delta": case "thread.message.completed": case "thread.message.incomplete": { - messageID = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_validateMessageEvent).call(this, stableEvent); + messageID = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_validateMessageEvent).call(this, stableEvent); messageData = stableEvent.data; break; } @@ -16179,21 +33553,21 @@ var init_AssistantStream = __esm({ case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": { - runStepID = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_validateRunStepEvent).call(this, stableEvent); + runStepID = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_validateRunStepEvent).call(this, stableEvent); runStepData = stableEvent.data; break; } } - __classPrivateFieldSet(this, _AssistantStream_currentEvent, exposedEvent, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, exposedEvent); + __classPrivateFieldSet2(this, _AssistantStream_currentEvent, exposedEvent, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, exposedEvent); if (messageID !== void 0 && messageData !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, messageData, messageID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, messageData, messageID); } if (runStepID !== void 0 && runStepData !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, runStepData, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, runStepData, runStepID); } - if (runStepID === void 0 && __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0 && __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"), __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")); + if (runStepID === void 0 && __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0 && __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f"), __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")); } switch (stableEvent.event) { case "thread.created": { @@ -16209,7 +33583,7 @@ var init_AssistantStream = __esm({ case "thread.run.cancelling": case "thread.run.cancelled": case "thread.run.expired": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, stableEvent); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, stableEvent); break; } case "thread.run.step.created": @@ -16222,15 +33596,15 @@ var init_AssistantStream = __esm({ if (runStepID === void 0) { throw new OpenAIError("Received assistant run-step event without a canonical run-step ID"); } - const activeRunStep = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + const activeRunStep = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (activeRunStep) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, activeRunStep, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, activeRunStep, runStepID); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, stableEvent, runStepID); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, stableEvent.data, runStepID); - const retainedRunStep = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, stableEvent, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, stableEvent.data, runStepID); + const retainedRunStep = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (retainedRunStep) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, retainedRunStep, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, retainedRunStep, runStepID); } break; } @@ -16239,21 +33613,21 @@ var init_AssistantStream = __esm({ case "thread.message.delta": case "thread.message.completed": case "thread.message.incomplete": { - if (messageID !== void 0 && __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"), messageID); + if (messageID !== void 0 && __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f"), messageID); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, stableEvent); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, stableEvent); if (messageID !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, stableEvent.data, messageID); - const retainedMessage = __classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[messageID]; + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, stableEvent.data, messageID); + const retainedMessage = __classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")[messageID]; if (retainedMessage) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, retainedMessage, messageID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, retainedMessage, messageID); } } break; } case "error": { - throw new APIError(void 0, stableEvent.data, void 0, void 0); + throw new APIError2(void 0, stableEvent.data, void 0, void 0); } default: { assertNever2(stableEvent); @@ -16263,10 +33637,10 @@ var init_AssistantStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_finalRun, "f")) { throw new Error("Final run has not been received"); } - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + return __classPrivateFieldGet2(this, _AssistantStream_finalRun, "f"); }, _AssistantStream_validateRunStepEvent = function _AssistantStream_validateRunStepEvent2(event) { const descriptor = Object.getOwnPropertyDescriptor(event.data, "id"); const runStepID = descriptor && "value" in descriptor ? descriptor.value : void 0; @@ -16275,39 +33649,39 @@ var init_AssistantStream = __esm({ } if (event.event === "thread.run.step.delta") { const delta = event.data.delta; - if (delta && hasOwn(delta, "id")) { + if (delta && hasOwn2(delta, "id")) { throw new OpenAIError("Run-step deltas must not contain an id field"); } } if (event.event === "thread.run.step.created") { - if (__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0) { - throw new OpenAIError(`Received run-step creation for "${runStepID}" before the active run step "${__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")}" reached a terminal state`); + if (__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0) { + throw new OpenAIError(`Received run-step creation for "${runStepID}" before the active run step "${__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")}" reached a terminal state`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { throw new OpenAIError(`Received run-step creation for run step "${runStepID}", which has already been created`); } - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, runStepID, "f"); - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, runStepID, "f"); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); return runStepID; } - if (__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0) { - if (runStepID !== __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")) { - throw new OpenAIError(`Received ${event.event} for run step "${runStepID}", which does not match the active run step "${__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")}"`); + if (__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0) { + if (runStepID !== __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")) { + throw new OpenAIError(`Received ${event.event} for run step "${runStepID}", which does not match the active run step "${__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")}"`); } return runStepID; } if (event.event === "thread.run.step.delta") { - if (!hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID)) { + if (!hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID)) { throw new OpenAIError("Received a RunStepDelta before creation of a snapshot"); } throw new OpenAIError(`Received run-step delta for "${runStepID}" with no active run step`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { throw new OpenAIError(`Received run-step event for run step "${runStepID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); if (event.event === "thread.run.step.in_progress") { - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, runStepID, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, runStepID, "f"); } return runStepID; }, _AssistantStream_reserveRunStepAlias = function _AssistantStream_reserveRunStepAlias2(data, canonicalID) { @@ -16316,11 +33690,11 @@ var init_AssistantStream = __esm({ if (typeof runStepID !== "string" || runStepID.length === 0) { throw new OpenAIError("Received assistant run-step event with an invalid run-step ID"); } - const owner = __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").get(runStepID); + const owner = __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").get(runStepID); if (owner !== void 0 && owner !== canonicalID) { throw new OpenAIError(`Received run-step creation for run step "${runStepID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, canonicalID); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, canonicalID); }, _AssistantStream_validateMessageEvent = function _AssistantStream_validateMessageEvent2(event) { const descriptor = Object.getOwnPropertyDescriptor(event.data, "id"); const messageID = descriptor && "value" in descriptor ? descriptor.value : void 0; @@ -16328,24 +33702,24 @@ var init_AssistantStream = __esm({ throw new OpenAIError("Received assistant message event with an invalid message ID"); } if (event.event === "thread.message.created") { - if (__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - throw new OpenAIError(`Received message creation for "${messageID}" before the active message "${__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")}" reached a terminal state`); + if (__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + throw new OpenAIError(`Received message creation for "${messageID}" before the active message "${__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")}" reached a terminal state`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f"), messageID) || __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").has(messageID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f"), messageID) || __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").has(messageID)) { throw new OpenAIError(`Received message creation for message "${messageID}", which has already been created`); } - __classPrivateFieldSet(this, _AssistantStream_activeMessageID, messageID, "f"); - __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").set(messageID, messageID); + __classPrivateFieldSet2(this, _AssistantStream_activeMessageID, messageID, "f"); + __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").set(messageID, messageID); return messageID; } - if (!__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { if (event.event === "thread.message.delta") { throw new OpenAIError("Received a delta with no existing snapshot (there should be one from message creation)"); } throw new OpenAIError("Received thread message event with no existing snapshot"); } - if (messageID !== __classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")) { - throw new OpenAIError(`Received ${event.event} for message "${messageID}", which does not match the active message "${__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")}"`); + if (messageID !== __classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")) { + throw new OpenAIError(`Received ${event.event} for message "${messageID}", which does not match the active message "${__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")}"`); } return messageID; }, _AssistantStream_reserveMessageAlias = function _AssistantStream_reserveMessageAlias2(data, canonicalID) { @@ -16354,137 +33728,137 @@ var init_AssistantStream = __esm({ if (typeof messageID !== "string" || messageID.length === 0) { throw new OpenAIError("Received assistant message event with an invalid message ID"); } - const owner = __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").get(messageID); + const owner = __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").get(messageID); if (owner !== void 0 && owner !== canonicalID) { throw new OpenAIError(`Received message creation for message "${messageID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").set(messageID, canonicalID); + __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").set(messageID, canonicalID); }, _AssistantStream_handleMessage = function _AssistantStream_handleMessage2(event) { - const [accumulatedMessage, newContent] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); - if (!__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")) { + const [accumulatedMessage, newContent] = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldSet2(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); + if (!__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")) { throw new OpenAIError("Received thread message event with no active message ID"); } - __classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")] = accumulatedMessage; + __classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")[__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")] = accumulatedMessage; for (const content of newContent) { const snapshotContent = accumulatedMessage.content[content.index]; if (snapshotContent?.type === "text") { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textCreated", snapshotContent.text); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textCreated", snapshotContent.text); } } switch (event.event) { case "thread.message.created": { - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentContent, void 0, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageCreated", event.data); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageCreated", event.data); break; } case "thread.message.in_progress": { break; } case "thread.message.delta": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDelta", event.data.delta, accumulatedMessage); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDelta", event.data.delta, accumulatedMessage); if (event.data.delta.content) { for (const content of event.data.delta.content) { if (content.type === "text" && content.text) { const textDelta = content.text; const snapshot = accumulatedMessage.content[content.index]; if (snapshot && snapshot.type === "text") { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDelta", textDelta, snapshot.text); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDelta", textDelta, snapshot.text); } else { throw new Error("The snapshot associated with this text delta is not text or missing"); } } - if (content.index !== __classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")) { - if (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f")) { - switch (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").type) { + if (content.index !== __classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f")) { + if (__classPrivateFieldGet2(this, _AssistantStream_currentContent, "f")) { + switch (__classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").type) { case "text": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", __classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").text, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } case "image_file": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", __classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").image_file, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } } } - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, content.index, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, content.index, "f"); } - __classPrivateFieldSet(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); } } break; } case "thread.message.completed": case "thread.message.incomplete": { - if (__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f") !== void 0) { - const currentContent = event.data.content[__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")]; + if (__classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f") !== void 0) { + const currentContent = event.data.content[__classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f")]; if (currentContent) { switch (currentContent.type) { case "image_file": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", currentContent.image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", currentContent.image_file, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } case "text": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", currentContent.text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", currentContent.text, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } } } } - if (__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDone", event.data); + if (__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDone", event.data); } - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentContent, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_activeMessageID, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_messageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeMessageID, void 0, "f"); } } }, _AssistantStream_handleRunStep = function _AssistantStream_handleRunStep2(event, runStepID) { - const accumulatedRunStep = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event, runStepID); - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); + const accumulatedRunStep = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event, runStepID); + __classPrivateFieldSet2(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); switch (event.event) { case "thread.run.step.created": { - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepCreated", event.data); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepCreated", event.data); break; } case "thread.run.step.delta": { const delta = event.data.delta; if (delta.step_details && delta.step_details.type === "tool_calls" && delta.step_details.tool_calls && accumulatedRunStep.step_details.type === "tool_calls") { for (const toolCall of delta.step_details.tool_calls) { - if (toolCall.index === __classPrivateFieldGet(this, _AssistantStream_currentToolCallIndex, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); + if (toolCall.index === __classPrivateFieldGet2(this, _AssistantStream_currentToolCallIndex, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); } else { - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallCreated", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallCreated", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } } } } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDelta", event.data.delta, accumulatedRunStep); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDelta", event.data.delta, accumulatedRunStep); break; } case "thread.run.step.completed": case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": { - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, void 0, "f"); const details = event.data.step_details; - if (details.type === "tool_calls" && __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + if (details.type === "tool_calls" && __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDone", event.data, accumulatedRunStep); - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDone", event.data, accumulatedRunStep); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); break; } case "thread.run.step.in_progress": { @@ -16499,39 +33873,39 @@ var init_AssistantStream = __esm({ } this._emit(event, ...args); }, _AssistantStream_handleEvent = function _AssistantStream_handleEvent2(event) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "event", event); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "event", event); }, _AssistantStream_accumulateRunStep = function _AssistantStream_accumulateRunStep2(event, runStepID) { switch (event.event) { case "thread.run.step.created": { - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; return event.data; } case "thread.run.step.delta": { - const snapshot = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + const snapshot = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (!snapshot) { throw new Error("Received a RunStepDelta before creation of a snapshot"); } const delta = event.data.delta; if (delta) { - if (hasOwn(delta, "id")) { + if (hasOwn2(delta, "id")) { throw new OpenAIError("Run-step deltas must not contain an id field"); } const accumulated = accumulateAssistantStreamDelta(snapshot, delta, true); - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = accumulated; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = accumulated; } - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + return __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; } case "thread.run.step.completed": case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": case "thread.run.step.in_progress": { - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; break; } } - if (__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]) { - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + if (__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]) { + return __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; } throw new Error("No snapshot available"); }, _AssistantStream_accumulateMessage = function _AssistantStream_accumulateMessage2(event, snapshot) { @@ -16550,9 +33924,9 @@ var init_AssistantStream = __esm({ const cacheArrays = !isAssistantStreamValueExternallyMutable(snapshot); const commitProjection = createAssistantStreamArrayDeltaCommit(snapshot.content, data.delta.content, "content", cacheArrays); for (const contentElement of data.delta.content) { - if (hasOwn(snapshot.content, contentElement.index)) { + if (hasOwn2(snapshot.content, contentElement.index)) { const currentContent = snapshot.content[contentElement.index]; - snapshot.content[contentElement.index] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent, cacheArrays); + snapshot.content[contentElement.index] = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent, cacheArrays); } else { defineAssistantStreamArrayEntry(snapshot.content, contentElement.index, contentElement); newContent.push(contentElement); @@ -16575,7 +33949,7 @@ var init_AssistantStream = __esm({ }, _AssistantStream_accumulateContent = function _AssistantStream_accumulateContent2(contentElement, currentContent, cacheArrays) { return accumulateAssistantStreamDelta(currentContent, contentElement, cacheArrays); }, _AssistantStream_handleRun = function _AssistantStream_handleRun2(event) { - __classPrivateFieldSet(this, _AssistantStream_currentRunSnapshot, event.data, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentRunSnapshot, event.data, "f"); switch (event.event) { case "thread.run.created": { break; @@ -16592,12 +33966,12 @@ var init_AssistantStream = __esm({ case "thread.run.completed": case "thread.run.expired": case "thread.run.incomplete": { - __classPrivateFieldSet(this, _AssistantStream_finalRun, event.data, "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + __classPrivateFieldSet2(this, _AssistantStream_finalRun, event.data, "f"); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); break; } case "thread.run.cancelling": { @@ -16638,7 +34012,7 @@ function sleepUntilAborted(milliseconds, signal) { settled = true; cleanup(); try { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, @@ -16681,7 +34055,7 @@ function sleepUntilAborted(milliseconds, signal) { }); } async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses, options) { - const headers = buildHeaders([ + const headers = buildHeaders2([ options?.headers, { "X-Stainless-Poll-Helper": "true", @@ -16706,7 +34080,7 @@ async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses } } const signal = options && Object.prototype.propertyIsEnumerable.call(options, "signal") ? options.signal : void 0; - await (signal ? sleepUntilAborted(sleepInterval, signal) : sleep(sleepInterval)); + await (signal ? sleepUntilAborted(sleepInterval, signal) : sleep2(sleepInterval)); } else if (terminalStatuses.includes(status)) { return data; } @@ -16714,9 +34088,9 @@ async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses } var init_polling = __esm({ "node_modules/openai/lib/polling.mjs"() { - init_error(); - init_headers2(); - init_sleep(); + init_error3(); + init_headers3(); + init_sleep2(); } }); @@ -16737,26 +34111,26 @@ var init_assistant_run_polling = __esm({ var Runs; var init_runs = __esm({ "node_modules/openai/resources/beta/threads/runs/runs.mjs"() { - init_resource(); + init_resource2(); init_steps(); init_steps(); - init_pagination(); - init_headers2(); + init_pagination2(); + init_headers3(); init_AssistantStream(); init_assistant_run_polling(); - init_path(); - Runs = class extends APIResource { + init_path2(); + Runs = class extends APIResource2 { constructor() { super(...arguments); this.steps = new Steps(this._client); } create(threadID, params, options) { const { include, ...body } = params; - return this._client.post(path`/threads/${threadID}/runs`, { + return this._client.post(path3`/threads/${threadID}/runs`, { query: { include }, body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: params.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16769,9 +34143,9 @@ var init_runs = __esm({ */ retrieve(runID, params, options) { const { thread_id } = params; - return this._client.get(path`/threads/${thread_id}/runs/${runID}`, { + return this._client.get(path3`/threads/${thread_id}/runs/${runID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16782,10 +34156,10 @@ var init_runs = __esm({ */ update(runID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16795,10 +34169,10 @@ var init_runs = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ list(threadID, query = {}, options) { - return this._client.getAPIList(path`/threads/${threadID}/runs`, CursorPage, { + return this._client.getAPIList(path3`/threads/${threadID}/runs`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16809,9 +34183,9 @@ var init_runs = __esm({ */ cancel(runID, params, options) { const { thread_id } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}/cancel`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16848,10 +34222,10 @@ var init_runs = __esm({ } submitToolOutputs(runID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: params.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16880,22 +34254,22 @@ var init_runs = __esm({ }); // node_modules/openai/resources/beta/threads/threads.mjs -var Threads2; -var init_threads2 = __esm({ +var Threads3; +var init_threads3 = __esm({ "node_modules/openai/resources/beta/threads/threads.mjs"() { - init_resource(); - init_messages2(); - init_messages2(); + init_resource2(); + init_messages4(); + init_messages4(); init_runs(); init_runs(); - init_headers2(); + init_headers3(); init_AssistantStream(); - init_path(); - Threads2 = class extends APIResource { + init_path2(); + Threads3 = class extends APIResource2 { constructor() { super(...arguments); this.runs = new Runs(this._client); - this.messages = new Messages2(this._client); + this.messages = new Messages4(this._client); } /** * Create a thread. @@ -16906,7 +34280,7 @@ var init_threads2 = __esm({ return this._client.post("/threads", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16916,9 +34290,9 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ retrieve(threadID, options) { - return this._client.get(path`/threads/${threadID}`, { + return this._client.get(path3`/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16928,10 +34302,10 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ update(threadID, body, options) { - return this._client.post(path`/threads/${threadID}`, { + return this._client.post(path3`/threads/${threadID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16941,9 +34315,9 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ delete(threadID, options) { - return this._client.delete(path`/threads/${threadID}`, { + return this._client.delete(path3`/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16951,7 +34325,7 @@ var init_threads2 = __esm({ return this._client.post("/threads/runs", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: body.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16973,54 +34347,54 @@ var init_threads2 = __esm({ return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options); } }; - Threads2.Runs = Runs; - Threads2.Messages = Messages2; + Threads3.Runs = Runs; + Threads3.Messages = Messages4; } }); // node_modules/openai/resources/beta/beta.mjs -var Beta; -var init_beta = __esm({ +var Beta2; +var init_beta2 = __esm({ "node_modules/openai/resources/beta/beta.mjs"() { - init_resource(); + init_resource2(); init_assistants(); init_assistants(); init_realtime(); init_realtime(); - init_agents(); - init_agents(); + init_agents2(); + init_agents2(); init_chatkit(); init_chatkit(); init_responses(); init_responses(); - init_threads2(); - init_threads2(); - Beta = class extends APIResource { + init_threads3(); + init_threads3(); + Beta2 = class extends APIResource2 { constructor() { super(...arguments); this.realtime = new Realtime(this._client); - this.agents = new Agents(this._client); + this.agents = new Agents2(this._client); this.responses = new Responses(this._client); this.chatkit = new ChatKit(this._client); this.assistants = new Assistants(this._client); - this.threads = new Threads2(this._client); + this.threads = new Threads3(this._client); } }; - Beta.Realtime = Realtime; - Beta.Agents = Agents; - Beta.Responses = Responses; - Beta.ChatKit = ChatKit; - Beta.Assistants = Assistants; - Beta.Threads = Threads2; + Beta2.Realtime = Realtime; + Beta2.Agents = Agents2; + Beta2.Responses = Responses; + Beta2.ChatKit = ChatKit; + Beta2.Assistants = Assistants; + Beta2.Threads = Threads3; } }); // node_modules/openai/resources/completions.mjs -var Completions2; -var init_completions3 = __esm({ +var Completions3; +var init_completions4 = __esm({ "node_modules/openai/resources/completions.mjs"() { - init_resource(); - Completions2 = class extends APIResource { + init_resource2(); + Completions3 = class extends APIResource2 { create(body, options) { return this._client.post("/completions", { body, @@ -17037,18 +34411,18 @@ var init_completions3 = __esm({ var Content; var init_content = __esm({ "node_modules/openai/resources/containers/files/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content = class extends APIResource2 { /** * Retrieve Container File Content */ retrieve(fileID, params, options) { const { container_id } = params; - return this._client.get(path`/containers/${container_id}/files/${fileID}/content`, { + return this._client.get(path3`/containers/${container_id}/files/${fileID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -17058,17 +34432,17 @@ var init_content = __esm({ }); // node_modules/openai/resources/containers/files/files.mjs -var Files2; -var init_files2 = __esm({ +var Files4; +var init_files4 = __esm({ "node_modules/openai/resources/containers/files/files.mjs"() { - init_resource(); + init_resource2(); init_content(); init_content(); - init_pagination(); - init_headers2(); - init_uploads(); - init_path(); - Files2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_uploads3(); + init_path2(); + Files4 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content(this._client); @@ -17080,14 +34454,14 @@ var init_files2 = __esm({ * a JSON request with a file ID. */ create(containerID, body, options) { - return this._client.post(path`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Retrieve Container File */ retrieve(fileID, params, options) { const { container_id } = params; - return this._client.get(path`/containers/${container_id}/files/${fileID}`, { + return this._client.get(path3`/containers/${container_id}/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); @@ -17096,7 +34470,7 @@ var init_files2 = __esm({ * List Container files */ list(containerID, query = {}, options) { - return this._client.getAPIList(path`/containers/${containerID}/files`, CursorPage, { + return this._client.getAPIList(path3`/containers/${containerID}/files`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -17107,14 +34481,14 @@ var init_files2 = __esm({ */ delete(fileID, params, options) { const { container_id } = params; - return this._client.delete(path`/containers/${container_id}/files/${fileID}`, { + return this._client.delete(path3`/containers/${container_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Files2.Content = Content; + Files4.Content = Content; } }); @@ -17122,16 +34496,16 @@ var init_files2 = __esm({ var Containers; var init_containers = __esm({ "node_modules/openai/resources/containers/containers.mjs"() { - init_resource(); - init_files2(); - init_files2(); - init_pagination(); - init_headers2(); - init_path(); - Containers = class extends APIResource { + init_resource2(); + init_files4(); + init_files4(); + init_pagination2(); + init_headers3(); + init_path2(); + Containers = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files2(this._client); + this.files = new Files4(this._client); } /** * Create Container @@ -17143,7 +34517,7 @@ var init_containers = __esm({ * Retrieve Container */ retrieve(containerID, options) { - return this._client.get(path`/containers/${containerID}`, { + return this._client.get(path3`/containers/${containerID}`, { ...options, __security: { bearerAuth: true } }); @@ -17162,14 +34536,14 @@ var init_containers = __esm({ * Delete Container */ delete(containerID, options) { - return this._client.delete(path`/containers/${containerID}`, { + return this._client.delete(path3`/containers/${containerID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Containers.Files = Files2; + Containers.Files = Files4; } }); @@ -17177,9 +34551,9 @@ var init_containers = __esm({ var ContentProvenanceChecks; var init_content_provenance_checks = __esm({ "node_modules/openai/resources/content-provenance-checks.mjs"() { - init_resource(); - init_uploads(); - ContentProvenanceChecks = class extends APIResource { + init_resource2(); + init_uploads3(); + ContentProvenanceChecks = class extends APIResource2 { /** * Check whether an image or audio file contains known OpenAI provenance signals. * [Learn more about content provenance](https://developers.openai.com/api/docs/guides/content-provenance). @@ -17192,7 +34566,7 @@ var init_content_provenance_checks = __esm({ * company's model, which the tool currently does not detect. */ create(body, options) { - return this._client.post("/content_provenance_checks", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/content_provenance_checks", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -17202,16 +34576,16 @@ var init_content_provenance_checks = __esm({ var Items4; var init_items4 = __esm({ "node_modules/openai/resources/conversations/items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Items4 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Items4 = class extends APIResource2 { /** * Create items in a conversation with the given ID. */ create(conversationID, params, options) { const { include, ...body } = params; - return this._client.post(path`/conversations/${conversationID}/items`, { + return this._client.post(path3`/conversations/${conversationID}/items`, { query: { include }, body, ...options, @@ -17223,7 +34597,7 @@ var init_items4 = __esm({ */ retrieve(itemID, params, options) { const { conversation_id, ...query } = params; - return this._client.get(path`/conversations/${conversation_id}/items/${itemID}`, { + return this._client.get(path3`/conversations/${conversation_id}/items/${itemID}`, { query, ...options, __security: { bearerAuth: true } @@ -17233,14 +34607,14 @@ var init_items4 = __esm({ * List all items for a conversation with the given ID. */ list(conversationID, query = {}, options) { - return this._client.getAPIList(path`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } }); } /** * Delete an item from a conversation with the given IDs. */ delete(itemID, params, options) { const { conversation_id } = params; - return this._client.delete(path`/conversations/${conversation_id}/items/${itemID}`, { + return this._client.delete(path3`/conversations/${conversation_id}/items/${itemID}`, { ...options, __security: { bearerAuth: true } }); @@ -17253,11 +34627,11 @@ var init_items4 = __esm({ var Conversations; var init_conversations = __esm({ "node_modules/openai/resources/conversations/conversations.mjs"() { - init_resource(); + init_resource2(); init_items4(); init_items4(); - init_path(); - Conversations = class extends APIResource { + init_path2(); + Conversations = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items4(this._client); @@ -17272,7 +34646,7 @@ var init_conversations = __esm({ * Get a conversation */ retrieve(conversationID, options) { - return this._client.get(path`/conversations/${conversationID}`, { + return this._client.get(path3`/conversations/${conversationID}`, { ...options, __security: { bearerAuth: true } }); @@ -17281,7 +34655,7 @@ var init_conversations = __esm({ * Update a conversation */ update(conversationID, body, options) { - return this._client.post(path`/conversations/${conversationID}`, { + return this._client.post(path3`/conversations/${conversationID}`, { body, ...options, __security: { bearerAuth: true } @@ -17291,7 +34665,7 @@ var init_conversations = __esm({ * Delete a conversation. Items in the conversation will not be deleted. */ delete(conversationID, options) { - return this._client.delete(path`/conversations/${conversationID}`, { + return this._client.delete(path3`/conversations/${conversationID}`, { ...options, __security: { bearerAuth: true } }); @@ -17306,7 +34680,7 @@ function createEmbedding(client, body, options) { const hasUserProvidedEncodingFormat = !!body.encoding_format; const encodingFormat = hasUserProvidedEncodingFormat ? body.encoding_format : "base64"; if (hasUserProvidedEncodingFormat) { - loggerFor(client).debug("embeddings/user defined encoding_format:", body.encoding_format); + loggerFor2(client).debug("embeddings/user defined encoding_format:", body.encoding_format); } const optimizedBody = { ...body, encoding_format: encodingFormat }; const requestOptions = { @@ -17318,7 +34692,7 @@ function createEmbedding(client, body, options) { if (hasUserProvidedEncodingFormat) { return response; } - loggerFor(client).debug("embeddings/decoding base64 embeddings from base64"); + loggerFor2(client).debug("embeddings/decoding base64 embeddings from base64"); return response._thenUnwrap((data) => { const embeddings = data?.data; if (embeddings !== void 0) { @@ -17342,7 +34716,7 @@ function createEmbedding(client, body, options) { } var init_embeddings = __esm({ "node_modules/openai/lib/embeddings.mjs"() { - init_utils2(); + init_utils4(); } }); @@ -17350,9 +34724,9 @@ var init_embeddings = __esm({ var Embeddings; var init_embeddings2 = __esm({ "node_modules/openai/resources/embeddings.mjs"() { - init_resource(); + init_resource2(); init_embeddings(); - Embeddings = class extends APIResource { + Embeddings = class extends APIResource2 { create(body, options) { return createEmbedding(this._client, body, options); } @@ -17364,16 +34738,16 @@ var init_embeddings2 = __esm({ var OutputItems; var init_output_items = __esm({ "node_modules/openai/resources/evals/runs/output-items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - OutputItems = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + OutputItems = class extends APIResource2 { /** * Get an evaluation run output item by ID. */ retrieve(outputItemID, params, options) { const { eval_id, run_id } = params; - return this._client.get(path`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, { + return this._client.get(path3`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, { ...options, __security: { bearerAuth: true } }); @@ -17383,7 +34757,7 @@ var init_output_items = __esm({ */ list(runID, params, options) { const { eval_id, ...query } = params; - return this._client.getAPIList(path`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -17393,12 +34767,12 @@ var init_output_items = __esm({ var Runs2; var init_runs2 = __esm({ "node_modules/openai/resources/evals/runs/runs.mjs"() { - init_resource(); + init_resource2(); init_output_items(); init_output_items(); - init_pagination(); - init_path(); - Runs2 = class extends APIResource { + init_pagination2(); + init_path2(); + Runs2 = class extends APIResource2 { constructor() { super(...arguments); this.outputItems = new OutputItems(this._client); @@ -17409,7 +34783,7 @@ var init_runs2 = __esm({ * schema specified in the config of the evaluation. */ create(evalID, body, options) { - return this._client.post(path`/evals/${evalID}/runs`, { + return this._client.post(path3`/evals/${evalID}/runs`, { body, ...options, __security: { bearerAuth: true } @@ -17420,7 +34794,7 @@ var init_runs2 = __esm({ */ retrieve(runID, params, options) { const { eval_id } = params; - return this._client.get(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.get(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17429,7 +34803,7 @@ var init_runs2 = __esm({ * Get a list of runs for an evaluation. */ list(evalID, query = {}, options) { - return this._client.getAPIList(path`/evals/${evalID}/runs`, CursorPage, { + return this._client.getAPIList(path3`/evals/${evalID}/runs`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -17440,7 +34814,7 @@ var init_runs2 = __esm({ */ delete(runID, params, options) { const { eval_id } = params; - return this._client.delete(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.delete(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17450,7 +34824,7 @@ var init_runs2 = __esm({ */ cancel(runID, params, options) { const { eval_id } = params; - return this._client.post(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.post(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17464,12 +34838,12 @@ var init_runs2 = __esm({ var Evals; var init_evals = __esm({ "node_modules/openai/resources/evals/evals.mjs"() { - init_resource(); + init_resource2(); init_runs2(); init_runs2(); - init_pagination(); - init_path(); - Evals = class extends APIResource { + init_pagination2(); + init_path2(); + Evals = class extends APIResource2 { constructor() { super(...arguments); this.runs = new Runs2(this._client); @@ -17489,13 +34863,13 @@ var init_evals = __esm({ * Get an evaluation by ID. */ retrieve(evalID, options) { - return this._client.get(path`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } /** * Update certain properties of an evaluation. */ update(evalID, body, options) { - return this._client.post(path`/evals/${evalID}`, { body, ...options, __security: { bearerAuth: true } }); + return this._client.post(path3`/evals/${evalID}`, { body, ...options, __security: { bearerAuth: true } }); } /** * List evaluations for a project. @@ -17511,7 +34885,7 @@ var init_evals = __esm({ * Delete an evaluation. */ delete(evalID, options) { - return this._client.delete(path`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } }; Evals.Runs = Runs2; @@ -17524,10 +34898,10 @@ async function waitForFileProcessing(resource, id, pollInterval, maxWait) { const start = performance.now(); let file2 = await resource.retrieve(id); while (!file2.status || !terminalStates.has(file2.status)) { - await sleep(pollInterval); + await sleep2(pollInterval); file2 = await resource.retrieve(id); if (performance.now() - start > maxWait) { - throw new APIConnectionTimeoutError({ + throw new APIConnectionTimeoutError2({ message: `Giving up on waiting for file ${id} to finish processing after ${maxWait} milliseconds.` }); } @@ -17536,22 +34910,22 @@ async function waitForFileProcessing(resource, id, pollInterval, maxWait) { } var init_file_processing = __esm({ "node_modules/openai/lib/file-processing.mjs"() { - init_error2(); - init_sleep(); + init_error4(); + init_sleep2(); } }); // node_modules/openai/resources/files.mjs -var Files3; -var init_files3 = __esm({ +var Files5; +var init_files5 = __esm({ "node_modules/openai/resources/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_uploads(); + init_resource2(); + init_pagination2(); + init_headers3(); + init_uploads3(); init_file_processing(); - init_path(); - Files3 = class extends APIResource { + init_path2(); + Files5 = class extends APIResource2 { /** * Upload a file that can be used across various endpoints. Individual files can be * up to 512 MB, and each project can store up to 2.5 TB of files in total. There @@ -17582,13 +34956,13 @@ var init_files3 = __esm({ * storage limits. */ create(body, options) { - return this._client.post("/files", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/files", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Returns information about a specific file. */ retrieve(fileID, options) { - return this._client.get(path`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } /** * Returns a list of files. @@ -17604,15 +34978,15 @@ var init_files3 = __esm({ * Delete a file and remove it from all vector stores. */ delete(fileID, options) { - return this._client.delete(path`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } /** * Returns a response containing the contents of the specified file. */ content(fileID, options) { - return this._client.get(path`/files/${fileID}/content`, { + return this._client.get(path3`/files/${fileID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -17631,8 +35005,8 @@ var init_files3 = __esm({ var Methods; var init_methods = __esm({ "node_modules/openai/resources/fine-tuning/methods.mjs"() { - init_resource(); - Methods = class extends APIResource { + init_resource2(); + Methods = class extends APIResource2 { }; } }); @@ -17641,8 +35015,8 @@ var init_methods = __esm({ var Graders; var init_graders = __esm({ "node_modules/openai/resources/fine-tuning/alpha/graders.mjs"() { - init_resource(); - Graders = class extends APIResource { + init_resource2(); + Graders = class extends APIResource2 { /** * Run a grader. * @@ -17699,10 +35073,10 @@ var init_graders = __esm({ var Alpha; var init_alpha = __esm({ "node_modules/openai/resources/fine-tuning/alpha/alpha.mjs"() { - init_resource(); + init_resource2(); init_graders(); init_graders(); - Alpha = class extends APIResource { + Alpha = class extends APIResource2 { constructor() { super(...arguments); this.graders = new Graders(this._client); @@ -17716,10 +35090,10 @@ var init_alpha = __esm({ var Permissions; var init_permissions = __esm({ "node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Permissions = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Permissions = class extends APIResource2 { /** * **NOTE:** Calling this endpoint requires an * [admin API key](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys). @@ -17739,7 +35113,7 @@ var init_permissions = __esm({ * ``` */ create(fineTunedModelCheckpoint, body, options) { - return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } /** * **NOTE:** This endpoint requires an @@ -17751,7 +35125,7 @@ var init_permissions = __esm({ * @deprecated Retrieve is deprecated. Please swap to the paginated list method instead. */ retrieve(fineTunedModelCheckpoint, query = {}, options) { - return this._client.get(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { + return this._client.get(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -17775,7 +35149,7 @@ var init_permissions = __esm({ * ``` */ list(fineTunedModelCheckpoint, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * **NOTE:** This endpoint requires an @@ -17798,7 +35172,7 @@ var init_permissions = __esm({ */ delete(permissionID, params, options) { const { fine_tuned_model_checkpoint } = params; - return this._client.delete(path`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, { ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.delete(path3`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -17808,10 +35182,10 @@ var init_permissions = __esm({ var Checkpoints; var init_checkpoints = __esm({ "node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs"() { - init_resource(); + init_resource2(); init_permissions(); init_permissions(); - Checkpoints = class extends APIResource { + Checkpoints = class extends APIResource2 { constructor() { super(...arguments); this.permissions = new Permissions(this._client); @@ -17825,10 +35199,10 @@ var init_checkpoints = __esm({ var Checkpoints2; var init_checkpoints2 = __esm({ "node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Checkpoints2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Checkpoints2 = class extends APIResource2 { /** * List checkpoints for a fine-tuning job. * @@ -17843,7 +35217,7 @@ var init_checkpoints2 = __esm({ * ``` */ list(fineTuningJobID, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -17853,12 +35227,12 @@ var init_checkpoints2 = __esm({ var Jobs; var init_jobs = __esm({ "node_modules/openai/resources/fine-tuning/jobs/jobs.mjs"() { - init_resource(); + init_resource2(); init_checkpoints2(); init_checkpoints2(); - init_pagination(); - init_path(); - Jobs = class extends APIResource { + init_pagination2(); + init_path2(); + Jobs = class extends APIResource2 { constructor() { super(...arguments); this.checkpoints = new Checkpoints2(this._client); @@ -17896,7 +35270,7 @@ var init_jobs = __esm({ * ``` */ retrieve(fineTuningJobID, options) { - return this._client.get(path`/fine_tuning/jobs/${fineTuningJobID}`, { + return this._client.get(path3`/fine_tuning/jobs/${fineTuningJobID}`, { ...options, __security: { bearerAuth: true } }); @@ -17930,7 +35304,7 @@ var init_jobs = __esm({ * ``` */ cancel(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/cancel`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -17949,7 +35323,7 @@ var init_jobs = __esm({ * ``` */ listEvents(fineTuningJobID, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } /** * Pause a fine-tune job. @@ -17962,7 +35336,7 @@ var init_jobs = __esm({ * ``` */ pause(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/pause`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/pause`, { ...options, __security: { bearerAuth: true } }); @@ -17978,7 +35352,7 @@ var init_jobs = __esm({ * ``` */ resume(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/resume`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/resume`, { ...options, __security: { bearerAuth: true } }); @@ -17992,7 +35366,7 @@ var init_jobs = __esm({ var FineTuning; var init_fine_tuning = __esm({ "node_modules/openai/resources/fine-tuning/fine-tuning.mjs"() { - init_resource(); + init_resource2(); init_methods(); init_methods(); init_alpha(); @@ -18001,7 +35375,7 @@ var init_fine_tuning = __esm({ init_checkpoints(); init_jobs(); init_jobs(); - FineTuning = class extends APIResource { + FineTuning = class extends APIResource2 { constructor() { super(...arguments); this.methods = new Methods(this._client); @@ -18021,8 +35395,8 @@ var init_fine_tuning = __esm({ var GraderModels; var init_grader_models = __esm({ "node_modules/openai/resources/graders/grader-models.mjs"() { - init_resource(); - GraderModels = class extends APIResource { + init_resource2(); + GraderModels = class extends APIResource2 { }; } }); @@ -18031,10 +35405,10 @@ var init_grader_models = __esm({ var Graders2; var init_graders2 = __esm({ "node_modules/openai/resources/graders/graders.mjs"() { - init_resource(); + init_resource2(); init_grader_models(); init_grader_models(); - Graders2 = class extends APIResource { + Graders2 = class extends APIResource2 { constructor() { super(...arguments); this.graderModels = new GraderModels(this._client); @@ -18048,9 +35422,9 @@ var init_graders2 = __esm({ var Images; var init_images = __esm({ "node_modules/openai/resources/images.mjs"() { - init_resource(); - init_uploads(); - Images = class extends APIResource { + init_resource2(); + init_uploads3(); + Images = class extends APIResource2 { /** * Creates a variation of a given image. This endpoint only supports `dall-e-2`. * @@ -18062,10 +35436,10 @@ var init_images = __esm({ * ``` */ createVariation(body, options) { - return this._client.post("/images/variations", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/images/variations", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } edit(body, options) { - return this._client.post("/images/edits", multipartFormRequestOptions({ + return this._client.post("/images/edits", multipartFormRequestOptions2({ body, ...options, stream: body.stream ?? false, @@ -18086,13 +35460,13 @@ var init_images = __esm({ }); // node_modules/openai/resources/live/sessions.mjs -var Sessions4; -var init_sessions4 = __esm({ +var Sessions5; +var init_sessions5 = __esm({ "node_modules/openai/resources/live/sessions.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Sessions4 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Sessions5 = class extends APIResource2 { /** * Accept an incoming SIP call. Supply session with type live, the model, and * startup configuration. Before accepting calls, follow the @@ -18108,10 +35482,10 @@ var init_sessions4 = __esm({ * ``` */ accept(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/accept`, { + return this._client.post(path3`/live/sessions/${sessionID}/accept`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18128,9 +35502,9 @@ var init_sessions4 = __esm({ * ``` */ downloadRecording(sessionID, options) { - return this._client.get(path`/live/sessions/${sessionID}/content`, { + return this._client.get(path3`/live/sessions/${sessionID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -18147,7 +35521,7 @@ var init_sessions4 = __esm({ * ``` */ fork(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/fork`, { + return this._client.post(path3`/live/sessions/${sessionID}/fork`, { body, ...options, __security: { bearerAuth: true } @@ -18162,9 +35536,9 @@ var init_sessions4 = __esm({ * ``` */ hangup(sessionID, options) { - return this._client.post(path`/live/sessions/${sessionID}/hangup`, { + return this._client.post(path3`/live/sessions/${sessionID}/hangup`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18180,10 +35554,10 @@ var init_sessions4 = __esm({ * ``` */ refer(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/refer`, { + return this._client.post(path3`/live/sessions/${sessionID}/refer`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18199,10 +35573,10 @@ var init_sessions4 = __esm({ * ``` */ reject(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/reject`, { + return this._client.post(path3`/live/sessions/${sessionID}/reject`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18214,8 +35588,8 @@ var init_sessions4 = __esm({ var Forks; var init_forks = __esm({ "node_modules/openai/resources/live/forks/forks.mjs"() { - init_resource(); - Forks = class extends APIResource { + init_resource2(); + Forks = class extends APIResource2 { }; } }); @@ -18224,8 +35598,8 @@ var init_forks = __esm({ var Sideband; var init_sideband = __esm({ "node_modules/openai/resources/live/sideband/sideband.mjs"() { - init_resource(); - Sideband = class extends APIResource { + init_resource2(); + Sideband = class extends APIResource2 { }; } }); @@ -18234,19 +35608,19 @@ var init_sideband = __esm({ var Live; var init_live = __esm({ "node_modules/openai/resources/live/live.mjs"() { - init_resource(); - init_sessions4(); - init_sessions4(); + init_resource2(); + init_sessions5(); + init_sessions5(); init_forks(); init_forks(); init_sideband(); init_sideband(); - Live = class extends APIResource { + Live = class extends APIResource2 { constructor() { super(...arguments); this.sideband = new Sideband(this._client); this.forks = new Forks(this._client); - this.sessions = new Sessions4(this._client); + this.sessions = new Sessions5(this._client); } /** * Create a Live WebRTC session. Start with the @@ -18266,38 +35640,38 @@ var init_live = __esm({ }; Live.Sideband = Sideband; Live.Forks = Forks; - Live.Sessions = Sessions4; + Live.Sessions = Sessions5; } }); // node_modules/openai/resources/models.mjs -var Models; -var init_models2 = __esm({ +var Models3; +var init_models4 = __esm({ "node_modules/openai/resources/models.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Models = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Models3 = class extends APIResource2 { /** * Retrieves a model instance, providing basic information about the model such as * the owner and permissioning. */ retrieve(model2, options) { - return this._client.get(path`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); } /** * Lists the currently available models, and provides basic information about each * one such as the owner and availability. */ list(options) { - return this._client.getAPIList("/models", Page, { ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList("/models", Page2, { ...options, __security: { bearerAuth: true } }); } /** * Delete a fine-tuned model. You must have the Owner role in your organization to * delete a model. */ delete(model2, options) { - return this._client.delete(path`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); } }; } @@ -18307,8 +35681,8 @@ var init_models2 = __esm({ var Moderations; var init_moderations = __esm({ "node_modules/openai/resources/moderations.mjs"() { - init_resource(); - Moderations = class extends APIResource { + init_resource2(); + Moderations = class extends APIResource2 { /** * Classifies if text and/or image inputs are potentially harmful. Learn more in * the @@ -18334,7 +35708,7 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra return { ...options, body: value2, - headers: buildHeaders([options.headers, { "content-type": encodings[rawBodyField].content_type }]) + headers: buildHeaders2([options.headers, { "content-type": encodings[rawBodyField].content_type }]) }; } const encoded = []; @@ -18345,10 +35719,10 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra const data = encoding.json ? JSON.stringify(value2) : value2; if (typeof data !== "string") throw new TypeError(`Multipart field ${name} must encode as a string`); - encoded.push([name, makeFile([data], "", { type: encoding.content_type })]); + encoded.push([name, makeFile2([data], "", { type: encoding.content_type })]); delete body[name]; } - const multipart = await multipartFormRequestOptions({ ...options, body }, client); + const multipart = await multipartFormRequestOptions2({ ...options, body }, client); const form = multipart.body; if (!(form instanceof FormData)) { await form.cancel(); @@ -18359,13 +35733,13 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra return { ...options, body: form, - headers: buildHeaders([options.headers, { "content-type": null }]) + headers: buildHeaders2([options.headers, { "content-type": null }]) }; } var init_multipart_encoding = __esm({ "node_modules/openai/internal/multipart-encoding.mjs"() { - init_uploads(); - init_headers2(); + init_uploads3(); + init_headers3(); } }); @@ -18373,11 +35747,11 @@ var init_multipart_encoding = __esm({ var Calls; var init_calls = __esm({ "node_modules/openai/resources/realtime/calls.mjs"() { - init_resource(); - init_headers2(); - init_path(); + init_resource2(); + init_headers3(); + init_path2(); init_multipart_encoding(); - Calls = class extends APIResource { + Calls = class extends APIResource2 { /** * Create a new Realtime API call over WebRTC and receive the SDP answer needed to * complete the peer connection. @@ -18393,7 +35767,7 @@ var init_calls = __esm({ return this._client.post("/realtime/calls", encodedMultipartFormRequestOptions({ body, ...options, - headers: buildHeaders([{ Accept: "application/sdp" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/sdp" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }, this._client, { @@ -18413,10 +35787,10 @@ var init_calls = __esm({ * ``` */ accept(callID, body, options) { - return this._client.post(path`/realtime/calls/${callID}/accept`, { + return this._client.post(path3`/realtime/calls/${callID}/accept`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18429,9 +35803,9 @@ var init_calls = __esm({ * ``` */ hangup(callID, options) { - return this._client.post(path`/realtime/calls/${callID}/hangup`, { + return this._client.post(path3`/realtime/calls/${callID}/hangup`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18446,10 +35820,10 @@ var init_calls = __esm({ * ``` */ refer(callID, body, options) { - return this._client.post(path`/realtime/calls/${callID}/refer`, { + return this._client.post(path3`/realtime/calls/${callID}/refer`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18462,10 +35836,10 @@ var init_calls = __esm({ * ``` */ reject(callID, body = {}, options) { - return this._client.post(path`/realtime/calls/${callID}/reject`, { + return this._client.post(path3`/realtime/calls/${callID}/reject`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18477,8 +35851,8 @@ var init_calls = __esm({ var ClientSecrets; var init_client_secrets = __esm({ "node_modules/openai/resources/realtime/client-secrets.mjs"() { - init_resource(); - ClientSecrets = class extends APIResource { + init_resource2(); + ClientSecrets = class extends APIResource2 { /** * Create a Realtime client secret with an associated session configuration. * @@ -18517,12 +35891,12 @@ var init_client_secrets = __esm({ var Realtime2; var init_realtime2 = __esm({ "node_modules/openai/resources/realtime/realtime.mjs"() { - init_resource(); + init_resource2(); init_calls(); init_calls(); init_client_secrets(); init_client_secrets(); - Realtime2 = class extends APIResource { + Realtime2 = class extends APIResource2 { constructor() { super(...arguments); this.clientSecrets = new ClientSecrets(this._client); @@ -18667,8 +36041,8 @@ function addOutputText(rsp) { } var init_ResponsesParser = __esm({ "node_modules/openai/lib/ResponsesParser.mjs"() { - init_error2(); - init_parser(); + init_error4(); + init_parser3(); } }); @@ -18856,7 +36230,7 @@ var init_canonical_output_text = __esm({ // node_modules/openai/internal/responses/response-accumulator.mjs function validateArrayIndex(collection, index, kind, allowAppend = false) { - if (!Array.isArray(collection) || !Number.isSafeInteger(index) || index < 0 || index > collection.length || (index === collection.length ? !allowAppend || index in collection : !hasOwn(collection, index))) { + if (!Array.isArray(collection) || !Number.isSafeInteger(index) || index < 0 || index > collection.length || (index === collection.length ? !allowAppend || index in collection : !hasOwn2(collection, index))) { throw new OpenAIError(`missing ${kind} at index ${index}`); } } @@ -18878,12 +36252,12 @@ function hasRoutedOutputCallIdentity(output) { return output.type === "function_call" || output.type === "custom_tool_call" || output.type === "shell_call" || output.type === "shell_call_output"; } function getOutputItemIdentityKeys(output, eventType) { - if (!hasOwn(output, "type") || typeof output.type !== "string") { + if (!hasOwn2(output, "type") || typeof output.type !== "string") { throw new OpenAIError(`expected an own output item type for ${eventType}`); } const optionalPlatformID = output.type === "function_call" || output.type === "custom_tool_call"; const identities = []; - if (hasOwn(output, "id")) { + if (hasOwn2(output, "id")) { if (typeof output.id !== "string" || output.id.length === 0) { throw new OpenAIError(`expected a non-empty output item id for ${eventType}`); } @@ -18892,7 +36266,7 @@ function getOutputItemIdentityKeys(output, eventType) { throw new OpenAIError(`expected a non-empty output item id for ${eventType}`); } if (hasRoutedOutputCallIdentity(output)) { - if (!hasOwn(output, "call_id") || typeof output.call_id !== "string" || output.call_id.length === 0) { + if (!hasOwn2(output, "call_id") || typeof output.call_id !== "string" || output.call_id.length === 0) { throw new OpenAIError(`expected a non-empty output item call_id for ${eventType}`); } identities.push(`call:${output.type}:${output.call_id}`); @@ -18955,11 +36329,11 @@ function validateCompletedOutputItemIdentity(event, snapshot) { const replacement = event.item; getOutputItemIdentityKeys(output, event.type); getOutputItemIdentityKeys(replacement, event.type); - if (!hasOwn(replacement, "type") || output.type !== replacement.type) { + if (!hasOwn2(replacement, "type") || output.type !== replacement.type) { throw new OpenAIError(`expected output item type '${output.type}', got '${replacement.type}'`); } - const outputID = hasOwn(output, "id") ? output.id : void 0; - const replacementID = hasOwn(replacement, "id") ? replacement.id : void 0; + const outputID = hasOwn2(output, "id") ? output.id : void 0; + const replacementID = hasOwn2(replacement, "id") ? replacement.id : void 0; if (outputID !== replacementID) { throw new OpenAIError(`expected output item id '${outputID}', got '${replacementID}'`); } @@ -18974,20 +36348,20 @@ function validateOutputItemIdentity(event, snapshot, rejectInvalidShellTargets) } if (rejectInvalidShellTargets && (event.type === "response.shell_call_command.added" || event.type === "response.shell_call_command.delta" || event.type === "response.shell_call_command.done")) { const output2 = getOutput(snapshot, event.output_index); - if (!hasOwn(output2, "type") || output2.type !== "shell_call") { + if (!hasOwn2(output2, "type") || output2.type !== "shell_call") { throw new OpenAIError(`expected output item type 'shell_call', got '${output2.type}'`); } return; } - if (event.type !== "response.content_part.added" && event.type !== "response.content_part.done" && !hasOwn(expectedOutputItemTypes, event.type)) { + if (event.type !== "response.content_part.added" && event.type !== "response.content_part.done" && !hasOwn2(expectedOutputItemTypes, event.type)) { return; } const itemEvent = event; - if (!hasOwn(event, "item_id") || typeof itemEvent.item_id !== "string" || itemEvent.item_id.length === 0) { + if (!hasOwn2(event, "item_id") || typeof itemEvent.item_id !== "string" || itemEvent.item_id.length === 0) { throw new OpenAIError(`expected a non-empty item_id for ${event.type}`); } const output = getOutput(snapshot, itemEvent.output_index); - const outputID = hasOwn(output, "id") ? output.id : void 0; + const outputID = hasOwn2(output, "id") ? output.id : void 0; if (outputID !== itemEvent.item_id) { throw new OpenAIError(`expected item_id '${outputID}', got '${itemEvent.item_id}'`); } @@ -19041,7 +36415,7 @@ function sanitizeResponseEvent(event) { return assertNever3(event); } const stableValues = /* @__PURE__ */ new Map([["type", type]]); - const itemScoped = type === "response.output_item.added" || type === "response.output_item.done" || type === "response.content_part.added" || type === "response.content_part.done" || type === "response.shell_call_command.added" || type === "response.shell_call_command.delta" || type === "response.shell_call_command.done" || hasOwn(expectedOutputItemTypes, type); + const itemScoped = type === "response.output_item.added" || type === "response.output_item.done" || type === "response.content_part.added" || type === "response.content_part.done" || type === "response.shell_call_command.added" || type === "response.shell_call_command.delta" || type === "response.shell_call_command.done" || hasOwn2(expectedOutputItemTypes, type); if (itemScoped) { try { for (const field of responseEventRoutingFields) { @@ -19634,8 +37008,8 @@ function accumulateResponseWithContext(event, snapshot, context, rejectInvalidSh var responseOutputIdentityIndexes, expectedOutputItemTypes, supportedResponseEventTypes, responseEventRoutingFields; var init_response_accumulator = __esm({ "node_modules/openai/internal/responses/response-accumulator.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); init_canonical_output_text(); responseOutputIdentityIndexes = /* @__PURE__ */ new WeakMap(); expectedOutputItemTypes = { @@ -19761,12 +37135,12 @@ function finalizeResponse(snapshot, params) { var _ResponseStream_instances, _ResponseStream_params, _ResponseStream_currentResponseSnapshot, _ResponseStream_finalResponse, _ResponseStream_accumulatorContext, _ResponseStream_beginRequest, _ResponseStream_addEvent, _ResponseStream_endRequest, ResponseStream; var init_ResponseStream = __esm({ "node_modules/openai/lib/responses/ResponseStream.mjs"() { - init_tslib(); - init_error2(); + init_tslib2(); + init_error4(); init_EventStream(); init_response_accumulator(); init_ResponsesParser(); - init_streaming2(); + init_streaming4(); ResponseStream = class _ResponseStream extends EventStream2 { /** Creates an unstarted stream, retaining request parameters for structured-output parsing. */ constructor(params) { @@ -19776,7 +37150,7 @@ var init_ResponseStream = __esm({ _ResponseStream_currentResponseSnapshot.set(this, void 0); _ResponseStream_finalResponse.set(this, void 0); _ResponseStream_accumulatorContext.set(this, createResponseContext()); - __classPrivateFieldSet(this, _ResponseStream_params, params, "f"); + __classPrivateFieldSet2(this, _ResponseStream_params, params, "f"); } /** Starts a new response stream or replays an existing response by its identifier. */ static createResponse(client, params, options) { @@ -19788,51 +37162,51 @@ var init_ResponseStream = __esm({ return runner; } /** Consumes serialized response events from a readable stream in another runtime. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ResponseStream(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } async _createOrRetrieveResponse(client, params, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); - let stream4; + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); + let stream5; let starting_after = null; if ("response_id" in params) { - stream4 = await client.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); + stream5 = await client.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); starting_after = params.starting_after ?? null; } else { - stream4 = await client.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); + stream5 = await client.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); } this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); + return __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, null); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, null); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); + return __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); } /** Iterates over response events; stopping iteration early aborts the underlying request. */ [(_ResponseStream_params = /* @__PURE__ */ new WeakMap(), _ResponseStream_currentResponseSnapshot = /* @__PURE__ */ new WeakMap(), _ResponseStream_finalResponse = /* @__PURE__ */ new WeakMap(), _ResponseStream_accumulatorContext = /* @__PURE__ */ new WeakMap(), _ResponseStream_instances = /* @__PURE__ */ new WeakSet(), _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() { if (this.ended) { return; } - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); }, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) { if (this.ended) { return; @@ -19847,13 +37221,13 @@ var init_ResponseStream = __esm({ // oxlint-disable-next-line anti-slop/no-runtime-typeof -- An error event can contain malformed server data; validate its container before extracting error details. "error" in event && typeof event.error === "object" && event.error !== null ? event.error : event ); - throw new APIError(void 0, error, event.message, void 0); + throw new APIError2(void 0, error, event.message, void 0); } let dispatchEvent = event; - const response = accumulateResponseWithContext(event, __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"), __classPrivateFieldGet(this, _ResponseStream_accumulatorContext, "f"), true, (sanitizedEvent) => { + const response = accumulateResponseWithContext(event, __classPrivateFieldGet2(this, _ResponseStream_currentResponseSnapshot, "f"), __classPrivateFieldGet2(this, _ResponseStream_accumulatorContext, "f"), true, (sanitizedEvent) => { dispatchEvent = sanitizedEvent; }); - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, response, "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, response, "f"); maybeEmit("event", event); switch (dispatchEvent.type) { case "response.output_text.delta": { @@ -19905,14 +37279,14 @@ var init_ResponseStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - const snapshot = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); + const snapshot = __classPrivateFieldGet2(this, _ResponseStream_currentResponseSnapshot, "f"); if (!snapshot) { throw new OpenAIError(`request ended without sending any events`); } - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); - const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet(this, _ResponseStream_params, "f")); - __classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); + const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet2(this, _ResponseStream_params, "f")); + __classPrivateFieldSet2(this, _ResponseStream_finalResponse, parsedResponse, "f"); return parsedResponse; }, Symbol.asyncIterator)]() { return this._createIterator((push) => { @@ -19929,7 +37303,7 @@ var init_ResponseStream = __esm({ */ async finalResponse() { await this.done(); - const response = __classPrivateFieldGet(this, _ResponseStream_finalResponse, "f"); + const response = __classPrivateFieldGet2(this, _ResponseStream_finalResponse, "f"); if (!response) { throw new OpenAIError("stream ended without producing a Response"); } @@ -19943,10 +37317,10 @@ var init_ResponseStream = __esm({ var InputItems2; var init_input_items2 = __esm({ "node_modules/openai/resources/responses/input-items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - InputItems2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + InputItems2 = class extends APIResource2 { /** * Returns a list of input items for a given response. * @@ -19961,7 +37335,7 @@ var init_input_items2 = __esm({ * ``` */ list(responseID, query = {}, options) { - return this._client.getAPIList(path`/responses/${responseID}/input_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/responses/${responseID}/input_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -19971,8 +37345,8 @@ var init_input_items2 = __esm({ var InputTokens2; var init_input_tokens2 = __esm({ "node_modules/openai/resources/responses/input-tokens.mjs"() { - init_resource(); - InputTokens2 = class extends APIResource { + init_resource2(); + InputTokens2 = class extends APIResource2 { /** * Returns input token counts of the request. * @@ -20001,14 +37375,14 @@ var init_responses2 = __esm({ "node_modules/openai/resources/responses/responses.mjs"() { init_ResponsesParser(); init_ResponseStream(); - init_resource(); + init_resource2(); init_input_items2(); init_input_items2(); init_input_tokens2(); init_input_tokens2(); - init_headers2(); - init_path(); - Responses2 = class extends APIResource { + init_headers3(); + init_path2(); + Responses2 = class extends APIResource2 { constructor() { super(...arguments); this.inputItems = new InputItems2(this._client); @@ -20028,7 +37402,7 @@ var init_responses2 = __esm({ }); } retrieve(responseID, query = {}, options) { - return this._client.get(path`/responses/${responseID}`, { + return this._client.get(path3`/responses/${responseID}`, { query, ...options, stream: query?.stream ?? false, @@ -20051,9 +37425,9 @@ var init_responses2 = __esm({ * ``` */ delete(responseID, options) { - return this._client.delete(path`/responses/${responseID}`, { + return this._client.delete(path3`/responses/${responseID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20079,7 +37453,7 @@ var init_responses2 = __esm({ * ``` */ cancel(responseID, options) { - return this._client.post(path`/responses/${responseID}/cancel`, { + return this._client.post(path3`/responses/${responseID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -20112,14 +37486,14 @@ var init_responses2 = __esm({ var Alerts; var init_alerts = __esm({ "node_modules/openai/resources/safety/alerts.mjs"() { - init_resource(); - init_path(); - Alerts = class extends APIResource { + init_resource2(); + init_path2(); + Alerts = class extends APIResource2 { /** * Get a safety alert belonging to the authenticated API project. */ retrieve(id, options) { - return this._client.get(path`/safety/alerts/${id}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/safety/alerts/${id}`, { ...options, __security: { bearerAuth: true } }); } }; } @@ -20129,10 +37503,10 @@ var init_alerts = __esm({ var Safety; var init_safety = __esm({ "node_modules/openai/resources/safety/safety.mjs"() { - init_resource(); + init_resource2(); init_alerts(); init_alerts(); - Safety = class extends APIResource { + Safety = class extends APIResource2 { constructor() { super(...arguments); this.alerts = new Alerts(this._client); @@ -20146,17 +37520,17 @@ var init_safety = __esm({ var Content2; var init_content2 = __esm({ "node_modules/openai/resources/skills/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content2 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content2 = class extends APIResource2 { /** * Download a skill zip bundle by its ID. */ retrieve(skillID, options) { - return this._client.get(path`/skills/${skillID}/content`, { + return this._client.get(path3`/skills/${skillID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20169,18 +37543,18 @@ var init_content2 = __esm({ var Content3; var init_content3 = __esm({ "node_modules/openai/resources/skills/versions/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content3 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content3 = class extends APIResource2 { /** * Download a skill version zip bundle. */ retrieve(version, params, options) { const { skill_id } = params; - return this._client.get(path`/skills/${skill_id}/versions/${version}/content`, { + return this._client.get(path3`/skills/${skill_id}/versions/${version}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20190,16 +37564,16 @@ var init_content3 = __esm({ }); // node_modules/openai/resources/skills/versions/versions.mjs -var Versions; -var init_versions = __esm({ +var Versions4; +var init_versions4 = __esm({ "node_modules/openai/resources/skills/versions/versions.mjs"() { - init_resource(); + init_resource2(); init_content3(); init_content3(); - init_pagination(); - init_uploads(); - init_path(); - Versions = class extends APIResource { + init_pagination2(); + init_uploads3(); + init_path2(); + Versions4 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content3(this._client); @@ -20208,7 +37582,7 @@ var init_versions = __esm({ * Create a new immutable skill version. */ create(skillID, body = {}, options) { - return this._client.post(path`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client, { + return this._client.post(path3`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client, { stripFilenames: false })); } @@ -20217,7 +37591,7 @@ var init_versions = __esm({ */ retrieve(version, params, options) { const { skill_id } = params; - return this._client.get(path`/skills/${skill_id}/versions/${version}`, { + return this._client.get(path3`/skills/${skill_id}/versions/${version}`, { ...options, __security: { bearerAuth: true } }); @@ -20226,7 +37600,7 @@ var init_versions = __esm({ * List skill versions for a skill. */ list(skillID, query = {}, options) { - return this._client.getAPIList(path`/skills/${skillID}/versions`, CursorPage, { + return this._client.getAPIList(path3`/skills/${skillID}/versions`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -20237,33 +37611,33 @@ var init_versions = __esm({ */ delete(version, params, options) { const { skill_id } = params; - return this._client.delete(path`/skills/${skill_id}/versions/${version}`, { + return this._client.delete(path3`/skills/${skill_id}/versions/${version}`, { ...options, __security: { bearerAuth: true } }); } }; - Versions.Content = Content3; + Versions4.Content = Content3; } }); // node_modules/openai/resources/skills/skills.mjs -var Skills; -var init_skills = __esm({ +var Skills3; +var init_skills3 = __esm({ "node_modules/openai/resources/skills/skills.mjs"() { - init_resource(); + init_resource2(); init_content2(); init_content2(); - init_versions(); - init_versions(); - init_pagination(); - init_uploads(); - init_path(); - Skills = class extends APIResource { + init_versions4(); + init_versions4(); + init_pagination2(); + init_uploads3(); + init_path2(); + Skills3 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content2(this._client); - this.versions = new Versions(this._client); + this.versions = new Versions4(this._client); } /** * Create a new skill. @@ -20277,13 +37651,13 @@ var init_skills = __esm({ * Get a skill by its ID. */ retrieve(skillID, options) { - return this._client.get(path`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } /** * Update the default version pointer for a skill. */ update(skillID, body, options) { - return this._client.post(path`/skills/${skillID}`, { + return this._client.post(path3`/skills/${skillID}`, { body, ...options, __security: { bearerAuth: true } @@ -20303,11 +37677,11 @@ var init_skills = __esm({ * Delete a skill by its ID. */ delete(skillID, options) { - return this._client.delete(path`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } }; - Skills.Content = Content2; - Skills.Versions = Versions; + Skills3.Content = Content2; + Skills3.Versions = Versions4; } }); @@ -20315,10 +37689,10 @@ var init_skills = __esm({ var Parts; var init_parts = __esm({ "node_modules/openai/resources/uploads/parts.mjs"() { - init_resource(); - init_uploads(); - init_path(); - Parts = class extends APIResource { + init_resource2(); + init_uploads3(); + init_path2(); + Parts = class extends APIResource2 { /** * Adds a * [Part](https://developers.openai.com/api/reference/resources/uploads/subresources/parts) @@ -20334,7 +37708,7 @@ var init_parts = __esm({ * [complete the Upload](https://developers.openai.com/api/reference/resources/uploads/methods/complete). */ create(uploadID, body, options) { - return this._client.post(path`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/uploads/${uploadID}/parts`, multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -20342,13 +37716,13 @@ var init_parts = __esm({ // node_modules/openai/resources/uploads/uploads.mjs var Uploads; -var init_uploads3 = __esm({ +var init_uploads5 = __esm({ "node_modules/openai/resources/uploads/uploads.mjs"() { - init_resource(); + init_resource2(); init_parts(); init_parts(); - init_path(); - Uploads = class extends APIResource { + init_path2(); + Uploads = class extends APIResource2 { constructor() { super(...arguments); this.parts = new Parts(this._client); @@ -20385,7 +37759,7 @@ var init_uploads3 = __esm({ * Returns the Upload object with status `cancelled`. */ cancel(uploadID, options) { - return this._client.post(path`/uploads/${uploadID}/cancel`, { + return this._client.post(path3`/uploads/${uploadID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -20408,7 +37782,7 @@ var init_uploads3 = __esm({ * object. */ complete(uploadID, body, options) { - return this._client.post(path`/uploads/${uploadID}/complete`, { + return this._client.post(path3`/uploads/${uploadID}/complete`, { body, ...options, __security: { bearerAuth: true } @@ -20493,21 +37867,21 @@ var init_vector_store_upload = __esm({ var FileBatches; var init_file_batches = __esm({ "node_modules/openai/resources/vector-stores/file-batches.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); + init_resource2(); + init_pagination2(); + init_headers3(); init_vector_store_polling(); init_vector_store_upload(); - init_path(); - FileBatches = class extends APIResource { + init_path2(); + FileBatches = class extends APIResource2 { /** * Create a vector store file batch. */ create(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}/file_batches`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}/file_batches`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20516,9 +37890,9 @@ var init_file_batches = __esm({ */ retrieve(batchID, params, options) { const { vector_store_id } = params; - return this._client.get(path`/vector_stores/${vector_store_id}/file_batches/${batchID}`, { + return this._client.get(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20528,9 +37902,9 @@ var init_file_batches = __esm({ */ cancel(batchID, params, options) { const { vector_store_id } = params; - return this._client.post(path`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, { + return this._client.post(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20546,10 +37920,10 @@ var init_file_batches = __esm({ */ listFiles(batchID, params, options) { const { vector_store_id, ...query } = params; - return this._client.getAPIList(path`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { + return this._client.getAPIList(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20575,25 +37949,25 @@ var init_file_batches = __esm({ }); // node_modules/openai/resources/vector-stores/files.mjs -var Files4; -var init_files4 = __esm({ +var Files6; +var init_files6 = __esm({ "node_modules/openai/resources/vector-stores/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); + init_resource2(); + init_pagination2(); + init_headers3(); init_vector_store_polling(); - init_path(); - Files4 = class extends APIResource { + init_path2(); + Files6 = class extends APIResource2 { /** * Create a vector store file by attaching a * [File](https://developers.openai.com/api/reference/resources/files) to a * [vector store](https://developers.openai.com/api/reference/resources/vector_stores). */ create(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}/files`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}/files`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20602,9 +37976,9 @@ var init_files4 = __esm({ */ retrieve(fileID, params, options) { const { vector_store_id } = params; - return this._client.get(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.get(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20613,10 +37987,10 @@ var init_files4 = __esm({ */ update(fileID, params, options) { const { vector_store_id, ...body } = params; - return this._client.post(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.post(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20624,10 +37998,10 @@ var init_files4 = __esm({ * Returns a list of vector store files. */ list(vectorStoreID, query = {}, options) { - return this._client.getAPIList(path`/vector_stores/${vectorStoreID}/files`, CursorPage, { + return this._client.getAPIList(path3`/vector_stores/${vectorStoreID}/files`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20639,9 +38013,9 @@ var init_files4 = __esm({ */ delete(fileID, params, options) { const { vector_store_id } = params; - return this._client.delete(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.delete(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20683,9 +38057,9 @@ var init_files4 = __esm({ */ content(fileID, params, options) { const { vector_store_id } = params; - return this._client.getAPIList(path`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, { + return this._client.getAPIList(path3`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page2, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20697,18 +38071,18 @@ var init_files4 = __esm({ var VectorStores; var init_vector_stores = __esm({ "node_modules/openai/resources/vector-stores/vector-stores.mjs"() { - init_resource(); + init_resource2(); init_file_batches(); init_file_batches(); - init_files4(); - init_files4(); - init_pagination(); - init_headers2(); - init_path(); - VectorStores = class extends APIResource { + init_files6(); + init_files6(); + init_pagination2(); + init_headers3(); + init_path2(); + VectorStores = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files4(this._client); + this.files = new Files6(this._client); this.fileBatches = new FileBatches(this._client); } /** @@ -20718,7 +38092,7 @@ var init_vector_stores = __esm({ return this._client.post("/vector_stores", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20726,9 +38100,9 @@ var init_vector_stores = __esm({ * Retrieves a vector store. */ retrieve(vectorStoreID, options) { - return this._client.get(path`/vector_stores/${vectorStoreID}`, { + return this._client.get(path3`/vector_stores/${vectorStoreID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20736,10 +38110,10 @@ var init_vector_stores = __esm({ * Modifies a vector store. */ update(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20750,7 +38124,7 @@ var init_vector_stores = __esm({ return this._client.getAPIList("/vector_stores", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20758,9 +38132,9 @@ var init_vector_stores = __esm({ * Delete a vector store. */ delete(vectorStoreID, options) { - return this._client.delete(path`/vector_stores/${vectorStoreID}`, { + return this._client.delete(path3`/vector_stores/${vectorStoreID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20769,16 +38143,16 @@ var init_vector_stores = __esm({ * filter. */ search(vectorStoreID, body, options) { - return this._client.getAPIList(path`/vector_stores/${vectorStoreID}/search`, Page, { + return this._client.getAPIList(path3`/vector_stores/${vectorStoreID}/search`, Page2, { body, method: "post", ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } }; - VectorStores.Files = Files4; + VectorStores.Files = Files6; VectorStores.FileBatches = FileBatches; } }); @@ -20787,19 +38161,19 @@ var init_vector_stores = __esm({ var Videos; var init_videos = __esm({ "node_modules/openai/resources/videos.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_uploads(); - init_path(); - Videos = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_uploads3(); + init_path2(); + Videos = class extends APIResource2 { /** * Create a new video generation job from a prompt and optional reference assets. * * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ create(body, options) { - return this._client.post("/videos", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Fetch the latest metadata for a generated video. @@ -20807,7 +38181,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ retrieve(videoID, options) { - return this._client.get(path`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); } /** * List recently generated videos for the current project. @@ -20827,7 +38201,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ delete(videoID, options) { - return this._client.delete(path`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); } /** * Create a character from an uploaded video. @@ -20835,7 +38209,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ createCharacter(body, options) { - return this._client.post("/videos/characters", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/characters", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Download the generated video bytes or a derived preview asset. @@ -20845,10 +38219,10 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ downloadContent(videoID, query = {}, options) { - return this._client.get(path`/videos/${videoID}/content`, { + return this._client.get(path3`/videos/${videoID}/content`, { query, ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20860,7 +38234,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ edit(body, options) { - return this._client.post("/videos/edits", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/edits", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Create an extension of a completed video. @@ -20868,7 +38242,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ extend(body, options) { - return this._client.post("/videos/extensions", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/extensions", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Fetch a character. @@ -20876,7 +38250,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ getCharacter(characterID, options) { - return this._client.get(path`/videos/characters/${characterID}`, { + return this._client.get(path3`/videos/characters/${characterID}`, { ...options, __security: { bearerAuth: true } }); @@ -20887,7 +38261,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ remix(videoID, body, options) { - return this._client.post(path`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -20911,7 +38285,7 @@ function* signatureCandidates(signatureHeader) { } function decodeSignature(signature) { try { - const signatureBytes = fromBase64(signature); + const signatureBytes = fromBase642(signature); return signatureBytes.byteLength === SHA256_SIGNATURE_LENGTH ? signatureBytes : void 0; } catch { return void 0; @@ -20960,9 +38334,9 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh if (useBoundedVerification && !firstSignature) { throw new InvalidWebhookSignatureError("The given webhook signature does not match the expected signature"); } - const decodedSecret = Uint8Array.from(secret.startsWith("whsec_") ? fromBase64(secret.slice("whsec_".length)) : encodeUTF8(secret)); + const decodedSecret = Uint8Array.from(secret.startsWith("whsec_") ? fromBase642(secret.slice("whsec_".length)) : encodeUTF82(secret)); const signedPayload = webhookId ? `${webhookId}.${timestamp2}.${payload}` : `${timestamp2}.${payload}`; - const signedPayloadBytes = Uint8Array.from(encodeUTF8(signedPayload)); + const signedPayloadBytes = Uint8Array.from(encodeUTF82(signedPayload)); const key = await crypto.subtle.importKey("raw", decodedSecret, { name: "HMAC", hash: "SHA-256" }, false, useBoundedVerification ? ["sign", "verify"] : ["verify"]); if (useBoundedVerification && firstSignature) { const expectedSignature = new Uint8Array(await crypto.subtle.sign("HMAC", key, signedPayloadBytes)); @@ -20977,7 +38351,7 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh } for (const signature of signatureCandidates(signatureHeader)) { try { - const signatureBytes = Uint8Array.from(fromBase64(signature)); + const signatureBytes = Uint8Array.from(fromBase642(signature)); const isValid2 = await crypto.subtle.verify("HMAC", key, signatureBytes, signedPayloadBytes); if (isValid2) { return; @@ -20990,9 +38364,9 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh var MAX_DIRECT_WEBHOOK_VERIFICATIONS, SHA256_SIGNATURE_LENGTH; var init_webhook_signature = __esm({ "node_modules/openai/lib/webhook-signature.mjs"() { - init_error2(); - init_base64(); - init_bytes(); + init_error4(); + init_base642(); + init_bytes2(); MAX_DIRECT_WEBHOOK_VERIFICATIONS = 32; SHA256_SIGNATURE_LENGTH = 32; } @@ -21002,8 +38376,8 @@ var init_webhook_signature = __esm({ var EventTypes; var init_event_types = __esm({ "node_modules/openai/resources/webhooks/event-types.mjs"() { - init_resource(); - EventTypes = class extends APIResource { + init_resource2(); + EventTypes = class extends APIResource2 { /** * Returns webhook event types visible to the authenticated project. * @@ -21021,18 +38395,18 @@ var init_event_types = __esm({ }); // node_modules/openai/resources/webhooks/webhooks.mjs -var _Webhooks_instances, _Webhooks_validateSecret, _Webhooks_getRequiredHeader, Webhooks; -var init_webhooks = __esm({ +var _Webhooks_instances, _Webhooks_validateSecret, _Webhooks_getRequiredHeader, Webhooks2; +var init_webhooks2 = __esm({ "node_modules/openai/resources/webhooks/webhooks.mjs"() { - init_tslib(); - init_resource(); - init_headers2(); + init_tslib2(); + init_resource2(); + init_headers3(); init_webhook_signature(); init_event_types(); init_event_types(); - init_pagination(); - init_path(); - Webhooks = class extends APIResource { + init_pagination2(); + init_path2(); + Webhooks2 = class extends APIResource2 { constructor() { super(...arguments); _Webhooks_instances.add(this); @@ -21065,7 +38439,7 @@ var init_webhooks = __esm({ * ``` */ retrieve(webhookEndpointID, options) { - return this._client.get(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.get(path3`/webhook_endpoints/${webhookEndpointID}`, { ...options, __security: { bearerAuth: true } }); @@ -21079,7 +38453,7 @@ var init_webhooks = __esm({ * ``` */ update(webhookEndpointID, body = {}, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}`, { body, ...options, __security: { bearerAuth: true } @@ -21114,7 +38488,7 @@ var init_webhooks = __esm({ * ``` */ delete(webhookEndpointID, options) { - return this._client.delete(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.delete(path3`/webhook_endpoints/${webhookEndpointID}`, { ...options, __security: { bearerAuth: true } }); @@ -21129,7 +38503,7 @@ var init_webhooks = __esm({ * ``` */ rotateSecret(webhookEndpointID, body = {}, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}/rotate_secret`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}/rotate_secret`, { body, ...options, __security: { bearerAuth: true } @@ -21147,7 +38521,7 @@ var init_webhooks = __esm({ * ``` */ test(webhookEndpointID, body, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}/test`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}/test`, { body, ...options, __security: { bearerAuth: true } @@ -21174,11 +38548,11 @@ var init_webhooks = __esm({ if (typeof crypto === "undefined" || typeof crypto.subtle?.importKey !== "function" || typeof crypto.subtle.verify !== "function") { throw new Error("Webhook signature verification is only supported when the `crypto` global is defined"); } - __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_validateSecret).call(this, secret); - const headersObj = buildHeaders([headers]).values; - const signatureHeader = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-signature"); - const timestamp2 = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-timestamp"); - const webhookId = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-id"); + __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_validateSecret).call(this, secret); + const headersObj = buildHeaders2([headers]).values; + const signatureHeader = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-signature"); + const timestamp2 = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-timestamp"); + const webhookId = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-id"); if (webhookSignatureRequiresSigning(signatureHeader) && typeof crypto.subtle.sign !== "function") { throw new Error("Webhook signature verification is only supported when the `crypto` global is defined"); } @@ -21199,40 +38573,40 @@ var init_webhooks = __esm({ } return value2; }; - Webhooks.EventTypes = EventTypes; + Webhooks2.EventTypes = EventTypes; } }); // node_modules/openai/resources/index.mjs -var init_resources = __esm({ +var init_resources3 = __esm({ "node_modules/openai/resources/index.mjs"() { init_chat2(); - init_shared(); + init_shared2(); init_admin(); init_audio(); - init_batches(); - init_beta(); - init_completions3(); + init_batches3(); + init_beta2(); + init_completions4(); init_containers(); init_content_provenance_checks(); init_conversations(); init_embeddings2(); init_evals(); - init_files3(); + init_files5(); init_fine_tuning(); init_graders2(); init_images(); init_live(); - init_models2(); + init_models4(); init_moderations(); init_realtime2(); init_responses2(); init_safety(); - init_skills(); - init_uploads3(); + init_skills3(); + init_uploads5(); init_vector_stores(); init_videos(); - init_webhooks(); + init_webhooks2(); } }); @@ -21272,7 +38646,7 @@ var init_provider = __esm({ // node_modules/openai/client.mjs function isRunningInBrowserOrBrowserWorker() { - if (isRunningInBrowser()) + if (isRunningInBrowser2()) return true; const scope = globalThis; return typeof scope.WorkerGlobalScope === "function" && scope instanceof scope.WorkerGlobalScope && typeof scope.WorkerNavigator === "function" && scope.navigator instanceof scope.WorkerNavigator && typeof scope.navigator?.userAgent === "string" && scope.navigator.userAgent !== "Cloudflare-Workers" && scope.process?.versions?.node === void 0 && scope.Deno === void 0 && scope.Bun === void 0 && scope.EdgeRuntime === void 0 && scope.WebSocketPair === void 0; @@ -21314,46 +38688,46 @@ function isUndiciDispatcherVersionMismatchError(error) { } return false; } -var _OpenAI_instances, _a3, _OpenAI_encoder, _OpenAI_x509Authentication, _OpenAI_x509Credential, _OpenAI_x509Fetch, _OpenAI_explicitDataResidency, _OpenAI_responseAttempts, _OpenAI_baseURLOverridden, WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER, inheritedDataResidencySelection, OpenAI, composedCallerSignals; -var init_client = __esm({ +var _OpenAI_instances, _a4, _OpenAI_encoder, _OpenAI_x509Authentication, _OpenAI_x509Credential, _OpenAI_x509Fetch, _OpenAI_explicitDataResidency, _OpenAI_responseAttempts, _OpenAI_baseURLOverridden, WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER, inheritedDataResidencySelection, OpenAI, composedCallerSignals; +var init_client2 = __esm({ "node_modules/openai/client.mjs"() { - init_tslib(); - init_uuid(); - init_values(); - init_sleep(); - init_abort2(); - init_errors(); - init_parse(); - init_detect_platform(); - init_shims(); - init_request_options(); - init_query(); - init_version2(); + init_tslib2(); + init_uuid2(); + init_values2(); + init_sleep2(); + init_abort3(); + init_errors2(); + init_parse2(); + init_detect_platform2(); + init_shims2(); + init_request_options2(); + init_query2(); + init_version3(); init_data_residency(); - init_error(); - init_pagination(); + init_error3(); + init_pagination2(); init_workload_identity_auth(); init_x509_api_origin(); init_x509_workload_identity_auth(); init_x509_credential_options(); init_x509_transport_state(); - init_error(); - init_uploads2(); - init_resources(); - init_api_promise(); + init_error3(); + init_uploads4(); + init_resources3(); + init_api_promise2(); init_realtime_credentials(); - init_batches(); - init_completions3(); + init_batches3(); + init_completions4(); init_content_provenance_checks(); init_embeddings2(); - init_files3(); + init_files5(); init_images(); - init_models2(); + init_models4(); init_moderations(); init_videos(); init_admin(); init_audio(); - init_beta(); + init_beta2(); init_chat(); init_containers(); init_conversations(); @@ -21364,16 +38738,16 @@ var init_client = __esm({ init_realtime2(); init_responses2(); init_safety(); - init_skills(); - init_uploads3(); + init_skills3(); + init_uploads5(); init_vector_stores(); - init_webhooks(); - init_detect_platform(); - init_headers2(); + init_webhooks2(); + init_detect_platform2(); + init_headers3(); init_provider(); - init_env(); - init_log(); - init_values(); + init_env2(); + init_log2(); + init_values2(); WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER = "workload-identity-auth"; inheritedDataResidencySelection = /* @__PURE__ */ Symbol("inheritedDataResidencySelection"); OpenAI = class { @@ -21403,22 +38777,22 @@ var init_client = __esm({ _OpenAI_x509Fetch.set(this, void 0); _OpenAI_explicitDataResidency.set(this, false); _OpenAI_responseAttempts.set(this, /* @__PURE__ */ new WeakMap()); - this.completions = new Completions2(this); + this.completions = new Completions3(this); this.chat = new Chat(this); this.embeddings = new Embeddings(this); - this.files = new Files3(this); + this.files = new Files5(this); this.images = new Images(this); this.contentProvenanceChecks = new ContentProvenanceChecks(this); this.audio = new Audio(this); this.moderations = new Moderations(this); - this.models = new Models(this); + this.models = new Models3(this); this.fineTuning = new FineTuning(this); this.graders = new Graders2(this); this.vectorStores = new VectorStores(this); this.safety = new Safety(this); - this.webhooks = new Webhooks(this); - this.beta = new Beta(this); - this.batches = new Batches(this); + this.webhooks = new Webhooks2(this); + this.beta = new Beta2(this); + this.batches = new Batches3(this); this.uploads = new Uploads(this); this.admin = new Admin(this); this.responses = new Responses2(this); @@ -21427,13 +38801,13 @@ var init_client = __esm({ this.conversations = new Conversations(this); this.evals = new Evals(this); this.containers = new Containers(this); - this.skills = new Skills(this); + this.skills = new Skills3(this); this.videos = new Videos(this); const { credential, options: normalizedOptions } = normalizeX509CredentialOptions(clientOptions); clientOptions = normalizedOptions; const residencyBaseURL = resolveDataResidency(clientOptions); const provider2 = clientOptions.provider; - const { baseURL = provider2 ? null : readEnv("OPENAI_BASE_URL"), dataResidency: _dataResidency, [inheritedDataResidencySelection]: inheritedResidencySelection = false, apiKey = provider2 ? null : readEnv("OPENAI_API_KEY") ?? null, adminAPIKey = provider2 ? null : readEnv("OPENAI_ADMIN_KEY") ?? null, organization = provider2 ? null : readEnv("OPENAI_ORG_ID") ?? null, project = provider2 ? null : readEnv("OPENAI_PROJECT_ID") ?? null, webhookSecret = readEnv("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity, x509Transport, credential: _credential, ...opts } = clientOptions; + const { baseURL = provider2 ? null : readEnv2("OPENAI_BASE_URL"), dataResidency: _dataResidency, [inheritedDataResidencySelection]: inheritedResidencySelection = false, apiKey = provider2 ? null : readEnv2("OPENAI_API_KEY") ?? null, adminAPIKey = provider2 ? null : readEnv2("OPENAI_ADMIN_KEY") ?? null, organization = provider2 ? null : readEnv2("OPENAI_ORG_ID") ?? null, project = provider2 ? null : readEnv2("OPENAI_PROJECT_ID") ?? null, webhookSecret = readEnv2("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity, x509Transport, credential: _credential, ...opts } = clientOptions; if (provider2) { const conflictingOptions = ["apiKey", "adminAPIKey", "workloadIdentity", "x509Transport", "baseURL", "dataResidency"].filter((key) => (key === "workloadIdentity" ? workloadIdentity : clientOptions[key]) != null); if (conflictingOptions.length) { @@ -21468,7 +38842,7 @@ var init_client = __esm({ } assertX509APIOrigin(options.baseURL); assertX509RequestOptions(options.fetchOptions); - if (this.fetchWithAuth !== _a3.prototype.fetchWithAuth || this.fetchWithTimeout !== _a3.prototype.fetchWithTimeout) { + if (this.fetchWithAuth !== _a4.prototype.fetchWithAuth || this.fetchWithTimeout !== _a4.prototype.fetchWithTimeout) { throw new OpenAIError("X.509 workload identity does not support overridden fetch dispatch hooks."); } } @@ -21482,17 +38856,17 @@ var init_client = __esm({ throw new OpenAIError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n"); } this.baseURL = options.baseURL; - __classPrivateFieldSet(this, _OpenAI_explicitDataResidency, residencyBaseURL !== void 0 || inheritedResidencySelection, "f"); - this.timeout = options.timeout ?? _a3.DEFAULT_TIMEOUT; + __classPrivateFieldSet2(this, _OpenAI_explicitDataResidency, residencyBaseURL !== void 0 || inheritedResidencySelection, "f"); + this.timeout = options.timeout ?? _a4.DEFAULT_TIMEOUT; this.logger = options.logger ?? console; const defaultLogLevel2 = "warn"; this.logLevel = defaultLogLevel2; - this.logLevel = parseLogLevel(options.logLevel, "ClientOptions.logLevel", this) ?? parseLogLevel(readEnv("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? defaultLogLevel2; + this.logLevel = parseLogLevel2(options.logLevel, "ClientOptions.logLevel", this) ?? parseLogLevel2(readEnv2("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? defaultLogLevel2; this.fetchOptions = options.fetchOptions; this.maxRetries = options.maxRetries ?? 2; - this.fetch = options.fetch ?? getDefaultFetch(); - __classPrivateFieldSet(this, _OpenAI_encoder, FallbackEncoder, "f"); - const customHeadersEnv = provider2 || credential ? void 0 : readEnv("OPENAI_CUSTOM_HEADERS"); + this.fetch = options.fetch ?? getDefaultFetch2(); + __classPrivateFieldSet2(this, _OpenAI_encoder, FallbackEncoder2, "f"); + const customHeadersEnv = provider2 || credential ? void 0 : readEnv2("OPENAI_CUSTOM_HEADERS"); if (customHeadersEnv) { const parsed = {}; for (const line of customHeadersEnv.split("\n")) { @@ -21501,17 +38875,17 @@ var init_client = __esm({ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); } } - options.defaultHeaders = buildHeaders([parsed, options.defaultHeaders]); + options.defaultHeaders = buildHeaders2([parsed, options.defaultHeaders]); } this._options = options; this._provider = providerRuntime; if (x509Identity) { const authentication = new X509WorkloadIdentityAuth(x509Identity, x509Transport, organization, project); this._workloadIdentityAuth = authentication; - __classPrivateFieldSet(this, _OpenAI_x509Authentication, authentication, "f"); - __classPrivateFieldSet(this, _OpenAI_x509Credential, credential, "f"); - __classPrivateFieldSet(this, _OpenAI_x509Fetch, authentication.fetch(), "f"); - this.fetch = __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Authentication, authentication, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Credential, credential, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Fetch, authentication.fetch(), "f"); + this.fetch = __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f"); markApprovedX509Client2(this); } else if (identity.legacy) { this._workloadIdentityAuth = new WorkloadIdentityAuth(identity.legacy, this.fetch); @@ -21527,7 +38901,7 @@ var init_client = __esm({ */ withOptions(options) { const residencyBaseURL = resolveDataResidency(options); - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); const inheritedOptions = { ...this._options, baseURL: this.baseURL, @@ -21535,7 +38909,7 @@ var init_client = __esm({ timeout: this.timeout, logger: this.logger, logLevel: this.logLevel, - fetch: __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ? void 0 : this.fetch, + fetch: __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ? void 0 : this.fetch, fetchOptions: this.fetchOptions, apiKey: this._options.apiKey, adminAPIKey: this.adminAPIKey, @@ -21545,7 +38919,7 @@ var init_client = __esm({ project: this.project, webhookSecret: this.webhookSecret }; - const { credential, provider: provider2 } = prepareX509ClientClone(inheritedOptions, options, __classPrivateFieldGet(this, _OpenAI_x509Credential, "f"), x509Authentication !== void 0); + const { credential, provider: provider2 } = prepareX509ClientClone(inheritedOptions, options, __classPrivateFieldGet2(this, _OpenAI_x509Credential, "f"), x509Authentication !== void 0); if (residencyBaseURL !== void 0) { delete inheritedOptions.baseURL; } @@ -21554,7 +38928,7 @@ var init_client = __esm({ ...options, credential, provider: provider2, - [inheritedDataResidencySelection]: __classPrivateFieldGet(this, _OpenAI_explicitDataResidency, "f") && residencyBaseURL === void 0 && !hasOwn(options, "baseURL") && options.credential === void 0 && !provider2 + [inheritedDataResidencySelection]: __classPrivateFieldGet2(this, _OpenAI_explicitDataResidency, "f") && residencyBaseURL === void 0 && !hasOwn2(options, "baseURL") && options.credential === void 0 && !provider2 }; const client = new this.constructor(clientOptions); if (provider2 && new URL(client.baseURL).origin !== new URL(this.baseURL).origin) { @@ -21565,14 +38939,14 @@ var init_client = __esm({ fetch: options.fetch }); client.fetchOptions = options.fetchOptions; - client.fetch = options.fetch ?? getDefaultFetch(); + client.fetch = options.fetch ?? getDefaultFetch2(); client.organization = options.organization ?? null; client.project = options.project ?? null; } - if (__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && __classPrivateFieldGet(client, _OpenAI_x509Authentication, "f") && this.baseURL === client.baseURL && __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").matches(__classPrivateFieldGet(client, _OpenAI_x509Authentication, "f"))) { - client._workloadIdentityAuth = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); - __classPrivateFieldSet(client, _OpenAI_x509Authentication, __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"), "f"); - __classPrivateFieldSet(client, _OpenAI_x509Fetch, __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f"), "f"); + if (__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && __classPrivateFieldGet2(client, _OpenAI_x509Authentication, "f") && this.baseURL === client.baseURL && __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").matches(__classPrivateFieldGet2(client, _OpenAI_x509Authentication, "f"))) { + client._workloadIdentityAuth = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); + __classPrivateFieldSet2(client, _OpenAI_x509Authentication, __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"), "f"); + __classPrivateFieldSet2(client, _OpenAI_x509Fetch, __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f"), "f"); } return client; } @@ -21581,7 +38955,7 @@ var init_client = __esm({ } /** @internal Client request headers for each new WebSocket handshake. */ _buildWebSocketHeaders(authHeaders) { - return Object.fromEntries(buildHeaders([ + return Object.fromEntries(buildHeaders2([ { "User-Agent": this.getUserAgent(), "OpenAI-Organization": this.organization, @@ -21610,20 +38984,20 @@ var init_client = __esm({ bearerAuth: true, adminAPIKeyAuth: true }) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; if (authentication instanceof X509WorkloadIdentityAuth && schemes.adminAPIKeyAuth && this.adminAPIKey !== null) { return await this.adminAPIKeyAuth(opts); } - return buildHeaders([ + return buildHeaders2([ schemes.bearerAuth ? await this.bearerAuth(opts) : null, schemes.adminAPIKeyAuth ? await this.adminAPIKeyAuth(opts) : null ]); } async bearerAuth(opts) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; if (authentication) { if (authentication instanceof X509WorkloadIdentityAuth) { - if (authentication === this._workloadIdentityAuth && (this.fetchWithAuth !== _a3.prototype.fetchWithAuth || this.fetchWithTimeout !== _a3.prototype.fetchWithTimeout)) { + if (authentication === this._workloadIdentityAuth && (this.fetchWithAuth !== _a4.prototype.fetchWithAuth || this.fetchWithTimeout !== _a4.prototype.fetchWithTimeout)) { throw new OpenAIError("X.509 workload identity does not support overridden fetch dispatch hooks."); } const snapshots = authentication.headerSnapshots(); @@ -21638,32 +39012,32 @@ var init_client = __esm({ signal: authentication.effectiveSignal(), ...authentication.tenantSnapshot() }) : await authentication.getToken(); - return buildHeaders([{ Authorization: `Bearer ${token}` }]); + return buildHeaders2([{ Authorization: `Bearer ${token}` }]); } const { apiKey } = await resolveRealtimeAPIKey(this); if (apiKey == null) { return void 0; } - return buildHeaders([{ Authorization: `Bearer ${apiKey}` }]); + return buildHeaders2([{ Authorization: `Bearer ${apiKey}` }]); } async adminAPIKeyAuth(opts) { if (this.adminAPIKey == null) { return void 0; } - return buildHeaders([{ Authorization: `Bearer ${this.adminAPIKey}` }]); + return buildHeaders2([{ Authorization: `Bearer ${this.adminAPIKey}` }]); } stringifyQuery(query) { - return stringifyQuery(query); + return stringifyQuery2(query); } getUserAgent() { - return `${this.constructor.name}/JS ${VERSION}`; + return `${this.constructor.name}/JS ${VERSION2}`; } defaultIdempotencyKey() { - return `stainless-node-retry-${uuid4()}`; + return `stainless-node-retry-${uuid42()}`; } makeStatusError(status, error, message, headers) { const normalizedError = error && typeof error === "object" && error.error == null ? { error } : error; - return APIError.generate(status, normalizedError, message, headers); + return APIError2.generate(status, normalizedError, message, headers); } _hasApiKeyProvider() { return typeof this._options.apiKey === "function"; @@ -21706,11 +39080,11 @@ var init_client = __esm({ return true; } buildURL(path5, query, defaultBaseURL) { - const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; - const url = isAbsoluteURL(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); + const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; + const url = isAbsoluteURL2(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); const defaultQuery = this.defaultQuery(); const pathQuery = Object.fromEntries(url.searchParams); - if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) { query = { ...pathQuery, ...defaultQuery, ...query }; } if (typeof query === "object" && query && !Array.isArray(query)) { @@ -21755,13 +39129,13 @@ var init_client = __esm({ })); } request(options, remainingRetries = null) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; const request2 = authentication instanceof X509WorkloadIdentityAuth ? Promise.resolve(options).then((resolved) => authentication.runRequest(() => this.makeRequest(resolved, remainingRetries, void 0), this)) : this.makeRequest(options, remainingRetries, void 0); return this.responsePromise(request2); } responsePromise(request2, parse2 = (client, props) => this.parseResponseWithTimeout(client, props)) { - const promise = new APIPromise(this, request2, (client, props) => { - const resume = __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").get(props.controller)?.continueRequest; + const promise = new APIPromise2(this, request2, (client, props) => { + const resume = __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").get(props.controller)?.continueRequest; return resume ? resume(() => parse2(client, props)) : parse2(client, props); }); promise.withResponse = async () => { @@ -21774,21 +39148,21 @@ var init_client = __esm({ } async parseResponseWithTimeout(client, props) { if (props.options.stream || props.options.__binaryResponse || props.response.status === 204 || props.response.headers.get("content-length") === "0") { - return defaultParseResponse(client, props); + return defaultParseResponse2(client, props); } while (true) { - const attempt = __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").get(props.controller); + const attempt = __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").get(props.controller); const timeout = attempt?.timeout ?? props.options.timeout ?? this.timeout; const x509Authentication = attempt?.authentication; const callerSignal = x509Authentication ? props.controller.signal : props.options.signal; - const abortError2 = () => x509Authentication && callerSignal ? this._makeUserAbortError(callerSignal) : new APIUserAbortError(); + const abortError2 = () => x509Authentication && callerSignal ? this._makeUserAbortError(callerSignal) : new APIUserAbortError2(); let remaining; try { remaining = x509Authentication?.remainingTimeout(props.options, timeout) ?? Math.max(0, props.startTime + timeout - Date.now()); } catch (error) { const cancellation = callerSignal?.aborted ? abortError2() : void 0; props.controller.abort(); - void CancelReadableStream(props.response.body).catch(() => void 0); + void CancelReadableStream2(props.response.body).catch(() => void 0); throw cancellation ?? error; } let timer; @@ -21802,7 +39176,7 @@ var init_client = __esm({ timer = setTimeout(() => { timedOut = true; props.controller.abort(); - reject2(new APIConnectionTimeoutError()); + reject2(new APIConnectionTimeoutError2()); }, remaining); if (callerSignal) { abortListener = () => { @@ -21812,7 +39186,7 @@ var init_client = __esm({ callerSignal.addEventListener("abort", abortListener, { once: true }); } }); - return await Promise.race([defaultParseResponse(client, props), timeoutPromise]); + return await Promise.race([defaultParseResponse2(client, props), timeoutPromise]); } catch (error) { if (callerSignal?.aborted && !timedOut) { throw abortError2(); @@ -21822,7 +39196,7 @@ var init_client = __esm({ throw new SyntaxError("X.509 workload identity API response contains invalid JSON."); } if (x509Authentication && !(error instanceof OpenAIError)) { - throw new APIConnectionError({ + throw new APIConnectionError2({ message: "X.509 workload identity API response body could not be read." }); } @@ -21830,7 +39204,7 @@ var init_client = __esm({ } const retriesRemaining = attempt?.retriesRemaining ?? 0; if (!retriesRemaining || attempt?.hasStreamingBody || props.options.__metadata?.["hasStreamingBody"] || globalThis.ReadableStream && props.options.body instanceof globalThis.ReadableStream || typeof props.options.body === "object" && props.options.body !== null && (Symbol.asyncIterator in props.options.body || Symbol.iterator in props.options.body && "next" in props.options.body && typeof props.options.body.next === "function")) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } if (timer !== void 0) clearTimeout(timer); @@ -21860,7 +39234,7 @@ var init_client = __esm({ try { const remaining = authentication.remainingTimeout(options, timeout); const expiration = authentication.waitForRetry(remaining, deadline.signal).then(() => { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); }); const body = await Promise.race([ response.text().catch(() => "X.509 workload identity API response body could not be read."), @@ -21871,10 +39245,10 @@ var init_client = __esm({ } return body; } catch (error) { - if (error instanceof APIConnectionTimeoutError) { + if (error instanceof APIConnectionTimeoutError2) { timedOut = !callerSignal.aborted; controller.abort(); - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } if (callerSignal.aborted && !timedOut) { throw this._makeUserAbortError(callerSignal); @@ -21891,7 +39265,7 @@ var init_client = __esm({ if (retriesRemaining == null) { retriesRemaining = maxRetries; } - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); x509Authentication?.beginRequestPreparation(); await this.prepareOptions(options); x509Authentication?.beginRequestPlanning(); @@ -21902,7 +39276,7 @@ var init_client = __esm({ }); built = { req: candidate.req, url: candidate.url, timeout: candidate.timeout }; if (x509Authentication) { - validatePositiveInteger("timeout", built.timeout); + validatePositiveInteger2("timeout", built.timeout); x509Authentication.authorizePlannedRequest(built.url, built.req, built.timeout); if (X509WorkloadIdentityAuth.isStreamingRequestBody(built.req.body)) { options.__metadata = { ...options.__metadata, hasStreamingBody: true }; @@ -21923,13 +39297,13 @@ var init_client = __esm({ const security2 = options.__security ?? { bearerAuth: true }; const authenticationHeaders = await this.authHeaders(options, security2); const suppliedHeaders = x509Authentication.headerSnapshots(); - const supplied = buildHeaders([suppliedHeaders.defaultHeaders, suppliedHeaders.requestHeaders]); + const supplied = buildHeaders2([suppliedHeaders.defaultHeaders, suppliedHeaders.requestHeaders]); for (const [name, value2] of authenticationHeaders?.values ?? []) { if (!supplied.nulls.has(name) && !built.req.headers.has(name)) { built.req.headers.set(name, value2); } } - this.validateHeaders(buildHeaders([supplied, built.req.headers]), security2); + this.validateHeaders(buildHeaders2([supplied, built.req.headers]), security2); } } catch (error) { x509Authentication?.retireRequestBody(); @@ -21955,7 +39329,7 @@ var init_client = __esm({ const startTime = x509Authentication?.requestStartedAt(options) ?? Date.now(); if (this.logLevel === "debug") { const body = typeof req.body === "string" ? { type: "string", length: req.body.length } : req.body; - loggerFor(this).debug(`[${requestLogID}] sending request`, formatRequestDetails({ + loggerFor2(this).debug(`[${requestLogID}] sending request`, formatRequestDetails2({ retryOfRequestLogID, method: options.method, url, @@ -21968,21 +39342,21 @@ var init_client = __esm({ throw this._makeUserAbortError(callerSignal?.aborted ? callerSignal : req.signal); } const security = options.__security ?? { bearerAuth: true }; - const controller = x509Authentication || this.fetchWithTimeout === _a3.prototype.fetchWithTimeout ? createRequestController(req.signal ?? (x509Authentication ? callerSignal : void 0), x509Authentication ? callerSignal : void 0) : new AbortController(); + const controller = x509Authentication || this.fetchWithTimeout === _a4.prototype.fetchWithTimeout ? createRequestController(req.signal ?? (x509Authentication ? callerSignal : void 0), x509Authentication ? callerSignal : void 0) : new AbortController(); const remainingTimeout = x509Authentication?.remainingTimeout(options, timeout) ?? timeout; - const fetchWithAuth = x509Authentication ? _a3.prototype.fetchWithAuth : this.fetchWithAuth; + const fetchWithAuth = x509Authentication ? _a4.prototype.fetchWithAuth : this.fetchWithAuth; x509Authentication?.releaseRequestBody(req.body); - const response = await fetchWithAuth.call(this, url, req, remainingTimeout, controller, security).catch(castToError); + const response = await fetchWithAuth.call(this, url, req, remainingTimeout, controller, security).catch(castToError2); const headersTime = Date.now(); if (response instanceof globalThis.Error) { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; if (callerSignal?.aborted || req.signal?.aborted) { throw this._makeUserAbortError(callerSignal?.aborted ? callerSignal : req.signal); } - const isTimeout = isAbortError(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); + const isTimeout = isAbortError2(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); if (retriesRemaining && !hasStreamingBody && (!x509Authentication || isTransientX509ConnectionError2(response))) { - loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); - loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, formatRequestDetails({ + loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); + loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, formatRequestDetails2({ retryOfRequestLogID, url, durationMs: headersTime - startTime, @@ -21991,8 +39365,8 @@ var init_client = __esm({ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, void 0, req.signal); } const terminalMessage = hasStreamingBody ? "error; streaming body cannot be retried" : "error; no more retries left"; - loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${terminalMessage}`); - loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${terminalMessage})`, formatRequestDetails({ + loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${terminalMessage}`); + loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${terminalMessage})`, formatRequestDetails2({ retryOfRequestLogID, url, durationMs: headersTime - startTime, @@ -22004,18 +39378,18 @@ var init_client = __esm({ if (isTimeout) { const transportCause = "cause" in response ? response.cause : void 0; const isHeadersTimeout = typeof transportCause === "object" && transportCause !== null && "code" in transportCause && transportCause.code === "UND_ERR_HEADERS_TIMEOUT"; - const timeoutError2 = isHeadersTimeout ? new APIConnectionTimeoutError({ + const timeoutError = isHeadersTimeout ? new APIConnectionTimeoutError2({ message: "Request timed out. Node.js fetch timed out waiting for response headers; configure a matching undici fetch and fetchOptions.dispatcher with an Agent whose headersTimeout is at least the SDK timeout." - }) : new APIConnectionTimeoutError(); + }) : new APIConnectionTimeoutError2(); if (x509Authentication) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } - throw Object.assign(timeoutError2, { cause: response }); + throw Object.assign(timeoutError, { cause: response }); } if (x509Authentication) { - throw new APIConnectionError({ message: "X.509 workload identity API connection failed." }); + throw new APIConnectionError2({ message: "X.509 workload identity API connection failed." }); } - throw new APIConnectionError({ + throw new APIConnectionError2({ message: getConnectionErrorMessage(response), cause: response }); @@ -22029,9 +39403,9 @@ var init_client = __esm({ } if (response.status === 401 && (x509Authentication || this._workloadIdentityAuth) && security.bearerAuth && (!x509Authentication || x509Authentication.usedWorkloadToken(options)) && (!x509Authentication || retriesRemaining > 0) && !hasStreamingBody && !options.__metadata?.["workloadIdentityTokenRefreshed"]) { if (x509Authentication) { - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } else { - await CancelReadableStream(response.body); + await CancelReadableStream2(response.body); this._workloadIdentityAuth?.invalidateToken(); } const replayOptions = { @@ -22047,12 +39421,12 @@ var init_client = __esm({ if (retriesRemaining && shouldRetry && !hasStreamingBody) { const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; if (x509Authentication) { - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } else { - await CancelReadableStream(response.body); + await CancelReadableStream2(response.body); } - loggerFor(this).info(`${responseInfo} - ${retryMessage2}`); - loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage2})`, formatRequestDetails({ + loggerFor2(this).info(`${responseInfo} - ${retryMessage2}`); + loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage2})`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -22062,11 +39436,11 @@ var init_client = __esm({ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers, req.signal); } const retryMessage = shouldRetry ? hasStreamingBody ? `error; streaming body cannot be retried` : `error; no more retries left` : `error; not retryable`; - loggerFor(this).info(`${responseInfo} - ${retryMessage}`); - const errText = x509Authentication ? await this.readX509ResponseError(response, options, timeout, controller, x509Authentication) : await response.text().catch((err2) => castToError(err2).message); - const errJSON = safeJSON(errText); + loggerFor2(this).info(`${responseInfo} - ${retryMessage}`); + const errText = x509Authentication ? await this.readX509ResponseError(response, options, timeout, controller, x509Authentication) : await response.text().catch((err2) => castToError2(err2).message); + const errJSON = safeJSON2(errText); const errMessage = errJSON ? void 0 : errText; - loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({ + loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -22077,8 +39451,8 @@ var init_client = __esm({ const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); throw err; } - loggerFor(this).info(responseInfo); - loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({ + loggerFor2(this).info(responseInfo); + loggerFor2(this).debug(`[${requestLogID}] response start`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -22087,7 +39461,7 @@ var init_client = __esm({ })); const continueRequest = x509Authentication?.continuation(); x509Authentication?.releaseRequestCredentials(); - __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").set(controller, { + __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").set(controller, { timeout, retriesRemaining, hasStreamingBody, @@ -22109,9 +39483,9 @@ var init_client = __esm({ return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path5, ...opts2 })) : { method: "get", path: path5, ...opts }); } requestAPIList(Page3, options) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; const request2 = authentication instanceof X509WorkloadIdentityAuth ? Promise.resolve(options).then((resolved) => authentication.runRequest(() => this.makeRequest(resolved, null, void 0), this)) : this.makeRequest(options, null, void 0); - const page3 = new PagePromise(this, request2, Page3); + const page3 = new PagePromise2(this, request2, Page3); const guarded = this.responsePromise(request2, async (client, props) => { const body = await this.parseResponseWithTimeout(client, props); return new Page3(client, props.response, body, props.options); @@ -22127,7 +39501,7 @@ var init_client = __esm({ bearerAuth: true, adminAPIKeyAuth: true }) { - if (this._workloadIdentityAuth && !__classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") && schemes.bearerAuth) { + if (this._workloadIdentityAuth && !__classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") && schemes.bearerAuth) { const headers = init.headers; const authHeader = headers.get("Authorization"); if (authHeader === `Bearer ${WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER}`) { @@ -22135,7 +39509,7 @@ var init_client = __esm({ headers.set("Authorization", `Bearer ${token}`); } } - const fetchWithTimeout = __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") ? _a3.prototype.fetchWithTimeout : this.fetchWithTimeout; + const fetchWithTimeout = __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") ? _a4.prototype.fetchWithTimeout : this.fetchWithTimeout; const response = await fetchWithTimeout.call(this, url, init, timeout, controller); return response; } @@ -22156,7 +39530,7 @@ var init_client = __esm({ fetchOptions.method = method2.toUpperCase(); } try { - const response = await (__classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") ?? this.fetch).call(void 0, url, fetchOptions); + const response = await (__classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") ?? this.fetch).call(void 0, url, fetchOptions); if (cleanup) { retainRequestAbortCallback(response.body ?? response, abort, controller.signal); } @@ -22206,11 +39580,11 @@ var init_client = __esm({ const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); if (x509Authentication) { const remaining = x509Authentication.remainingTimeout(options, x509Authentication.requestSnapshot().timeout); if (timeoutMillis >= remaining) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } } if (x509Authentication) { @@ -22218,7 +39592,7 @@ var init_client = __esm({ } else { const retrySignals = requestSignal === options.signal ? [requestSignal] : [requestSignal, options.signal]; try { - await sleep(timeoutMillis, ...retrySignals); + await sleep2(timeoutMillis, ...retrySignals); } catch (error) { const abortedSignal = retrySignals.find((signal) => signal?.aborted); if (abortedSignal) { @@ -22244,16 +39618,16 @@ var init_client = __esm({ * can call `this.authHeaders()` to resolve headers with request-local credentials. */ async buildRequest(inputOptions, { retryCount = 0 } = {}) { - if (__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").inRequest(this)) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + if (__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").inRequest(this)) { + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); return await authentication.runRequest(async () => { - const built = await _a3.prototype.buildRequest.call(this, inputOptions, { retryCount }); + const built = await _a4.prototype.buildRequest.call(this, inputOptions, { retryCount }); authentication.releaseRequestBody(built.req.body); return built; }, this); } const options = { ...inputOptions }; - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); const x509Tenant = x509Authentication?.snapshotTenant(this.organization, this.project); const x509Headers = x509Authentication?.snapshotHeaders(this._options.defaultHeaders, options.headers); if (x509Headers) { @@ -22266,7 +39640,7 @@ var init_client = __esm({ x509Authentication?.snapshotAPIURL(url); const explicitTimeout = "timeout" in options; if (explicitTimeout) - validatePositiveInteger("timeout", options.timeout); + validatePositiveInteger2("timeout", options.timeout); options.timeout = options.timeout ?? this.timeout; if (x509Authentication && x509RequestFetchOptions) { x509Authentication.snapshotRequest(options.signal, options.timeout, x509RequestFetchOptions); @@ -22319,25 +39693,25 @@ var init_client = __esm({ } const helperMethod = options.__metadata?.["helperMethod"]; const timeout = x509Headers ? x509Timeout : options.timeout; - const headers = buildHeaders([ + const headers = buildHeaders2([ idempotencyHeaders, { Accept: "application/json", ...!isRunningInBrowserOrBrowserWorker() ? { "User-Agent": this.getUserAgent() } : void 0, "X-Stainless-Retry-Count": String(retryCount), ...timeout ? { "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)) } : {}, - ...getPlatformHeaders(), + ...getPlatformHeaders2(), ...typeof helperMethod === "string" ? { "X-Stainless-Helper-Method": helperMethod } : {}, "OpenAI-Organization": x509Tenant ? x509Tenant.organization : this.organization, "OpenAI-Project": x509Tenant ? x509Tenant.project : this.project }, // X.509 owns streaming uploads before authentication so it can retire them on failure. - __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").isPlanningRequest() ? await this.authHeaders(options, options.__security ?? { bearerAuth: true }) : authenticationHeaders, + __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").isPlanningRequest() ? await this.authHeaders(options, options.__security ?? { bearerAuth: true }) : authenticationHeaders, x509Headers?.defaultHeaders ?? this._options.defaultHeaders, bodyHeaders, x509Headers?.requestHeaders ?? options.headers ]); - if (!this._provider && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f")?.isPlanningRequest()) { + if (!this._provider && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f")?.isPlanningRequest()) { this.validateHeaders(headers, options.__security ?? { bearerAuth: true }); } return headers.values; @@ -22346,7 +39720,7 @@ var init_client = __esm({ return () => controller.abort(); } _makeUserAbortError(signal) { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, configurable: true }); return error; } @@ -22354,11 +39728,11 @@ var init_client = __esm({ const { body, headers: rawHeaders } = options; if (!body) { if (body === void 0 && "body" in options) { - return { ...__classPrivateFieldGet(this, _OpenAI_encoder, "f").call(this, { body, headers: buildHeaders([rawHeaders]) }), isStreamingBody: false }; + return { ...__classPrivateFieldGet2(this, _OpenAI_encoder, "f").call(this, { body, headers: buildHeaders2([rawHeaders]) }), isStreamingBody: false }; } return { bodyHeaders: void 0, body: void 0, isStreamingBody: false }; } - const headers = buildHeaders([rawHeaders]); + const headers = buildHeaders2([rawHeaders]); const isReadableStream2 = typeof globalThis.ReadableStream !== "undefined" && body instanceof globalThis.ReadableStream; const isRetryableBody = !isReadableStream2 && (typeof body === "string" || body instanceof ArrayBuffer || ArrayBuffer.isView(body) || typeof globalThis.Blob !== "undefined" && body instanceof globalThis.Blob || body instanceof URLSearchParams || body instanceof FormData); if ( @@ -22374,7 +39748,7 @@ var init_client = __esm({ } else if (typeof body === "object" && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function")) { return { bodyHeaders: void 0, - body: ReadableStreamFrom(body), + body: ReadableStreamFrom2(body), isStreamingBody: true }; } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { @@ -22384,47 +39758,47 @@ var init_client = __esm({ isStreamingBody: false }; } else { - return { ...__classPrivateFieldGet(this, _OpenAI_encoder, "f").call(this, { body, headers }), isStreamingBody: false }; + return { ...__classPrivateFieldGet2(this, _OpenAI_encoder, "f").call(this, { body, headers }), isStreamingBody: false }; } } }; - _a3 = OpenAI, _OpenAI_encoder = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Authentication = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Credential = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Fetch = /* @__PURE__ */ new WeakMap(), _OpenAI_explicitDataResidency = /* @__PURE__ */ new WeakMap(), _OpenAI_responseAttempts = /* @__PURE__ */ new WeakMap(), _OpenAI_instances = /* @__PURE__ */ new WeakSet(), _OpenAI_baseURLOverridden = function _OpenAI_baseURLOverridden2() { - return __classPrivateFieldGet(this, _OpenAI_explicitDataResidency, "f") || this._provider !== void 0 || this.baseURL !== "https://api.openai.com/v1"; + _a4 = OpenAI, _OpenAI_encoder = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Authentication = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Credential = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Fetch = /* @__PURE__ */ new WeakMap(), _OpenAI_explicitDataResidency = /* @__PURE__ */ new WeakMap(), _OpenAI_responseAttempts = /* @__PURE__ */ new WeakMap(), _OpenAI_instances = /* @__PURE__ */ new WeakSet(), _OpenAI_baseURLOverridden = function _OpenAI_baseURLOverridden2() { + return __classPrivateFieldGet2(this, _OpenAI_explicitDataResidency, "f") || this._provider !== void 0 || this.baseURL !== "https://api.openai.com/v1"; }; - OpenAI.OpenAI = _a3; + OpenAI.OpenAI = _a4; OpenAI.DEFAULT_TIMEOUT = 6e5; OpenAI.OpenAIError = OpenAIError; - OpenAI.APIError = APIError; - OpenAI.APIConnectionError = APIConnectionError; - OpenAI.APIConnectionTimeoutError = APIConnectionTimeoutError; - OpenAI.APIUserAbortError = APIUserAbortError; - OpenAI.NotFoundError = NotFoundError; - OpenAI.ConflictError = ConflictError; - OpenAI.RateLimitError = RateLimitError; - OpenAI.BadRequestError = BadRequestError; - OpenAI.AuthenticationError = AuthenticationError; - OpenAI.InternalServerError = InternalServerError; - OpenAI.PermissionDeniedError = PermissionDeniedError; - OpenAI.UnprocessableEntityError = UnprocessableEntityError; + OpenAI.APIError = APIError2; + OpenAI.APIConnectionError = APIConnectionError2; + OpenAI.APIConnectionTimeoutError = APIConnectionTimeoutError2; + OpenAI.APIUserAbortError = APIUserAbortError2; + OpenAI.NotFoundError = NotFoundError2; + OpenAI.ConflictError = ConflictError2; + OpenAI.RateLimitError = RateLimitError2; + OpenAI.BadRequestError = BadRequestError2; + OpenAI.AuthenticationError = AuthenticationError2; + OpenAI.InternalServerError = InternalServerError2; + OpenAI.PermissionDeniedError = PermissionDeniedError2; + OpenAI.UnprocessableEntityError = UnprocessableEntityError2; OpenAI.InvalidWebhookSignatureError = InvalidWebhookSignatureError; - OpenAI.toFile = toFile; + OpenAI.toFile = toFile2; OpenAI.toStreamingFile = toStreamingFile; - OpenAI.Completions = Completions2; + OpenAI.Completions = Completions3; OpenAI.Chat = Chat; OpenAI.Embeddings = Embeddings; - OpenAI.Files = Files3; + OpenAI.Files = Files5; OpenAI.Images = Images; OpenAI.ContentProvenanceChecks = ContentProvenanceChecks; OpenAI.Audio = Audio; OpenAI.Moderations = Moderations; - OpenAI.Models = Models; + OpenAI.Models = Models3; OpenAI.FineTuning = FineTuning; OpenAI.Graders = Graders2; OpenAI.VectorStores = VectorStores; OpenAI.Safety = Safety; - OpenAI.Webhooks = Webhooks; - OpenAI.Beta = Beta; - OpenAI.Batches = Batches; + OpenAI.Webhooks = Webhooks2; + OpenAI.Beta = Beta2; + OpenAI.Batches = Batches3; OpenAI.Uploads = Uploads; OpenAI.Admin = Admin; OpenAI.Responses = Responses2; @@ -22433,12 +39807,12 @@ var init_client = __esm({ OpenAI.Conversations = Conversations; OpenAI.Evals = Evals; OpenAI.Containers = Containers; - OpenAI.Skills = Skills; + OpenAI.Skills = Skills3; OpenAI.Videos = Videos; OpenAI.ConversationCursorPage = ConversationCursorPage; OpenAI.CursorPage = CursorPage; OpenAI.NextCursorPage = NextCursorPage; - OpenAI.Page = Page; + OpenAI.Page = Page2; OpenAI.TokenPage = TokenPage; composedCallerSignals = /* @__PURE__ */ new WeakMap(); } @@ -22447,11 +39821,11 @@ var init_client = __esm({ // node_modules/openai/azure.mjs var init_azure = __esm({ "node_modules/openai/azure.mjs"() { - init_headers2(); - init_error2(); - init_utils2(); - init_path(); - init_client(); + init_headers3(); + init_error4(); + init_utils4(); + init_path2(); + init_client2(); init_data_residency(); } }); @@ -22460,347 +39834,128 @@ var init_azure = __esm({ var brand_privateBedrockClient; var init_bedrock = __esm({ "node_modules/openai/internal/bedrock.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); brand_privateBedrockClient = /* @__PURE__ */ Symbol.for("openai.privateBedrockClient"); } }); // node_modules/openai/bedrock.mjs -var _a4; +var _a5; var init_bedrock2 = __esm({ "node_modules/openai/bedrock.mjs"() { - init_error2(); - init_client(); + init_error4(); + init_client2(); init_realtime_credentials(); init_data_residency(); init_bedrock(); - init_headers2(); - init_utils2(); + init_headers3(); + init_utils4(); init_ResponsesParser(); - init_resources(); - _a4 = brand_privateBedrockClient; + init_resources3(); + _a5 = brand_privateBedrockClient; } }); // node_modules/openai/index.mjs var init_openai = __esm({ "node_modules/openai/index.mjs"() { - init_client(); - init_uploads2(); - init_api_promise(); - init_client(); - init_pagination(); - init_error(); + init_client2(); + init_uploads4(); + init_api_promise2(); + init_client2(); + init_pagination2(); + init_error3(); init_azure(); init_bedrock2(); } }); -// node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js -function getBunSandboxEnvValue(name) { - if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) { - return void 0; +// node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +function normalizeProviderError(error) { + if (!(error instanceof Error)) { + return { message: safeJsonStringify2(error), messageCarriesBody: false }; } - if (procEnvCache === null) { - procEnvCache = /* @__PURE__ */ new Map(); - try { - const { readFileSync } = __require("node:fs"); - const data = readFileSync("/proc/self/environ", "utf-8"); - for (const entry2 of data.split("\0")) { - const idx = entry2.indexOf("="); - if (idx > 0) { - procEnvCache.set(entry2.slice(0, idx), entry2.slice(idx + 1)); - } - } - } catch { - } - } - return procEnvCache.get(name); + const sdkError = error; + const status = extractStatus(sdkError); + const body = extractBody(sdkError); + const messageCarriesBody = body === void 0 || error.message.includes(body); + return { + status, + body, + message: error.message, + messageCarriesBody + }; } -function getProviderEnvValue(name, env) { - return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0; -} -var procEnvCache; -var init_provider_env = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js"() { - procEnvCache = null; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js -function isJsonSchemaObject(value2) { - return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); -} -function isStructuredSchema(schema4) { - if (!isJsonSchemaObject(schema4)) - return false; - const types = typeof schema4.type === "string" ? [schema4.type] : Array.isArray(schema4.type) ? schema4.type : []; - return types.includes("object") || types.includes("array") || schema4.properties !== void 0 || schema4.items !== void 0; -} -function schemaAllowsNull(schema4) { - if (!isJsonSchemaObject(schema4)) - return false; - if (schema4.type === "null" || Array.isArray(schema4.type) && schema4.type.includes("null")) - return true; - if (schema4.const === null || Array.isArray(schema4.enum) && schema4.enum.includes(null)) - return true; - return Array.isArray(schema4.anyOf) && schema4.anyOf.some((variant) => schemaAllowsNull(variant)); -} -function makeJsonSchemaNodeStrict(schema4, isUnsupportedKeyword) { - if (!isJsonSchemaObject(schema4)) { - throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported"); - } - for (const key of UNSUPPORTED_STRICT_SCHEMA_KEYS) { - if (schema4[key] !== void 0) { - throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`); - } - } - if (isUnsupportedKeyword) { - for (const [key, value2] of Object.entries(schema4)) { - if (isUnsupportedKeyword(key, value2)) { - throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value2)} is unsupported`); - } - } - } - if (schema4.anyOf !== void 0) { - if (!Array.isArray(schema4.anyOf) || schema4.anyOf.length === 0) { - throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema"); - } - for (const variant of schema4.anyOf) { - if (isStructuredSchema(variant)) { - throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported"); - } - makeJsonSchemaNodeStrict(variant, isUnsupportedKeyword); - } - } - if (schema4.items !== void 0) { - if (Array.isArray(schema4.items)) { - throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported"); - } - makeJsonSchemaNodeStrict(schema4.items, isUnsupportedKeyword); - } - const isObjectSchema = schema4.type === "object"; - if (schema4.properties !== void 0 && !isObjectSchema) { - throw new UnsupportedStrictJsonSchemaError("properties require type object"); - } - if (!isObjectSchema) - return; - if (schema4.additionalProperties !== void 0 && schema4.additionalProperties !== false) { - throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported"); - } - if (schema4.properties !== void 0 && !isJsonSchemaObject(schema4.properties)) { - throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map"); - } - if (schema4.required !== void 0 && (!Array.isArray(schema4.required) || schema4.required.some((key) => typeof key !== "string"))) { - throw new UnsupportedStrictJsonSchemaError("object required must be a string array"); - } - const properties = schema4.properties ?? {}; - const propertyNames = Object.keys(properties); - const required = new Set(Array.isArray(schema4.required) ? schema4.required : []); - if ([...required].some((key) => !propertyNames.includes(key))) { - throw new UnsupportedStrictJsonSchemaError("required contains an unknown property"); - } - for (const [key, property] of Object.entries(properties)) { - makeJsonSchemaNodeStrict(property, isUnsupportedKeyword); - if (!required.has(key) && !schemaAllowsNull(property)) { - properties[key] = { anyOf: [property, { type: "null" }] }; - } - } - schema4.required = propertyNames; - schema4.additionalProperties = false; -} -function makeStrictJsonSchema(schema4, isUnsupportedKeyword) { - const cloned = structuredClone(schema4); - if (!isJsonSchemaObject(cloned)) { - throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); - } - makeJsonSchemaNodeStrict(cloned, isUnsupportedKeyword); - if (cloned.type !== "object") { - throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); - } - return cloned; -} -function prefersJsonSchemaStrictSampling(tool) { - const config = tool.constrainedSampling; - return !!config && config.type === "json_schema" && config.strict === "prefer"; -} -function isStrictToolLimitErrorMessage(message) { - return STRICT_TOOL_LIMIT_ERROR_MESSAGES.some((limitMessage) => message.includes(limitMessage)); -} -function getJsonSchemaToolParameters(tool, strict) { - return strict === true ? makeStrictJsonSchema(tool.parameters) : tool.parameters; -} -function getGrammarToolInput(toolName2, arguments_, inputProperty) { - const input = arguments_[inputProperty]; - if (typeof input !== "string") { - throw new Error(`Grammar tool call "${toolName2}" requires argument "${inputProperty}" to be a string.`); - } - return input; -} -function appendGrammarToolInputJsonDelta(buffer, inputProperty, inputDelta) { - if (buffer.closed) { - throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); - } - if (inputDelta.length === 0) - return void 0; - buffer.input += inputDelta; - return grammarToolInputJsonStart(buffer, inputProperty) + JSON.stringify(inputDelta).slice(1, -1); -} -function closeGrammarToolInputJson(buffer, inputProperty, finalInput) { - if (buffer.closed) { - if (finalInput === void 0 || finalInput === buffer.input) - return void 0; - throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); - } - if (finalInput !== void 0 && !finalInput.startsWith(buffer.input)) { - throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`); - } - const rest = finalInput === void 0 ? "" : finalInput.slice(buffer.input.length); - if (finalInput !== void 0) - buffer.input = finalInput; - buffer.closed = true; - return `${grammarToolInputJsonStart(buffer, inputProperty)}${JSON.stringify(rest).slice(1, -1)}"}`; -} -function grammarToolInputJsonStart(buffer, inputProperty) { - if (buffer.started) - return ""; - buffer.started = true; - return `{${JSON.stringify(inputProperty)}:"`; -} -function inferGrammarInputProperty(tool) { - const schema4 = tool.parameters; - if (schema4.type !== "object") { - throw new Error("grammar constrained sampling requires an object parameter schema"); - } - if (!Array.isArray(schema4.required) || schema4.required.length !== 1 || typeof schema4.required[0] !== "string") { - throw new Error("grammar constrained sampling requires exactly one required string property"); - } - const inputProperty = schema4.required[0]; - if (!schema4.properties?.[inputProperty]) { - throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`); - } - if (schema4.properties[inputProperty]?.type !== "string") { - throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`); - } - return inputProperty; -} -function resolveJsonSchemaStrictSampling(tool, supportsStrictMode, isUnsupportedKeyword) { - const config = tool.constrainedSampling; - if (!config || config.type !== "json_schema") - return void 0; - if (supportsStrictMode) { - try { - makeStrictJsonSchema(tool.parameters, isUnsupportedKeyword); - return true; - } catch (error) { - if (!(error instanceof UnsupportedStrictJsonSchemaError)) - throw error; - if (config.strict !== "require") - return void 0; - throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`); - } - } - if (config.strict === "require") { - throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`); - } +function extractStatus(error) { + if (typeof error.statusCode === "number") + return error.statusCode; + if (typeof error.status === "number") + return error.status; + if (typeof error.$metadata?.httpStatusCode === "number") + return error.$metadata.httpStatusCode; + if (typeof error.$response?.statusCode === "number") + return error.$response.statusCode; return void 0; } -function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) { - const config = tool.constrainedSampling; - if (!config || config.type !== "grammar") { +function extractBody(error) { + const bodyText = pickBodyText(error); + if (bodyText === void 0) return void 0; - } - if (!supportsOpenAIGrammarTools) { + const trimmed = bodyText.trim(); + if (trimmed.length === 0) return void 0; - } - const larkDefinition = config.variants.openai_lark; - const regexDefinition = config.variants.openai_regex; - const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0; - const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0; - if (!hasLarkDefinition && !hasRegexDefinition) { - throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`); - } - try { - return { - format: hasLarkDefinition ? "lark" : "regex", - definition: hasLarkDefinition ? larkDefinition : regexDefinition, - inputProperty: inferGrammarInputProperty(tool) - }; - } catch (error) { - const message = error instanceof Error ? error.message : String(error); - throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`); - } + return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS); } -function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) { - const properties = /* @__PURE__ */ new Map(); - for (const tool of tools ?? []) { - const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools); - if (grammar) { - properties.set(tool.name, grammar.inputProperty); - } - } - return properties; +function pickBodyText(error) { + if (typeof error.body === "string") + return error.body; + if (isPlainNonEmptyObject(error.error)) + return safeJsonStringify2(error.error); + const responseBody = error.$response?.body; + if (typeof responseBody === "string") + return responseBody; + if (isReadableStreamLike(responseBody)) + return void 0; + if (isPlainNonEmptyObject(responseBody)) + return safeJsonStringify2(responseBody); + return void 0; } -var UnsupportedStrictJsonSchemaError, UNSUPPORTED_STRICT_SCHEMA_KEYS, STRICT_TOOL_LIMIT_ERROR_MESSAGES; -var init_constrained_sampling = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js"() { - UnsupportedStrictJsonSchemaError = class extends Error { - }; - UNSUPPORTED_STRICT_SCHEMA_KEYS = [ - "$ref", - "$defs", - "definitions", - "allOf", - "oneOf", - "patternProperties", - "dependentSchemas", - "dependencies", - "unevaluatedProperties", - "propertyNames", - "contains", - "prefixItems", - "not", - "if", - "then", - "else" - ]; - STRICT_TOOL_LIMIT_ERROR_MESSAGES = [ - "The compiled grammar is too large", - "Too many strict tools (", - "Schemas contains too many parameters with union types (" - ]; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js -function inferCopilotInitiator(messages) { - const last = messages[messages.length - 1]; - return last && last.role !== "user" ? "agent" : "user"; +function isReadableStreamLike(value2) { + return typeof value2 === "object" && value2 !== null && "pipe" in value2 && typeof value2.pipe === "function"; } -function hasCopilotVisionInput(messages) { - return messages.some((msg) => { - if (msg.role === "user" && Array.isArray(msg.content)) { - return msg.content.some((c) => c.type === "image"); - } - if (msg.role === "toolResult" && Array.isArray(msg.content)) { - return msg.content.some((c) => c.type === "image"); - } +function isPlainNonEmptyObject(value2) { + if (typeof value2 !== "object" || value2 === null) return false; - }); + const proto = Object.getPrototypeOf(value2); + if (proto !== Object.prototype && proto !== null) + return false; + return Object.keys(value2).length > 0; } -function buildCopilotDynamicHeaders(params) { - const headers = { - "X-Initiator": inferCopilotInitiator(params.messages), - "Openai-Intent": "conversation-edits" - }; - if (params.hasImages) { - headers["Copilot-Vision-Request"] = "true"; +function formatProviderError(norm, prefix) { + if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) { + return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message; } - return headers; + return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`; } -var init_github_copilot_headers = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js"() { +function truncateErrorText(text2, maxChars) { + if (text2.length <= maxChars) + return text2; + return `${ownedSlice(text2, 0, maxChars)}... [truncated ${text2.length - maxChars} chars]`; +} +function safeJsonStringify2(value2) { + try { + const serialized = JSON.stringify(value2); + return serialized === void 0 ? String(value2) : serialized; + } catch { + return String(value2); + } +} +var MAX_PROVIDER_ERROR_BODY_CHARS; +var init_error_body = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/error-body.js"() { + init_text(); + MAX_PROVIDER_ERROR_BODY_CHARS = 4e3; } }); @@ -22838,994 +39993,6 @@ var init_hash = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js -function sanitizeSurrogates(text2) { - return text2.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(? { - const length = jsonString.length; - let index = 0; - const markPartialJSON = (msg) => { - throw new PartialJSON2(`${msg} at position ${index}`); - }; - const throwMalformedError = (msg) => { - throw new MalformedJSON2(`${msg} at position ${index}`); - }; - const parseAny = () => { - skipBlank(); - if (index >= length) - markPartialJSON("Unexpected end of input"); - if (jsonString[index] === '"') - return parseStr(); - if (jsonString[index] === "{") - return parseObj(); - if (jsonString[index] === "[") - return parseArr(); - if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) { - index += 4; - return null; - } - if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) { - index += 4; - return true; - } - if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) { - index += 5; - return false; - } - if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) { - index += 8; - return Infinity; - } - if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) { - index += 9; - return -Infinity; - } - if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) { - index += 3; - return NaN; - } - return parseNum(); - }; - const parseStr = () => { - const start = index; - let escape2 = false; - index++; - while (index < length && (jsonString[index] !== '"' || escape2 && jsonString[index - 1] === "\\")) { - escape2 = jsonString[index] === "\\" ? !escape2 : false; - index++; - } - if (jsonString.charAt(index) == '"') { - try { - return JSON.parse(jsonString.substring(start, ++index - Number(escape2))); - } catch (e) { - throwMalformedError(String(e)); - } - } else if (options_1.Allow.STR & allow) { - try { - return JSON.parse(jsonString.substring(start, index - Number(escape2)) + '"'); - } catch (e) { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); - } - } - markPartialJSON("Unterminated string literal"); - }; - const parseObj = () => { - index++; - skipBlank(); - const obj2 = {}; - try { - while (jsonString[index] !== "}") { - skipBlank(); - if (index >= length && options_1.Allow.OBJ & allow) - return obj2; - const key = parseStr(); - skipBlank(); - index++; - try { - const value2 = parseAny(); - obj2[key] = value2; - } catch (e) { - if (options_1.Allow.OBJ & allow) - return obj2; - else - throw e; - } - skipBlank(); - if (jsonString[index] === ",") - index++; - } - } catch (e) { - if (options_1.Allow.OBJ & allow) - return obj2; - else - markPartialJSON("Expected '}' at end of object"); - } - index++; - return obj2; - }; - const parseArr = () => { - index++; - const arr2 = []; - try { - while (jsonString[index] !== "]") { - arr2.push(parseAny()); - skipBlank(); - if (jsonString[index] === ",") { - index++; - } - } - } catch (e) { - if (options_1.Allow.ARR & allow) { - return arr2; - } - markPartialJSON("Expected ']' at end of array"); - } - index++; - return arr2; - }; - const parseNum = () => { - if (index === 0) { - if (jsonString === "-") - throwMalformedError("Not sure what '-' is"); - try { - return JSON.parse(jsonString); - } catch (e) { - if (options_1.Allow.NUM & allow) - try { - return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); - } catch (e2) { - } - throwMalformedError(String(e)); - } - } - const start = index; - if (jsonString[index] === "-") - index++; - while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1) - index++; - if (index == length && !(options_1.Allow.NUM & allow)) - markPartialJSON("Unterminated number literal"); - try { - return JSON.parse(jsonString.substring(start, index)); - } catch (e) { - if (jsonString.substring(start, index) === "-") - markPartialJSON("Not sure what '-' is"); - try { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); - } catch (e2) { - throwMalformedError(String(e2)); - } - } - }; - const skipBlank = () => { - while (index < length && " \n\r ".includes(jsonString[index])) { - index++; - } - }; - return parseAny(); - }; - var parse2 = parseJSON2; - exports.parse = parse2; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js -function isControlCharacter(char) { - const codePoint = char.codePointAt(0); - return codePoint !== void 0 && codePoint >= 0 && codePoint <= 31; -} -function escapeControlCharacter(char) { - switch (char) { - case "\b": - return "\\b"; - case "\f": - return "\\f"; - case "\n": - return "\\n"; - case "\r": - return "\\r"; - case " ": - return "\\t"; - default: - return `\\u${char.codePointAt(0)?.toString(16).padStart(4, "0") ?? "0000"}`; - } -} -function repairJson(json) { - let repaired = ""; - let inString = false; - for (let index = 0; index < json.length; index++) { - const char = json[index]; - if (!inString) { - repaired += char; - if (char === '"') { - inString = true; - } - continue; - } - if (char === '"') { - repaired += char; - inString = false; - continue; - } - if (char === "\\") { - const nextChar = json[index + 1]; - if (nextChar === void 0) { - repaired += "\\\\"; - continue; - } - if (nextChar === "u") { - const unicodeDigits = json.slice(index + 2, index + 6); - if (/^[0-9a-fA-F]{4}$/.test(unicodeDigits)) { - repaired += `\\u${unicodeDigits}`; - index += 5; - continue; - } - } - if (VALID_JSON_ESCAPES.has(nextChar)) { - repaired += `\\${nextChar}`; - index += 1; - continue; - } - repaired += "\\\\"; - continue; - } - repaired += isControlCharacter(char) ? escapeControlCharacter(char) : char; - } - return repaired; -} -function parseJsonWithRepair(json) { - try { - return JSON.parse(json); - } catch (error) { - const repairedJson = repairJson(json); - if (repairedJson !== json) { - return JSON.parse(repairedJson); - } - throw error; - } -} -function parseToolCallArguments(json) { - if (!json?.trim()) - return { arguments: {} }; - try { - const parsed = parseJsonWithRepair(json); - if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { - throw new Error("Tool arguments must be a JSON object"); - } - return { arguments: parsed }; - } catch (error) { - return { - arguments: {}, - argumentsError: `${error instanceof Error ? error.message : String(error)} - -Received arguments: -${json}` - }; - } -} -function parseStreamingJson(partialJson) { - if (!partialJson || partialJson.trim() === "") { - return {}; - } - try { - return parseJsonWithRepair(partialJson); - } catch { - try { - const result = (0, import_partial_json.parse)(partialJson); - return result ?? {}; - } catch { - try { - const result = (0, import_partial_json.parse)(repairJson(partialJson)); - return result ?? {}; - } catch { - return {}; - } - } - } -} -var import_partial_json, VALID_JSON_ESCAPES; -var init_json_parse = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js"() { - import_partial_json = __toESM(require_dist(), 1); - VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]); - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js -function isDelimiter(char) { - return char === " " || char === " " || char === "\n" || char === "\r" || char === "," || char === ":" || char === "{" || char === "}" || char === "[" || char === "]" || char === '"'; -} -function isHexDigit(char) { - return char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F"; -} -function scalarValue(token) { - for (const [literal, value2] of LITERALS) - if (token === literal) - return value2; - return NUMBER.test(token) ? Number(token) : void 0; -} -function pendingScalarValue(token) { - for (const [literal, value2] of LITERALS) - if (literal.startsWith(token)) - return value2; - if (NUMBER.test(token)) - return Number(token); - const mantissa = NUMBER_WITHOUT_EXPONENT_DIGITS.exec(token); - return mantissa === null ? void 0 : Number(mantissa[1]); -} -function setSlot(container, slot, value2) { - if (slot.kind === "element") - container[slot.index] = value2; - else if (slot.kind === "member") - setMember(container, slot.key, value2); -} -function setMember(members, key, value2) { - if (key === "__proto__") { - Object.defineProperty(members, key, { value: value2, writable: true, enumerable: true, configurable: true }); - } else { - members[key] = value2; - } -} -var MAX_REPORTED_DEPTH, ROOT_SLOT, CREDIT_PER_APPEND, CREDIT_PER_CHARACTER, MAX_PENDING_SCALAR_LENGTH, NUMBER, NUMBER_WITHOUT_EXPONENT_DIGITS, LITERALS, QUOTE, BACKSLASH, StreamingJsonParser, ToolCallArgumentsStream, SIMPLE_ESCAPES; -var init_streaming_json = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js"() { - init_json_parse(); - MAX_REPORTED_DEPTH = 32; - ROOT_SLOT = { kind: "root" }; - CREDIT_PER_APPEND = 256; - CREDIT_PER_CHARACTER = 8; - MAX_PENDING_SCALAR_LENGTH = 64; - NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; - NUMBER_WITHOUT_EXPONENT_DIGITS = /^(-?(?:0|[1-9]\d*)(?:\.\d+)?)[eE][+-]?$/; - LITERALS = [ - ["true", true], - ["false", false], - ["null", null] - ]; - QUOTE = 34; - BACKSLASH = 92; - StreamingJsonParser = class { - #root = void 0; - #done = false; - #stack = []; - #string = void 0; - #scalar = ""; - #scalarSlot = void 0; - /** Sum of `size + 1` over the open path: what a fresh snapshot copies. */ - #pathCost = 0; - #credit = 0; - #dirty = false; - #snapshot = void 0; - /** Changes of the piece being read. */ - #changes = []; - /** - * Read the next piece of text; returns the changes it made, in order. Costs time linear in `text.length`. - */ - append(text2) { - this.#credit += CREDIT_PER_APPEND + CREDIT_PER_CHARACTER * text2.length; - this.#changes = []; - if (this.#string !== void 0) - this.#string.change = void 0; - let index = 0; - while (index < text2.length && !this.#done) { - const open = this.#string; - if (open !== void 0) - index = this.#readString(open, text2, index); - else if (this.#scalar !== "") - index = this.#readScalar(text2, index); - else - this.#structural(text2[index++]); - } - return this.#changes; - } - /** - * The value of the text read so far: `undefined` before a value starts, otherwise a plain JSON value that never - * changes afterwards. Returns the previous snapshot while the text read since did not change the value, or while a - * fresh copy of the open path is not yet paid for (see the module comment). - */ - snapshot() { - if (!this.#dirty) - return this.#snapshot; - const pending = this.#pendingScalar(); - const cost = this.#pathCost + (pending === void 0 ? 0 : 1); - if (cost > this.#credit) - return this.#snapshot; - this.#credit -= cost; - this.#dirty = false; - this.#snapshot = this.#copyOpenPath(pending); - return this.#snapshot; - } - /** Read string characters from `start` until the string ends or the text does; returns the next index. */ - #readString(open, text2, start) { - let runStart = start; - for (let index = start; index < text2.length; index++) { - const code = text2.charCodeAt(index); - if (open.escape !== "") { - if (this.#continueEscape(open, text2[index])) { - runStart = index + 1; - continue; - } - runStart = index; - } - if (code === QUOTE) { - if (index > runStart) - this.#appendString(open, text2.slice(runStart, index)); - this.#endString(open); - return index + 1; - } - if (code === BACKSLASH) { - if (index > runStart) - this.#appendString(open, text2.slice(runStart, index)); - open.escape = "\\"; - runStart = index + 1; - } - } - if (text2.length > runStart) - this.#appendString(open, text2.slice(runStart)); - return text2.length; - } - /** Read number or literal characters from `start` up to the next delimiter; returns the delimiter's index. */ - #readScalar(text2, start) { - let end = start; - while (end < text2.length && !isDelimiter(text2[end])) - end++; - if (end > start) { - this.#scalar += text2.slice(start, end); - if (this.#scalarSlot !== void 0) - this.#dirty = true; - } - if (end < text2.length) - this.#endScalar(); - return end; - } - /** Handle one character outside strings. */ - #structural(char) { - switch (char) { - case " ": - case " ": - case "\n": - case "\r": - return; - case '"': - this.#startString(); - return; - case "{": - case "[": - this.#openContainer(char === "{" ? {} : []); - return; - case "}": - case "]": - this.#closeContainer(); - return; - case ":": { - const frame = this.#stack.at(-1); - if (frame !== void 0 && !Array.isArray(frame.container) && frame.phase === "colon") - frame.phase = "value"; - return; - } - case ",": { - const frame = this.#stack.at(-1); - if (frame !== void 0) - frame.phase = Array.isArray(frame.container) ? "value" : "key"; - return; - } - default: - this.#scalar = char; - this.#scalarSlot = this.#valueSlot(); - if (this.#scalarSlot !== void 0) - this.#dirty = true; - } - } - /** Where a value starting now goes, or `undefined` when this position takes no value. */ - #valueSlot() { - const frame = this.#stack.at(-1); - if (frame === void 0) - return this.#root === void 0 ? ROOT_SLOT : void 0; - if (Array.isArray(frame.container)) - return { kind: "element", index: frame.container.length }; - if ((frame.phase === "value" || frame.phase === "colon") && frame.key !== void 0) { - return { kind: "member", key: frame.key }; - } - return void 0; - } - #startString() { - const frame = this.#stack.at(-1); - if (frame !== void 0 && !Array.isArray(frame.container) && (frame.phase === "key" || frame.phase === "comma")) { - this.#string = { target: "key", slot: void 0, text: "", escape: "", path: void 0, change: void 0 }; - return; - } - const slot = this.#valueSlot(); - const path5 = this.#reportedPath(slot); - this.#string = { target: "value", slot, text: "", escape: "", path: path5, change: void 0 }; - this.#place(slot, ""); - if (path5 !== void 0) - this.#string.change = this.#report({ kind: "set", path: path5, value: "" }); - } - /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ - #reportedPath(slot) { - if (slot === void 0) - return void 0; - if (slot.kind === "root") - return []; - const frame = this.#stack.at(-1); - if (!frame.reportsInside) - return void 0; - return [...frame.path, slot.kind === "member" ? slot.key : slot.index]; - } - #report(change) { - this.#changes.push(change); - return change; - } - /** Continue an escape with `char`; returns false when `char` is not part of it and must be read normally. */ - #continueEscape(open, char) { - if (open.escape === "\\") { - const decoded = SIMPLE_ESCAPES[char]; - if (decoded !== void 0) { - open.escape = ""; - this.#appendString(open, decoded); - return true; - } - if (char === "u") { - open.escape = "\\u"; - return true; - } - open.escape = ""; - this.#appendString(open, "\\"); - return false; - } - if (isHexDigit(char)) { - open.escape += char; - if (open.escape.length < 6) - return true; - const decoded = String.fromCharCode(Number.parseInt(open.escape.slice(2), 16)); - open.escape = ""; - this.#appendString(open, decoded); - return true; - } - const literal = open.escape; - open.escape = ""; - this.#appendString(open, literal); - return false; - } - #appendString(open, text2) { - open.text += text2; - if (open.target !== "value") - return; - this.#place(open.slot, open.text); - if (open.path === void 0) - return; - const change = open.change; - if (change !== void 0 && this.#changes.at(-1) === change) { - if (change.kind === "set") - change.value = change.value + text2; - else - change.text += text2; - return; - } - open.change = this.#report({ kind: "append", path: open.path, text: text2 }); - } - #endString(open) { - this.#string = void 0; - const frame = this.#stack.at(-1); - if (open.target === "key") { - if (frame === void 0) - return; - frame.key = open.text; - frame.phase = "colon"; - return; - } - this.#valueEnded(frame); - } - #endScalar() { - const token = this.#scalar; - const slot = this.#scalarSlot; - this.#scalar = ""; - this.#scalarSlot = void 0; - const value2 = scalarValue(token); - if (value2 !== void 0) { - this.#place(slot, value2); - const path5 = this.#reportedPath(slot); - if (path5 !== void 0) - this.#report({ kind: "set", path: path5, value: value2 }); - } - this.#valueEnded(this.#stack.at(-1)); - } - /** The value of the unterminated scalar at the end of the text, if it shows. */ - #pendingScalar() { - const slot = this.#scalarSlot; - const token = this.#scalar; - if (slot === void 0 || token === "" || token.length > MAX_PENDING_SCALAR_LENGTH) - return void 0; - const value2 = pendingScalarValue(token); - return value2 === void 0 ? void 0 : { slot, value: value2 }; - } - #openContainer(container) { - const slot = this.#valueSlot(); - const path5 = this.#reportedPath(slot); - this.#place(slot, container); - this.#stack.push({ - container, - slot, - path: path5, - reportsInside: path5 !== void 0 && path5.length < MAX_REPORTED_DEPTH, - size: 0, - key: void 0, - phase: Array.isArray(container) ? "value" : "key" - }); - this.#pathCost += 1; - this.#dirty = true; - if (path5 !== void 0) - this.#report({ kind: "set", path: path5, value: Array.isArray(container) ? [] : {} }); - } - #closeContainer() { - const frame = this.#stack.pop(); - if (frame === void 0) - return; - this.#pathCost -= frame.size + 1; - this.#dirty = true; - if (frame.path !== void 0 && !frame.reportsInside) { - this.#report({ kind: "set", path: frame.path, value: frame.container }); - } - this.#valueEnded(this.#stack.at(-1)); - } - /** A value in `frame`, or the root value when there is no frame, has ended. */ - #valueEnded(frame) { - if (frame === void 0) { - if (this.#root !== void 0) - this.#done = true; - return; - } - frame.phase = "comma"; - } - /** Set the value at `slot` in the open path; nothing for a value in an invalid position. */ - #place(slot, value2) { - if (slot === void 0) - return; - this.#dirty = true; - if (slot.kind === "root") { - this.#root = value2; - return; - } - const frame = this.#stack.at(-1); - if (slot.kind === "element") { - const elements = frame.container; - if (slot.index === elements.length) { - frame.size++; - this.#pathCost++; - } - elements[slot.index] = value2; - return; - } - const members = frame.container; - if (!Object.hasOwn(members, slot.key)) { - frame.size++; - this.#pathCost++; - } - setMember(members, slot.key, value2); - } - /** A fresh snapshot: copies of the open containers, innermost first, each holding the copy of its open child. */ - #copyOpenPath(pending) { - if (this.#stack.length === 0) - return pending?.slot.kind === "root" ? pending.value : this.#root; - let child; - let childSlot; - for (let depth = this.#stack.length - 1; depth >= 0; depth--) { - const frame = this.#stack[depth]; - const copy2 = Array.isArray(frame.container) ? frame.container.slice() : { ...frame.container }; - if (depth === this.#stack.length - 1 && pending !== void 0) - setSlot(copy2, pending.slot, pending.value); - if (child !== void 0 && childSlot !== void 0) - setSlot(copy2, childSlot, child); - child = copy2; - childSlot = frame.slot; - } - return childSlot?.kind === "root" ? child : this.#root; - } - }; - ToolCallArgumentsStream = class { - #text = ""; - #parser = new StreamingJsonParser(); - #snapshot = void 0; - #arguments = {}; - /** The raw argument text received so far. */ - get text() { - return this.#text; - } - /** Append a piece of argument text; returns the partial arguments, a new object whenever they changed. */ - append(delta) { - this.#text += delta; - this.#parser.append(delta); - return this.#partial(); - } - /** - * Take the provider's complete argument text. When it continues the text so far, returns the missing piece as - * `delta`; otherwise starts over with `text`. Either way returns the partial arguments of `text`. - */ - replace(text2) { - if (text2.startsWith(this.#text)) { - const delta = text2.slice(this.#text.length); - return { delta, arguments: delta === "" ? this.#partial() : this.append(delta) }; - } - this.#text = ""; - this.#parser = new StreamingJsonParser(); - return { delta: void 0, arguments: this.append(text2) }; - } - /** The final arguments: one full parse of the complete text, which reports malformed arguments. */ - finish() { - return parseToolCallArguments(this.#text); - } - #partial() { - const snapshot = this.#parser.snapshot(); - if (snapshot === this.#snapshot) - return this.#arguments; - this.#snapshot = snapshot; - this.#arguments = typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : {}; - return this.#arguments; - } - }; - SIMPLE_ESCAPES = { - '"': '"', - "\\": "\\", - "/": "/", - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: " " - }; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js -function splitErrorToolResultImages(msg) { - if (!msg.isError) - return void 0; - const images = msg.content.filter((block) => block.type === "image"); - if (images.length === 0) - return void 0; - return { - content: replaceImagesWithPlaceholder(msg.content, ERROR_TOOL_IMAGE_PLACEHOLDER), - caption: `Images from the error result of tool call ${msg.toolCallId} (${msg.toolName}):`, - images - }; -} -function replaceImagesWithPlaceholder(content, placeholder) { - const result = []; - let previousWasPlaceholder = false; - for (const block of content) { - if (block.type === "image") { - if (!previousWasPlaceholder) { - result.push({ type: "text", text: placeholder }); - } - previousWasPlaceholder = true; - continue; - } - result.push(block); - previousWasPlaceholder = block.text === placeholder; - } - return result; -} -function downgradeUnsupportedImages(messages, model2) { - if (model2.input.includes("image")) { - return messages; - } - return messages.map((msg) => { - if (msg.role === "user" && Array.isArray(msg.content)) { - return { - ...msg, - content: replaceImagesWithPlaceholder(msg.content, NON_VISION_USER_IMAGE_PLACEHOLDER) - }; - } - if (msg.role === "toolResult") { - return { - ...msg, - content: replaceImagesWithPlaceholder(msg.content, NON_VISION_TOOL_IMAGE_PLACEHOLDER) - }; - } - return msg; - }); -} -function transformMessages(messages, model2, normalizeToolCallId2) { - const toolCallIdMap = /* @__PURE__ */ new Map(); - const normalizedMessages = messages.map((msg) => msg.content == null ? { ...msg, content: [] } : msg); - const imageAwareMessages = downgradeUnsupportedImages(normalizedMessages, model2); - const transformed = imageAwareMessages.map((msg) => { - if (msg.role === "system" || msg.role === "user") { - return msg; - } - if (msg.role === "toolResult") { - const normalizedId = toolCallIdMap.get(msg.toolCallId); - if (normalizedId && normalizedId !== msg.toolCallId) { - return { ...msg, toolCallId: normalizedId }; - } - return msg; - } - if (msg.role === "assistant") { - const assistantMsg = msg; - const isSameModel = assistantMsg.provider === model2.provider && assistantMsg.api === model2.api && assistantMsg.model === model2.id; - const transformedContent = assistantMsg.content.flatMap((block) => { - if (block.type === "thinking") { - if (!isSameModel) - return []; - if (block.redacted || block.thinkingSignature) - return block; - if (!block.thinking || block.thinking.trim() === "") - return []; - return block; - } - if (block.type === "text") { - if (isSameModel) - return block; - return { - type: "text", - text: block.text - }; - } - if (block.type === "toolCall") { - const toolCall = block; - let normalizedToolCall = toolCall; - if (!isSameModel && toolCall.thoughtSignature) { - normalizedToolCall = { ...toolCall }; - delete normalizedToolCall.thoughtSignature; - } - if (!isSameModel && normalizeToolCallId2) { - const normalizedId = normalizeToolCallId2(toolCall.id, model2, assistantMsg); - if (normalizedId !== toolCall.id) { - toolCallIdMap.set(toolCall.id, normalizedId); - normalizedToolCall = { ...normalizedToolCall, id: normalizedId }; - } - } - return normalizedToolCall; - } - return block; - }); - return { - ...assistantMsg, - content: transformedContent - }; - } - return msg; - }); - const result = []; - let pendingToolCalls = []; - let existingToolResultIds = /* @__PURE__ */ new Set(); - const heldSystemMessages = []; - const closePendingToolCalls = () => { - if (pendingToolCalls.length > 0) { - for (const tc of pendingToolCalls) { - if (!existingToolResultIds.has(tc.id)) { - result.push({ - role: "toolResult", - toolCallId: tc.id, - toolName: tc.name, - content: [{ type: "text", text: "No result provided" }], - isError: true, - timestamp: Date.now() - }); - } - } - pendingToolCalls = []; - existingToolResultIds = /* @__PURE__ */ new Set(); - } - result.push(...heldSystemMessages); - heldSystemMessages.length = 0; - }; - for (let i = 0; i < transformed.length; i++) { - const msg = transformed[i]; - if (msg.role === "assistant") { - closePendingToolCalls(); - const assistantMsg = msg; - if (assistantMsg.stopReason === "error" || assistantMsg.stopReason === "aborted") { - continue; - } - const toolCalls = assistantMsg.content.filter((b) => b.type === "toolCall"); - if (toolCalls.length > 0) { - pendingToolCalls = toolCalls; - existingToolResultIds = /* @__PURE__ */ new Set(); - } - result.push(msg); - } else if (msg.role === "toolResult") { - existingToolResultIds.add(msg.toolCallId); - result.push(msg); - } else if (msg.role === "system") { - if (pendingToolCalls.length > 0) { - heldSystemMessages.push(msg); - } else { - result.push(msg); - } - } else if (msg.role === "user") { - closePendingToolCalls(); - result.push(msg); - } else { - result.push(msg); - } - } - closePendingToolCalls(); - return result; -} -var NON_VISION_USER_IMAGE_PLACEHOLDER, NON_VISION_TOOL_IMAGE_PLACEHOLDER, ERROR_TOOL_IMAGE_PLACEHOLDER; -var init_transform_messages = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js"() { - NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)"; - NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)"; - ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)"; - } -}); - // node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js function encodeTextSignatureV1(id, phase) { const payload = { v: 1, id }; @@ -24138,7 +40305,7 @@ function convertResponsesTools(tools, options) { return functionTool; }); } -async function processResponsesStream(openaiStream, output, stream4, model2, options) { +async function processResponsesStream(openaiStream, output, stream5, model2, options) { let sawTerminalResponseEvent = false; const outputSlots = /* @__PURE__ */ new Map(); const unfinishedToolCalls = /* @__PURE__ */ new Set(); @@ -24155,7 +40322,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt const pushToolCallDelta = (slot, delta) => { if (delta === void 0) return; - stream4.push({ + stream5.push({ type: "toolcall_delta", contentIndex: slot.contentIndex, delta, @@ -24172,7 +40339,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt contentIndex: output.content.length - 1 }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "thinking_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "thinking_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "message") { @@ -24181,7 +40348,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt output.content.push(block); const slot = { type: "text", block, contentIndex: output.content.length - 1 }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "text_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "text_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "function_call") { @@ -24202,7 +40369,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt input: { kind: "json", arguments: args } }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "custom_tool_call") { @@ -24224,7 +40391,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt input: customInput(inputProperty, input) }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); return slot; } return void 0; @@ -24278,7 +40445,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt const incompleteDetails = response?.incomplete_details; const incompleteReason = typeof incompleteDetails?.reason === "string" ? incompleteDetails.reason : void 0; output.rawStopReason = incompleteReason ? `${status}.${incompleteReason}` : status; - const mappedStop = mapStopReason(status, incompleteReason); + const mappedStop = mapStopReason2(status, incompleteReason); output.stopReason = mappedStop.stopReason; if (mappedStop.errorMessage === void 0) delete output.errorMessage; @@ -24299,7 +40466,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += event.delta; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24310,7 +40477,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += "\n\n"; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: "\n\n", @@ -24321,7 +40488,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += event.delta; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24332,7 +40499,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.text += event.delta; - stream4.push({ + stream5.push({ type: "text_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24343,7 +40510,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.text += event.delta; - stream4.push({ + stream5.push({ type: "text_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24383,7 +40550,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt slot.block.thinking = summaryText2 || contentText3 || slot.block.thinking; slot.block.thinkingSignature = JSON.stringify(item); reasoningBlocksById.set(item.id, slot.block); - stream4.push({ + stream5.push({ type: "thinking_end", contentIndex: slot.contentIndex, content: slot.block.thinking, @@ -24393,7 +40560,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt } else if (item.type === "message" && slot?.type === "text") { slot.block.text = item.content?.map((c) => c.type === "output_text" ? c.text : c.refusal).join("") || ""; slot.block.textSignature = encodeTextSignatureV1(item.id, item.phase ?? void 0); - stream4.push({ + stream5.push({ type: "text_end", contentIndex: slot.contentIndex, content: slot.block.text, @@ -24407,7 +40574,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (item.namespace !== void 0) slot.block.namespace = item.namespace; unfinishedToolCalls.delete(slot.block); - stream4.push({ + stream5.push({ type: "toolcall_end", contentIndex: slot.contentIndex, toolCall: slot.block, @@ -24419,7 +40586,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (item.namespace !== void 0) slot.block.namespace = item.namespace; unfinishedToolCalls.delete(slot.block); - stream4.push({ + stream5.push({ type: "toolcall_end", contentIndex: slot.contentIndex, toolCall: slot.block, @@ -24472,7 +40639,7 @@ function sendCustomInput(block, input, jsonDelta) { input.unsent = ""; return sent; } -function mapStopReason(status, incompleteReason) { +function mapStopReason2(status, incompleteReason) { if (!status) return { stopReason: "stop" }; switch (status) { @@ -24512,181 +40679,16 @@ var init_openai_responses_shared = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js -function calculateContextTokens(usage) { - return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite; -} -function safeJsonStringify2(value2) { - try { - return JSON.stringify(value2) ?? "undefined"; - } catch { - return "[unserializable]"; - } -} -function estimateTextAndImageContentChars(content) { - if (typeof content === "string") - return content.length; - let chars = 0; - for (const block of content) - chars += block.type === "text" ? block.text.length : ESTIMATED_IMAGE_CHARS; - return chars; -} -function estimateTextTokens(text2) { - return Math.ceil(text2.length / CHARS_PER_TOKEN); -} -function estimateTextAndImageContentTokens(content) { - return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN); -} -function estimateMessageTokens(message) { - let chars = 0; - if (message.role === "system") { - return estimateTextTokens(getSystemMessageText(message)) + estimateToolsTokens(message.toolsAdded) + estimateToolsTokens(message.toolsRemoved); - } - if (message.role === "user") - return estimateTextAndImageContentTokens(message.content); - if (message.role === "toolResult") - return estimateTextAndImageContentTokens(message.content); - for (const block of message.content) { - if (block.type === "text") { - chars += block.text.length; - } else if (block.type === "thinking") { - chars += block.thinking.length; - } else { - chars += block.name.length + safeJsonStringify2(block.arguments).length; - } - } - return Math.ceil(chars / CHARS_PER_TOKEN); -} -function getLastAssistantUsageInfo(messages) { - let latestPrefixTimestamp = Number.NEGATIVE_INFINITY; - let usageInfo; - for (let i = 0; i < messages.length; i++) { - const message = messages[i]; - if (message.role === "assistant") { - const assistant = message; - const usageAppliesToPrefix = assistant.timestamp >= latestPrefixTimestamp; - if (usageAppliesToPrefix && assistant.stopReason !== "aborted" && assistant.stopReason !== "error" && calculateContextTokens(assistant.usage) > 0) { - usageInfo = { usage: assistant.usage, index: i }; - } - } - latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp); - } - return usageInfo; -} -function estimateContextTokens(context) { - const messages = "messages" in context ? context.messages : context; - const usageInfo = getLastAssistantUsageInfo(messages); - if (usageInfo) { - const usageTokens = calculateContextTokens(usageInfo.usage); - let trailingTokens = 0; - for (let i = usageInfo.index + 1; i < messages.length; i++) { - trailingTokens += estimateMessageTokens(messages[i]); - } - return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index }; - } - let tokens = 0; - for (const message of messages) - tokens += estimateMessageTokens(message); - return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null }; -} -function estimateToolsTokens(tools) { - if (!tools || tools.length === 0) - return 0; - return estimateTextTokens(safeJsonStringify2(tools)); -} -var CHARS_PER_TOKEN, ESTIMATED_IMAGE_CHARS; -var init_estimate = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/estimate.js"() { - init_text(); - CHARS_PER_TOKEN = 3.5; - ESTIMATED_IMAGE_CHARS = 4800; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/simple-options.js -function clampMaxTokensToContext(model2, context, maxTokens) { - if (model2.contextWindow <= 0) - return Math.max(MIN_MAX_TOKENS, maxTokens); - const available = model2.contextWindow - estimateContextTokens(context).tokens - CONTEXT_SAFETY_TOKENS; - return Math.min(maxTokens, Math.max(MIN_MAX_TOKENS, available)); -} -function resolveSamplingParams(model2, thinkingLevel, requestParams) { - const effectiveThinkingLevel = clampThinkingLevel(model2, thinkingLevel); - const thinkingLevelParams = model2.samplingParamsByThinkingLevel?.[effectiveThinkingLevel]; - return model2.samplingParams || thinkingLevelParams || requestParams ? { ...model2.samplingParams, ...thinkingLevelParams, ...requestParams } : void 0; -} -function buildBaseOptions(model2, context, options, apiKey) { - const samplingParams = resolveSamplingParams(model2, options?.reasoning ?? "off", options?.samplingParams); - return { - temperature: options?.temperature, - samplingParams, - maxTokens: clampMaxTokensToContext(model2, context, options?.maxTokens ?? model2.maxTokens), - signal: options?.signal, - telemetry: options?.telemetry, - apiKey: apiKey || options?.apiKey, - fetch: options?.fetch, - transport: options?.transport, - cacheRetention: options?.cacheRetention, - sessionId: options?.sessionId, - headers: options?.headers, - identity: options?.identity, - onPayload: options?.onPayload, - onResponse: options?.onResponse, - onProviderStreamEvent: options?.onProviderStreamEvent, - timeoutMs: options?.timeoutMs, - websocketConnectTimeoutMs: options?.websocketConnectTimeoutMs, - maxRetries: options?.maxRetries, - maxRetryDelayMs: options?.maxRetryDelayMs, - metadata: options?.metadata, - env: options?.env - }; -} -function clampReasoning(effort) { - return effort === "xhigh" || effort === "max" ? "high" : effort; -} -function thinkingBudgetForLevel(reasoningLevel, customBudgets) { - const budgets = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets }; - const level = clampReasoning(reasoningLevel); - return budgets[level]; -} -function clampThinkingBudgetToAnswerRoom(thinkingBudget, ceiling) { - return Math.min(thinkingBudget, Math.max(0, ceiling - MIN_ANSWER_TOKENS)); -} -function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) { - let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets); - const maxTokens = baseMaxTokens === void 0 ? modelMaxTokens : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens); - if (maxTokens <= thinkingBudget) { - thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens); - } - return { maxTokens, thinkingBudget }; -} -var CONTEXT_SAFETY_TOKENS, MIN_MAX_TOKENS, MIN_ANSWER_TOKENS, DEFAULT_THINKING_BUDGETS; -var init_simple_options = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/simple-options.js"() { - init_models(); - init_estimate(); - CONTEXT_SAFETY_TOKENS = 4096; - MIN_MAX_TOKENS = 1; - MIN_ANSWER_TOKENS = 1024; - DEFAULT_THINKING_BUDGETS = { - minimal: 1024, - low: 2048, - medium: 8192, - high: 16384 - }; - } -}); - // node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js var openai_responses_exports = {}; __export(openai_responses_exports, { - stream: () => stream, - streamSimple: () => streamSimple + stream: () => stream3, + streamSimple: () => streamSimple2 }); function isChatGPTSignIn(model2, apiKey) { return model2.provider === "openai" && model2.baseUrl === "https://api.openai.com/v1" && apiKey !== void 0 && !apiKey.startsWith("sk-"); } -function hasHeader(headers, name) { +function hasHeader2(headers, name) { if (!headers) return false; const expected = name.toLowerCase(); @@ -24699,14 +40701,14 @@ function hasHeader(headers, name) { function getClientApiKey(provider2, apiKey, headers) { if (apiKey) return apiKey; - if (hasHeader(headers, "authorization") || hasHeader(headers, "cf-aig-authorization")) + if (hasHeader2(headers, "authorization") || hasHeader2(headers, "cf-aig-authorization")) return "unused"; throw new Error(`No API key for provider: ${provider2}`); } function detectSessionAffinityFormat(model2) { return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai") ? "openrouter" : "openai"; } -function resolveCacheRetention(cacheRetention, env) { +function resolveCacheRetention2(cacheRetention, env) { if (cacheRetention) { return cacheRetention; } @@ -24749,7 +40751,7 @@ function getPromptCacheOptions(compat, cacheRetention) { return { ttl: "30m" }; return void 0; } -function createClient(model2, context, apiKey, optionsHeaders, identity, fetch2, sessionId) { +function createClient2(model2, context, apiKey, optionsHeaders, identity, fetch2, sessionId) { const compat = getCompat(model2); const headers = { ...getIdentityHeaders(model2, identity), ...model2.headers }; if (model2.provider === "github-copilot") { @@ -24781,7 +40783,7 @@ function createClient(model2, context, apiKey, optionsHeaders, identity, fetch2, defaultHeaders: headers }); } -function buildParams(model2, context, options, compat, grammarToolInputProperties, configurationUpdateEffort) { +function buildParams2(model2, context, options, compat, grammarToolInputProperties, configurationUpdateEffort) { const transcriptTools = resolveTranscriptTools(context.messages, getResponsesToolSupport(compat)); const messages = convertResponsesMessages(model2, context, OPENAI_TOOL_CALL_PROVIDERS, { grammarToolInputProperties, @@ -24794,7 +40796,7 @@ function buildParams(model2, context, options, compat, grammarToolInputPropertie }, configurationUpdateEffort }); - const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); const omitUnsupportedFields = isChatGPTSignIn(model2, options?.apiKey); const params = { model: model2.id, @@ -24868,14 +40870,14 @@ function applyServiceTierPricing(usage, serviceTier, model2) { usage.cost.cacheWrite *= multiplier; usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite; } -var OPENAI_TOOL_CALL_PROVIDERS, OPENAI_RESPONSES_MIN_OUTPUT_TOKENS, CHATGPT_USAGE_URL, CHATGPT_WORKSPACE_LIMIT_HINT, CONFIGURATION_UPDATE_REQUEST_EFFORT, stream, streamSimple; +var OPENAI_TOOL_CALL_PROVIDERS, OPENAI_RESPONSES_MIN_OUTPUT_TOKENS, CHATGPT_USAGE_URL, CHATGPT_WORKSPACE_LIMIT_HINT, CONFIGURATION_UPDATE_REQUEST_EFFORT, stream3, streamSimple2; var init_openai_responses = __esm({ "node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js"() { init_openai(); init_models(); init_error_body(); init_event_stream(); - init_headers(); + init_headers2(); init_identity(); init_provider_env(); init_provider_retry(); @@ -24890,8 +40892,8 @@ var init_openai_responses = __esm({ CHATGPT_USAGE_URL = "https://chatgpt.com/settings/usage"; CHATGPT_WORKSPACE_LIMIT_HINT = "You've reached your ChatGPT workspace's usage limit. Ask your workspace admin to increase it at admin.openai.com \u2192 Workspace \u2192 Usage limits."; CONFIGURATION_UPDATE_REQUEST_EFFORT = "medium"; - stream = (model2, context, options) => { - const stream4 = new AssistantMessageEventStream(); + stream3 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); const normalizedContext = resolveTranscript(context, getCompat(model2).supportsMidConvoSystemMessages); (async () => { const compat = getCompat(model2); @@ -24916,11 +40918,11 @@ var init_openai_responses = __esm({ }; try { const apiKey = getClientApiKey(model2.provider, options?.apiKey, options?.headers); - const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; const grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(normalizedContext.messages), compat.supportsOpenAIGrammarTools); - const client = createClient(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId); - let params = buildParams(model2, normalizedContext, options, compat, grammarToolInputProperties, configurationUpdateEffort); + const client = createClient2(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId); + let params = buildParams2(model2, normalizedContext, options, compat, grammarToolInputProperties, configurationUpdateEffort); const nextParams = await options?.onPayload?.(params, model2); if (nextParams !== void 0) { params = nextParams; @@ -24936,8 +40938,8 @@ var init_openai_responses = __esm({ signal: options?.signal }); await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - stream4.push({ type: "start", partial: output }); - await processResponsesStream(openaiStream, output, stream4, model2, { + stream5.push({ type: "start", partial: output }); + await processResponsesStream(openaiStream, output, stream5, model2, { onProviderStreamEvent: options?.onProviderStreamEvent, serviceTier: options?.serviceTier, grammarToolInputProperties, @@ -24952,27 +40954,27 @@ var init_openai_responses = __esm({ if (output.stopReason === "aborted" || output.stopReason === "error") { throw new Error(output.errorMessage || "An unknown error occurred"); } - stream4.push({ type: "done", reason: output.stopReason, message: output }); - stream4.end(); + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); } catch (error) { output.stopReason = options?.signal?.aborted ? "aborted" : "error"; - const errorMessage3 = formatProviderError(normalizeProviderError(error), `${model2.provider === "openai" ? "OpenAI" : model2.provider} API error`); - if (errorMessage3.includes("subscription_sharing_usage_limit_exceeded")) { - output.errorMessage = `${errorMessage3} + const errorMessage2 = formatProviderError(normalizeProviderError(error), `${model2.provider === "openai" ? "OpenAI" : model2.provider} API error`); + if (errorMessage2.includes("subscription_sharing_usage_limit_exceeded")) { + output.errorMessage = `${errorMessage2} Check your ChatGPT usage: ${CHATGPT_USAGE_URL}`; - } else if (errorMessage3.includes("subscription_sharing_workplace_individual_usage_limit_exceeded")) { - output.errorMessage = `${errorMessage3} + } else if (errorMessage2.includes("subscription_sharing_workplace_individual_usage_limit_exceeded")) { + output.errorMessage = `${errorMessage2} ${CHATGPT_WORKSPACE_LIMIT_HINT}`; } else { - output.errorMessage = errorMessage3; + output.errorMessage = errorMessage2; } - stream4.push({ type: "error", reason: output.stopReason, error: output }); - stream4.end(); + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); } })(); - return stream4; + return stream5; }; - streamSimple = (model2, context, options) => { + streamSimple2 = (model2, context, options) => { getClientApiKey(model2.provider, options?.apiKey, options?.headers); const base = { ...buildBaseOptions(model2, context, options, options?.apiKey), @@ -24980,7 +40982,7 @@ ${CHATGPT_WORKSPACE_LIMIT_HINT}`; }; const clampedReasoning = options?.reasoning ? clampThinkingLevel(model2, options.reasoning) : void 0; const reasoningEffort = clampedReasoning === "off" ? void 0 : clampedReasoning; - return stream(model2, context, { + return stream3(model2, context, { ...base, reasoningEffort }); @@ -24988,15187 +40990,14 @@ ${CHATGPT_WORKSPACE_LIMIT_HINT}`; } }); -// node_modules/@anthropic-ai/sdk/internal/tslib.mjs -function __classPrivateFieldSet2(receiver, state2, value2, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state2.set(receiver, value2), value2; -} -function __classPrivateFieldGet2(receiver, state2, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); -} -var init_tslib2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/tslib.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/errors.mjs -function isAbortError2(err) { - return typeof err === "object" && err !== null && // Spec-compliant fetch implementations - ("name" in err && err.name === "AbortError" || // Expo fetch - "message" in err && String(err.message).includes("FetchRequestCanceledException")); -} -var castToError2; -var init_errors2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/errors.mjs"() { - castToError2 = (err) => { - if (err instanceof Error) - return err; - if (typeof err === "object" && err !== null) { - try { - const tag = Object.prototype.toString.call(err); - if (tag === "[object Error]" || tag === "[object DOMException]") { - const error = new Error(err.message, err.cause ? { cause: err.cause } : {}); - if (err.stack) - error.stack = err.stack; - if (err.cause && !error.cause) - error.cause = err.cause; - if (err.name) - error.name = err.name; - return error; - } - } catch { - } - try { - return new Error(JSON.stringify(err)); - } catch { - } - } - return new Error(err); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/core/error.mjs -var AnthropicError, APIError2, APIUserAbortError2, APIConnectionError2, APIConnectionTimeoutError2, RetryableError, BadRequestError2, AuthenticationError2, PermissionDeniedError2, NotFoundError2, ConflictError2, UnprocessableEntityError2, RateLimitError2, InternalServerError2; -var init_error3 = __esm({ - "node_modules/@anthropic-ai/sdk/core/error.mjs"() { - init_errors2(); - AnthropicError = /* @__PURE__ */ (() => { - class AnthropicError2 extends Error { - } - return AnthropicError2; - })(); - APIError2 = class _APIError extends AnthropicError { - constructor(status, error, message, headers, type) { - super(`${_APIError.makeMessage(status, error, message)}`); - this.status = status; - this.headers = headers; - this.requestID = headers?.get("request-id"); - this.workspaceID = headers?.get("anthropic-workspace-id"); - this.error = error; - this.type = type ?? null; - } - static makeMessage(status, error, message) { - const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message; - if (status && msg) { - return `${status} ${msg}`; - } - if (status) { - return `${status} status code (no body)`; - } - if (msg) { - return msg; - } - return "(no status code or body)"; - } - static generate(status, errorResponse, message, headers) { - if (!status || !headers) { - return new APIConnectionError2({ message, cause: castToError2(errorResponse) }); - } - const error = errorResponse; - const type = error?.["error"]?.["type"]; - if (status === 400) { - return new BadRequestError2(status, error, message, headers, type); - } - if (status === 401) { - return new AuthenticationError2(status, error, message, headers, type); - } - if (status === 403) { - return new PermissionDeniedError2(status, error, message, headers, type); - } - if (status === 404) { - return new NotFoundError2(status, error, message, headers, type); - } - if (status === 409) { - return new ConflictError2(status, error, message, headers, type); - } - if (status === 422) { - return new UnprocessableEntityError2(status, error, message, headers, type); - } - if (status === 429) { - return new RateLimitError2(status, error, message, headers, type); - } - if (status >= 500) { - return new InternalServerError2(status, error, message, headers, type); - } - return new _APIError(status, error, message, headers, type); - } - }; - APIUserAbortError2 = class extends APIError2 { - constructor({ message } = {}) { - super(void 0, void 0, message || "Request was aborted.", void 0); - } - }; - APIConnectionError2 = class extends APIError2 { - constructor({ message, cause }) { - super(void 0, void 0, message || "Connection error.", void 0); - if (cause) - this.cause = cause; - } - }; - APIConnectionTimeoutError2 = class extends APIConnectionError2 { - constructor({ message } = {}) { - super({ message: message ?? "Request timed out." }); - } - }; - RetryableError = class extends AnthropicError { - constructor(message, { cause } = {}) { - super(message ?? "Retryable error."); - if (cause !== void 0) - this.cause = cause; - } - }; - BadRequestError2 = class extends APIError2 { - }; - AuthenticationError2 = class extends APIError2 { - }; - PermissionDeniedError2 = class extends APIError2 { - }; - NotFoundError2 = class extends APIError2 { - }; - ConflictError2 = class extends APIError2 { - }; - UnprocessableEntityError2 = class extends APIError2 { - }; - RateLimitError2 = class extends APIError2 { - }; - InternalServerError2 = class extends APIError2 { - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/values.mjs -function maybeObj2(x) { - if (typeof x !== "object") { - return {}; - } - return x ?? {}; -} -function isEmptyObj2(obj2) { - if (!obj2) - return true; - for (const _k in obj2) - return false; - return true; -} -function hasOwn2(obj2, key) { - return Object.prototype.hasOwnProperty.call(obj2, key); -} -function isObj2(obj2) { - return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); -} -function checkNever(_value) { -} -var startsWithSchemeRegexp2, isAbsoluteURL2, isArray2, isReadonlyArray2, validatePositiveInteger2, safeJSON2; -var init_values2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/values.mjs"() { - init_error3(); - startsWithSchemeRegexp2 = /^[a-z][a-z0-9+.-]*:/i; - isAbsoluteURL2 = (url) => { - return startsWithSchemeRegexp2.test(url); - }; - isArray2 = (val) => (isArray2 = Array.isArray, isArray2(val)); - isReadonlyArray2 = isArray2; - validatePositiveInteger2 = (name, n) => { - if (typeof n !== "number" || !Number.isInteger(n)) { - throw new AnthropicError(`${name} must be an integer`); - } - if (n < 0) { - throw new AnthropicError(`${name} must be a positive integer`); - } - return n; - }; - safeJSON2 = (text2) => { - try { - return JSON.parse(text2); - } catch (err) { - return void 0; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs -var sleep2; -var init_sleep2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs"() { - sleep2 = (ms, signal) => new Promise((resolve2) => { - if (signal?.aborted) - return resolve2(); - const onAbort = () => { - clearTimeout(timer); - resolve2(); - }; - const timer = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve2(); - }, ms); - signal?.addEventListener("abort", onAbort, { once: true }); - }); - } -}); - -// node_modules/@anthropic-ai/sdk/version.mjs -var VERSION2; -var init_version3 = __esm({ - "node_modules/@anthropic-ai/sdk/version.mjs"() { - VERSION2 = "0.129.0"; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs -function getDetectedPlatform2() { - if (typeof Deno !== "undefined" && Deno.build != null) { - return "deno"; - } - if (typeof EdgeRuntime !== "undefined") { - return "edge"; - } - if (Object.prototype.toString.call(typeof globalThis.process !== "undefined" ? globalThis.process : 0) === "[object process]") { - return "node"; - } - return "unknown"; -} -function getBrowserInfo2() { - if (typeof navigator === "undefined" || !navigator) { - return null; - } - const browserPatterns = [ - { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } - ]; - for (const { key, pattern } of browserPatterns) { - const match = pattern.exec(navigator.userAgent); - if (match) { - const major = match[1] || 0; - const minor = match[2] || 0; - const patch = match[3] || 0; - return { browser: key, version: `${major}.${minor}.${patch}` }; - } - } - return null; -} -var isRunningInBrowser2, getPlatformProperties2, normalizeArch2, normalizePlatform2, _platformHeaders2, getPlatformHeaders2; -var init_detect_platform2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs"() { - init_version3(); - isRunningInBrowser2 = () => { - return ( - // @ts-ignore - typeof window !== "undefined" && // @ts-ignore - typeof window.document !== "undefined" && // @ts-ignore - typeof navigator !== "undefined" - ); - }; - getPlatformProperties2 = () => { - const detectedPlatform = getDetectedPlatform2(); - if (detectedPlatform === "deno") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": normalizePlatform2(Deno.build.os), - "X-Stainless-Arch": normalizeArch2(Deno.build.arch), - "X-Stainless-Runtime": "deno", - "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" - }; - } - if (typeof EdgeRuntime !== "undefined") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": `other:${EdgeRuntime}`, - "X-Stainless-Runtime": "edge", - "X-Stainless-Runtime-Version": globalThis.process?.version ?? "unknown" - }; - } - if (detectedPlatform === "node") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": normalizePlatform2(globalThis.process.platform ?? "unknown"), - "X-Stainless-Arch": normalizeArch2(globalThis.process.arch ?? "unknown"), - "X-Stainless-Runtime": "node", - "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" - }; - } - const browserInfo = getBrowserInfo2(); - if (browserInfo) { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": `browser:${browserInfo.browser}`, - "X-Stainless-Runtime-Version": browserInfo.version - }; - } - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": "unknown", - "X-Stainless-Runtime-Version": "unknown" - }; - }; - normalizeArch2 = (arch) => { - if (arch === "x32") - return "x32"; - if (arch === "x86_64" || arch === "x64") - return "x64"; - if (arch === "arm") - return "arm"; - if (arch === "aarch64" || arch === "arm64") - return "arm64"; - if (arch) - return `other:${arch}`; - return "unknown"; - }; - normalizePlatform2 = (platform) => { - platform = platform.toLowerCase(); - if (platform.includes("ios")) - return "iOS"; - if (platform === "android") - return "Android"; - if (platform === "darwin") - return "MacOS"; - if (platform === "win32") - return "Windows"; - if (platform === "freebsd") - return "FreeBSD"; - if (platform === "openbsd") - return "OpenBSD"; - if (platform === "linux") - return "Linux"; - if (platform) - return `Other:${platform}`; - return "Unknown"; - }; - getPlatformHeaders2 = () => { - return _platformHeaders2 ?? (_platformHeaders2 = getPlatformProperties2()); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/request-signal.mjs -function makeCleanup(signal, listener) { - return () => signal.removeEventListener("abort", listener); -} -function registerRequestSignalCleanup(controller, signal, listener) { - cleanups.set(controller, makeCleanup(signal, listener)); -} -function armAbandonmentBackstop(body, controller) { - if (cleanups.has(controller)) - registry?.register(body, controller, controller); -} -function releaseRequestSignal(controller) { - const cleanup = cleanups.get(controller); - if (cleanup) { - cleanups.delete(controller); - registry?.unregister(controller); - cleanup(); - } -} -var cleanups, registry; -var init_request_signal = __esm({ - "node_modules/@anthropic-ai/sdk/internal/request-signal.mjs"() { - cleanups = /* @__PURE__ */ new WeakMap(); - registry = typeof globalThis.FinalizationRegistry === "function" ? new globalThis.FinalizationRegistry((controller) => releaseRequestSignal(controller)) : null; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/shims.mjs -function getDefaultFetch2() { - if (typeof fetch !== "undefined") { - return fetch; - } - throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); -} -function makeReadableStream2(...args) { - const ReadableStream2 = globalThis.ReadableStream; - if (typeof ReadableStream2 === "undefined") { - throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); - } - return new ReadableStream2(...args); -} -function ReadableStreamFrom2(iterable) { - let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); - return makeReadableStream2({ - start() { - }, - async pull(controller) { - const { done, value: value2 } = await iter.next(); - if (done) { - controller.close(); - } else { - controller.enqueue(value2); - } - }, - async cancel() { - await iter.return?.(); - } - }); -} -function ReadableStreamToAsyncIterable2(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) - reader.releaseLock(); - return result; - } catch (e) { - reader.releaseLock(); - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: void 0 }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -async function CancelReadableStream2(stream4) { - if (stream4 === null || typeof stream4 !== "object") - return; - if (stream4[Symbol.asyncIterator]) { - await stream4[Symbol.asyncIterator]().return?.(); - return; - } - const reader = stream4.getReader(); - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; -} -var init_shims2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/shims.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/request-options.mjs -var FallbackEncoder2; -var init_request_options2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/request-options.mjs"() { - FallbackEncoder2 = ({ headers, body }) => { - return { - bodyHeaders: { - "content-type": "application/json" - }, - body: JSON.stringify(body) - }; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs -var default_format2, default_formatter2, formatters2, RFC17382; -var init_formats2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs"() { - default_format2 = "RFC3986"; - default_formatter2 = (v) => String(v); - formatters2 = { - RFC1738: (v) => String(v).replace(/%20/g, "+"), - RFC3986: default_formatter2 - }; - RFC17382 = "RFC1738"; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs -function is_buffer2(obj2) { - if (!obj2 || typeof obj2 !== "object") { - return false; - } - return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2)); -} -function maybe_map2(val, fn) { - if (isArray2(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -} -var has2, hex_table2, limit2, encode2; -var init_utils3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs"() { - init_formats2(); - init_values2(); - has2 = (obj2, key) => (has2 = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has2(obj2, key)); - hex_table2 = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); - } - return array; - })(); - limit2 = 1024; - encode2 = (str2, _defaultEncoder, charset, _kind, format) => { - if (str2.length === 0) { - return str2; - } - let string2 = str2; - if (typeof str2 === "symbol") { - string2 = Symbol.prototype.toString.call(str2); - } else if (typeof str2 !== "string") { - string2 = String(str2); - } - if (charset === "iso-8859-1") { - return escape(string2).replace(/%u[0-9a-f]{4}/gi, function($0) { - return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; - }); - } - let out = ""; - for (let j = 0; j < string2.length; j += limit2) { - const segment = string2.length >= limit2 ? string2.slice(j, j + limit2) : string2; - const arr2 = []; - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if (c === 45 || // - - c === 46 || // . - c === 95 || // _ - c === 126 || // ~ - c >= 48 && c <= 57 || // 0-9 - c >= 65 && c <= 90 || // a-z - c >= 97 && c <= 122 || // A-Z - format === RFC17382 && (c === 40 || c === 41)) { - arr2[arr2.length] = segment.charAt(i); - continue; - } - if (c < 128) { - arr2[arr2.length] = hex_table2[c]; - continue; - } - if (c < 2048) { - arr2[arr2.length] = hex_table2[192 | c >> 6] + hex_table2[128 | c & 63]; - continue; - } - if (c < 55296 || c >= 57344) { - arr2[arr2.length] = hex_table2[224 | c >> 12] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; - continue; - } - i += 1; - c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); - arr2[arr2.length] = hex_table2[240 | c >> 18] + hex_table2[128 | c >> 12 & 63] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; - } - out += arr2.join(""); - } - return out; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs -function is_non_nullish_primitive2(v) { - return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; -} -function inner_stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder6, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { - let obj2 = object; - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel2)) !== void 0 && !find_flag) { - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== "undefined") { - if (pos === step) { - throw new RangeError("Cyclic object value"); - } else { - find_flag = true; - } - } - if (typeof tmp_sc.get(sentinel2) === "undefined") { - step = 0; - } - } - if (typeof filter === "function") { - obj2 = filter(prefix, obj2); - } else if (obj2 instanceof Date) { - obj2 = serializeDate?.(obj2); - } else if (generateArrayPrefix === "comma" && isArray2(obj2)) { - obj2 = maybe_map2(obj2, function(value2) { - if (value2 instanceof Date) { - return serializeDate?.(value2); - } - return value2; - }); - } - if (obj2 === null) { - if (strictNullHandling) { - return encoder6 && !encodeValuesOnly ? ( - // @ts-expect-error - encoder6(prefix, defaults2.encoder, charset, "key", format) - ) : prefix; - } - obj2 = ""; - } - if (is_non_nullish_primitive2(obj2) || is_buffer2(obj2)) { - if (encoder6) { - const key_value = encodeValuesOnly ? prefix : encoder6(prefix, defaults2.encoder, charset, "key", format); - return [ - formatter?.(key_value) + "=" + // @ts-expect-error - formatter?.(encoder6(obj2, defaults2.encoder, charset, "value", format)) - ]; - } - return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; - } - const values = []; - if (typeof obj2 === "undefined") { - return values; - } - let obj_keys; - if (generateArrayPrefix === "comma" && isArray2(obj2)) { - if (encodeValuesOnly && encoder6) { - obj2 = maybe_map2(obj2, encoder6); - } - obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; - } else if (isArray2(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj2); - obj_keys = sort ? keys.sort(sort) : keys; - } - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); - const adjusted_prefix = commaRoundTrip && isArray2(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; - if (allowEmptyArrays && isArray2(obj2) && obj2.length === 0) { - return adjusted_prefix + "[]"; - } - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value2 = ( - // @ts-ignore - typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj2[key] - ); - if (skipNulls && value2 === null) { - continue; - } - const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; - const key_prefix = isArray2(obj2) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); - sideChannel.set(object, step); - const valueSideChannel = /* @__PURE__ */ new WeakMap(); - valueSideChannel.set(sentinel2, sideChannel); - push_to_array3(values, inner_stringify2( - value2, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj2) ? null : encoder6, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - return values; -} -function normalize_stringify_options2(opts = defaults2) { - if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - } - if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { - throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); - } - if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { - throw new TypeError("Encoder has to be a function."); - } - const charset = opts.charset || defaults2.charset; - if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - } - let format = default_format2; - if (typeof opts.format !== "undefined") { - if (!has2(formatters2, opts.format)) { - throw new TypeError("Unknown format option provided."); - } - format = opts.format; - } - const formatter = formatters2[format]; - let filter = defaults2.filter; - if (typeof opts.filter === "function" || isArray2(opts.filter)) { - filter = opts.filter; - } - let arrayFormat; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators2) { - arrayFormat = opts.arrayFormat; - } else if ("indices" in opts) { - arrayFormat = opts.indices ? "indices" : "repeat"; - } else { - arrayFormat = defaults2.arrayFormat; - } - if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { - throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); - } - const allowDots = typeof opts.allowDots === "undefined" ? !!opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; - return { - addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, - // @ts-ignore - allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, - arrayFormat, - charset, - charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, - encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, - encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, - filter, - format, - formatter, - serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, - skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, - // @ts-ignore - sort: typeof opts.sort === "function" ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling - }; -} -function stringify2(object, opts = {}) { - let obj2 = object; - const options = normalize_stringify_options2(opts); - let obj_keys; - let filter; - if (typeof options.filter === "function") { - filter = options.filter; - obj2 = filter("", obj2); - } else if (isArray2(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - const keys = []; - if (typeof obj2 !== "object" || obj2 === null) { - return ""; - } - const generateArrayPrefix = array_prefix_generators2[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; - if (!obj_keys) { - obj_keys = Object.keys(obj2); - } - if (options.sort) { - obj_keys.sort(options.sort); - } - const sideChannel = /* @__PURE__ */ new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]; - if (options.skipNulls && obj2[key] === null) { - continue; - } - push_to_array3(keys, inner_stringify2( - obj2[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? "?" : ""; - if (options.charsetSentinel) { - if (options.charset === "iso-8859-1") { - prefix += "utf8=%26%2310003%3B&"; - } else { - prefix += "utf8=%E2%9C%93&"; - } - } - return joined.length > 0 ? prefix + joined : ""; -} -var array_prefix_generators2, push_to_array3, toISOString2, defaults2, sentinel2; -var init_stringify2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs"() { - init_utils3(); - init_formats2(); - init_values2(); - array_prefix_generators2 = { - brackets(prefix) { - return String(prefix) + "[]"; - }, - comma: "comma", - indices(prefix, key) { - return String(prefix) + "[" + key + "]"; - }, - repeat(prefix) { - return String(prefix); - } - }; - push_to_array3 = function(arr2, value_or_array) { - Array.prototype.push.apply(arr2, isArray2(value_or_array) ? value_or_array : [value_or_array]); - }; - defaults2 = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: "indices", - charset: "utf-8", - charsetSentinel: false, - delimiter: "&", - encode: true, - encodeDotInKeys: false, - encoder: encode2, - encodeValuesOnly: false, - format: default_format2, - formatter: default_formatter2, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString2 ?? (toISOString2 = Function.prototype.call.bind(Date.prototype.toISOString)))(date); - }, - skipNulls: false, - strictNullHandling: false - }; - sentinel2 = {}; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/query.mjs -function stringifyQuery2(query) { - return stringify2(query, { arrayFormat: "brackets" }); -} -var init_query2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/query.mjs"() { - init_stringify2(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/node.browser.mjs -var node_browser_exports = {}; -__export(node_browser_exports, { - child_process: () => child_process, - crypto: () => crypto2, - fs: () => fs, - os: () => os, - path: () => path2, - stream: () => stream2, - util: () => util -}); -function unavailable(module) { - return new Proxy({}, { - get(_target, property) { - if (typeof property === "symbol") - return void 0; - throw new AnthropicError(`\`${module}.${property}\` is not available in this environment; it needs a Node.js-compatible runtime`); - } - }); -} -var child_process, crypto2, fs, os, path2, stream2, util; -var init_node_browser = __esm({ - "node_modules/@anthropic-ai/sdk/internal/node.browser.mjs"() { - init_error3(); - child_process = /* @__PURE__ */ unavailable("child_process"); - crypto2 = /* @__PURE__ */ unavailable("crypto"); - fs = /* @__PURE__ */ unavailable("fs"); - os = /* @__PURE__ */ unavailable("os"); - path2 = /* @__PURE__ */ unavailable("path"); - stream2 = /* @__PURE__ */ unavailable("stream"); - util = /* @__PURE__ */ unavailable("util"); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs -function requireSecureTokenEndpoint(baseURL) { - if (!baseURL) - return; - let u; - try { - u = new URL(baseURL); - } catch (err) { - throw new WorkloadIdentityError(`Invalid token endpoint base URL "${baseURL}": ${err}`); - } - if (u.protocol === "https:") - return; - const host = u.hostname.toLowerCase().replace(/^\[|\]$/g, ""); - if (u.protocol === "http:" && (host === "localhost" || host === "127.0.0.1" || host === "::1")) { - return; - } - throw new WorkloadIdentityError(`Refusing to send credential over non-https token endpoint "${baseURL}"`); -} -async function parseTokenResponse(resp, requestId) { - const text2 = await readLimitedText(resp); - let data; - try { - data = JSON.parse(text2); - } catch { - throw new WorkloadIdentityError(`Token endpoint returned non-JSON response (status ${resp.status})`, resp.status, redactSensitive(text2), requestId); - } - if (!data.access_token) { - throw new WorkloadIdentityError(`Token endpoint response missing access_token: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - if (data.token_type && data.token_type.toLowerCase() !== "bearer") { - throw new WorkloadIdentityError(`Token endpoint response: unsupported token_type "${data.token_type}" (want Bearer)`, resp.status, redactSensitive(data), requestId); - } - return data; -} -function redactSensitive(body) { - if (body == null) - return body; - if (typeof body === "string") { - let parsed; - try { - parsed = JSON.parse(body); - } catch { - if (body.length <= MAX_ERROR_BODY_CHARS) - return body; - return body.slice(0, MAX_ERROR_BODY_CHARS) + `... <${body.length - MAX_ERROR_BODY_CHARS} more chars>`; - } - return JSON.stringify(redactSensitive(parsed)); - } - if (typeof body === "object" && !Array.isArray(body)) { - const out = {}; - for (const [k, v] of Object.entries(body)) { - if (SAFE_ERROR_KEYS.has(k)) - out[k] = v; - } - return out; - } - return null; -} -async function checkCredentialsFileSafety(path5, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) { - if (typeof process === "undefined" || process.platform === "win32") - return; - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - let resolved = path5; - let st; - try { - resolved = await fs3.promises.realpath(path5); - st = await fs3.promises.stat(resolved); - } catch { - return; - } - const mode = st.mode & 511; - if (mode & 18) { - throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-writable (mode 0o${mode.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${resolved}\`.`); - } - if (mode & 36) { - throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-readable (mode 0o${mode.toString(8)}); run \`chmod 600 ${resolved}\` before retrying.`); - } - if (typeof process.getuid === "function" && st.uid !== process.getuid()) { - onWarn(`credentials file at ${resolved} is owned by uid ${st.uid} (current process uid ${process.getuid()}); verify this is intentional.`); - } -} -async function writeCredentialsFileAtomic(targetPath, data) { - const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const dir = path5.dirname(targetPath); - await fs3.promises.mkdir(dir, { recursive: true, mode: 448 }); - const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`; - try { - const fh = await fs3.promises.open(tmpPath, "w", 384); - try { - await fh.writeFile(JSON.stringify(data, null, 2)); - await fh.sync(); - } finally { - await fh.close(); - } - await fs3.promises.rename(tmpPath, targetPath); - } catch (err) { - await fs3.promises.unlink(tmpPath).catch(() => { - }); - throw err; - } - try { - const dirFh = await fs3.promises.open(dir, "r"); - try { - await dirFh.sync(); - } finally { - await dirFh.close(); - } - } catch { - } -} -async function readLimitedText(resp) { - if (!resp.body) { - return ""; - } - const reader = resp.body.getReader(); - const chunks = []; - let received = 0; - for (; ; ) { - const { done, value: value2 } = await reader.read(); - if (done) - break; - if (received + value2.length > MAX_TOKEN_RESPONSE_BYTES) { - const remaining = MAX_TOKEN_RESPONSE_BYTES - received; - if (remaining > 0) - chunks.push(value2.subarray(0, remaining)); - await reader.cancel(); - break; - } - chunks.push(value2); - received += value2.length; - } - let merged; - if (chunks.length === 1) { - merged = chunks[0]; - } else { - merged = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0)); - let offset = 0; - for (const c of chunks) { - merged.set(c, offset); - offset += c.length; - } - } - return new TextDecoder("utf-8").decode(merged); -} -var GRANT_TYPE_JWT_BEARER, GRANT_TYPE_REFRESH_TOKEN, TOKEN_ENDPOINT, OAUTH_API_BETA_HEADER, FEDERATION_BETA_HEADER, ADVISORY_REFRESH_THRESHOLD_IN_SECONDS, MANDATORY_REFRESH_THRESHOLD_IN_SECONDS, ADVISORY_REFRESH_BACKOFF_IN_SECONDS, MAX_TOKEN_RESPONSE_BYTES, MAX_ERROR_BODY_CHARS, SAFE_ERROR_KEYS, WorkloadIdentityError; -var init_types = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs"() { - init_error3(); - GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer"; - GRANT_TYPE_REFRESH_TOKEN = "refresh_token"; - TOKEN_ENDPOINT = "/v1/oauth/token"; - OAUTH_API_BETA_HEADER = "oauth-2025-04-20"; - FEDERATION_BETA_HEADER = "oidc-federation-2026-04-01"; - ADVISORY_REFRESH_THRESHOLD_IN_SECONDS = 120; - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS = 30; - ADVISORY_REFRESH_BACKOFF_IN_SECONDS = 5; - MAX_TOKEN_RESPONSE_BYTES = 1 << 20; - MAX_ERROR_BODY_CHARS = 2e3; - SAFE_ERROR_KEYS = /* @__PURE__ */ new Set(["error", "error_description", "error_uri"]); - WorkloadIdentityError = class extends AnthropicError { - constructor(message, statusCode = null, body = null, requestId = null) { - super(message); - this.statusCode = statusCode; - this.body = body; - this.requestId = requestId; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/time.mjs -function nowAsSeconds() { - return Math.floor(Date.now() / 1e3); -} -var init_time = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/time.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs -var TokenCache; -var init_token_cache = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs"() { - init_types(); - init_time(); - TokenCache = class { - constructor(provider2, onAdvisoryRefreshError) { - this.cached = null; - this.pendingRefresh = null; - this.nextForce = false; - this.lastAdvisoryError = 0; - this.provider = provider2; - this.onAdvisoryRefreshError = onAdvisoryRefreshError; - } - async getToken() { - const force = this.nextForce; - this.nextForce = false; - const cached = this.cached; - if (force || cached == null) { - const token2 = await this.refresh(force); - return token2.token; - } - if (cached.expiresAt == null) { - return cached.token; - } - const remaining = cached.expiresAt - nowAsSeconds(); - if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) { - return cached.token; - } - if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { - this.backgroundRefresh(); - return cached.token; - } - const token = await this.refresh(); - return token.token; - } - /** - * Clears the cached token and marks the next {@link getToken} as a forced - * refresh, so the underlying provider bypasses any on-disk freshness check. - * Called after a 401 — the server has just told us the token is bad even - * if its `expires_at` still looks fresh. - */ - invalidate() { - this.cached = null; - this.nextForce = true; - } - /** - * Mandatory refresh. Joins any in-flight refresh unless forced — a forced - * refresh must not coalesce into a non-forced one that may re-serve the - * same stale disk token. - */ - refresh(force = false) { - if (this.pendingRefresh && !force) { - return this.pendingRefresh; - } - return this.doRefresh(force); - } - /** - * Advisory background refresh. Shares the same in-flight promise as - * mandatory refreshes for deduplication, but swallows errors so the - * stale cached token keeps being served. Backs off for - * {@link ADVISORY_REFRESH_BACKOFF_IN_SECONDS} after a failure so an - * outage during the advisory window doesn't hammer the token endpoint. - */ - backgroundRefresh() { - if (this.pendingRefresh) { - return; - } - if (nowAsSeconds() - this.lastAdvisoryError < ADVISORY_REFRESH_BACKOFF_IN_SECONDS) { - return; - } - this.doRefresh().catch((err) => { - this.lastAdvisoryError = nowAsSeconds(); - this.onAdvisoryRefreshError?.(err); - }); - } - /** - * Core refresh. Sets {@link pendingRefresh} so concurrent callers - * (both advisory and mandatory) coalesce into a single provider call. - */ - doRefresh(force = false) { - this.pendingRefresh = this.provider(force ? { forceRefresh: true } : void 0).then((token) => { - this.cached = token; - this.pendingRefresh = null; - return token; - }, (err) => { - this.pendingRefresh = null; - throw err; - }); - return this.pendingRefresh; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/env.mjs -var readEnv2; -var init_env2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/env.mjs"() { - readEnv2 = (env) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env]?.trim() || void 0; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env)?.trim() || void 0; - } - return void 0; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs -function concatBytes(buffers) { - let length = 0; - for (const buffer of buffers) { - length += buffer.length; - } - const output = new Uint8Array(length); - let index = 0; - for (const buffer of buffers) { - output.set(buffer, index); - index += buffer.length; - } - return output; -} -function encodeUTF82(str2) { - let encoder6; - return (encodeUTF8_2 ?? (encoder6 = new globalThis.TextEncoder(), encodeUTF8_2 = encoder6.encode.bind(encoder6)))(str2); -} -function decodeUTF82(bytes2) { - let decoder5; - return (decodeUTF8_2 ?? (decoder5 = new globalThis.TextDecoder(), decodeUTF8_2 = decoder5.decode.bind(decoder5)))(bytes2); -} -var encodeUTF8_2, decodeUTF8_2; -var init_bytes2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs -var fromBase642; -var init_base642 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs"() { - init_error3(); - fromBase642 = (str2) => { - if (typeof globalThis.Buffer !== "undefined") { - const buf = globalThis.Buffer.from(str2, "base64"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - if (typeof atob !== "undefined") { - const bstr = atob(str2); - const buf = new Uint8Array(bstr.length); - for (let i = 0; i < bstr.length; i++) { - buf[i] = bstr.charCodeAt(i); - } - return buf; - } - throw new AnthropicError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined"); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/log.mjs -function noop2() { -} -function makeLogFn2(fnLevel, logger, logLevel) { - if (!logger || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) { - return noop2; - } else { - return logger[fnLevel].bind(logger); - } -} -function filterLogger(logger, logLevel) { - const cachedLogger = cachedLoggers2.get(logger); - if (cachedLogger && cachedLogger[0] === logLevel) { - return cachedLogger[1]; - } - const levelLogger = { - error: makeLogFn2("error", logger, logLevel), - warn: makeLogFn2("warn", logger, logLevel), - info: makeLogFn2("info", logger, logLevel), - debug: makeLogFn2("debug", logger, logLevel) - }; - cachedLoggers2.set(logger, [logLevel, levelLogger]); - return levelLogger; -} -function loggerFor2(client) { - const logger = client.logger; - const logLevel = client.logLevel ?? "off"; - if (!logger) { - return noopLogger2; - } - return filterLogger(logger, logLevel); -} -function defaultLogger() { - const envLevel = readEnv2("ANTHROPIC_LOG"); - if (!cachedDefaultLogger || envLevel !== lastEnvLevel) { - lastEnvLevel = envLevel; - cachedDefaultLogger = filterLogger(console, parseLogLevel2(envLevel, "process.env['ANTHROPIC_LOG']", filterLogger(console, defaultLogLevel)) ?? defaultLogLevel); - } - return cachedDefaultLogger; -} -function debugLogRequestDetails(logger, message, details) { - if (logger.debug === noop2) { - return; - } - logger.debug(message, formatRequestDetails2(details)); -} -var defaultLogLevel, levelNumbers2, parseLogLevel2, noopLogger2, cachedLoggers2, lastEnvLevel, cachedDefaultLogger, formatRequestDetails2; -var init_log2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/log.mjs"() { - init_values2(); - init_env2(); - defaultLogLevel = "warn"; - levelNumbers2 = { - off: 0, - error: 200, - warn: 300, - info: 400, - debug: 500 - }; - parseLogLevel2 = (maybeLevel, sourceName, logger) => { - if (!maybeLevel) { - return void 0; - } - if (hasOwn2(levelNumbers2, maybeLevel)) { - return maybeLevel; - } - logger.warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers2))}`); - return void 0; - }; - noopLogger2 = { - error: noop2, - warn: noop2, - info: noop2, - debug: noop2 - }; - cachedLoggers2 = /* @__PURE__ */ new WeakMap(); - formatRequestDetails2 = (details) => { - if (details.options) { - details.options = { ...details.options }; - delete details.options["headers"]; - } - if (details.headers) { - details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value2]) => [ - name, - name.toLowerCase() === "authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value2 - ])); - } - if ("retryOfRequestLogID" in details) { - if (details.retryOfRequestLogID) { - details.retryOf = details.retryOfRequestLogID; - } - delete details.retryOfRequestLogID; - } - return details; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs -var uuid42; -var init_uuid2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs"() { - uuid42 = function() { - const { crypto: crypto3 } = globalThis; - if (crypto3?.randomUUID) { - uuid42 = crypto3.randomUUID.bind(crypto3); - return crypto3.randomUUID(); - } - const u8 = new Uint8Array(1); - const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; - return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils.mjs -var init_utils4 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils.mjs"() { - init_values2(); - init_base642(); - init_env2(); - init_log2(); - init_uuid2(); - init_sleep2(); - init_query2(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/credentials.mjs -function validateProfileName(name) { - if (!name) { - throw new Error("profile name is empty"); - } - if (name === "." || name === "..") { - throw new Error(`profile name "${name}" is not allowed`); - } - if (name.includes("/") || name.includes("\\")) { - throw new Error(`profile name "${name}" must not contain path separators`); - } - if (!PROFILE_NAME_PATTERN.test(name)) { - throw new Error(`profile name "${name}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`); - } -} -var CREDENTIALS_FILE_VERSION, PROFILE_NAME_PATTERN, loadConfigWithSource, getCredentialsPath, getRootConfigPath, supportsLocalConfigFiles, getActiveProfileName; -var init_credentials2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/credentials.mjs"() { - init_detect_platform2(); - init_utils4(); - CREDENTIALS_FILE_VERSION = "1.0"; - PROFILE_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/; - loadConfigWithSource = async (profile) => { - var _a6, _b; - const rootConfigPath = await getRootConfigPath(); - if (rootConfigPath === null) { - return null; - } - const profileName = profile ?? await getActiveProfileName(); - if (profileName === null) { - return null; - } - validateProfileName(profileName); - const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const configPath = path5.join(rootConfigPath, "configs", `${profileName}.json`); - let configRaw; - try { - configRaw = await fs3.promises.readFile(configPath, "utf-8"); - } catch (err) { - if (err?.code !== "ENOENT") { - throw new Error(`failed to read config file ${configPath}: ${err}`); - } - configRaw = null; - } - if (configRaw === null) { - const organizationId = readEnv2("ANTHROPIC_ORGANIZATION_ID"); - const identityTokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - const federationRuleId = readEnv2("ANTHROPIC_FEDERATION_RULE_ID"); - if (federationRuleId && organizationId) { - return { - fromFile: false, - config: { - organization_id: organizationId, - // A defaulted-but-empty CI variable (`ANTHROPIC_WORKSPACE_ID=""`) is - // treated as unset — readEnv coerces empty to undefined, and the body - // builder's truthy check skips it — so `"workspace_id": ""` never goes - // on the wire. - workspace_id: readEnv2("ANTHROPIC_WORKSPACE_ID"), - base_url: readEnv2("ANTHROPIC_BASE_URL"), - authentication: { - type: "oidc_federation", - federation_rule_id: federationRuleId, - service_account_id: readEnv2("ANTHROPIC_SERVICE_ACCOUNT_ID"), - identity_token: identityTokenFile ? { source: "file", path: identityTokenFile } : void 0, - scope: readEnv2("ANTHROPIC_SCOPE") - } - } - }; - } - return null; - } - let config; - try { - config = JSON.parse(configRaw); - } catch (err) { - throw new Error(`failed to parse config file ${configPath}: ${err}`); - } - if (!config.authentication) { - throw new Error(`config file ${configPath} is missing "authentication"`); - } - const authType = config.authentication.type; - if (authType !== "oidc_federation" && authType !== "user_oauth") { - throw new Error(`authentication.type "${authType}" is not a known authentication type`); - } - config.organization_id ?? (config.organization_id = readEnv2("ANTHROPIC_ORGANIZATION_ID")); - config.workspace_id ?? (config.workspace_id = readEnv2("ANTHROPIC_WORKSPACE_ID")); - config.base_url ?? (config.base_url = readEnv2("ANTHROPIC_BASE_URL")); - (_a6 = config.authentication).scope ?? (_a6.scope = readEnv2("ANTHROPIC_SCOPE")); - if (config.authentication.type === "oidc_federation") { - if (!config.authentication.identity_token) { - const identityTokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - if (identityTokenFile) { - config.authentication.identity_token = { - source: "file", - path: identityTokenFile - }; - } - } - if (!config.authentication.federation_rule_id) { - config.authentication.federation_rule_id = readEnv2("ANTHROPIC_FEDERATION_RULE_ID") ?? ""; - } - (_b = config.authentication).service_account_id ?? (_b.service_account_id = readEnv2("ANTHROPIC_SERVICE_ACCOUNT_ID")); - } - return { config, fromFile: true }; - }; - getCredentialsPath = async (config, profile) => { - if (config?.authentication.credentials_path) { - return config.authentication.credentials_path; - } - const rootConfigPath = await getRootConfigPath(); - if (!rootConfigPath) { - return null; - } - const profileName = profile ?? await getActiveProfileName(); - if (!profileName) { - return null; - } - validateProfileName(profileName); - const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - return path5.join(rootConfigPath, "credentials", `${profileName}.json`); - }; - getRootConfigPath = async () => { - if (!supportsLocalConfigFiles()) { - return null; - } - const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const configDir = readEnv2("ANTHROPIC_CONFIG_DIR"); - if (configDir) { - return configDir; - } - const os2 = getPlatformHeaders2()["X-Stainless-OS"]; - if (os2 === "Windows") { - const appData = readEnv2("APPDATA"); - if (appData) { - return path5.join(appData, "Anthropic"); - } - const userProfile = readEnv2("USERPROFILE"); - if (userProfile) { - return path5.join(userProfile, "AppData", "Roaming", "Anthropic"); - } - return null; - } - const xdgConfigHome = readEnv2("XDG_CONFIG_HOME"); - if (xdgConfigHome) { - return path5.join(xdgConfigHome, "anthropic"); - } - const home = readEnv2("HOME"); - if (home) { - return path5.join(home, ".config", "anthropic"); - } - return null; - }; - supportsLocalConfigFiles = () => { - const runtime = getPlatformHeaders2()["X-Stainless-Runtime"]; - return runtime === "node" || runtime === "deno"; - }; - getActiveProfileName = async () => { - const rootConfigPath = await getRootConfigPath(); - if (!rootConfigPath) { - return null; - } - const profileName = readEnv2("ANTHROPIC_PROFILE"); - if (profileName) { - return profileName; - } - const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const filePath = path5.join(rootConfigPath, "active_config"); - try { - return (await fs3.promises.readFile(filePath, "utf-8")).trim() || "default"; - } catch (err) { - if (err?.code !== "ENOENT") { - throw new Error(`failed to read ${filePath}: ${err}`); - } - return "default"; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs -function identityTokenFromFile(path5) { - if (!path5) { - throw new AnthropicError("Identity token file path is empty"); - } - return async () => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - let content; - try { - content = await fs3.promises.readFile(path5, "utf-8"); - } catch (err) { - throw new AnthropicError(`Failed to read identity token file at ${path5}: ${err}`); - } - const token = content.trim(); - if (!token) { - throw new AnthropicError(`Identity token file at ${path5} is empty`); - } - return token; - }; -} -function identityTokenFromValue(token) { - if (!token) { - throw new AnthropicError("Identity token value is empty"); - } - return () => token; -} -var init_identity_token = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs -function oidcFederationProvider(config) { - return async () => { - requireSecureTokenEndpoint(config.baseURL); - const jwt = await config.identityTokenProvider(); - if (jwt.length > 16 * 1024) { - throw new WorkloadIdentityError(`Identity token is ${Math.ceil(jwt.length / 1024)} KiB, exceeds the 16 KiB assertion limit`); - } - const body = { - grant_type: GRANT_TYPE_JWT_BEARER, - assertion: jwt, - federation_rule_id: config.federationRuleId, - organization_id: config.organizationId - }; - if (config.serviceAccountId) { - body["service_account_id"] = config.serviceAccountId; - } - if (config.workspaceId) { - body["workspace_id"] = config.workspaceId; - } - const url = `${config.baseURL}${TOKEN_ENDPOINT}`; - let resp; - try { - resp = await config.fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "anthropic-beta": `${OAUTH_API_BETA_HEADER},${FEDERATION_BETA_HEADER}`, - "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION2} oidcFederationProvider` - }, - body: JSON.stringify(body) - }); - } catch (err) { - throw new WorkloadIdentityError(`Failed to reach token endpoint ${url}: ${err}`); - } - const requestId = resp.headers.get("Request-Id"); - if (!resp.ok) { - const text2 = await resp.text().catch(() => ""); - const redacted = redactSensitive(text2); - let hint = ""; - if (resp.status === 401) { - const hintMiddle = config.workspaceId ? "" : "If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "; - hint = ` Ensure your federation rule matches your identity token. ${hintMiddle}View your authentication events in the Workload identity page of Claude Console for more details.`; - } - throw new WorkloadIdentityError(`Token exchange failed with status ${resp.status}${requestId ? ` (request-id ${requestId})` : ""}: ${redacted}${hint}`, resp.status, redacted, requestId); - } - const data = await parseTokenResponse(resp, requestId); - const expiresIn = Number(data.expires_in); - if (!Number.isFinite(expiresIn)) { - throw new WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - return { - token: data.access_token, - expiresAt: nowAsSeconds() + expiresIn - }; - }; -} -var init_oidc_federation = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs"() { - init_types(); - init_time(); - init_version3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs -function userOAuthProvider(config) { - return async (opts) => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning); - let raw; - try { - raw = await fs3.promises.readFile(config.credentialsPath, "utf-8"); - } catch (err) { - throw new WorkloadIdentityError(`Credentials file not found at ${config.credentialsPath}: ${err}`); - } - let creds; - try { - creds = JSON.parse(raw); - } catch (err) { - throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} is not valid JSON: ${err}`); - } - const accessToken = creds.access_token; - if (!accessToken) { - throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} must include 'access_token'`); - } - const expiresAt = creds.expires_at; - if (!opts?.forceRefresh && (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS)) { - return { token: accessToken, expiresAt: expiresAt ?? null }; - } - const refreshToken = creds.refresh_token; - if (!config.clientId || !refreshToken) { - throw new WorkloadIdentityError(`Access token at ${config.credentialsPath} has expired and no refresh is available (client_id ${config.clientId ? "set" : "empty"}, refresh_token ${refreshToken ? "set" : "empty"})`); - } - requireSecureTokenEndpoint(config.baseURL); - const body = { - grant_type: GRANT_TYPE_REFRESH_TOKEN, - refresh_token: refreshToken, - client_id: config.clientId - }; - const url = `${config.baseURL}${TOKEN_ENDPOINT}`; - let resp; - try { - resp = await config.fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "anthropic-beta": OAUTH_API_BETA_HEADER, - "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION2} userOAuthProvider` - }, - body: JSON.stringify(body) - }); - } catch (err) { - throw new WorkloadIdentityError(`User OAuth refresh failed to reach token endpoint: ${err}`); - } - const requestId = resp.headers.get("Request-Id"); - if (!resp.ok) { - const text2 = await resp.text().catch(() => ""); - throw new WorkloadIdentityError(`User OAuth refresh failed (HTTP ${resp.status}): ${redactSensitive(text2)}`, resp.status, redactSensitive(text2), requestId); - } - const data = await parseTokenResponse(resp, requestId); - const expiresIn = Number(data.expires_in); - if (!Number.isFinite(expiresIn)) { - throw new WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - const newExpiresAt = nowAsSeconds() + expiresIn; - const newRefreshToken = data.refresh_token || refreshToken; - await writeCredentialsFileAtomic(config.credentialsPath, { - ...creds, - version: CREDENTIALS_FILE_VERSION, - type: "oauth_token", - access_token: data.access_token, - expires_at: newExpiresAt, - refresh_token: newRefreshToken - }); - return { token: data.access_token, expiresAt: newExpiresAt }; - }; -} -var init_user_oauth = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs"() { - init_credentials2(); - init_types(); - init_time(); - init_version3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs -function resolveCredentialsFromConfig(config, options) { - const credentialsPath = config.authentication.credentials_path ?? null; - const effectiveBaseURL = (config.base_url || options.baseURL).replace(/\/+$/, ""); - const provider2 = buildProvider(config, credentialsPath, effectiveBaseURL, options); - const extraHeaders = {}; - if (config.workspace_id && config.authentication.type === "user_oauth") { - extraHeaders["anthropic-workspace-id"] = config.workspace_id; - } - return { provider: provider2, extraHeaders, baseURL: config.base_url || void 0 }; -} -async function defaultCredentials(options, profile) { - const loaded = await loadConfigWithSource(profile); - if (!loaded) { - return null; - } - const { config, fromFile } = loaded; - const withPath = config.authentication.credentials_path || !fromFile ? config : { - ...config, - authentication: { - ...config.authentication, - credentials_path: await getCredentialsPath(config, profile) ?? void 0 - } - }; - return resolveCredentialsFromConfig(withPath, options); -} -function buildProvider(config, credentialsPath, baseURL, options) { - switch (config.authentication.type) { - case "oidc_federation": { - const auth = config.authentication; - const identityProvider = resolveIdentityTokenProvider(auth); - if (!identityProvider) { - throw new WorkloadIdentityError("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)"); - } - if (!auth.federation_rule_id) { - throw new WorkloadIdentityError("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence)."); - } - if (!config.organization_id) { - throw new WorkloadIdentityError("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)"); - } - const exchange = oidcFederationProvider({ - identityTokenProvider: identityProvider, - federationRuleId: auth.federation_rule_id, - organizationId: config.organization_id, - serviceAccountId: auth.service_account_id, - workspaceId: config.workspace_id, - baseURL, - fetch: options.fetch, - userAgent: options.userAgent - }); - if (credentialsPath) { - return cachedExchangeProvider(exchange, credentialsPath, options.onCacheWriteError, options.onSafetyWarning); - } - return exchange; - } - case "user_oauth": { - if (!credentialsPath) { - throw new WorkloadIdentityError("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)"); - } - return userOAuthProvider({ - credentialsPath, - clientId: config.authentication.client_id, - baseURL, - fetch: options.fetch, - userAgent: options.userAgent, - onSafetyWarning: options.onSafetyWarning - }); - } - default: { - const t = config.authentication.type; - throw new WorkloadIdentityError(`authentication.type "${t}" is not a known authentication type`); - } - } -} -function resolveIdentityTokenProvider(auth) { - if (auth.identity_token) { - const source = auth.identity_token.source; - if (source !== "file") { - throw new WorkloadIdentityError(`identity_token.source "${source}" is not supported by this SDK version (only "file")`); - } - if (!auth.identity_token.path) { - throw new WorkloadIdentityError(`identity_token.source "file" requires a non-empty path`); - } - return identityTokenFromFile(auth.identity_token.path); - } - const tokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - if (tokenFile) { - return identityTokenFromFile(tokenFile); - } - const tokenValue = readEnv2("ANTHROPIC_IDENTITY_TOKEN"); - if (tokenValue) { - return identityTokenFromValue(tokenValue); - } - return null; -} -function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) { - return async (opts) => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - await checkCredentialsFileSafety(credentialsPath, onSafetyWarning); - let existing; - try { - const raw = await fs3.promises.readFile(credentialsPath, "utf-8"); - existing = JSON.parse(raw); - const token = existing?.["access_token"]; - if (token && !opts?.forceRefresh) { - const expiresAt = existing?.["expires_at"]; - if (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { - return { token, expiresAt: expiresAt ?? null }; - } - } - } catch (err) { - const code = err?.code; - if (code !== "ENOENT" && !(err instanceof SyntaxError)) { - onCacheWriteError?.(err); - } - } - const result = await exchange(opts); - try { - await writeCredentialsFileAtomic(credentialsPath, { - ...existing ?? {}, - version: CREDENTIALS_FILE_VERSION, - type: "oauth_token", - access_token: result.token, - expires_at: result.expiresAt - }); - } catch (err) { - onCacheWriteError?.(err); - } - return result; - }; -} -var init_credential_chain = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs"() { - init_env2(); - init_credentials2(); - init_types(); - init_time(); - init_identity_token(); - init_oidc_federation(); - init_user_oauth(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs -function findNewlineIndex2(buffer, startIndex) { - const newline = 10; - const carriage = 13; - for (let i = startIndex ?? 0; i < buffer.length; i++) { - if (buffer[i] === newline) { - return { preceding: i, index: i + 1, carriage: false }; - } - if (buffer[i] === carriage) { - return { preceding: i, index: i + 1, carriage: true }; - } - } - return null; -} -var _LineDecoder_buffer2, _LineDecoder_carriageReturnIndex, LineDecoder2; -var init_line2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs"() { - init_tslib2(); - init_bytes2(); - LineDecoder2 = /* @__PURE__ */ (() => { - class LineDecoder3 { - constructor() { - _LineDecoder_buffer2.set(this, void 0); - _LineDecoder_carriageReturnIndex.set(this, void 0); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - } - decode(chunk) { - if (chunk == null) { - return []; - } - const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? encodeUTF82(chunk) : chunk; - __classPrivateFieldSet2(this, _LineDecoder_buffer2, concatBytes([__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), binaryChunk]), "f"); - const lines2 = []; - let patternIndex; - while ((patternIndex = findNewlineIndex2(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { - if (patternIndex.carriage && __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") == null) { - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); - continue; - } - if (__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { - lines2.push(decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") - 1))); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f")), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - continue; - } - const endIndex = __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; - const line = decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, endIndex)); - lines2.push(line); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(patternIndex.index), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - } - return lines2; - } - flush() { - if (!__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { - return []; - } - return this.decode("\n"); - } - } - _LineDecoder_buffer2 = /* @__PURE__ */ new WeakMap(), _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); - LineDecoder3.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); - LineDecoder3.NEWLINE_REGEXP = /\r\n|[\n\r]/g; - return LineDecoder3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/streaming.mjs -async function* _iterSSEMessages2(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); - } - throw new AnthropicError(`Attempted to iterate over a response with no body`); - } - const sseDecoder = new SSEDecoder2(); - const lineDecoder = new LineDecoder2(); - const iter = ReadableStreamToAsyncIterable2(response.body); - for await (const chunk of iter) { - for (const line of lineDecoder.decode(chunk)) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } - } - for (const line of lineDecoder.flush()) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } -} -function partition2(str2, delimiter) { - const index = str2.indexOf(delimiter); - if (index !== -1) { - return [str2.substring(0, index), delimiter, str2.substring(index + delimiter.length)]; - } - return [str2, "", ""]; -} -var _Stream_client2, Stream2, SSEDecoder2; -var init_streaming3 = __esm({ - "node_modules/@anthropic-ai/sdk/core/streaming.mjs"() { - init_tslib2(); - init_error3(); - init_shims2(); - init_line2(); - init_shims2(); - init_errors2(); - init_values2(); - init_bytes2(); - init_log2(); - init_error3(); - init_request_signal(); - Stream2 = /* @__PURE__ */ (() => { - class Stream3 { - constructor(iterator, controller, client) { - this.iterator = iterator; - _Stream_client2.set(this, void 0); - this.controller = controller; - __classPrivateFieldSet2(this, _Stream_client2, client, "f"); - } - /** - * Iterate the raw Server-Sent Events from `response` — `{event, data, raw}` - * objects, before any JSON parsing or event-name filtering. - * - * This reads `response.body` directly (not a clone), so the response is - * consumed. Use this in middleware that fully replaces the stream body; for - * read-only observation of parsed events, use `ctx.parse()` instead. - */ - static rawEvents(response, controller = new AbortController()) { - return _iterSSEMessages2(response, controller); - } - static fromSSEResponse(response, controller, client) { - let consumed = false; - const logger = client ? loggerFor2(client) : console; - async function* iterator() { - if (consumed) { - throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const sse of _iterSSEMessages2(response, controller)) { - if (sse.event === "completion") { - try { - yield JSON.parse(sse.data); - } catch (e) { - logger.error(`Could not parse message into JSON:`, sse.data); - logger.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop" || sse.event === "message" || sse.event === "user.message" || sse.event === "user.interrupt" || sse.event === "user.tool_confirmation" || sse.event === "user.custom_tool_result" || sse.event === "user.tool_result" || sse.event === "agent.message" || sse.event === "agent.thinking" || sse.event === "agent.tool_use" || sse.event === "agent.tool_result" || sse.event === "agent.mcp_tool_use" || sse.event === "agent.mcp_tool_result" || sse.event === "agent.custom_tool_use" || sse.event === "agent.thread_context_compacted" || sse.event === "session.status_running" || sse.event === "session.status_idle" || sse.event === "session.status_rescheduled" || sse.event === "session.status_terminated" || sse.event === "session.error" || sse.event === "session.deleted" || sse.event === "session.updated" || sse.event === "span.model_request_start" || sse.event === "span.model_request_end" || sse.event === "span.outcome_evaluation_start" || sse.event === "span.outcome_evaluation_ongoing" || sse.event === "span.outcome_evaluation_end" || sse.event === "user.define_outcome" || sse.event === "agent.thread_message_received" || sse.event === "agent.thread_message_sent" || sse.event === "agent.session_thread_message_received" || sse.event === "agent.session_thread_message_sent" || sse.event === "session.thread_created" || sse.event === "session.thread_status_created" || sse.event === "session.thread_status_running" || sse.event === "session.thread_status_idle" || sse.event === "session.thread_status_rescheduled" || sse.event === "session.thread_status_terminated" || sse.event === "event_start" || sse.event === "event_delta" || sse.event === "system.message") { - try { - yield JSON.parse(sse.data); - } catch (e) { - logger.error(`Could not parse message into JSON:`, sse.data); - logger.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "ping") { - continue; - } - if (sse.event === "error") { - const body = safeJSON2(sse.data) ?? sse.data; - const type = body?.error?.type; - throw new APIError2(void 0, body, void 0, response.headers, type); - } - } - done = true; - } catch (e) { - if (isAbortError2(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - releaseRequestSignal(controller); - } - } - return new Stream3(iterator, controller, client); - } - /** - * Generates a Stream from a newline-separated ReadableStream - * where each item is a JSON value. - */ - static fromReadableStream(readableStream, controller, client) { - let consumed = false; - async function* iterLines() { - const lineDecoder = new LineDecoder2(); - const iter = ReadableStreamToAsyncIterable2(readableStream); - for await (const chunk of iter) { - for (const line of lineDecoder.decode(chunk)) { - yield line; - } - } - for (const line of lineDecoder.flush()) { - yield line; - } - } - async function* iterator() { - if (consumed) { - throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const line of iterLines()) { - if (done) - continue; - if (line) - yield JSON.parse(line); - } - done = true; - } catch (e) { - if (isAbortError2(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - releaseRequestSignal(controller); - } - } - return new Stream3(iterator, controller, client); - } - [(_Stream_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - return this.iterator(); - } - /** - * Splits the stream into two streams which can be - * independently read from at different speeds. - */ - tee() { - const left = []; - const right = []; - const iterator = this.iterator(); - const teeIterator = (queue2) => { - return { - next: () => { - if (queue2.length === 0) { - const result = iterator.next(); - left.push(result); - right.push(result); - } - return queue2.shift(); - } - }; - }; - return [ - new Stream3(() => teeIterator(left), this.controller, __classPrivateFieldGet2(this, _Stream_client2, "f")), - new Stream3(() => teeIterator(right), this.controller, __classPrivateFieldGet2(this, _Stream_client2, "f")) - ]; - } - /** - * Converts this stream to a newline-separated ReadableStream of - * JSON stringified values in the stream - * which can be turned back into a Stream with `Stream.fromReadableStream()`. - */ - toReadableStream() { - const self = this; - let iter; - return makeReadableStream2({ - async start() { - iter = self[Symbol.asyncIterator](); - }, - async pull(ctrl) { - try { - const { value: value2, done } = await iter.next(); - if (done) - return ctrl.close(); - const bytes2 = encodeUTF82(JSON.stringify(value2) + "\n"); - ctrl.enqueue(bytes2); - } catch (err) { - ctrl.error(err); - } - }, - async cancel() { - await iter.return?.(); - } - }); - } - } - return Stream3; - })(); - SSEDecoder2 = class { - constructor() { - this.event = null; - this.data = []; - this.chunks = []; - } - decode(line) { - if (line.endsWith("\r")) { - line = line.substring(0, line.length - 1); - } - if (!line) { - if (!this.event && !this.data.length) - return null; - const sse = { - event: this.event, - data: this.data.join("\n"), - raw: this.chunks - }; - this.event = null; - this.data = []; - this.chunks = []; - return sse; - } - this.chunks.push(line); - if (line.startsWith(":")) { - return null; - } - let [fieldname, _, value2] = partition2(line, ":"); - if (value2.startsWith(" ")) { - value2 = value2.substring(1); - } - if (fieldname === "event") { - this.event = value2; - } else if (fieldname === "data") { - this.data.push(value2); - } - return null; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/parse.mjs -async function defaultParseResponse2(client, props) { - const { response, requestLogID, retryOfRequestLogID, startTime } = props; - const body = await (async () => { - if (props.options.stream) { - loggerFor2(client).debug("response", response.status, response.url, response.headers, response.body); - return Stream2.fromSSEResponse(response, props.controller, client); - } - if (response.status === 204) { - return null; - } - if (props.options.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - const contentLength = response.headers.get("content-length"); - if (contentLength === "0") { - return void 0; - } - const json = await response.json(); - return addResponseIDs(json, response); - } - const text2 = await response.text(); - return text2; - })().finally(() => { - if (!props.options.stream && !props.options.__binaryResponse) { - releaseRequestSignal(props.controller); - } - }); - debugLogRequestDetails(loggerFor2(client), `[${requestLogID}] response parsed`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - body, - durationMs: Date.now() - startTime - }); - return body; -} -function addResponseIDs(value2, response) { - if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) { - return value2; - } - return Object.defineProperties(value2, { - _request_id: { value: response.headers.get("request-id"), enumerable: false }, - _workspace_id: { value: response.headers.get("anthropic-workspace-id"), enumerable: false } - }); -} -var init_parse2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/parse.mjs"() { - init_streaming3(); - init_log2(); - init_request_signal(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/middleware.mjs -function isFetchOriginError(err) { - return typeof err === "object" && err !== null && fetchOriginErrors.has(err); -} -function isRetryableError(err) { - const seen = /* @__PURE__ */ new Set(); - while (typeof err === "object" && err !== null && !seen.has(err)) { - seen.add(err); - if (isFetchOriginError(err) || isAbortError2(err) || err instanceof APIConnectionError2 || err instanceof RetryableError) { - return true; - } - err = err.cause; - } - return false; -} -function wrapFetchWithMiddleware(fetchFn, middleware, options, client) { - return async (url, init = {}) => { - if (middleware.length === 0) { - return fetchFn.call(void 0, url, init); - } - const headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - const response = await applyMiddleware(fetchFn, middleware, options, client)({ - ...init, - headers, - url: typeof url === "string" ? url : url instanceof URL ? url.href : url.url - }); - if (response.bodyUsed || response.body?.locked) { - throw new AnthropicError("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it"); - } - return response; - }; -} -function createMiddlewareContext(options, client) { - const cache = /* @__PURE__ */ new WeakMap(); - return { - options, - // Resolved per chain, so changes to the client's `logLevel`/`logger` - // apply to subsequent requests. - logger: client ? loggerFor2(client) : defaultLogger(), - parse(response) { - if (options?.stream && response.ok) { - return parseMiddlewareResponse(response, options, client); - } - let parsed = cache.get(response); - if (!parsed) { - parsed = parseMiddlewareResponse(response, options, client); - cache.set(response, parsed); - } - return parsed; - } - }; -} -async function parseMiddlewareResponse(response, options, client) { - if (response.bodyUsed || response.body?.locked) { - throw new AnthropicError("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()"); - } - if (options?.stream && response.ok) { - return Stream2.fromSSEResponse(response.clone(), new AbortController(), client); - } - if (response.status === 204) { - return null; - } - if (options?.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - if (response.headers.get("content-length") === "0") { - return void 0; - } - return addResponseIDs(await response.clone().json(), response); - } - return await response.clone().text(); -} -function applyMiddleware(fetchFn, middleware, options, client) { - let next = async ({ url, ...init }) => { - try { - return await fetchFn.call(void 0, url, init); - } catch (err) { - const error = castToError2(err); - fetchOriginErrors.add(error); - throw error; - } - }; - const ctx = createMiddlewareContext(options, client); - for (let i = middleware.length - 1; i >= 0; i--) { - const mw = middleware[i]; - const nextInner = next; - next = async (request2) => mw(request2, nextInner, ctx); - } - return next; -} -var fetchOriginErrors; -var init_middleware = __esm({ - "node_modules/@anthropic-ai/sdk/core/middleware.mjs"() { - init_errors2(); - init_parse2(); - init_log2(); - init_error3(); - init_streaming3(); - fetchOriginErrors = /* @__PURE__ */ new WeakSet(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/api-promise.mjs -var _APIPromise_client2, APIPromise2; -var init_api_promise2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/api-promise.mjs"() { - init_tslib2(); - init_parse2(); - APIPromise2 = /* @__PURE__ */ (() => { - class APIPromise3 extends Promise { - constructor(client, responsePromise, parseResponse2 = defaultParseResponse2) { - super((resolve2) => { - resolve2(null); - }); - this.responsePromise = responsePromise; - this.parseResponse = parseResponse2; - _APIPromise_client2.set(this, void 0); - __classPrivateFieldSet2(this, _APIPromise_client2, client, "f"); - } - _thenUnwrap(transform) { - return new APIPromise3(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), this.responsePromise, async (client, props) => addResponseIDs(transform(await this.parseResponse(client, props), props), props.response)); - } - /** - * Gets the raw `Response` instance instead of parsing the response - * data. - * - * If you want to parse the response body but still get the `Response` - * instance, you can use {@link withResponse()}. - * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` - * to your `tsconfig.json`. - */ - asResponse() { - return this.responsePromise.then((p) => p.response); - } - /** - * Gets the parsed response data, the raw `Response` instance and the ID of the request, - * returned via the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * If you just want to get the raw `Response` instance without parsing it, - * you can use {@link asResponse()}. - * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` - * to your `tsconfig.json`. - */ - async withResponse() { - const [data, response] = await Promise.all([this.parse(), this.asResponse()]); - return { - data, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - parse() { - if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), data)); - } - return this.parsedPromise; - } - then(onfulfilled, onrejected) { - return this.parse().then(onfulfilled, onrejected); - } - catch(onrejected) { - return this.parse().catch(onrejected); - } - finally(onfinally) { - return this.parse().finally(onfinally); - } - } - _APIPromise_client2 = /* @__PURE__ */ new WeakMap(); - return APIPromise3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/pagination.mjs -var _AbstractPage_client2, AbstractPage2, PagePromise2, Page2, PageCursor, BidirectionalPageCursor; -var init_pagination2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/pagination.mjs"() { - init_tslib2(); - init_error3(); - init_parse2(); - init_api_promise2(); - init_values2(); - AbstractPage2 = /* @__PURE__ */ (() => { - class AbstractPage3 { - constructor(client, response, body, options) { - _AbstractPage_client2.set(this, void 0); - __classPrivateFieldSet2(this, _AbstractPage_client2, client, "f"); - this.options = options; - this.response = response; - this.body = body; - } - hasNextPage() { - const items = this.getPaginatedItems(); - if (!items.length) - return false; - return this.nextPageRequestOptions() != null; - } - async getNextPage() { - const nextOptions = this.nextPageRequestOptions(); - if (!nextOptions) { - throw new AnthropicError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); - } - return await __classPrivateFieldGet2(this, _AbstractPage_client2, "f").requestAPIList(this.constructor, nextOptions); - } - async *iterPages() { - let page3 = this; - yield page3; - while (page3.hasNextPage()) { - page3 = await page3.getNextPage(); - yield page3; - } - } - async *[(_AbstractPage_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - for await (const page3 of this.iterPages()) { - for (const item of page3.getPaginatedItems()) { - yield item; - } - } - } - } - return AbstractPage3; - })(); - PagePromise2 = /* @__PURE__ */ (() => { - class PagePromise3 extends APIPromise2 { - constructor(client, request2, Page3) { - super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse2(client2, props), props.options)); - } - /** - * Allow auto-paginating iteration on an unawaited list call, eg: - * - * for await (const item of client.items.list()) { - * console.log(item) - * } - */ - async *[Symbol.asyncIterator]() { - const page3 = await this; - for await (const item of page3) { - yield item; - } - } - } - return PagePromise3; - })(); - Page2 = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.has_more = body.has_more || false; - this.first_id = body.first_id || null; - this.last_id = body.last_id || null; - } - getPaginatedItems() { - return this.data ?? []; - } - hasNextPage() { - if (this.has_more === false) { - return false; - } - return super.hasNextPage(); - } - nextPageRequestOptions() { - if (this.options.query?.["before_id"]) { - const first_id = this.first_id; - if (!first_id) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - before_id: first_id - } - }; - } - const cursor = this.last_id; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - after_id: cursor - } - }; - } - }; - PageCursor = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.next_page = body.next_page || null; - } - getPaginatedItems() { - return this.data ?? []; - } - nextPageRequestOptions() { - const cursor = this.next_page; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - page: cursor - } - }; - } - }; - BidirectionalPageCursor = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.next_page = body.next_page || null; - this.prev_page = body.prev_page || null; - } - getPaginatedItems() { - return this.data ?? []; - } - nextPageRequestOptions() { - const cursor = this.next_page; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - page: cursor - } - }; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/uploads.mjs -function makeFile2(fileBits, fileName, options) { - checkFileSupport2(); - return new File(fileBits, fileName ?? "", options); -} -function getName2(value2, stripPath) { - const val = typeof value2 === "object" && value2 !== null && ("name" in value2 && value2.name && String(value2.name) || "url" in value2 && value2.url && String(value2.url) || "filename" in value2 && value2.filename && String(value2.filename) || "path" in value2 && value2.path && String(value2.path)) || ""; - return stripPath ? val.split(/[\\/]/).pop() || void 0 : val; -} -function supportsFormData2(fetchObject) { - const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; - const cached = supportsFormDataMap2.get(fetch2); - if (cached) - return cached; - const promise = (async () => { - try { - const FetchResponse = "Response" in fetch2 ? fetch2.Response : (await fetch2("data:,")).constructor; - const data = new FormData(); - if (data.toString() === await new FetchResponse(data).text()) { - return false; - } - return true; - } catch { - return true; - } - })(); - supportsFormDataMap2.set(fetch2, promise); - return promise; -} -var checkFileSupport2, isAsyncIterable2, multipartFormRequestOptions2, supportsFormDataMap2, createForm2, addFormValue2; -var init_uploads4 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/uploads.mjs"() { - init_shims2(); - checkFileSupport2 = () => { - if (typeof File === "undefined") { - const { process: process2 } = globalThis; - const isOldNode = typeof process2?.versions?.node === "string" && parseInt(process2.versions.node.split(".")) < 20; - throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : "")); - } - }; - isAsyncIterable2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; - multipartFormRequestOptions2 = async (opts, fetch2, stripFilenames = true) => { - return { ...opts, body: await createForm2(opts.body, fetch2, stripFilenames) }; - }; - supportsFormDataMap2 = /* @__PURE__ */ new WeakMap(); - createForm2 = async (body, fetch2, stripFilenames = true) => { - if (!await supportsFormData2(fetch2)) { - throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); - } - const form = new FormData(); - await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue2(form, key, value2, stripFilenames))); - return form; - }; - addFormValue2 = async (form, key, value2, stripFilenames) => { - if (value2 === void 0) - return; - if (value2 == null) { - throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); - } - if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean") { - form.append(key, String(value2)); - } else if (value2 instanceof Response) { - let options = {}; - const contentType = value2.headers.get("Content-Type"); - if (contentType) { - options = { type: contentType }; - } - form.append(key, makeFile2([await value2.blob()], getName2(value2, stripFilenames), options)); - } else if (isAsyncIterable2(value2)) { - form.append(key, makeFile2([await new Response(ReadableStreamFrom2(value2)).blob()], getName2(value2, stripFilenames))); - } else if (value2 instanceof Blob) { - const isFile = typeof File !== "undefined" && value2 instanceof File; - const name = isFile ? value2.name : getName2(value2, stripFilenames); - form.append(key, makeFile2([value2], name, { type: value2.type })); - } else if (Array.isArray(value2)) { - await Promise.all(value2.map((entry2) => addFormValue2(form, key + "[]", entry2, stripFilenames))); - } else if (typeof value2.then === "function") { - throw new TypeError(`Received a Promise for "${key}"; await it first, e.g. \`await toFile(...)\``); - } else if (value2 instanceof ArrayBuffer || ArrayBuffer.isView(value2)) { - throw new TypeError(`Received ${value2.constructor.name} for "${key}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``); - } else if (typeof value2 === "object") { - await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue2(form, `${key}[${name}]`, prop, stripFilenames))); - } else { - throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/to-file.mjs -async function toFile2(value2, name, options) { - checkFileSupport2(); - value2 = await value2; - name || (name = value2 instanceof File ? value2.name : getName2(value2, true)); - if (isFileLike2(value2)) { - if (value2 instanceof File && name == null && options == null) { - return value2; - } - return makeFile2([await value2.arrayBuffer()], name ?? value2.name, { - type: value2.type, - lastModified: value2.lastModified, - ...options - }); - } - if (isResponseLike2(value2)) { - const blob = await value2.blob(); - name || (name = new URL(value2.url).pathname.split(/[\\/]/).pop()); - return makeFile2(await getBytes2(blob), name, options); - } - const parts = await getBytes2(value2); - if (!options?.type) { - const type = parts.find((part) => typeof part === "object" && "type" in part && part.type); - if (typeof type === "string") { - options = { ...options, type }; - } - } - return makeFile2(parts, name, options); -} -async function getBytes2(value2) { - let parts = []; - if (typeof value2 === "string" || ArrayBuffer.isView(value2) || // includes Uint8Array, Buffer, etc. - value2 instanceof ArrayBuffer) { - parts.push(value2); - } else if (isBlobLike2(value2)) { - parts.push(value2 instanceof Blob ? value2 : await value2.arrayBuffer()); - } else if (isAsyncIterable2(value2)) { - for await (const chunk of value2) { - parts.push(...await getBytes2(chunk)); - } - } else { - const constructor = value2?.constructor?.name; - throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError2(value2)}`); - } - return parts; -} -function propsForError2(value2) { - if (typeof value2 !== "object" || value2 === null) - return ""; - const props = Object.getOwnPropertyNames(value2); - return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; -} -var isBlobLike2, isFileLike2, isResponseLike2; -var init_to_file2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/to-file.mjs"() { - init_uploads4(); - init_uploads4(); - isBlobLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; - isFileLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike2(value2); - isResponseLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; - } -}); - -// node_modules/@anthropic-ai/sdk/core/uploads.mjs -var init_uploads5 = __esm({ - "node_modules/@anthropic-ai/sdk/core/uploads.mjs"() { - init_to_file2(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/shared.mjs -var init_shared2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/shared.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/core/resource.mjs -var APIResource2; -var init_resource2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/resource.mjs"() { - APIResource2 = class { - constructor(client) { - this._client = client; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/headers.mjs -function* iterateHeaders2(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders2 in headers) { - const { values, nulls } = headers; - yield* values.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (isReadonlyArray2(headers)) { - iter = headers; - } else { - shouldClear = true; - iter = Object.entries(headers ?? {}); - } - for (let row of iter) { - const name = row[0]; - if (typeof name !== "string") - throw new TypeError("expected header name to be a string"); - const values = isReadonlyArray2(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value2 of values) { - if (value2 === void 0) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, clearSentinel]; - } - yield [name, value2]; - } - } -} -var brand_privateNullableHeaders2, clearSentinel, APPEND_HEADERS, appendHeaderValue, buildHeaders2; -var init_headers3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/headers.mjs"() { - init_values2(); - brand_privateNullableHeaders2 = /* @__PURE__ */ Symbol.for("brand.privateNullableHeaders"); - clearSentinel = /* @__PURE__ */ Symbol("clear"); - APPEND_HEADERS = /* @__PURE__ */ new Set(["x-stainless-helper"]); - appendHeaderValue = (existing, addition) => { - const tokens = existing ? existing.split(",").map((t) => t.trim()).filter(Boolean) : []; - for (const tok of addition.split(",").map((t) => t.trim())) { - if (tok && !tokens.includes(tok)) - tokens.push(tok); - } - return tokens.join(", "); - }; - buildHeaders2 = (newHeaders) => { - const targetHeaders = new Headers(); - const nullHeaders = /* @__PURE__ */ new Set(); - for (const headers of newHeaders) { - const seenHeaders = /* @__PURE__ */ new Set(); - for (const [name, value2] of iterateHeaders2(headers)) { - const lowerName = name.toLowerCase(); - if (APPEND_HEADERS.has(lowerName)) { - if (value2 === clearSentinel) - continue; - if (value2 === null) { - targetHeaders.delete(name); - nullHeaders.add(lowerName); - } else { - targetHeaders.set(name, appendHeaderValue(targetHeaders.get(name), value2)); - nullHeaders.delete(lowerName); - } - continue; - } - if (value2 === clearSentinel || !seenHeaders.has(lowerName)) { - targetHeaders.delete(name); - seenHeaders.add(lowerName); - if (value2 === clearSentinel) - continue; - } - if (value2 === null) { - targetHeaders.delete(name); - nullHeaders.add(lowerName); - } else { - targetHeaders.append(name, value2); - nullHeaders.delete(lowerName); - } - } - } - return { [brand_privateNullableHeaders2]: true, values: targetHeaders, nulls: nullHeaders }; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/path.mjs -function encodeURIPath2(str2) { - return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); -} -var EMPTY2, createPathTagFunction2, path3; -var init_path2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() { - init_error3(); - EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); - createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path5(statics, ...params) { - if (statics.length === 1) - return statics[0]; - let postPath = false; - const invalidSegments = []; - const path6 = statics.reduce((previousValue, currentValue, index) => { - if (/[?#]/.test(currentValue)) { - postPath = true; - } - const value2 = params[index]; - let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value2); - if (index !== params.length && (value2 == null || typeof value2 === "object" && // handle values from other realms - value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY2) ?? EMPTY2)?.toString)) { - encoded = value2 + ""; - invalidSegments.push({ - start: previousValue.length + currentValue.length, - length: encoded.length, - error: `Value of type ${Object.prototype.toString.call(value2).slice(8, -1)} is not a valid path parameter` - }); - } - return previousValue + currentValue + (index === params.length ? "" : encoded); - }, ""); - const pathOnly = path6.split(/[?#]/, 1)[0]; - const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; - let match; - while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { - invalidSegments.push({ - start: match.index, - length: match[0].length, - error: `Value "${match[0]}" can't be safely passed as a path parameter` - }); - } - invalidSegments.sort((a, b) => a.start - b.start); - if (invalidSegments.length > 0) { - let lastEnd = 0; - const underline = invalidSegments.reduce((acc, segment) => { - const spaces = " ".repeat(segment.start - lastEnd); - const arrows = "^".repeat(segment.length); - lastEnd = segment.start + segment.length; - return acc + spaces + arrows; - }, ""); - throw new AnthropicError(`Path parameters result in path with invalid segments: -${invalidSegments.map((e) => e.error).join("\n")} -${path6} -${underline}`); - } - return path6; - }; - path3 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs -var DeploymentRuns; -var init_deployment_runs = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - DeploymentRuns = class extends APIResource2 { - /** - * Get Deployment Run - * - * @example - * ```ts - * const betaManagedAgentsDeploymentRun = - * await client.beta.deploymentRuns.retrieve( - * 'deployment_run_id', - * ); - * ``` - */ - retrieve(deploymentRunID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/deployment_runs/${deploymentRunID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Deployment Runs - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsDeploymentRun of client.beta.deploymentRuns.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/deployment_runs?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs -var Deployments; -var init_deployments = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Deployments = class extends APIResource2 { - /** - * Create Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.create({ - * agent: 'string', - * environment_id: 'x', - * initial_events: [ - * { - * content: [ - * { - * text: 'Where is my order #1234?', - * type: 'text', - * }, - * ], - * type: 'user.message', - * }, - * ], - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/deployments?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.retrieve( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - retrieve(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/deployments/${deploymentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.update( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - update(deploymentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/deployments/${deploymentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Deployments - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsDeployment of client.beta.deployments.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/deployments?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.archive( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - archive(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Pause Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.pause( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - pause(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/pause?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Run Deployment Now - * - * @example - * ```ts - * const betaManagedAgentsDeploymentRun = - * await client.beta.deployments.run( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - run(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/run?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Unpause Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.unpause( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - unpause(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/unpause?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs -var Dreams; -var init_dreams = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Dreams = class extends APIResource2 { - /** - * Start an asynchronous job that uses past sessions to produce a reorganized - * version of a memory store and get back the dream to poll for the result. - * - * By default the dream writes its result to a new memory store and doesn't change - * the input memory store. The response has `status` set to `pending` and an empty - * `outputs` array. Poll the dream until `status` is `completed`, `failed`, or - * `canceled`. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#create-a-dream) - * to learn more about creating dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.create({ - * inputs: [{ memory_store_id: 'x', type: 'memory_store' }], - * model: 'string', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/dreams?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get a dream by ID to check its status, output memory store, and token usage. - * - * Archived dreams are returned too. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#track-progress) - * for how to poll a dream and what each status means. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.retrieve( - * 'dream_id', - * ); - * ``` - */ - retrieve(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/dreams/${dreamID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List the dreams in the workspace, newest first. - * - * Archived dreams are left out unless `include_archived` is `true`. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#list-dreams) - * for how to page through dreams. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaDream of client.beta.dreams.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/dreams?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Hide a `completed`, `failed`, or `canceled` dream from the default list of - * dreams. - * - * Archiving a `pending` or `running` dream returns a 400 error, so cancel it - * first. Archiving an archived dream returns it unchanged. An archived dream can - * still be fetched by ID. Archiving can't be undone. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#archive-a-dream) - * to learn more about archiving dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.archive( - * 'dream_id', - * ); - * ``` - */ - archive(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/dreams/${dreamID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stop a `pending` or `running` dream. - * - * The response shows `status` as `canceled`, unless the dream reached `completed` - * or `failed` first. `usage` can keep changing after the response. Canceling a - * `canceled` dream returns it unchanged. Canceling a `completed` or `failed` dream - * returns a 400 error. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#cancel-a-dream) - * to learn more about canceling dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.cancel( - * 'dream_id', - * ); - * ``` - */ - cancel(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/dreams/${dreamID}/cancel?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs -function helperHeader(value2) { - return { [STAINLESS_HELPER_HEADER]: value2 }; -} -function wasCreatedByStainlessHelper(value2) { - return typeof value2 === "object" && value2 !== null && SDK_HELPER_SYMBOL in value2; -} -function collectStainlessHelpers(tools, messages) { - const helpers = /* @__PURE__ */ new Set(); - if (tools) { - for (const tool of tools) { - if (wasCreatedByStainlessHelper(tool)) { - helpers.add(tool[SDK_HELPER_SYMBOL]); - } - } - } - if (messages) { - for (const message of messages) { - if (wasCreatedByStainlessHelper(message)) { - helpers.add(message[SDK_HELPER_SYMBOL]); - } - const content = message.content; - if (Array.isArray(content)) { - for (const block of content) { - if (wasCreatedByStainlessHelper(block)) { - helpers.add(block[SDK_HELPER_SYMBOL]); - } - const definition = block?.tool?.definition; - if (wasCreatedByStainlessHelper(definition)) { - helpers.add(definition[SDK_HELPER_SYMBOL]); - } - } - } - } - } - return Array.from(helpers); -} -function stainlessHelperHeader(tools, messages) { - const helpers = collectStainlessHelpers(tools, messages); - if (helpers.length === 0) - return {}; - return { [STAINLESS_HELPER_HEADER]: helpers.join(", ") }; -} -function stainlessHelperHeaderFromFile(file2) { - if (wasCreatedByStainlessHelper(file2)) { - return { [STAINLESS_HELPER_HEADER]: file2[SDK_HELPER_SYMBOL] }; - } - return {}; -} -var STAINLESS_HELPER_HEADER, STAINLESS_HELPER_METHOD_HEADER, SDK_HELPER_SYMBOL; -var init_stainless_helper_header = __esm({ - "node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs"() { - STAINLESS_HELPER_HEADER = "x-stainless-helper"; - STAINLESS_HELPER_METHOD_HEADER = "x-stainless-helper-method"; - SDK_HELPER_SYMBOL = /* @__PURE__ */ Symbol("anthropic.sdk.stainlessHelper"); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/files.mjs -var Files5; -var init_files5 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/files.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_stainless_helper_header(); - init_uploads4(); - init_path2(); - Files5 = class extends APIResource2 { - /** - * List Files - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFileMetadata of client.beta.files.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/files?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete File - * - * @example - * ```ts - * const betaDeletedFile = await client.beta.files.delete( - * 'file_id', - * ); - * ``` - */ - delete(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/files/${fileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Download File - * - * @example - * ```ts - * const response = await client.beta.files.download( - * 'file_id', - * ); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}/content?beta=true`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - /** - * Get File Metadata - * - * @example - * ```ts - * const betaFileMetadata = - * await client.beta.files.retrieveMetadata('file_id'); - * ``` - */ - retrieveMetadata(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Upload File - * - * @example - * ```ts - * const betaFileMetadata = await client.beta.files.upload({ - * file: fs.createReadStream('path/to/file'), - * }); - * ``` - */ - upload(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/files?beta=true", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - stainlessHelperHeaderFromFile(body.file), - options?.headers - ]) - }, this._client)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/models.mjs -var Models2; -var init_models3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/models.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Models2 = class extends APIResource2 { - /** - * Get a specific model. - * - * The Models API response can be used to determine information about a specific - * model or resolve a model alias to a model ID. - * - * @example - * ```ts - * const betaModelInfo = await client.beta.models.retrieve( - * 'model_id', - * ); - * ``` - */ - retrieve(modelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/models/${modelID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List available models. - * - * The Models API response can be used to determine which models are available for - * use in the API. More recently released models are listed first. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaModelInfo of client.beta.models.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs -var UserProfiles; -var init_user_profiles = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - UserProfiles = class extends APIResource2 { - /** - * Create User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.create(); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/user_profiles?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.retrieve( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - retrieve(userProfileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/user_profiles/${userProfileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.update( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - update(userProfileID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/user_profiles/${userProfileID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List User Profiles - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaUserProfile of client.beta.userProfiles.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/user_profiles?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Create Enrollment URL - * - * @example - * ```ts - * const betaUserProfileEnrollmentURL = - * await client.beta.userProfiles.createEnrollmentURL( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - createEnrollmentURL(userProfileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@stablelib/base64/lib/base64.js -var require_base64 = __commonJS({ - "node_modules/@stablelib/base64/lib/base64.js"(exports) { - "use strict"; - var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { - d2.__proto__ = b2; - } || function(d2, b2) { - for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p]; - }; - return extendStatics(d, b); - }; - return function(d, b) { - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var INVALID_BYTE = 256; - var Coder = ( - /** @class */ - (function() { - function Coder2(_paddingCharacter) { - if (_paddingCharacter === void 0) { - _paddingCharacter = "="; - } - this._paddingCharacter = _paddingCharacter; - } - Coder2.prototype.encodedLength = function(length) { - if (!this._paddingCharacter) { - return (length * 8 + 5) / 6 | 0; - } - return (length + 2) / 3 * 4 | 0; - }; - Coder2.prototype.encode = function(data) { - var out = ""; - var i = 0; - for (; i < data.length - 2; i += 3) { - var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2]; - out += this._encodeByte(c >>> 3 * 6 & 63); - out += this._encodeByte(c >>> 2 * 6 & 63); - out += this._encodeByte(c >>> 1 * 6 & 63); - out += this._encodeByte(c >>> 0 * 6 & 63); - } - var left = data.length - i; - if (left > 0) { - var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0); - out += this._encodeByte(c >>> 3 * 6 & 63); - out += this._encodeByte(c >>> 2 * 6 & 63); - if (left === 2) { - out += this._encodeByte(c >>> 1 * 6 & 63); - } else { - out += this._paddingCharacter || ""; - } - out += this._paddingCharacter || ""; - } - return out; - }; - Coder2.prototype.maxDecodedLength = function(length) { - if (!this._paddingCharacter) { - return (length * 6 + 7) / 8 | 0; - } - return length / 4 * 3 | 0; - }; - Coder2.prototype.decodedLength = function(s) { - return this.maxDecodedLength(s.length - this._getPaddingLength(s)); - }; - Coder2.prototype.decode = function(s) { - if (s.length === 0) { - return new Uint8Array(0); - } - var paddingLength = this._getPaddingLength(s); - var length = s.length - paddingLength; - var out = new Uint8Array(this.maxDecodedLength(length)); - var op2 = 0; - var i = 0; - var haveBad = 0; - var v0 = 0, v1 = 0, v2 = 0, v3 = 0; - for (; i < length - 4; i += 4) { - v0 = this._decodeChar(s.charCodeAt(i + 0)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - v2 = this._decodeChar(s.charCodeAt(i + 2)); - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op2++] = v0 << 2 | v1 >>> 4; - out[op2++] = v1 << 4 | v2 >>> 2; - out[op2++] = v2 << 6 | v3; - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - haveBad |= v2 & INVALID_BYTE; - haveBad |= v3 & INVALID_BYTE; - } - if (i < length - 1) { - v0 = this._decodeChar(s.charCodeAt(i)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - out[op2++] = v0 << 2 | v1 >>> 4; - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - } - if (i < length - 2) { - v2 = this._decodeChar(s.charCodeAt(i + 2)); - out[op2++] = v1 << 4 | v2 >>> 2; - haveBad |= v2 & INVALID_BYTE; - } - if (i < length - 3) { - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op2++] = v2 << 6 | v3; - haveBad |= v3 & INVALID_BYTE; - } - if (haveBad !== 0) { - throw new Error("Base64Coder: incorrect characters for decoding"); - } - return out; - }; - Coder2.prototype._encodeByte = function(b) { - var result = b; - result += 65; - result += 25 - b >>> 8 & 0 - 65 - 26 + 97; - result += 51 - b >>> 8 & 26 - 97 - 52 + 48; - result += 61 - b >>> 8 & 52 - 48 - 62 + 43; - result += 62 - b >>> 8 & 62 - 43 - 63 + 47; - return String.fromCharCode(result); - }; - Coder2.prototype._decodeChar = function(c) { - var result = INVALID_BYTE; - result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62; - result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63; - result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; - result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; - result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; - return result; - }; - Coder2.prototype._getPaddingLength = function(s) { - var paddingLength = 0; - if (this._paddingCharacter) { - for (var i = s.length - 1; i >= 0; i--) { - if (s[i] !== this._paddingCharacter) { - break; - } - paddingLength++; - } - if (s.length < 4 || paddingLength > 2) { - throw new Error("Base64Coder: incorrect padding"); - } - } - return paddingLength; - }; - return Coder2; - })() - ); - exports.Coder = Coder; - var stdCoder = new Coder(); - function encode3(data) { - return stdCoder.encode(data); - } - exports.encode = encode3; - function decode(s) { - return stdCoder.decode(s); - } - exports.decode = decode; - var URLSafeCoder = ( - /** @class */ - (function(_super) { - __extends(URLSafeCoder2, _super); - function URLSafeCoder2() { - return _super !== null && _super.apply(this, arguments) || this; - } - URLSafeCoder2.prototype._encodeByte = function(b) { - var result = b; - result += 65; - result += 25 - b >>> 8 & 0 - 65 - 26 + 97; - result += 51 - b >>> 8 & 26 - 97 - 52 + 48; - result += 61 - b >>> 8 & 52 - 48 - 62 + 45; - result += 62 - b >>> 8 & 62 - 45 - 63 + 95; - return String.fromCharCode(result); - }; - URLSafeCoder2.prototype._decodeChar = function(c) { - var result = INVALID_BYTE; - result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62; - result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63; - result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; - result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; - result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; - return result; - }; - return URLSafeCoder2; - })(Coder) - ); - exports.URLSafeCoder = URLSafeCoder; - var urlSafeCoder = new URLSafeCoder(); - function encodeURLSafe(data) { - return urlSafeCoder.encode(data); - } - exports.encodeURLSafe = encodeURLSafe; - function decodeURLSafe(s) { - return urlSafeCoder.decode(s); - } - exports.decodeURLSafe = decodeURLSafe; - exports.encodedLength = function(length) { - return stdCoder.encodedLength(length); - }; - exports.maxDecodedLength = function(length) { - return stdCoder.maxDecodedLength(length); - }; - exports.decodedLength = function(s) { - return stdCoder.decodedLength(s); - }; - } -}); - -// node_modules/fast-sha256/sha256.js -var require_sha256 = __commonJS({ - "node_modules/fast-sha256/sha256.js"(exports, module) { - (function(root, factory) { - var exports2 = {}; - factory(exports2); - var sha256 = exports2["default"]; - for (var k in exports2) { - sha256[k] = exports2[k]; - } - if (typeof module === "object" && typeof module.exports === "object") { - module.exports = sha256; - } else if (typeof define === "function" && define.amd) { - define(function() { - return sha256; - }); - } else { - root.sha256 = sha256; - } - })(exports, function(exports2) { - "use strict"; - exports2.__esModule = true; - exports2.digestLength = 32; - exports2.blockSize = 64; - var K = new Uint32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 - ]); - function hashBlocks(w, v, p, pos, len) { - var a, b, c, d, e, f, g, h, u, i, j, t1, t2; - while (len >= 64) { - a = v[0]; - b = v[1]; - c = v[2]; - d = v[3]; - e = v[4]; - f = v[5]; - g = v[6]; - h = v[7]; - for (i = 0; i < 16; i++) { - j = pos + i * 4; - w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255; - } - for (i = 16; i < 64; i++) { - u = w[i - 2]; - t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; - u = w[i - 15]; - t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; - w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0); - } - for (i = 0; i < 64; i++) { - t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0; - t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; - h = g; - g = f; - f = e; - e = d + t1 | 0; - d = c; - c = b; - b = a; - a = t1 + t2 | 0; - } - v[0] += a; - v[1] += b; - v[2] += c; - v[3] += d; - v[4] += e; - v[5] += f; - v[6] += g; - v[7] += h; - pos += 64; - len -= 64; - } - return pos; - } - var Hash = ( - /** @class */ - (function() { - function Hash2() { - this.digestLength = exports2.digestLength; - this.blockSize = exports2.blockSize; - this.state = new Int32Array(8); - this.temp = new Int32Array(64); - this.buffer = new Uint8Array(128); - this.bufferLength = 0; - this.bytesHashed = 0; - this.finished = false; - this.reset(); - } - Hash2.prototype.reset = function() { - this.state[0] = 1779033703; - this.state[1] = 3144134277; - this.state[2] = 1013904242; - this.state[3] = 2773480762; - this.state[4] = 1359893119; - this.state[5] = 2600822924; - this.state[6] = 528734635; - this.state[7] = 1541459225; - this.bufferLength = 0; - this.bytesHashed = 0; - this.finished = false; - return this; - }; - Hash2.prototype.clean = function() { - for (var i = 0; i < this.buffer.length; i++) { - this.buffer[i] = 0; - } - for (var i = 0; i < this.temp.length; i++) { - this.temp[i] = 0; - } - this.reset(); - }; - Hash2.prototype.update = function(data, dataLength) { - if (dataLength === void 0) { - dataLength = data.length; - } - if (this.finished) { - throw new Error("SHA256: can't update because hash was finished."); - } - var dataPos = 0; - this.bytesHashed += dataLength; - if (this.bufferLength > 0) { - while (this.bufferLength < 64 && dataLength > 0) { - this.buffer[this.bufferLength++] = data[dataPos++]; - dataLength--; - } - if (this.bufferLength === 64) { - hashBlocks(this.temp, this.state, this.buffer, 0, 64); - this.bufferLength = 0; - } - } - if (dataLength >= 64) { - dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength); - dataLength %= 64; - } - while (dataLength > 0) { - this.buffer[this.bufferLength++] = data[dataPos++]; - dataLength--; - } - return this; - }; - Hash2.prototype.finish = function(out) { - if (!this.finished) { - var bytesHashed = this.bytesHashed; - var left = this.bufferLength; - var bitLenHi = bytesHashed / 536870912 | 0; - var bitLenLo = bytesHashed << 3; - var padLength = bytesHashed % 64 < 56 ? 64 : 128; - this.buffer[left] = 128; - for (var i = left + 1; i < padLength - 8; i++) { - this.buffer[i] = 0; - } - this.buffer[padLength - 8] = bitLenHi >>> 24 & 255; - this.buffer[padLength - 7] = bitLenHi >>> 16 & 255; - this.buffer[padLength - 6] = bitLenHi >>> 8 & 255; - this.buffer[padLength - 5] = bitLenHi >>> 0 & 255; - this.buffer[padLength - 4] = bitLenLo >>> 24 & 255; - this.buffer[padLength - 3] = bitLenLo >>> 16 & 255; - this.buffer[padLength - 2] = bitLenLo >>> 8 & 255; - this.buffer[padLength - 1] = bitLenLo >>> 0 & 255; - hashBlocks(this.temp, this.state, this.buffer, 0, padLength); - this.finished = true; - } - for (var i = 0; i < 8; i++) { - out[i * 4 + 0] = this.state[i] >>> 24 & 255; - out[i * 4 + 1] = this.state[i] >>> 16 & 255; - out[i * 4 + 2] = this.state[i] >>> 8 & 255; - out[i * 4 + 3] = this.state[i] >>> 0 & 255; - } - return this; - }; - Hash2.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - Hash2.prototype._saveState = function(out) { - for (var i = 0; i < this.state.length; i++) { - out[i] = this.state[i]; - } - }; - Hash2.prototype._restoreState = function(from, bytesHashed) { - for (var i = 0; i < this.state.length; i++) { - this.state[i] = from[i]; - } - this.bytesHashed = bytesHashed; - this.finished = false; - this.bufferLength = 0; - }; - return Hash2; - })() - ); - exports2.Hash = Hash; - var HMAC = ( - /** @class */ - (function() { - function HMAC2(key) { - this.inner = new Hash(); - this.outer = new Hash(); - this.blockSize = this.inner.blockSize; - this.digestLength = this.inner.digestLength; - var pad = new Uint8Array(this.blockSize); - if (key.length > this.blockSize) { - new Hash().update(key).finish(pad).clean(); - } else { - for (var i = 0; i < key.length; i++) { - pad[i] = key[i]; - } - } - for (var i = 0; i < pad.length; i++) { - pad[i] ^= 54; - } - this.inner.update(pad); - for (var i = 0; i < pad.length; i++) { - pad[i] ^= 54 ^ 92; - } - this.outer.update(pad); - this.istate = new Uint32Array(8); - this.ostate = new Uint32Array(8); - this.inner._saveState(this.istate); - this.outer._saveState(this.ostate); - for (var i = 0; i < pad.length; i++) { - pad[i] = 0; - } - } - HMAC2.prototype.reset = function() { - this.inner._restoreState(this.istate, this.inner.blockSize); - this.outer._restoreState(this.ostate, this.outer.blockSize); - return this; - }; - HMAC2.prototype.clean = function() { - for (var i = 0; i < this.istate.length; i++) { - this.ostate[i] = this.istate[i] = 0; - } - this.inner.clean(); - this.outer.clean(); - }; - HMAC2.prototype.update = function(data) { - this.inner.update(data); - return this; - }; - HMAC2.prototype.finish = function(out) { - if (this.outer.finished) { - this.outer.finish(out); - } else { - this.inner.finish(out); - this.outer.update(out, this.digestLength).finish(out); - } - return this; - }; - HMAC2.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - return HMAC2; - })() - ); - exports2.HMAC = HMAC; - function hash(data) { - var h = new Hash().update(data); - var digest = h.digest(); - h.clean(); - return digest; - } - exports2.hash = hash; - exports2["default"] = hash; - function hmac(key, data) { - var h = new HMAC(key).update(data); - var digest = h.digest(); - h.clean(); - return digest; - } - exports2.hmac = hmac; - function fillBuffer(buffer, hmac2, info, counter) { - var num2 = counter[0]; - if (num2 === 0) { - throw new Error("hkdf: cannot expand more"); - } - hmac2.reset(); - if (num2 > 1) { - hmac2.update(buffer); - } - if (info) { - hmac2.update(info); - } - hmac2.update(counter); - hmac2.finish(buffer); - counter[0]++; - } - var hkdfSalt = new Uint8Array(exports2.digestLength); - function hkdf(key, salt, info, length) { - if (salt === void 0) { - salt = hkdfSalt; - } - if (length === void 0) { - length = 32; - } - var counter = new Uint8Array([1]); - var okm = hmac(salt, key); - var hmac_ = new HMAC(okm); - var buffer = new Uint8Array(hmac_.digestLength); - var bufpos = buffer.length; - var out = new Uint8Array(length); - for (var i = 0; i < length; i++) { - if (bufpos === buffer.length) { - fillBuffer(buffer, hmac_, info, counter); - bufpos = 0; - } - out[i] = buffer[bufpos++]; - } - hmac_.clean(); - buffer.fill(0); - counter.fill(0); - return out; - } - exports2.hkdf = hkdf; - function pbkdf2(password, salt, iterations, dkLen) { - var prf = new HMAC(password); - var len = prf.digestLength; - var ctr = new Uint8Array(4); - var t = new Uint8Array(len); - var u = new Uint8Array(len); - var dk = new Uint8Array(dkLen); - for (var i = 0; i * len < dkLen; i++) { - var c = i + 1; - ctr[0] = c >>> 24 & 255; - ctr[1] = c >>> 16 & 255; - ctr[2] = c >>> 8 & 255; - ctr[3] = c >>> 0 & 255; - prf.reset(); - prf.update(salt); - prf.update(ctr); - prf.finish(u); - for (var j = 0; j < len; j++) { - t[j] = u[j]; - } - for (var j = 2; j <= iterations; j++) { - prf.reset(); - prf.update(u).finish(u); - for (var k = 0; k < len; k++) { - t[k] ^= u[k]; - } - } - for (var j = 0; j < len && i * len + j < dkLen; j++) { - dk[i * len + j] = t[j]; - } - } - for (var i = 0; i < len; i++) { - t[i] = u[i] = 0; - } - for (var i = 0; i < 4; i++) { - ctr[i] = 0; - } - prf.clean(); - return dk; - } - exports2.pbkdf2 = pbkdf2; - }); - } -}); - -// node_modules/standardwebhooks/dist/timing_safe_equal.js -var require_timing_safe_equal = __commonJS({ - "node_modules/standardwebhooks/dist/timing_safe_equal.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.timingSafeEqual = timingSafeEqual; - function assert(expr, msg = "") { - if (!expr) { - throw new Error(msg); - } - } - function timingSafeEqual(a, b) { - if (a.byteLength !== b.byteLength) { - return false; - } - if (!(a instanceof DataView)) { - a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a); - } - if (!(b instanceof DataView)) { - b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b); - } - assert(a instanceof DataView); - assert(b instanceof DataView); - const length = a.byteLength; - let out = 0; - let i = -1; - while (++i < length) { - out |= a.getUint8(i) ^ b.getUint8(i); - } - return out === 0; - } - } -}); - -// node_modules/standardwebhooks/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/standardwebhooks/dist/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Webhook = exports.WebhookVerificationError = void 0; - var base64 = require_base64(); - var sha256 = require_sha256(); - var timing_safe_equal_1 = require_timing_safe_equal(); - var WEBHOOK_TOLERANCE_IN_SECONDS = 5 * 60; - var ExtendableError = class _ExtendableError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _ExtendableError.prototype); - this.name = "ExtendableError"; - this.stack = new Error(message).stack; - } - }; - var WebhookVerificationError = class _WebhookVerificationError extends ExtendableError { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _WebhookVerificationError.prototype); - this.name = "WebhookVerificationError"; - } - }; - exports.WebhookVerificationError = WebhookVerificationError; - var Webhook2 = class _Webhook { - constructor(secret, options) { - if ((options === null || options === void 0 ? void 0 : options.format) === "raw") { - if (secret instanceof Uint8Array) { - this.key = secret; - } else { - this.key = Uint8Array.from(secret, (c) => c.charCodeAt(0)); - } - } else { - if (typeof secret !== "string") { - throw new Error("Expected secret to be of type string"); - } - if (secret.startsWith(_Webhook.prefix)) { - secret = secret.substring(_Webhook.prefix.length); - } - this.key = base64.decode(secret); - } - if (this.key.length === 0) { - throw new Error("Secret can't be empty."); - } - } - verify(payload, headers, options) { - var _a6; - const jsonParse = (_a6 = options === null || options === void 0 ? void 0 : options.jsonParse) !== null && _a6 !== void 0 ? _a6 : true; - const normalizedHeaders = {}; - for (const key of Object.keys(headers)) { - normalizedHeaders[key.toLowerCase()] = headers[key]; - } - const msgId = normalizedHeaders["webhook-id"]; - const msgSignature = normalizedHeaders["webhook-signature"]; - const msgTimestamp = normalizedHeaders["webhook-timestamp"]; - if (!msgSignature || !msgId || !msgTimestamp) { - throw new WebhookVerificationError("Missing required headers"); - } - const timestamp2 = this.verifyTimestamp(msgTimestamp); - const computedSignature = this.sign(msgId, timestamp2, payload); - const expectedSignature = computedSignature.split(",")[1]; - const passedSignatures = msgSignature.split(" "); - const encoder6 = new globalThis.TextEncoder(); - for (const versionedSignature of passedSignatures) { - const [version, signature] = versionedSignature.split(","); - if (version !== "v1") { - continue; - } - if ((0, timing_safe_equal_1.timingSafeEqual)(encoder6.encode(signature), encoder6.encode(expectedSignature))) { - const payloadString = payload.toString(); - if (payloadString === "") { - return void 0; - } - if (jsonParse) { - return JSON.parse(payloadString); - } else { - return void 0; - } - } - } - throw new WebhookVerificationError("No matching signature found"); - } - sign(msgId, timestamp2, payload) { - if (typeof payload === "string") { - } else if (payload.constructor.name === "Buffer") { - payload = payload.toString(); - } else { - throw new Error("Expected payload to be of type string or Buffer."); - } - const encoder6 = new TextEncoder(); - const timestampNumber = Math.floor(timestamp2.getTime() / 1e3); - const toSign = encoder6.encode(`${msgId}.${timestampNumber}.${payload}`); - const expectedSignature = base64.encode(sha256.hmac(this.key, toSign)); - return `v1,${expectedSignature}`; - } - verifyTimestamp(timestampHeader) { - const now = Math.floor(Date.now() / 1e3); - const timestamp2 = parseInt(timestampHeader, 10); - if (Number.isNaN(timestamp2)) { - throw new WebhookVerificationError("Invalid Signature Headers"); - } - if (now - timestamp2 > WEBHOOK_TOLERANCE_IN_SECONDS) { - throw new WebhookVerificationError("Message timestamp too old"); - } - if (timestamp2 > now + WEBHOOK_TOLERANCE_IN_SECONDS) { - throw new WebhookVerificationError("Message timestamp too new"); - } - return new Date(timestamp2 * 1e3); - } - }; - exports.Webhook = Webhook2; - Webhook2.prefix = "whsec_"; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs -var import_standardwebhooks, Webhooks2; -var init_webhooks2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs"() { - init_resource2(); - import_standardwebhooks = __toESM(require_dist2(), 1); - Webhooks2 = class extends APIResource2 { - /** - * Parses a webhook payload into an event without verifying its signature. Prefer - * `unwrap()` unless you have already verified the signature yourself. - */ - parseUnverified(body) { - return JSON.parse(body); - } - /** - * Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and - * `webhook-signature` headers using your webhook signing key, then parses the - * payload into an event. Fails if the signature is missing or invalid. - */ - unwrap(body, options) { - const headers = options?.headers; - if (headers == null) - throw new Error("Webhook headers are required in order to verify the signature"); - const keyStr = options.key === void 0 ? this._client.webhookKey : options.key; - if (!keyStr) - throw new Error("Webhook key must not be null or empty in order to unwrap"); - const wh = new import_standardwebhooks.Webhook(keyStr); - wh.verify(body, headers); - return JSON.parse(body); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs -var Versions2; -var init_versions2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Versions2 = class extends APIResource2 { - /** - * List Agent Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsAgent of client.beta.agents.versions.list( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * )) { - * // ... - * } - * ``` - */ - list(agentID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/agents/${agentID}/versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs -var Agents2; -var init_agents2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs"() { - init_resource2(); - init_versions2(); - init_versions2(); - init_pagination2(); - init_headers3(); - init_path2(); - Agents2 = /* @__PURE__ */ (() => { - class Agents3 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions2(this._client); - } - /** - * Create Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.create({ - * model: 'claude-opus-5', - * name: 'My First Agent', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/agents?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.retrieve( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * ); - * ``` - */ - retrieve(agentID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.get(path3`/v1/agents/${agentID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.update( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * { description: 'updated' }, - * ); - * ``` - */ - update(agentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/agents/${agentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Agents - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsAgent of client.beta.agents.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/agents?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.archive( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * ); - * ``` - */ - archive(agentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/agents/${agentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Agents3.Versions = Versions2; - return Agents3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs -function linkAbort(external, controller) { - if (!external) - return () => { - }; - if (external.aborted) { - controller.abort(); - return () => { - }; - } - const onAbort = () => controller.abort(); - external.addEventListener("abort", onAbort); - return () => external.removeEventListener("abort", onAbort); -} -var init_abort3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs -function isStatus(e, code) { - return e instanceof APIError2 && e.status === code; -} -function is4xx(e) { - return e instanceof APIError2 && typeof e.status === "number" && e.status >= 400 && e.status < 500; -} -function isFatal4xx(e) { - return is4xx(e) && !isStatus(e, 408) && !isStatus(e, 409) && !isStatus(e, 429); -} -function backoff(attempt, baseMs, capMs) { - return Math.min(baseMs * 2 ** attempt, capMs); -} -function jitter(lowMs, highMs) { - return lowMs + Math.random() * (highMs - lowMs); -} -function applyJitter(ms) { - return ms * (1 - Math.random() * 0.25); -} -var init_backoff = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/helper-client.mjs -function copyClientForHelper(client, { authToken, helper }) { - if (!authToken) { - throw new AnthropicError(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(authToken)}`); - } - const internal = client; - const parentDefaults = internal._options.defaultHeaders; - const parentAuthExtraHeaders = internal._authState?.extraHeaders; - const inheritedAuthExtraHeaders = parentAuthExtraHeaders ? Object.fromEntries(Object.entries(parentAuthExtraHeaders).filter(([name]) => { - const lower = name.toLowerCase(); - return lower !== "authorization" && lower !== "x-api-key"; - })) : void 0; - const defaultHeaders = buildHeaders2([ - inheritedAuthExtraHeaders, - parentDefaults, - { [STAINLESS_HELPER_HEADER]: helper } - ]); - return client.withOptions({ - apiKey: null, - authToken, - baseURL: client.baseURL, - credentials: void 0, - defaultHeaders - }); -} -var init_helper_client = __esm({ - "node_modules/@anthropic-ai/sdk/lib/helper-client.mjs"() { - init_error3(); - init_headers3(); - init_stainless_helper_header(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs -function backoff2(attempt) { - return backoff(attempt, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS); -} -function defaultWorkerId() { - const env = globalThis.process?.env; - const host = env?.["HOSTNAME"]; - return host ? `${host}-${uuid42()}` : uuid42(); -} -var _WorkPoller_runnerClient, _WorkPoller_consumed, _WorkPoller_controller, _WorkPoller_detachExternal, _WorkPoller_autoStop, _WorkPoller_drain, _WorkPoller_blockMs, _WorkPoller_reclaimOlderThanMs, _WorkPoller_requestOpts, _IdleLog_log, _IdleLog_environmentId, _IdleLog_idleSince, _IdleLog_lastReport, POLL_BLOCK_MS, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS, IDLE_REPORT_INTERVAL_MS, WorkPoller, IdleLog; -var init_poller = __esm({ - "node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_sleep2(); - init_uuid2(); - init_abort3(); - init_headers3(); - init_backoff(); - init_helper_client(); - POLL_BLOCK_MS = 999; - POLL_BACKOFF_BASE_MS = 1e3; - POLL_BACKOFF_CAP_MS = 6e4; - IDLE_REPORT_INTERVAL_MS = 3e5; - WorkPoller = /* @__PURE__ */ (() => { - class WorkPoller2 { - constructor(opts) { - _WorkPoller_runnerClient.set(this, void 0); - _WorkPoller_consumed.set(this, false); - _WorkPoller_controller.set(this, void 0); - _WorkPoller_detachExternal.set(this, void 0); - _WorkPoller_autoStop.set(this, void 0); - _WorkPoller_drain.set(this, void 0); - _WorkPoller_blockMs.set(this, void 0); - _WorkPoller_reclaimOlderThanMs.set(this, void 0); - _WorkPoller_requestOpts.set(this, void 0); - this.client = opts.client; - this.environmentId = opts.environmentId; - this.environmentKey = opts.environmentKey; - this.workerId = opts.workerId ?? defaultWorkerId(); - __classPrivateFieldSet2(this, _WorkPoller_runnerClient, copyClientForHelper(opts.client, { - authToken: opts.environmentKey, - helper: "environments-work-poller" - }), "f"); - __classPrivateFieldSet2(this, _WorkPoller_autoStop, opts.autoStop ?? true, "f"); - __classPrivateFieldSet2(this, _WorkPoller_drain, opts.drain ?? false, "f"); - __classPrivateFieldSet2(this, _WorkPoller_blockMs, opts.blockMs === void 0 ? POLL_BLOCK_MS : opts.blockMs, "f"); - __classPrivateFieldSet2(this, _WorkPoller_reclaimOlderThanMs, opts.reclaimOlderThanMs ?? null, "f"); - __classPrivateFieldSet2(this, _WorkPoller_requestOpts, opts.requestOptions, "f"); - __classPrivateFieldSet2(this, _WorkPoller_controller, new AbortController(), "f"); - __classPrivateFieldSet2(this, _WorkPoller_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet2(this, _WorkPoller_controller, "f")), "f"); - } - /** Read-only view of this iterator's abort signal. */ - get signal() { - return __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal; - } - /** Abort the iterator. The current `for await` will exit cleanly. */ - abort() { - __classPrivateFieldGet2(this, _WorkPoller_controller, "f").abort(); - } - async *[(_WorkPoller_runnerClient = /* @__PURE__ */ new WeakMap(), _WorkPoller_consumed = /* @__PURE__ */ new WeakMap(), _WorkPoller_controller = /* @__PURE__ */ new WeakMap(), _WorkPoller_detachExternal = /* @__PURE__ */ new WeakMap(), _WorkPoller_autoStop = /* @__PURE__ */ new WeakMap(), _WorkPoller_drain = /* @__PURE__ */ new WeakMap(), _WorkPoller_blockMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_reclaimOlderThanMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_requestOpts = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet2(this, _WorkPoller_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed WorkPoller"); - } - __classPrivateFieldSet2(this, _WorkPoller_consumed, true, "f"); - const log = loggerFor2(this.client); - log.info("poller starting", { - component: "work-poller", - environment_id: this.environmentId - }); - const idle = new IdleLog(log, this.environmentId); - try { - let attempt = 0; - while (!__classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal.aborted) { - let work; - try { - work = await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.poll(this.environmentId, { - "Anthropic-Worker-ID": this.workerId, - ...__classPrivateFieldGet2(this, _WorkPoller_blockMs, "f") !== null ? { block_ms: __classPrivateFieldGet2(this, _WorkPoller_blockMs, "f") } : {}, - ...__classPrivateFieldGet2(this, _WorkPoller_reclaimOlderThanMs, "f") !== null ? { reclaim_older_than_ms: __classPrivateFieldGet2(this, _WorkPoller_reclaimOlderThanMs, "f") } : {} - }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal }); - } catch (e) { - if (__classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal.aborted) - return; - if (isFatal4xx(e)) { - log.error("poll failed permanently, stopping poller", { error: String(e) }); - throw e; - } - const wait = applyJitter(backoff2(attempt)); - log.warn("poll failed, backing off", { error: String(e), backoff_ms: wait }); - attempt++; - await sleep2(wait, __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal); - continue; - } - attempt = 0; - if (work == null) { - if (__classPrivateFieldGet2(this, _WorkPoller_drain, "f")) - return; - idle.onEmptyPoll(); - await sleep2(jitter(1e3, 3e3), __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal); - continue; - } - idle.onClaim(); - log.info("claimed work", { - component: "work-poller", - environment_id: this.environmentId, - work_id: work.id, - work_type: work.data.type - }); - try { - await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.ack(work.id, { environment_id: work.environment_id }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal }); - } catch (e) { - log.error("ack failed", { work_id: work.id, error: String(e) }); - continue; - } - try { - yield work; - } finally { - if (__classPrivateFieldGet2(this, _WorkPoller_autoStop, "f")) { - try { - await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.stop(work.id, { environment_id: work.environment_id }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]) }); - } catch (e) { - if (!isStatus(e, 409)) - log.warn("stop failed", { work_id: work.id, error: String(e) }); - } - } - } - } - } finally { - __classPrivateFieldGet2(this, _WorkPoller_detachExternal, "f").call(this); - } - } - } - return WorkPoller2; - })(); - IdleLog = /* @__PURE__ */ (() => { - class IdleLog2 { - constructor(log, environmentId) { - _IdleLog_log.set(this, void 0); - _IdleLog_environmentId.set(this, void 0); - _IdleLog_idleSince.set(this, void 0); - _IdleLog_lastReport.set(this, 0); - __classPrivateFieldSet2(this, _IdleLog_log, log, "f"); - __classPrivateFieldSet2(this, _IdleLog_environmentId, environmentId, "f"); - } - onEmptyPoll() { - const now = Date.now(); - const fields = { component: "work-poller", environment_id: __classPrivateFieldGet2(this, _IdleLog_environmentId, "f") }; - if (__classPrivateFieldGet2(this, _IdleLog_idleSince, "f") === void 0) { - __classPrivateFieldSet2(this, _IdleLog_idleSince, __classPrivateFieldSet2(this, _IdleLog_lastReport, now, "f"), "f"); - __classPrivateFieldGet2(this, _IdleLog_log, "f").info("idle; polling for work", fields); - } else if (now - __classPrivateFieldGet2(this, _IdleLog_lastReport, "f") >= IDLE_REPORT_INTERVAL_MS) { - __classPrivateFieldSet2(this, _IdleLog_lastReport, now, "f"); - __classPrivateFieldGet2(this, _IdleLog_log, "f").info(`still polling; idle for ${Math.round((now - __classPrivateFieldGet2(this, _IdleLog_idleSince, "f")) / 1e3)}s`, fields); - } else { - __classPrivateFieldGet2(this, _IdleLog_log, "f").debug("poll returned no work", fields); - } - } - onClaim() { - __classPrivateFieldSet2(this, _IdleLog_idleSince, void 0, "f"); - } - } - _IdleLog_log = /* @__PURE__ */ new WeakMap(), _IdleLog_environmentId = /* @__PURE__ */ new WeakMap(), _IdleLog_idleSince = /* @__PURE__ */ new WeakMap(), _IdleLog_lastReport = /* @__PURE__ */ new WeakMap(); - return IdleLog2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs -var _AsyncQueue_items, _AsyncQueue_waiters, _AsyncQueue_closed, AsyncQueue; -var init_async_queue = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs"() { - init_tslib2(); - AsyncQueue = /* @__PURE__ */ (() => { - class AsyncQueue2 { - constructor() { - _AsyncQueue_items.set(this, []); - _AsyncQueue_waiters.set(this, []); - _AsyncQueue_closed.set(this, false); - } - /** Enqueue an item, or hand it directly to a waiting reader. Returns `false` once closed. */ - push(item) { - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f")) - return false; - const w = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").shift(); - if (w) - w({ done: false, value: item }); - else - __classPrivateFieldGet2(this, _AsyncQueue_items, "f").push(item); - return true; - } - /** Mark the queue done. Idempotent; wakes every pending reader with `done: true`. */ - close() { - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f")) - return; - __classPrivateFieldSet2(this, _AsyncQueue_closed, true, "f"); - while (__classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").length > 0) { - const w = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").shift(); - w({ done: true, value: void 0 }); - } - } - /** - * Resolve with the next item, or `done: true` once the queue is closed and - * drained. When `signal` is supplied, aborting it resolves a pending read - * with `done: true` (cancellation is pushed down here rather than handled by - * an outer `Promise.race`). - */ - next(signal) { - if (__classPrivateFieldGet2(this, _AsyncQueue_items, "f").length > 0) { - return Promise.resolve({ done: false, value: __classPrivateFieldGet2(this, _AsyncQueue_items, "f").shift() }); - } - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f") || signal?.aborted) { - return Promise.resolve({ done: true, value: void 0 }); - } - return new Promise((resolve2) => { - const waiter = (r) => { - signal?.removeEventListener("abort", onAbort); - resolve2(r); - }; - const onAbort = () => { - const idx = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").indexOf(waiter); - if (idx >= 0) - __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").splice(idx, 1); - resolve2({ done: true, value: void 0 }); - }; - __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").push(waiter); - signal?.addEventListener("abort", onAbort, { once: true }); - }); - } - /** Synchronously remove and return the next buffered item, or `undefined` if empty. */ - tryShift() { - return __classPrivateFieldGet2(this, _AsyncQueue_items, "f").shift(); - } - } - _AsyncQueue_items = /* @__PURE__ */ new WeakMap(), _AsyncQueue_waiters = /* @__PURE__ */ new WeakMap(), _AsyncQueue_closed = /* @__PURE__ */ new WeakMap(); - return AsyncQueue2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs -var ToolError; -var init_ToolError = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs"() { - ToolError = /* @__PURE__ */ (() => { - class ToolError2 extends Error { - constructor(content) { - const message = typeof content === "string" ? content : content.map((block) => { - if (block.type === "text") - return block.text; - return `[${block.type}]`; - }).join(" "); - super(message); - this.name = "ToolError"; - this.content = content; - } - } - return ToolError2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs -function toolName(tool) { - return "name" in tool ? tool.name : "mcp_server_name" in tool ? tool.mcp_server_name : tool.type; -} -function toolErrorContent(e) { - return e instanceof ToolError ? e.content : `Error: ${e instanceof Error ? e.message : String(e)}`; -} -async function runRunnableTool(tool, rawInput, context) { - try { - const input = tool.parse ? tool.parse(rawInput) : rawInput; - const content = await tool.run(input, context); - return { content, isError: false }; - } catch (e) { - return { content: toolErrorContent(e), isError: true }; - } -} -var init_BetaRunnableTool = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs"() { - init_ToolError(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs -function isEndTurnIdle(ev) { - return ev.type === "session.status_idle" && ev.stop_reason?.type === "end_turn"; -} -function buildResultEvent(ev, isError, content) { - if (ev.type === "agent.custom_tool_use") { - return { type: "user.custom_tool_result", custom_tool_use_id: ev.id, is_error: isError, content }; - } - return { type: "user.tool_result", tool_use_id: ev.id, is_error: isError, content }; -} -function toSessionContent(content) { - if (typeof content === "string") - return [{ type: "text", text: content || "(no output)" }]; - const out = content.map((b) => { - if (b.type === "text") - return { type: "text", text: b.text || "(no output)" }; - if (b.type === "image" || b.type === "document") - return b; - if (b.type === "search_result") { - return { - type: "search_result", - source: b.source, - title: b.title, - content: b.content.map((c) => ({ type: "text", text: c.text })), - citations: { enabled: b.citations?.enabled ?? false } - }; - } - return { type: "text", text: JSON.stringify(b) }; - }); - return out.length > 0 ? out : [{ type: "text", text: "(no output)" }]; -} -var _IdleClock_maxIdleMs, _IdleClock_onExpire, _IdleClock_blockers, _IdleClock_armPending, _IdleClock_timer, _SessionToolRunner_instances, _SessionToolRunner_consumed, _SessionToolRunner_controller, _SessionToolRunner_detachExternal, _SessionToolRunner_requestOpts, _SessionToolRunner_toolByName, _SessionToolRunner_logger, _SessionToolRunner_seen, _SessionToolRunner_answered, _SessionToolRunner_confirmationVerdicts, _SessionToolRunner_awaitingConfirmation, _SessionToolRunner_results, _SessionToolRunner_inFlightCount, _SessionToolRunner_sendRetryWindowMs, _SessionToolRunner_onIdle, _SessionToolRunner_idleClock, _SessionToolRunner_requestOptions, _SessionToolRunner_streamLoop, _SessionToolRunner_reconcile, _SessionToolRunner_ingestHistory, _SessionToolRunner_handleStreamEvent, _SessionToolRunner_routeToolEvent, _SessionToolRunner_noteConfirmation, _SessionToolRunner_applyVerdict, _SessionToolRunner_surfaceCall, _SessionToolRunner_execute, _SessionToolRunner_sendResult, _SessionToolRunner_drain, STREAM_BACKOFF_START_MS, STREAM_BACKOFF_CAP_MS, TOOL_TIMEOUT_MS, DRAIN_TIMEOUT_MS, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS, SEND_RETRY_WINDOW_MS, DEFAULT_MAX_IDLE_MS, IdleClock, SessionToolRunner; -var init_SessionToolRunner = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_sleep2(); - init_backoff(); - init_abort3(); - init_async_queue(); - init_headers3(); - init_stainless_helper_header(); - init_BetaRunnableTool(); - STREAM_BACKOFF_START_MS = 500; - STREAM_BACKOFF_CAP_MS = 1e4; - TOOL_TIMEOUT_MS = 12e4; - DRAIN_TIMEOUT_MS = 3e4; - SEND_BACKOFF_START_MS = 1e3; - SEND_BACKOFF_CAP_MS = 3e4; - SEND_RETRY_WINDOW_MS = 5 * 6e4; - DEFAULT_MAX_IDLE_MS = 6e4; - IdleClock = /* @__PURE__ */ (() => { - class IdleClock2 { - constructor(maxIdleMs, onExpire) { - _IdleClock_maxIdleMs.set(this, void 0); - _IdleClock_onExpire.set(this, void 0); - _IdleClock_blockers.set(this, /* @__PURE__ */ new Set()); - _IdleClock_armPending.set(this, false); - _IdleClock_timer.set(this, void 0); - __classPrivateFieldSet2(this, _IdleClock_maxIdleMs, maxIdleMs, "f"); - __classPrivateFieldSet2(this, _IdleClock_onExpire, onExpire, "f"); - } - /** - * Arm on `status_idle{end_turn}`; disarm otherwise. `user.tool_confirmation` - * is neutral: it signals neither agent activity nor an idle, and its effect - * on the clock flows through {@link block} / {@link unblock} instead — - * disarming here would discard the pending arm the verdict is about to - * settle. - */ - noteEvent(ev) { - if (ev.type === "user.tool_confirmation") - return; - if (isEndTurnIdle(ev)) - this.arm(); - else - this.disarm(); - } - /** Register gated work that must resolve before an idle countdown starts. */ - block(toolUseId) { - __classPrivateFieldGet2(this, _IdleClock_blockers, "f").add(toolUseId); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) { - __classPrivateFieldSet2(this, _IdleClock_armPending, true, "f"); - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, void 0, "f"); - } - } - /** - * Retire gated work (a no-op for ids never blocked); applies a pending arm — - * with a fresh full `maxIdleMs` window — once the last blocker retires. - */ - unblock(toolUseId) { - __classPrivateFieldGet2(this, _IdleClock_blockers, "f").delete(toolUseId); - if (__classPrivateFieldGet2(this, _IdleClock_blockers, "f").size === 0 && __classPrivateFieldGet2(this, _IdleClock_armPending, "f")) - this.arm(); - } - /** - * (Re)start the idle countdown — or, while blockers are outstanding, hold - * the arm pending instead. Stopping then would drop a held call when its - * verdict later arrives, or cut the runner off before a released call's - * result can drive the next turn. - */ - arm() { - if (__classPrivateFieldGet2(this, _IdleClock_maxIdleMs, "f") <= 0) - return; - if (__classPrivateFieldGet2(this, _IdleClock_blockers, "f").size > 0) { - __classPrivateFieldSet2(this, _IdleClock_armPending, true, "f"); - return; - } - __classPrivateFieldSet2(this, _IdleClock_armPending, false, "f"); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, setTimeout(__classPrivateFieldGet2(this, _IdleClock_onExpire, "f"), __classPrivateFieldGet2(this, _IdleClock_maxIdleMs, "f")), "f"); - } - /** - * Cancel the idle countdown and any pending arm. Blockers persist — they - * track real outstanding work, retired only by {@link unblock}. - */ - disarm() { - __classPrivateFieldSet2(this, _IdleClock_armPending, false, "f"); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) { - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, void 0, "f"); - } - } - } - _IdleClock_maxIdleMs = /* @__PURE__ */ new WeakMap(), _IdleClock_onExpire = /* @__PURE__ */ new WeakMap(), _IdleClock_blockers = /* @__PURE__ */ new WeakMap(), _IdleClock_armPending = /* @__PURE__ */ new WeakMap(), _IdleClock_timer = /* @__PURE__ */ new WeakMap(); - return IdleClock2; - })(); - SessionToolRunner = /* @__PURE__ */ (() => { - class SessionToolRunner2 { - constructor(sessionId, opts) { - _SessionToolRunner_instances.add(this); - _SessionToolRunner_consumed.set(this, false); - _SessionToolRunner_controller.set(this, void 0); - _SessionToolRunner_detachExternal.set(this, void 0); - _SessionToolRunner_requestOpts.set(this, void 0); - _SessionToolRunner_toolByName.set(this, void 0); - _SessionToolRunner_logger.set(this, void 0); - _SessionToolRunner_seen.set(this, /* @__PURE__ */ new Set()); - _SessionToolRunner_answered.set(this, /* @__PURE__ */ new Set()); - _SessionToolRunner_confirmationVerdicts.set(this, /* @__PURE__ */ new Map()); - _SessionToolRunner_awaitingConfirmation.set(this, /* @__PURE__ */ new Map()); - _SessionToolRunner_results.set(this, new AsyncQueue()); - _SessionToolRunner_inFlightCount.set(this, 0); - _SessionToolRunner_sendRetryWindowMs.set(this, SEND_RETRY_WINDOW_MS); - _SessionToolRunner_onIdle.set(this, null); - _SessionToolRunner_idleClock.set(this, void 0); - this.client = opts.client; - this.sessionId = sessionId; - this.tools = opts.tools; - this.maxIdleMs = opts.maxIdleMs ?? DEFAULT_MAX_IDLE_MS; - __classPrivateFieldSet2(this, _SessionToolRunner_logger, loggerFor2(opts.client), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_toolByName, new Map(opts.tools.map((t) => [toolName(t), t])), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_controller, new AbortController(), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f")), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_requestOpts, opts.requestOptions, "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_idleClock, new IdleClock(this.maxIdleMs, () => { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session idle after end_turn; stopping", { - component: "session-tool-runner", - session_id: this.sessionId, - max_idle_ms: this.maxIdleMs - }); - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - }), "f"); - } - /** Read-only view of this runner's abort signal. */ - get signal() { - return __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal; - } - /** Abort the runner. Background tasks will wind down and `for await` will exit cleanly. */ - abort() { - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - } - /** - * @internal - * `EnvironmentWorker` keeps this equal to the lease TTL each heartbeat - * reports; applies to a send already retrying. - */ - _setSendRetryWindow(ms) { - __classPrivateFieldSet2(this, _SessionToolRunner_sendRetryWindowMs, ms, "f"); - } - async *[(_SessionToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_controller = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_detachExternal = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_requestOpts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_toolByName = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_logger = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_seen = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_answered = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_confirmationVerdicts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_awaitingConfirmation = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_results = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_inFlightCount = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_sendRetryWindowMs = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_onIdle = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_idleClock = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet2(this, _SessionToolRunner_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed SessionToolRunner"); - } - __classPrivateFieldSet2(this, _SessionToolRunner_consumed, true, "f"); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session tool runner starting", { - component: "session-tool-runner", - session_id: this.sessionId - }); - const streamPromise = __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_streamLoop).call(this).catch((e) => { - if (!__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal.aborted) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("stream loop failed", { error: String(e) }); - } - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - }); - try { - while (true) { - const next = await __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").next(__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal); - if (next.done) - break; - yield next.value; - } - await streamPromise; - let pending; - while ((pending = __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").tryShift()) !== void 0) { - yield pending; - } - } finally { - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - await streamPromise; - try { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_drain).call(this); - } catch (e) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("drain failed", { error: String(e) }); - } - __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").close(); - for (const t of this.tools) { - try { - await t.close?.(); - } catch (e) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("tool.close failed", { tool: toolName(t), error: String(e) }); - } - } - __classPrivateFieldGet2(this, _SessionToolRunner_detachExternal, "f").call(this); - } - } - } - _SessionToolRunner_requestOptions = function _SessionToolRunner_requestOptions2() { - return { - ...__classPrivateFieldGet2(this, _SessionToolRunner_requestOpts, "f"), - headers: buildHeaders2([helperHeader("session-tool-runner"), __classPrivateFieldGet2(this, _SessionToolRunner_requestOpts, "f")?.headers]), - signal: __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal - }; - }, _SessionToolRunner_streamLoop = // ===== event stream ===== - async function _SessionToolRunner_streamLoop2() { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - let backoff3 = STREAM_BACKOFF_START_MS; - while (!ctrl.signal.aborted) { - try { - const stream4 = await this.client.beta.sessions.events.stream(this.sessionId, {}, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_reconcile).call(this); - for await (const ev of stream4) { - backoff3 = STREAM_BACKOFF_START_MS; - if (await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_handleStreamEvent).call(this, ev)) - return; - } - } catch (e) { - ctrl.signal.throwIfAborted(); - if (isFatal4xx(e)) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("permanent stream failure, shutting down", { error: String(e) }); - ctrl.abort(); - throw e; - } - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("stream disconnected, reconnecting", { - error: String(e), - backoff_ms: backoff3 - }); - } - ctrl.signal.throwIfAborted(); - await sleep2(backoff3, ctrl.signal); - backoff3 = Math.min(backoff3 * 2, STREAM_BACKOFF_CAP_MS); - } - }, _SessionToolRunner_reconcile = /** - * Read full history before dispatching so a `tool_use` whose result appears - * later in the same history is not re-executed. Runs after the live stream is - * already attached (see {@link SessionToolRunner.#streamLoop}). - */ - async function _SessionToolRunner_reconcile2() { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - const pending = []; - let lastWasEndTurn = false; - try { - for await (const ev of this.client.beta.sessions.events.list(this.sessionId, { limit: 1e3 }, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this))) { - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_ingestHistory).call(this, ev, pending); - lastWasEndTurn = isEndTurnIdle(ev); - } - } catch (e) { - ctrl.signal.throwIfAborted(); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("reconcile list failed", { error: String(e) }); - for (const ev of pending) - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").delete(ev.id); - return; - } - const unanswered = pending.filter((ev) => !__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - for (const ev of unanswered) - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); - for (const held2 of [...__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").values()]) { - const verdict = __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").get(held2.id); - if (verdict !== void 0) - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held2, verdict); - } - const outstanding = unanswered.filter((ev) => !__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id) && !__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)); - if (lastWasEndTurn && outstanding.length === 0) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").arm(); - else - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - }, _SessionToolRunner_ingestHistory = function _SessionToolRunner_ingestHistory2(ev, pending) { - if (ev.type === "agent.tool_use" || ev.type === "agent.custom_tool_use") { - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").add(ev.id); - if (!__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)) - pending.push(ev); - } else if (ev.type === "user.tool_result") { - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); - } else if (ev.type === "user.custom_tool_result") { - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); - } else if (ev.type === "user.tool_confirmation") { - if (!__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.tool_use_id)) - __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); - } - }, _SessionToolRunner_handleStreamEvent = /** Returns true when the runner should exit. */ - async function _SessionToolRunner_handleStreamEvent2(ev) { - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").noteEvent(ev); - switch (ev.type) { - case "agent.tool_use": - case "agent.custom_tool_use": - if (!__classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").has(ev.id)) { - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").add(ev.id); - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); - } - return false; - case "user.tool_confirmation": - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_noteConfirmation).call(this, ev); - return false; - case "user.tool_result": - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); - return false; - case "user.custom_tool_result": - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); - return false; - case "session.status_terminated": - case "session.deleted": - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session terminated", { - component: "session-tool-runner", - session_id: this.sessionId - }); - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - return true; - default: - return false; - } - }, _SessionToolRunner_routeToolEvent = // ===== confirmation gating (always_ask tools) ===== - /** - * Dispatch `ev`, honoring its evaluated permission. A call the server gated - * (`evaluated_permission == "ask"`) is held until its `user.tool_confirmation` - * arrives. Fails closed: only an explicit `allow` verdict releases a gated - * call; a server-side `deny` overrides any recorded verdict; an unrecognized - * permission is held like `ask` and an unrecognized verdict is denied. - */ - async function _SessionToolRunner_routeToolEvent2(ev) { - const permission = ev.evaluated_permission; - const verdict = permission === "deny" ? "deny" : __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").get(ev.id); - if (verdict === void 0) { - if (permission === void 0 || permission === "allow") { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, void 0); - } else if (!__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call awaiting confirmation; holding", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").set(ev.id, ev); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").block(ev.id); - } - return; - } - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, ev, verdict); - }, _SessionToolRunner_noteConfirmation = /** Record an allow/deny verdict and release the held call it gates, if any. */ - async function _SessionToolRunner_noteConfirmation2(ev) { - __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); - const held2 = __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").get(ev.tool_use_id); - if (held2 === void 0) - return; - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held2, ev.result); - }, _SessionToolRunner_applyVerdict = /** - * Dispatch or resolve a gated call according to its verdict. - * - * The idle-clock blocker accounting lives here: a denial retires the held - * call's blocker, while an allow keeps one on the call — taking it now if the - * verdict was already known when the call was routed, so it was never held — - * until `#execute` has finished with it. The countdown must not run over - * gated work that is still in flight. - */ - async function _SessionToolRunner_applyVerdict2(ev, verdict) { - const wasHeld = __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").delete(ev.id); - if (verdict === "allow") { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call confirmed", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - if (!wasHeld) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").block(ev.id); - try { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, "allow"); - } finally { - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); - } - return; - } - if (wasHeld) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call denied; not executing", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - toolUseId: ev.id, - name: ev.name, - isError: false, - posted: false, - confirmation: "deny" - }); - }, _SessionToolRunner_surfaceCall = function _SessionToolRunner_surfaceCall2(call) { - __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").push(call); - }, _SessionToolRunner_execute = // ===== tool execution ===== - async function _SessionToolRunner_execute2(ev, confirmation) { - var _a6, _b; - if (__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)) - return; - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("executing tool", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldSet2(this, _SessionToolRunner_inFlightCount, (_a6 = __classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f"), _a6++, _a6), "f"); - try { - const tool = __classPrivateFieldGet2(this, _SessionToolRunner_toolByName, "f").get(ev.name); - if (!tool) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - toolUseId: ev.id, - name: ev.name, - isError: false, - posted: false, - confirmation - }); - return; - } - let content; - let isError; - const toolCtrl = new AbortController(); - const detachTool = linkAbort(__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal, toolCtrl); - const timer = setTimeout(() => toolCtrl.abort(), TOOL_TIMEOUT_MS); - try { - const outcome = await runRunnableTool(tool, ev.input, { - toolUse: ev, - toolUseBlock: ev, - signal: toolCtrl.signal - }); - content = outcome.content; - isError = outcome.isError; - } finally { - clearTimeout(timer); - detachTool(); - } - const result = buildResultEvent(ev, isError, toSessionContent(content)); - const posted = await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_sendResult).call(this, result, ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - result, - toolUseId: ev.id, - name: ev.name, - isError, - posted, - confirmation - }); - } finally { - __classPrivateFieldSet2(this, _SessionToolRunner_inFlightCount, (_b = __classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f"), _b--, _b), "f"); - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") === 0) - __classPrivateFieldGet2(this, _SessionToolRunner_onIdle, "f")?.call(this); - } - }, _SessionToolRunner_sendResult = async function _SessionToolRunner_sendResult2(result, toolUseId) { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - const start = Date.now(); - let lastErr; - let attempt = 0; - while (true) { - attempt++; - ctrl.signal.throwIfAborted(); - try { - await this.client.beta.sessions.events.send(this.sessionId, { events: [result] }, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(toolUseId); - return true; - } catch (e) { - lastErr = e; - if (isFatal4xx(e)) - break; - const remainingMs = __classPrivateFieldGet2(this, _SessionToolRunner_sendRetryWindowMs, "f") - (Date.now() - start); - if (remainingMs <= 0) - break; - const waitMs = Math.min(applyJitter(backoff(attempt - 1, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS)), remainingMs); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("tool result send failed; retrying", { - tool_use_id: toolUseId, - attempt, - backoff_ms: waitMs, - error: String(e) - }); - await sleep2(waitMs, ctrl.signal); - } - } - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("failed to send tool result", { - tool_use_id: toolUseId, - attempts: attempt, - error: String(lastErr) - }); - return false; - }, _SessionToolRunner_drain = /** Wait (bounded) for in-flight tool executions to finish during teardown. */ - async function _SessionToolRunner_drain2() { - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") === 0) - return; - await Promise.race([new Promise((r) => __classPrivateFieldSet2(this, _SessionToolRunner_onIdle, r, "f")), sleep2(DRAIN_TIMEOUT_MS)]); - __classPrivateFieldSet2(this, _SessionToolRunner_onIdle, null, "f"); - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") > 0) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("drain timeout exceeded"); - } - }; - return SessionToolRunner2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs -function checkMemorySyncInterval(ms, option) { - if (!(ms >= MIN_MEMORY_SYNC_INTERVAL_MS)) { - throw new AnthropicError(`${option} must be at least ${MIN_MEMORY_SYNC_INTERVAL_MS}ms (got ${ms}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`); - } -} -var DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS; -var init_sync_interval = __esm({ - "node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs"() { - init_error3(); - DEFAULT_MEMORY_SYNC_INTERVAL_MS = 15e3; - MIN_MEMORY_SYNC_INTERVAL_MS = 5e3; - } -}); - -// node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs -var node_browser_exports2 = {}; -__export(node_browser_exports2, { - BashSession: () => BashSession, - BashTimeoutError: () => BashTimeoutError, - DEFAULT_MEMORY_SYNC_INTERVAL_MS: () => DEFAULT_MEMORY_SYNC_INTERVAL_MS, - MARKER_PATH: () => MARKER_PATH, - MEMORY_FLUSH_TIMEOUT_MS: () => MEMORY_FLUSH_TIMEOUT_MS, - MIN_MEMORY_SYNC_INTERVAL_MS: () => MIN_MEMORY_SYNC_INTERVAL_MS, - SessionMemoryError: () => SessionMemoryError, - SessionMemoryStores: () => SessionMemoryStores, - betaAgentToolset20260401: () => betaAgentToolset20260401, - betaBashTool: () => betaBashTool, - betaEditTool: () => betaEditTool, - betaGlobTool: () => betaGlobTool, - betaGrepTool: () => betaGrepTool, - betaReadTool: () => betaReadTool, - betaWriteTool: () => betaWriteTool, - extractSkillArchive: () => extractSkillArchive, - resolvePath: () => resolvePath, - setupSkills: () => setupSkills -}); -function nodeOnly(name) { - throw new AnthropicError(`${name} requires Node.js or a Node-compatible runtime`); -} -function setupSkills(_ctx) { - return nodeOnly("setupSkills"); -} -function extractSkillArchive(_resp, _dest) { - return nodeOnly("extractSkillArchive"); -} -function betaAgentToolset20260401(_ctx) { - return nodeOnly("betaAgentToolset20260401"); -} -function resolvePath(_ctx, _p) { - return nodeOnly("resolvePath"); -} -function betaBashTool(_ctx) { - return nodeOnly("betaBashTool"); -} -function betaReadTool(_ctx) { - return nodeOnly("betaReadTool"); -} -function betaWriteTool(_ctx) { - return nodeOnly("betaWriteTool"); -} -function betaEditTool(_ctx) { - return nodeOnly("betaEditTool"); -} -function betaGlobTool(_ctx) { - return nodeOnly("betaGlobTool"); -} -function betaGrepTool(_ctx) { - return nodeOnly("betaGrepTool"); -} -var MEMORY_FLUSH_TIMEOUT_MS, MARKER_PATH, SessionMemoryError, SessionMemoryStores, BashTimeoutError, BashSession; -var init_node_browser2 = __esm({ - "node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs"() { - init_error3(); - init_sync_interval(); - MEMORY_FLUSH_TIMEOUT_MS = 3e4; - MARKER_PATH = ".anthropic-memory-store"; - SessionMemoryError = class extends AnthropicError { - constructor(message, cause) { - super(message); - this.name = "SessionMemoryError"; - if (cause !== void 0) - this.cause = cause; - } - }; - SessionMemoryStores = class { - constructor(_client, _opts) { - nodeOnly("SessionMemoryStores"); - } - get roots() { - return nodeOnly("SessionMemoryStores"); - } - get readOnlyRoots() { - return nodeOnly("SessionMemoryStores"); - } - download(_session) { - return nodeOnly("SessionMemoryStores"); - } - finish() { - return nodeOnly("SessionMemoryStores"); - } - /** @internal */ - syncAll(_final) { - return nodeOnly("SessionMemoryStores"); - } - syncIfDue() { - return nodeOnly("SessionMemoryStores"); - } - flushWrites(_signal) { - return nodeOnly("SessionMemoryStores"); - } - dispose() { - return nodeOnly("SessionMemoryStores"); - } - }; - BashTimeoutError = class extends AnthropicError { - constructor(timeoutMs) { - super(`bash command timed out after ${timeoutMs}ms`); - this.name = "BashTimeoutError"; - this.timeoutMs = timeoutMs; - } - }; - BashSession = class { - constructor(_dir, _env) { - nodeOnly("BashSession"); - } - get closed() { - return nodeOnly("BashSession"); - } - exec(_command, _opts = {}) { - return nodeOnly("BashSession"); - } - close() { - nodeOnly("BashSession"); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs -function hasMemoryStore(session) { - return session.resources.some((r) => r.type === "memory_store"); -} -function sessionsTokenFromSecret(secret) { - if (!secret) - return null; - let parsed; - try { - const normalized = secret.replace(/-/g, "+").replace(/_/g, "/"); - const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "="); - parsed = JSON.parse(decodeUTF82(fromBase642(padded))); - } catch { - return null; - } - if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) - return null; - const token = parsed.sessions_token; - return typeof token === "string" && token !== "" ? token : null; -} -async function withTimeout(p, ms) { - let timer; - try { - return await Promise.race([ - p.then(() => false, () => false), - new Promise((resolve2) => { - timer = setTimeout(() => resolve2(true), ms); - }) - ]); - } finally { - if (timer !== void 0) - clearTimeout(timer); - } -} -async function forceStop(client, work, log, requestOptions) { - try { - await client.beta.environments.work.stop( - work.id, - { environment_id: work.environment_id, force: true }, - // Caller's headers pass through; the helper-tag header is on the scoped - // sub-client's default_headers via copyClientForHelper, so no per-call - // re-stamping needed. - { ...requestOptions, headers: buildHeaders2([requestOptions?.headers]) } - ); - } catch (e) { - if (!isStatus(e, 409)) { - log.error("force-stop on exit failed", { work_id: work.id, error: String(e) }); - } - } -} -function serverLeaseState(e) { - let node = e instanceof APIError2 ? e.error : void 0; - for (const key of ["error", "details", "current_state"]) { - if (!isObj2(node)) - return {}; - node = node[key]; - } - return isObj2(node) ? node : {}; -} -async function heartbeatLoop(client, work, lease, logger, requestOptions, onLeaseTtl) { - let intervalMs = HEARTBEAT_DEFAULT_MS; - let ttlMs = HEARTBEAT_TTL_DEFAULT_MS; - let lastSuccessMs = Date.now(); - let last = NO_HEARTBEAT_SENTINEL; - const beat = async () => { - const beatCtrl = new AbortController(); - const detach = linkAbort(lease.signal, beatCtrl); - const cutoff = setTimeout(() => beatCtrl.abort(), intervalMs); - try { - const resp = await client.beta.environments.work.heartbeat(work.id, { environment_id: work.environment_id, expected_last_heartbeat: last }, { ...requestOptions, headers: buildHeaders2([requestOptions?.headers]), signal: beatCtrl.signal }); - lastSuccessMs = Date.now(); - last = resp.last_heartbeat; - if (resp.ttl_seconds > 0) { - ttlMs = resp.ttl_seconds * 1e3; - intervalMs = Math.max(1e3, Math.min(ttlMs / 2, HEARTBEAT_DEFAULT_MS)); - onLeaseTtl?.(ttlMs); - } - if (resp.state === "stopping" || resp.state === "stopped") { - logger.info("heartbeat signals shutdown", { work_id: work.id, state: resp.state }); - lease.finish("control_plane_stop"); - } - if (!resp.lease_extended) { - logger.warn("lease not extended, shutting down", { work_id: work.id }); - lease.finish("control_plane_stop"); - } - } catch (e) { - lease.signal.throwIfAborted(); - if (isStatus(e, 412)) { - const server = serverLeaseState(e); - logger.error("lease lost: heartbeat precondition failed", { - work_id: work.id, - server_state: server["state"], - server_ttl_seconds: server["ttl_seconds"], - server_last_heartbeat: server["last_heartbeat"] - }); - lease.finish("lease_lost"); - return; - } - if (isFatal4xx(e)) { - logger.error("permanent heartbeat failure", { work_id: work.id, error: String(e) }); - lease.finish("heartbeat_rejected"); - throw e; - } - if (Date.now() - lastSuccessMs > ttlMs) { - logger.error("lease assumed lost: no successful heartbeat in ttl", { - work_id: work.id, - ttl_ms: ttlMs, - error: String(e) - }); - lease.finish("assumed_lost"); - return; - } - logger.warn("transient heartbeat failure", { work_id: work.id, error: String(e) }); - } finally { - clearTimeout(cutoff); - detach(); - } - }; - await beat(); - while (!lease.signal.aborted) { - await sleep2(intervalMs, lease.signal); - lease.signal.throwIfAborted(); - await beat(); - } -} -var _EnvironmentWorker_instances, _EnvironmentWorker_signal, _EnvironmentWorker_handleItem, _Lease_ctrl, _Lease_endReason, HEARTBEAT_DEFAULT_MS, HEARTBEAT_TTL_DEFAULT_MS, NO_HEARTBEAT_SENTINEL, EnvironmentWorker, Lease; -var init_worker = __esm({ - "node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_base642(); - init_bytes2(); - init_env2(); - init_sleep2(); - init_backoff(); - init_abort3(); - init_values2(); - init_headers3(); - init_SessionToolRunner(); - init_poller(); - init_helper_client(); - init_sync_interval(); - HEARTBEAT_DEFAULT_MS = 3e4; - HEARTBEAT_TTL_DEFAULT_MS = 9e4; - NO_HEARTBEAT_SENTINEL = "NO_HEARTBEAT"; - EnvironmentWorker = /* @__PURE__ */ (() => { - class EnvironmentWorker2 { - constructor(opts) { - _EnvironmentWorker_instances.add(this); - _EnvironmentWorker_signal.set(this, void 0); - if (opts.unrestrictedPaths !== void 0) { - throw new AnthropicError("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory."); - } - this.client = opts.client; - this.environmentId = opts.environmentId; - this.environmentKey = opts.environmentKey; - this.tools = opts.tools; - this.workdir = opts.workdir ?? process.cwd(); - this.maxFileBytes = opts.maxFileBytes; - this.maxIdleMs = opts.maxIdleMs; - if (opts.memorySyncIntervalMs != null) { - checkMemorySyncInterval(opts.memorySyncIntervalMs, "memorySyncIntervalMs"); - } - this.memorySyncIntervalMs = opts.memorySyncIntervalMs; - this.memorySyncDeletions = opts.memorySyncDeletions ?? "enabled"; - this.workerId = opts.workerId; - this.requestOptions = opts.requestOptions; - __classPrivateFieldSet2(this, _EnvironmentWorker_signal, opts.signal, "f"); - } - /** - * Poll the environment and service each claimed session until the supplied - * signal (or the one passed to the constructor) aborts. Throws if - * `environmentId` / `environmentKey` were not provided to the constructor. - */ - async run(signal) { - const { environmentId, environmentKey } = this; - if (environmentId === void 0 || environmentKey === void 0) { - throw new AnthropicError("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work"); - } - const externalSignal = signal ?? __classPrivateFieldGet2(this, _EnvironmentWorker_signal, "f"); - const poller = new WorkPoller({ - client: this.client, - environmentId, - environmentKey, - ...this.workerId !== void 0 ? { workerId: this.workerId } : {}, - ...externalSignal ? { signal: externalSignal } : {}, - ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, - // The per-item handler stops or releases every work item on exit; let it - // be the single owner of `work.stop` rather than double-posting from the - // poller. - autoStop: false - }); - for await (const work of poller) { - try { - await __classPrivateFieldGet2(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, poller.signal); - } catch (e) { - if (poller.signal?.aborted) - throw e; - loggerFor2(this.client).error("work item failed", { work_id: work.id, error: String(e) }); - } - } - } - /** - * Service a single, already-claimed work item without the poll loop: build the - * per-session {@link AgentToolContext} (workdir from this worker's options), - * download the session agent's skills (`setupSkills`), run a - * {@link SessionToolRunner} for the session while heartbeating the work-item - * lease, and force-stop the work item on exit (whether the runner finishes - * normally, throws, or the control plane signals shutdown). The one - * exception is a lost lease: the item then belongs to the queue or another - * worker and is left alone. - * - * Use this when something else does the claiming — e.g. a `worker poll - * --on-work` script that hands an already-claimed item to a fresh process. The - * work id / environment id / session id each fall back to `ANTHROPIC_WORK_ID` / - * `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that - * command sets) when not passed; the environment key resolves from this - * option, then the worker's own `environmentKey`, then - * `ANTHROPIC_ENVIRONMENT_KEY`, and is needed only when the work item's - * `secret` yields no sessions token — a host that receives only the - * per-item secret runs without ever holding the key. With no arguments - * inside that command it just works. Throws a clear error naming the first - * required value still missing after resolution, and — rather than ever - * running unauthenticated — when neither a sessions token nor an - * environment key resolved. Throws `SessionMemoryError` when the - * session has memory stores attached but they cannot be mounted — the work - * item carried no sessions token (unless `memorySyncIntervalMs` turned - * memory off), or a store failed to download. - * - * `workSecret` is the work item's per-item `secret` payload from the poll - * response, falling back to `ANTHROPIC_WORK_SECRET`; unlike the others it is - * optional — when present, the sessions token extracted from it is preferred - * as the Bearer credential for this item's heartbeat / force-stop / session - * calls; when absent (or undecodable) those calls use the environment key. - */ - async handleItem(opts) { - const workId = opts?.workId ?? readEnv2("ANTHROPIC_WORK_ID"); - const environmentId = opts?.environmentId ?? readEnv2("ANTHROPIC_ENVIRONMENT_ID"); - const sessionId = opts?.sessionId ?? readEnv2("ANTHROPIC_SESSION_ID"); - const environmentKey = (opts?.environmentKey ?? this.environmentKey ?? readEnv2("ANTHROPIC_ENVIRONMENT_KEY")) || void 0; - const workSecret = opts?.workSecret || readEnv2("ANTHROPIC_WORK_SECRET") || null; - if (!workId) { - throw new AnthropicError("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID"); - } - if (!environmentId) { - throw new AnthropicError("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID"); - } - if (!sessionId) { - throw new AnthropicError("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID"); - } - if (!environmentKey && !workSecret) { - throw new AnthropicError("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY"); - } - const work = { - id: workId, - environment_id: environmentId, - secret: workSecret, - data: { type: "session", id: sessionId } - }; - await __classPrivateFieldGet2(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, opts?.signal ?? __classPrivateFieldGet2(this, _EnvironmentWorker_signal, "f")); - } - } - _EnvironmentWorker_signal = /* @__PURE__ */ new WeakMap(), _EnvironmentWorker_instances = /* @__PURE__ */ new WeakSet(), _EnvironmentWorker_handleItem = /** - * The per-item body shared by {@link EnvironmentWorker.run}'s poll loop and - * {@link EnvironmentWorker.handleItem}: run a {@link SessionToolRunner} for the - * work item's session while heartbeating its lease, force-stopping on exit - * unless the lease was lost. Non-session work items are ignored. - * - * When the poll response carried a per-item `secret` (a short-lived payload - * scoped to this work item), the sessions token extracted from it is - * preferred over `environmentKey` as the Bearer credential for those - * per-item calls; a missing/undecodable secret falls back to - * `environmentKey` unchanged. - */ - async function _EnvironmentWorker_handleItem2(work, environmentKey, externalSignal) { - const log = loggerFor2(this.client); - const sessionsToken = sessionsTokenFromSecret(work.secret); - const itemCredential = sessionsToken ?? environmentKey; - if (itemCredential === void 0) { - throw new AnthropicError("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)"); - } - if (work.secret && sessionsToken === null) { - log.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key", { work_id: work.id }); - } - const sessionClient = copyClientForHelper(this.client, { - authToken: itemCredential, - helper: "environments-worker" - }); - const sessionId = work.data.id; - const ctrl = new AbortController(); - const detachExternal = linkAbort(externalSignal, ctrl); - const lease = new Lease(ctrl); - const agentToolset = await Promise.resolve().then(() => (init_node_browser2(), node_browser_exports2)); - let leaseTtlMs; - let runner; - const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => { - leaseTtlMs = ttlMs; - runner?._setSendRetryWindow(ttlMs); - }).catch((e) => { - if (!ctrl.signal.aborted) - log.error("heartbeat loop failed", { work_id: work.id, error: String(e) }); - ctrl.abort(); - }); - let cleanupSkills = async () => { - }; - let stores; - let cleanEnd = false; - try { - if (work.data.type !== "session") { - log.debug("skipping non-session work item", { work_id: work.id, type: work.data.type }); - return; - } - const session = await sessionClient.beta.sessions.retrieve(sessionId); - if (sessionsToken === null && this.memorySyncIntervalMs !== null && hasMemoryStore(session)) { - throw new agentToolset.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${work.id}, session_id=${sessionId}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`); - } - const ctx = { - workdir: this.workdir, - // The scoped sub-client, not the parent: the skill download - // `setupSkills` performs for this session rides the same per-item - // credential as every other per-item call. - client: sessionClient, - session, - ...this.maxFileBytes !== void 0 ? { maxFileBytes: this.maxFileBytes } : {} - }; - try { - cleanupSkills = await agentToolset.setupSkills(ctx); - } catch (e) { - log.warn("skill setup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); - } - if (sessionsToken !== null && this.memorySyncIntervalMs !== null) { - stores = new agentToolset.SessionMemoryStores(sessionClient, { - workdir: this.workdir, - ...this.memorySyncIntervalMs !== void 0 ? { syncIntervalMs: this.memorySyncIntervalMs } : {}, - syncDeletions: this.memorySyncDeletions - }); - await stores.download(session); - ctx.allowedRoots = stores.roots; - ctx.readOnlyRoots = stores.readOnlyRoots; - } else { - log.debug("memory stores disabled for this item", { work_id: work.id }); - } - const tools = typeof this.tools === "function" ? this.tools(ctx) : this.tools ?? agentToolset.betaAgentToolset20260401(ctx); - runner = new SessionToolRunner(sessionId, { - client: sessionClient, - tools, - ...this.maxIdleMs !== void 0 ? { maxIdleMs: this.maxIdleMs } : {}, - ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, - signal: ctrl.signal - }); - if (leaseTtlMs !== void 0) - runner._setSendRetryWindow(leaseTtlMs); - for await (const _ of runner) { - if (stores) - await stores.syncIfDue(); - } - cleanEnd = !ctrl.signal.aborted; - } finally { - try { - await cleanupSkills().catch((e) => { - log.warn("skill cleanup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); - }); - } finally { - if (stores) { - const boundMs = agentToolset.MEMORY_FLUSH_TIMEOUT_MS; - if (cleanEnd) { - const finishCutOff = await withTimeout(stores.finish(), boundMs); - if (finishCutOff) { - log.warn(`final memory sync cut off after ${boundMs}ms; the flush that follows still uploads changed files`, { session_id: sessionId, work_id: work.id }); - } - } - const flushBound = new AbortController(); - const flushCutOff = await withTimeout(stores.flushWrites(flushBound.signal), boundMs); - if (flushCutOff) { - flushBound.abort(); - log.warn(`memory flush cut off after ${boundMs}ms; changed files it had not uploaded yet are not saved`, { session_id: sessionId, work_id: work.id }); - } - await stores.dispose().catch((e) => { - log.warn("memory store cleanup failed", { - session_id: sessionId, - work_id: work.id, - error: String(e) - }); - }); - } - } - lease.finish("runner_done"); - detachExternal(); - await heartbeatPromise; - if (lease.lost) { - log.info("lease lost; released without stopping it", { session_id: sessionId, work_id: work.id }); - } else { - await forceStop(sessionClient, work, log, this.requestOptions); - } - } - }; - return EnvironmentWorker2; - })(); - Lease = /* @__PURE__ */ (() => { - class Lease2 { - constructor(ctrl) { - _Lease_ctrl.set(this, void 0); - _Lease_endReason.set(this, void 0); - __classPrivateFieldSet2(this, _Lease_ctrl, ctrl, "f"); - } - get signal() { - return __classPrivateFieldGet2(this, _Lease_ctrl, "f").signal; - } - finish(reason) { - __classPrivateFieldSet2(this, _Lease_endReason, __classPrivateFieldGet2(this, _Lease_endReason, "f") ?? reason, "f"); - __classPrivateFieldGet2(this, _Lease_ctrl, "f").abort(); - } - /** True once the item belongs to the queue or another worker. */ - get lost() { - return __classPrivateFieldGet2(this, _Lease_endReason, "f") === "lease_lost" || __classPrivateFieldGet2(this, _Lease_endReason, "f") === "assumed_lost"; - } - } - _Lease_ctrl = /* @__PURE__ */ new WeakMap(), _Lease_endReason = /* @__PURE__ */ new WeakMap(); - return Lease2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs -var Work; -var init_work = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - init_poller(); - init_worker(); - Work = /* @__PURE__ */ (() => { - class Work2 extends APIResource2 { - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Retrieve detailed information about a specific work item. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.retrieve('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - retrieve(workID, params, options) { - const { environment_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/environments/${environment_id}/work/${workID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Update work item metadata with merge semantics. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.update('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * metadata: { foo: 'string' }, - * }); - * ``` - */ - update(workID, params, options) { - const { environment_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * List work items in an environment. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSelfHostedWork of client.beta.environments.work.list( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * )) { - * // ... - * } - * ``` - */ - list(environmentID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/environments/${environmentID}/work?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' - * and removing it from the queue. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.ack('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - ack(workID, params, options) { - const { environment_id, betas } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/ack?beta=true`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Record a heartbeat for a work item to maintain the lease. - * - * @example - * ```ts - * const betaSelfHostedWorkHeartbeatResponse = - * await client.beta.environments.work.heartbeat('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - heartbeat(workID, params, options) { - const { environment_id, desired_ttl_seconds, expected_last_heartbeat, betas } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/heartbeat?beta=true`, { - query: { desired_ttl_seconds, expected_last_heartbeat }, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Long poll for work items in the queue. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.poll( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - poll(environmentID, params = {}, options) { - const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}/work/poll?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...anthropicWorkerID != null ? { "Anthropic-Worker-ID": anthropicWorkerID } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get statistics about the work queue for an environment. - * - * @example - * ```ts - * const betaSelfHostedWorkQueueStats = - * await client.beta.environments.work.stats( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - stats(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}/work/stats?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Stop a work item, initiating graceful or forced shutdown. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.stop('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - stop(workID, params, options) { - const { environment_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/stop?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Continuously claim work from a self-hosted environment, ack each item, - * and yield it. Posts `stop` automatically when the consumer's loop body - * returns or when iteration ends. - * - * @example - * ```ts - * for await (const work of client.beta.environments.work.poller({ - * environmentId, - * environmentKey, - * })) { - * if (work.data.type !== 'session') continue; - * // ...service the work... - * } - * ``` - */ - poller(opts) { - return new WorkPoller({ ...opts, client: this._client }); - } - worker(opts) { - return new EnvironmentWorker({ ...opts, client: this._client }); - } - } - Work2.WorkPoller = WorkPoller; - Work2.EnvironmentWorker = EnvironmentWorker; - return Work2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs -var Environments2; -var init_environments2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs"() { - init_resource2(); - init_work(); - init_work(); - init_pagination2(); - init_headers3(); - init_path2(); - Environments2 = /* @__PURE__ */ (() => { - class Environments3 extends APIResource2 { - constructor() { - super(...arguments); - this.work = new Work(this._client); - } - /** - * Create a new environment with the specified configuration. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.create({ - * name: 'python-data-analysis', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/environments?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a specific environment by ID. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.retrieve( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - retrieve(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update an existing environment's configuration. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.update( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - update(environmentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environmentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List environments with pagination support. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaEnvironment of client.beta.environments.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/environments?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete an environment by ID. Returns a confirmation of the deletion. - * - * @example - * ```ts - * const betaEnvironmentDeleteResponse = - * await client.beta.environments.delete( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - delete(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/environments/${environmentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive an environment by ID. Archived environments cannot be used to create new - * sessions. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.archive( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - archive(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/environments/${environmentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Environments3.Work = Work; - return Environments3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs -var Memories; -var init_memories = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Memories = class extends APIResource2 { - /** - * Create a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.create( - * 'memory_store_id', - * { content: 'content', path: 'xx' }, - * ); - * ``` - */ - create(memoryStoreID, params, options) { - const { view: view2, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, { - query: { view: view2 }, - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.retrieve( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - retrieve(memoryID, params, options) { - const { memory_store_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.update( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - update(memoryID, params, options) { - const { memory_store_id, view: view2, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query: { view: view2 }, - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memories - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryListItem of client.beta.memoryStores.memories.list( - * 'memory_store_id', - * )) { - * // ... - * } - * ``` - */ - list(memoryStoreID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a memory - * - * @example - * ```ts - * const betaManagedAgentsDeletedMemory = - * await client.beta.memoryStores.memories.delete( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - delete(memoryID, params, options) { - const { memory_store_id, expected_content_sha256, betas, workspace_id } = params; - return this._client.delete(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query: { expected_content_sha256 }, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs -var MemoryVersions; -var init_memory_versions = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - MemoryVersions = class extends APIResource2 { - /** - * Retrieve a memory version - * - * @example - * ```ts - * const betaManagedAgentsMemoryVersion = - * await client.beta.memoryStores.memoryVersions.retrieve( - * 'memory_version_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - retrieve(memoryVersionID, params, options) { - const { memory_store_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memory versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryVersion of client.beta.memoryStores.memoryVersions.list( - * 'memory_store_id', - * )) { - * // ... - * } - * ``` - */ - list(memoryStoreID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Redact a memory version - * - * @example - * ```ts - * const betaManagedAgentsMemoryVersion = - * await client.beta.memoryStores.memoryVersions.redact( - * 'memory_version_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - redact(memoryVersionID, params, options) { - const { memory_store_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs -var MemoryStores; -var init_memory_stores = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs"() { - init_resource2(); - init_memories(); - init_memories(); - init_memory_versions(); - init_memory_versions(); - init_pagination2(); - init_headers3(); - init_path2(); - MemoryStores = /* @__PURE__ */ (() => { - class MemoryStores2 extends APIResource2 { - constructor() { - super(...arguments); - this.memories = new Memories(this._client); - this.memoryVersions = new MemoryVersions(this._client); - } - /** - * Create a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.create({ name: 'x' }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/memory_stores?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.retrieve( - * 'memory_store_id', - * ); - * ``` - */ - retrieve(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.update('memory_store_id'); - * ``` - */ - update(memoryStoreID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memory stores - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryStore of client.beta.memoryStores.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/memory_stores?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a memory store - * - * @example - * ```ts - * const betaManagedAgentsDeletedMemoryStore = - * await client.beta.memoryStores.delete('memory_store_id'); - * ``` - */ - delete(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.archive('memory_store_id'); - * ``` - */ - archive(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - MemoryStores2.Memories = Memories; - MemoryStores2.MemoryVersions = MemoryVersions; - return MemoryStores2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/error.mjs -var init_error4 = __esm({ - "node_modules/@anthropic-ai/sdk/error.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs -var JSONLDecoder; -var init_jsonl = __esm({ - "node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs"() { - init_error3(); - init_shims2(); - init_line2(); - JSONLDecoder = /* @__PURE__ */ (() => { - class JSONLDecoder2 { - constructor(iterator, controller) { - this.iterator = iterator; - this.controller = controller; - } - async *decoder() { - const lineDecoder = new LineDecoder2(); - for await (const chunk of this.iterator) { - for (const line of lineDecoder.decode(chunk)) { - yield JSON.parse(line); - } - } - for (const line of lineDecoder.flush()) { - yield JSON.parse(line); - } - } - [Symbol.asyncIterator]() { - return this.decoder(); - } - static fromResponse(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); - } - throw new AnthropicError(`Attempted to iterate over a response with no body`); - } - return new JSONLDecoder2(ReadableStreamToAsyncIterable2(response.body), controller); - } - } - return JSONLDecoder2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs -var Batches2; -var init_batches2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_jsonl(); - init_error4(); - init_path2(); - Batches2 = class extends APIResource2 { - /** - * Send a batch of Message creation requests. - * - * The Message Batches API can be used to process multiple Messages API requests at - * once. Once a Message Batch is created, it begins processing immediately. Batches - * can take up to 24 hours to complete. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.create({ - * requests: [ - * { - * custom_id: 'my-custom-id-1', - * params: { - * max_tokens: 1024, - * messages: [ - * { content: 'Hello, world', role: 'user' }, - * ], - * model: 'claude-opus-5', - * }, - * }, - * ], - * }); - * ``` - */ - create(params, options) { - const { betas, user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/batches?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * This endpoint is idempotent and can be used to poll for Message Batch - * completion. To access the results of a Message Batch, make a request to the - * `results_url` field in the response. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.retrieve( - * 'message_batch_id', - * ); - * ``` - */ - retrieve(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List all Message Batches within a Workspace. Most recently created batches are - * returned first. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaMessageBatch of client.beta.messages.batches.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/messages/batches?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a Message Batch. - * - * Message Batches can only be deleted once they've finished processing. If you'd - * like to delete an in-progress batch, you must first cancel it. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaDeletedMessageBatch = - * await client.beta.messages.batches.delete( - * 'message_batch_id', - * ); - * ``` - */ - delete(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Batches may be canceled any time before processing ends. Once cancellation is - * initiated, the batch enters a `canceling` state, at which time the system may - * complete any in-progress, non-interruptible requests before finalizing - * cancellation. - * - * The number of canceled requests is specified in `request_counts`. To determine - * which requests were canceled, check the individual results within the batch. - * Note that cancellation may not result in any canceled requests if they were - * non-interruptible. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.cancel( - * 'message_batch_id', - * ); - * ``` - */ - cancel(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Streams the results of a Message Batch as a `.jsonl` file. - * - * Each line in the file is a JSON object containing the result of a single request - * in the Message Batch. Results are not guaranteed to be in the same order as - * requests. Use the `custom_id` field to match results to requests. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatchIndividualResponse = - * await client.beta.messages.batches.results( - * 'message_batch_id', - * ); - * ``` - */ - async results(messageBatchID, params = {}, options) { - const batch = await this.retrieve(messageBatchID, params, options); - if (!batch.results_url) { - throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - const { betas, workspace_id } = params ?? {}; - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/constants.mjs -var MODEL_NONSTREAMING_TOKENS; -var init_constants = __esm({ - "node_modules/@anthropic-ai/sdk/internal/constants.mjs"() { - MODEL_NONSTREAMING_TOKENS = { - "claude-opus-4@20250514": 8192, - "anthropic.claude-opus-4-1-20250805-v1:0": 8192, - "claude-opus-4-1@20250805": 8192 - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs -function getOutputFormat(params) { - return params?.output_format ?? params?.output_config?.format; -} -function maybeParseBetaMessage(message, params, opts) { - const outputFormat = getOutputFormat(params); - if (!params || !("parse" in (outputFormat ?? {}))) { - return { - ...message, - content: message.content.map((block) => { - if (block.type === "text") { - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: null, - enumerable: false - }); - return Object.defineProperty(parsedBlock, "parsed", { - get() { - opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); - return null; - }, - enumerable: false - }); - } - return block; - }), - parsed_output: null - }; - } - return parseBetaMessage(message, params, opts); -} -function parseBetaMessage(message, params, opts) { - let firstParsedOutput = null; - const content = message.content.map((block) => { - if (block.type === "text") { - const parsedOutput = parseBetaOutputFormat(params, block.text); - if (firstParsedOutput === null) { - firstParsedOutput = parsedOutput; - } - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: parsedOutput, - enumerable: false - }); - return Object.defineProperty(parsedBlock, "parsed", { - get() { - opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); - return parsedOutput; - }, - enumerable: false - }); - } - return block; - }); - return { - ...message, - content, - parsed_output: firstParsedOutput - }; -} -function parseBetaOutputFormat(params, content) { - const outputFormat = getOutputFormat(params); - if (outputFormat?.type !== "json_schema") { - return null; - } - try { - if ("parse" in outputFormat) { - return outputFormat.parse(content); - } - return JSON.parse(content); - } catch (error) { - throw new AnthropicError(`Failed to parse structured output: ${error}`); - } -} -var init_beta_parser = __esm({ - "node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/streaming.mjs -var init_streaming4 = __esm({ - "node_modules/@anthropic-ai/sdk/streaming.mjs"() { - init_streaming3(); - } -}); - -// node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs -var tokenize, strip, unstrip, generate, partialParse3; -var init_parser3 = __esm({ - "node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs"() { - tokenize = (input) => { - let current = 0; - let tokens = []; - while (current < input.length) { - let char = input[current]; - if (char === "\\") { - current++; - continue; - } - if (char === "{") { - tokens.push({ - type: "brace", - value: "{" - }); - current++; - continue; - } - if (char === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - current++; - continue; - } - if (char === "[") { - tokens.push({ - type: "paren", - value: "[" - }); - current++; - continue; - } - if (char === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - current++; - continue; - } - if (char === ":") { - tokens.push({ - type: "separator", - value: ":" - }); - current++; - continue; - } - if (char === ",") { - tokens.push({ - type: "delimiter", - value: "," - }); - current++; - continue; - } - if (char === '"') { - const start = current + 1; - let end = start; - let danglingQuote = false; - while (true) { - end = input.indexOf('"', end); - if (end === -1) { - danglingQuote = true; - break; - } - let backslashes = 0; - let i = end - 1; - while (i >= start && input[i] === "\\") { - backslashes++; - i--; - } - if (backslashes % 2 === 0) - break; - end++; - } - if (danglingQuote) { - current = input.length; - } else { - tokens.push({ - type: "string", - value: input.slice(start, end) - }); - current = end + 1; - } - continue; - } - let WHITESPACE = /\s/; - if (char && WHITESPACE.test(char)) { - current++; - continue; - } - let NUMBERS = /[0-9]/; - if (char && NUMBERS.test(char) || char === "-" || char === ".") { - let value2 = ""; - if (char === "-") { - value2 += char; - char = input[++current]; - } - while (char && (NUMBERS.test(char) || char === "." || // exponent marker, e.g. `1e10` or `1.5E-9` - char === "e" || char === "E" || // exponent sign, only valid immediately after the exponent marker - (char === "-" || char === "+") && (value2[value2.length - 1] === "e" || value2[value2.length - 1] === "E"))) { - value2 += char; - char = input[++current]; - } - tokens.push({ - type: "number", - value: value2, - unterminated: current === input.length - }); - continue; - } - let LETTERS = /[a-z]/i; - if (char && LETTERS.test(char)) { - let value2 = ""; - while (char && LETTERS.test(char)) { - if (current === input.length) { - break; - } - value2 += char; - char = input[++current]; - } - if (value2 == "true" || value2 == "false" || value2 === "null") { - tokens.push({ - type: "name", - value: value2 - }); - } else { - current++; - continue; - } - continue; - } - current++; - } - return tokens; - }; - strip = (tokens) => { - let open = []; - for (const token of tokens) { - if (token.type === "brace" || token.type === "paren") { - if (token.value === "{" || token.value === "[") { - open.push(token.value); - } else { - open.pop(); - } - } - } - let innermostOpenBracket = open[open.length - 1]; - let length = tokens.length; - let JSON_NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/; - while (length > 0) { - let lastToken = tokens[length - 1]; - switch (lastToken.type) { - case "separator": - length--; - continue; - case "number": - if (lastToken.unterminated || !JSON_NUMBER.test(lastToken.value)) { - length--; - continue; - } - break; - case "string": - let tokenBeforeTheLastToken = tokens[length - 2]; - if (innermostOpenBracket === "{" && (tokenBeforeTheLastToken?.type === "delimiter" || tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{")) { - length--; - continue; - } - break; - case "delimiter": - length--; - break; - } - break; - } - return tokens.slice(0, length); - }; - unstrip = (tokens) => { - let tail = []; - tokens.map((token) => { - if (token.type === "brace") { - if (token.value === "{") { - tail.push("}"); - } else { - tail.splice(tail.lastIndexOf("}"), 1); - } - } - if (token.type === "paren") { - if (token.value === "[") { - tail.push("]"); - } else { - tail.splice(tail.lastIndexOf("]"), 1); - } - } - }); - if (tail.length > 0) { - tail.reverse().map((item) => { - if (item === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - } else if (item === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - } - }); - } - return tokens; - }; - generate = (tokens) => { - let output = ""; - tokens.map((token) => { - switch (token.type) { - case "string": - output += '"' + token.value + '"'; - break; - default: - output += token.value; - break; - } - }); - return output; - }; - partialParse3 = (input) => JSON.parse(generate(unstrip(strip(tokenize(input))))); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs -function withLazyInput(prev, jsonBuf) { - const next = {}; - for (const key of Object.keys(prev)) { - if (key !== "input") - next[key] = prev[key]; - } - Object.defineProperty(next, JSON_BUF_PROPERTY, { value: jsonBuf, enumerable: false, writable: true }); - let input; - let parsed = false; - Object.defineProperty(next, "input", { - enumerable: true, - configurable: true, - get() { - if (!parsed) { - input = jsonBuf ? partialParse3(jsonBuf) : {}; - parsed = true; - } - return input; - } - }); - return next; -} -var JSON_BUF_PROPERTY; -var init_message_stream_utils = __esm({ - "node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs"() { - init_parser3(); - JSON_BUF_PROPERTY = "__json_buf"; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs -function tracksToolInput(content) { - return content.type === "tool_use" || content.type === "server_tool_use" || content.type === "mcp_tool_use"; -} -var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_params, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_workspace_id, _BetaMessageStream_logger, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage, _BetaMessageStream_toolInputParseError, BetaMessageStream; -var init_BetaMessageStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_error4(); - init_errors2(); - init_values2(); - init_streaming4(); - init_beta_parser(); - init_message_stream_utils(); - BetaMessageStream = /* @__PURE__ */ (() => { - class BetaMessageStream2 { - constructor(params, opts) { - _BetaMessageStream_instances.add(this); - this.messages = []; - this.receivedMessages = []; - _BetaMessageStream_currentMessageSnapshot.set(this, void 0); - _BetaMessageStream_params.set(this, null); - this.controller = new AbortController(); - _BetaMessageStream_connectedPromise.set(this, void 0); - _BetaMessageStream_resolveConnectedPromise.set(this, () => { - }); - _BetaMessageStream_rejectConnectedPromise.set(this, () => { - }); - _BetaMessageStream_endPromise.set(this, void 0); - _BetaMessageStream_resolveEndPromise.set(this, () => { - }); - _BetaMessageStream_rejectEndPromise.set(this, () => { - }); - _BetaMessageStream_listeners.set(this, {}); - _BetaMessageStream_ended.set(this, false); - _BetaMessageStream_errored.set(this, false); - _BetaMessageStream_aborted.set(this, false); - _BetaMessageStream_catchingPromiseCreated.set(this, false); - _BetaMessageStream_response.set(this, void 0); - _BetaMessageStream_request_id.set(this, void 0); - _BetaMessageStream_workspace_id.set(this, void 0); - _BetaMessageStream_logger.set(this, void 0); - _BetaMessageStream_handleError.set(this, (error) => { - __classPrivateFieldSet2(this, _BetaMessageStream_errored, true, "f"); - if (isAbortError2(error)) { - error = new APIUserAbortError2(); - } - if (error instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _BetaMessageStream_aborted, true, "f"); - return this._emit("abort", error); - } - if (error instanceof AnthropicError) { - return this._emit("error", error); - } - if (error instanceof Error) { - const anthropicError = new AnthropicError(error.message); - anthropicError.cause = error; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError(String(error))); - }); - __classPrivateFieldSet2(this, _BetaMessageStream_connectedPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveConnectedPromise, resolve2, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectConnectedPromise, reject2, "f"); - }), "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_endPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveEndPromise, resolve2, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectEndPromise, reject2, "f"); - }), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise, "f").catch(() => { - }); - __classPrivateFieldGet2(this, _BetaMessageStream_endPromise, "f").catch(() => { - }); - __classPrivateFieldSet2(this, _BetaMessageStream_params, params, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_logger, opts?.logger ?? console, "f"); - } - get response() { - return __classPrivateFieldGet2(this, _BetaMessageStream_response, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _BetaMessageStream_request_id, "f"); - } - get workspace_id() { - return __classPrivateFieldGet2(this, _BetaMessageStream_workspace_id, "f"); - } - /** - * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, - * returned vie the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * This is the same as the `APIPromise.withResponse()` method. - * - * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` - * as no `Response` is available. - */ - async withResponse() { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - const response = await __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - /** - * Intended for use on the frontend, consuming a stream produced with - * `.toReadableStream()` on the backend. - * - * Note that messages sent to the model do not appear in `.on('message')` - * in this context. - */ - static fromReadableStream(stream4) { - const runner = new BetaMessageStream2(null); - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options, { logger } = {}) { - const runner = new BetaMessageStream2(params, { logger }); - for (const message of params.messages) { - runner._addMessageParam(message); - } - __classPrivateFieldSet2(runner, _BetaMessageStream_params, { ...params, stream: true }, "f"); - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit2 = true) { - this.receivedMessages.push(message); - if (emit2) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_response, response, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_request_id, response?.headers.get("request-id"), "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveConnectedPromise, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _BetaMessageStream_ended, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _BetaMessageStream_errored, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _BetaMessageStream_aborted, "f"); - } - abort() { - this.controller.abort(); - } - /** - * Adds the listener function to the end of the listeners array for the event. - * No checks are made to see if the listener has already been added. Multiple calls passing - * the same combination of event and listener will result in the listener being added, and - * called, multiple times. - * @returns this MessageStream, so that calls can be chained - */ - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = []); - listeners.push({ listener }); - return this; - } - /** - * Removes the specified listener from the listener array for the event. - * off() will remove, at most, one instance of a listener from the listener array. If any single - * listener has been added multiple times to the listener array for the specified event, then - * off() must be called multiple times to remove each instance. - * @returns this MessageStream, so that calls can be chained - */ - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - /** - * Adds a one-time listener function for the event. The next time the event is triggered, - * this listener is removed and then invoked. - * @returns this MessageStream, so that calls can be chained - */ - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - /** - * This is similar to `.once()`, but returns a Promise that resolves the next time - * the event is triggered, instead of calling a listener callback. - * @returns a Promise that resolves the next time given event is triggered, - * or rejects if an error is emitted. (If you request the 'error' event, - * returns a promise that resolves with the error). - * - * Example: - * - * const message = await stream.emitted('message') // rejects if the stream errors - */ - emitted(event) { - return new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - if (event !== "error") - this.once("error", reject2); - this.once(event, resolve2); - }); - } - async done() { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet2(this, _BetaMessageStream_endPromise, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - } - /** - * @returns a promise that resolves with the the final assistant Message response, - * or rejects if an error occurred or the stream ended prematurely without producing a Message. - * If structured outputs were used, this will be a ParsedMessage with a `parsed` field. - */ - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this); - } - /** - * @returns a promise that resolves with the the final assistant Message's text response, concatenated - * together if there are more than one text blocks. - * Rejects if an error occurred or the stream ended prematurely without producing a Message. - */ - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalText).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _BetaMessageStream_ended, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _BetaMessageStream_ended, true, "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveEndPromise, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - return; - } - if (event === "error") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - [(_BetaMessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_params = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_listeners = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_ended = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_errored = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_aborted = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_response = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_request_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_logger = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_handleError = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_instances = /* @__PURE__ */ new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); - }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent2(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_accumulateMessage).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if (tracksToolInput(content) && __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f").inputJson?.length) { - let jsonSnapshot; - try { - jsonSnapshot = content.input; - } catch (err) { - __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, content, err)); - break; - } - this._emit("inputJson", event.delta.partial_json, jsonSnapshot); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - case "compaction_delta": { - if (content.type === "compaction" && content.content) { - this._emit("compaction", content.content); - } - break; - } - default: - checkNever(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(maybeParseBetaMessage(messageSnapshot, __classPrivateFieldGet2(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _BetaMessageStream_logger, "f") }), true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest2() { - if (this.ended) { - throw new AnthropicError(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - if (!snapshot) { - throw new AnthropicError(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); - return maybeParseBetaMessage(snapshot, __classPrivateFieldGet2(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _BetaMessageStream_logger, "f") }); - }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage2(event) { - let snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.stop_details = event.delta.stop_details; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.delta.container != null) { - snapshot.container = event.delta.container; - } - if (event.context_management != null) { - snapshot.context_management = event.context_management; - } - if (event.input_transformations != null) { - snapshot.input_transformations = event.input_transformations; - } - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - if (event.usage.iterations != null) { - snapshot.usage.iterations = event.usage.iterations; - } - if (event.usage.fallback_credit != null) { - snapshot.usage.fallback_credit = event.usage.fallback_credit; - } - if (event.usage.output_tokens_details != null) { - snapshot.usage.output_tokens_details = event.usage.output_tokens_details; - } - return snapshot; - case "content_block_start": - snapshot.content.push(event.content_block); - if (event.content_block.type === "fallback") { - snapshot.model = event.content_block.to.model; - } - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - text: (snapshotContent.text || "") + event.delta.text - }; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - citations: [...snapshotContent.citations ?? [], event.delta.citation] - }; - } - break; - } - case "input_json_delta": { - if (snapshotContent && tracksToolInput(snapshotContent)) { - const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; - snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - thinking: snapshotContent.thinking + event.delta.thinking - }; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - signature: event.delta.signature - }; - } - break; - } - case "compaction_delta": { - if (snapshotContent?.type === "compaction") { - const block = { ...snapshotContent, content: event.delta.content }; - if ("encrypted_content" in event.delta) { - block.encrypted_content = event.delta.encrypted_content; - } - snapshot.content[event.index] = block; - } - break; - } - default: - checkNever(event.delta); - } - return snapshot; - } - case "content_block_stop": { - const snapshotContent = snapshot.content.at(event.index); - if (snapshotContent && tracksToolInput(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { - let input; - try { - input = snapshotContent.input; - } catch (err) { - input = {}; - __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, snapshotContent, err)); - } - Object.defineProperty(snapshotContent, "input", { - value: input, - enumerable: true, - configurable: true, - writable: true - }); - } - return snapshot; - } - } - }, _BetaMessageStream_toolInputParseError = function _BetaMessageStream_toolInputParseError2(block, err) { - const jsonBuf = block[JSON_BUF_PROPERTY]; - return new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`); - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); - } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - } - return BetaMessageStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs -var _BetaToolRunnerStream_instances, _BetaToolRunnerStream_onToolCall, _BetaToolRunnerStream_emitted, _BetaToolRunnerStream_readers, _BetaToolRunnerStream_toolCalls, _BetaToolRunnerStream_closed, _BetaToolRunnerStream_ready, _BetaToolRunnerStream_fallback, _BetaToolRunnerStream_track, _BetaToolRunnerStream_release, _BetaToolRunnerStream_removeReader, BetaToolRunnerStream; -var init_BetaToolRunnerStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_BetaMessageStream(); - BetaToolRunnerStream = /* @__PURE__ */ (() => { - class BetaToolRunnerStream2 extends BetaMessageStream { - constructor(params, onToolCall) { - super(params); - _BetaToolRunnerStream_instances.add(this); - _BetaToolRunnerStream_onToolCall.set(this, void 0); - _BetaToolRunnerStream_emitted.set(this, 0); - _BetaToolRunnerStream_readers.set(this, []); - _BetaToolRunnerStream_toolCalls.set(this, []); - _BetaToolRunnerStream_closed.set(this, void 0); - _BetaToolRunnerStream_ready.set(this, []); - _BetaToolRunnerStream_fallback.set(this, false); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_onToolCall, onToolCall, "f"); - } - /** The `tool_use` blocks that have finished streaming, in the model's order */ - get toolCalls() { - return __classPrivateFieldGet2(this, _BetaToolRunnerStream_toolCalls, "f"); - } - /** Sends the request as `client.beta.messages.stream()` does. */ - static start(messages, params, options, onToolCall) { - const stream4 = new BetaToolRunnerStream2({ ...params, stream: true }, onToolCall); - for (const message of params.messages) { - stream4._addMessageParam(message); - } - stream4._run(() => stream4._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return stream4; - } - _emit(event, ...args) { - var _a6; - if (event !== "streamEvent" || this.ended) { - super._emit(event, ...args); - return; - } - __classPrivateFieldSet2(this, _BetaToolRunnerStream_emitted, (_a6 = __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f"), _a6++, _a6), "f"); - const [streamEvent, snapshot] = args; - const block = streamEvent.type === "content_block_stop" ? snapshot.content[streamEvent.index] : void 0; - const closed = block?.type === "tool_use" ? block : void 0; - if (closed) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_toolCalls, "f").push(closed); - } - super._emit(event, ...args); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_track).call(this, streamEvent, closed); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - [(_BetaToolRunnerStream_onToolCall = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_emitted = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_readers = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_toolCalls = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_closed = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_ready = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_fallback = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - const iterator = super[Symbol.asyncIterator](); - const reader = { handled: __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f") }; - __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").push(reader); - let holdsEvent = false; - return { - next: async () => { - if (holdsEvent) { - holdsEvent = false; - reader.handled++; - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - try { - const result = await iterator.next(); - holdsEvent = !result.done; - if (result.done) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - } - return result; - } catch (error) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - throw error; - } - }, - return: async () => { - const result = iterator.return?.(); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - return await result ?? { value: void 0, done: true }; - } - }; - } - } - _BetaToolRunnerStream_track = function _BetaToolRunnerStream_track2(event, closed) { - if (__classPrivateFieldGet2(this, _BetaToolRunnerStream_fallback, "f")) { - return; - } - if (event.type === "content_block_start" && event.content_block.type === "fallback") { - __classPrivateFieldSet2(this, _BetaToolRunnerStream_fallback, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, void 0, "f"); - return; - } - const movedOn = event.type === "content_block_start" || event.type === "message_delta" && event.delta.stop_reason === "tool_use"; - if (__classPrivateFieldGet2(this, _BetaToolRunnerStream_closed, "f") && movedOn) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f").push({ toolUse: __classPrivateFieldGet2(this, _BetaToolRunnerStream_closed, "f"), event: __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f") }); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, void 0, "f"); - } - if (closed) { - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, closed, "f"); - } - }, _BetaToolRunnerStream_release = function _BetaToolRunnerStream_release2() { - if (this.errored || this.controller.signal.aborted) { - return; - } - const handled = Math.min(__classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f"), ...__classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").map((reader) => reader.handled)); - while (__classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f")[0] && __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f")[0].event <= handled) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_onToolCall, "f").call(this, __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f").shift().toolUse); - } - }, _BetaToolRunnerStream_removeReader = function _BetaToolRunnerStream_removeReader2(reader) { - const index = __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").indexOf(reader); - if (index >= 0) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").splice(index, 1); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - }; - return BetaToolRunnerStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs -function promiseWithResolvers() { - let resolve2; - let reject2; - const promise = new Promise((res, rej) => { - resolve2 = res; - reject2 = rej; - }); - return { promise, resolve: resolve2, reject: reject2 }; -} -var init_promise = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs -function rejectCompactionParam(params) { - if ("compaction" in params && params.compaction != null) { - throw new AnthropicError("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead."); - } -} -function rejectCompactionControl(params) { - if ("compactionControl" in params && params.compactionControl != null) { - throw new AnthropicError("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted."); - } -} -function rejectRunToolsEagerlyWithoutStream(params) { - if (params.runToolsEagerly && !params.stream) { - throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole."); - } -} -function rejectCompactionEdit(params) { - if (params.context_management?.edits?.some((edit) => edit.type.startsWith("compact_"))) { - throw new AnthropicError("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first."); - } -} -function withoutCompactionIncompatibleParams(params) { - const { context_management, stop_sequences, output_format, ...kept } = params; - const withoutFormat = ({ format, ...outputConfig }) => outputConfig; - if (kept.tool_choice?.type === "any" || kept.tool_choice?.type === "tool") { - delete kept.tool_choice; - } - if (kept.output_config) { - kept.output_config = withoutFormat(kept.output_config); - } - if (Array.isArray(kept.fallbacks)) { - kept.fallbacks = kept.fallbacks.map((fallback) => fallback.output_config ? { ...fallback, output_config: withoutFormat(fallback.output_config) } : fallback); - } - return kept; -} -async function generateToolResponse(runnable, available, lastMessage, requestOptions, calls) { - if (!lastMessage || lastMessage.role !== "assistant" || !lastMessage.content || typeof lastMessage.content === "string") { - return null; - } - const toolUseBlocks = lastMessage.content.filter((content) => content.type === "tool_use"); - if (toolUseBlocks.length === 0) { - return null; - } - const toolResults = await Promise.all(toolUseBlocks.map((toolUse) => { - const call = calls?.get(toolUse.id); - if (call?.status === "started") { - return call.result; - } - const result = runToolCall(runnable, available, toolUse, requestOptions); - calls?.set(toolUse.id, { status: "started", result }); - return result; - })); - return { - role: "user", - content: toolResults - }; -} -async function runToolCall(runnable, available, toolUse, requestOptions) { - const tool = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0; - if (!tool) { - return toolNotFoundResult(toolUse); - } - try { - let input = toolUse.input; - if ("parse" in tool && tool.parse) { - input = tool.parse(input); - } - const result = await tool.run(input, { - toolUse, - toolUseBlock: toolUse, - signal: requestOptions?.signal - }); - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: result - }; - } catch (error) { - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: error instanceof ToolError ? error.content : `Error: ${error instanceof Error ? error.message : String(error)}`, - is_error: true - }; - } -} -function asContentParam(content) { - return content; -} -function toolNotFoundResult(toolUse) { - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: `Error: Tool '${toolUse.name}' not found`, - is_error: true - }; -} -function applyToolChange(block, available) { - switch (block.type) { - case "tool_removal": - case "tool_addition": - applyToolReference(block, available); - break; - } -} -function applyToolReference(block, available) { - const name = changedToolName(block.tool); - if (name === void 0) - return; - if (block.type === "tool_removal") { - available.delete(name); - } else { - available.add(name); - } -} -function changedToolName(tool) { - switch (tool.type) { - case "tool_reference": - return tool.name; - case "tool_definition": - return "name" in tool.definition ? tool.definition.name : void 0; - default: - return void 0; - } -} -function determineNextStepFromStopReason(stopReason) { - if (stopReason === null) - return "stop"; - switch (stopReason) { - case "tool_use": - return "run_tools"; - case "pause_turn": - // pause_after_compaction hands the turn back before the model answers; sending it back - // unchanged continues it. - case "compaction": - return "resume"; - case "end_turn": - case "stop_sequence": - case "max_tokens": - case "model_context_window_exceeded": - case "refusal": - return "stop"; - default: - checkNever(stopReason); - return "stop"; - } -} -var _BetaToolRunner_instances, _BetaToolRunner_consumed, _BetaToolRunner_mutated, _BetaToolRunner_state, _BetaToolRunner_options, _BetaToolRunner_message, _BetaToolRunner_stream, _BetaToolRunner_toolResponse, _BetaToolRunner_completion, _BetaToolRunner_iterationCount, _BetaToolRunner_compaction, _BetaToolRunner_calls, _BetaToolRunner_lastStopReason, _BetaToolRunner_toolOverrides, _BetaToolRunner_pendingToolChanges, _BetaToolRunner_send, _BetaToolRunner_streamThatStartsTools, _BetaToolRunner_startedCallsSettled, _BetaToolRunner_compact, _BetaToolRunner_runnableTools, _BetaToolRunner_availableToolNames, _BetaToolRunner_recordRemovalsFromHistory, _BetaToolRunner_compactAfterFinalTurn, _BetaToolRunner_generateToolResponse, _BetaToolRunner_flushPendingToolChanges, _BetaToolRunner_pendingToolChangesMessage, BetaToolRunner; -var init_BetaToolRunner = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs"() { - init_tslib2(); - init_ToolError(); - init_error3(); - init_BetaToolRunnerStream(); - init_headers3(); - init_promise(); - init_values2(); - init_log2(); - init_stainless_helper_header(); - BetaToolRunner = /* @__PURE__ */ (() => { - class BetaToolRunner2 { - constructor(client, params, options) { - _BetaToolRunner_instances.add(this); - this.client = client; - _BetaToolRunner_consumed.set(this, false); - _BetaToolRunner_mutated.set(this, false); - _BetaToolRunner_state.set(this, void 0); - _BetaToolRunner_options.set(this, void 0); - _BetaToolRunner_message.set(this, void 0); - _BetaToolRunner_stream.set(this, void 0); - _BetaToolRunner_toolResponse.set(this, void 0); - _BetaToolRunner_completion.set(this, void 0); - _BetaToolRunner_iterationCount.set(this, 0); - _BetaToolRunner_compaction.set(this, { status: "idle" }); - _BetaToolRunner_calls.set(this, void 0); - _BetaToolRunner_lastStopReason.set(this, null); - _BetaToolRunner_toolOverrides.set(this, /* @__PURE__ */ new Map()); - _BetaToolRunner_pendingToolChanges.set(this, []); - rejectCompactionParam(params); - rejectCompactionControl(params); - rejectRunToolsEagerlyWithoutStream(params); - __classPrivateFieldSet2(this, _BetaToolRunner_state, { - params: { - // You can't clone the entire params since there are functions as handlers. - // You also don't really need to clone params.messages, but it probably will prevent a foot gun - // somewhere. - ...params, - // Not structuredClone(): it throws on a function, and a runnable tool written by value into a - // `tool_addition` block has `run`. A JSON copy is the messages as they are sent, which drops it. - messages: JSON.parse(JSON.stringify(params.messages)) - } - }, "f"); - const collected = collectStainlessHelpers(params.tools, params.messages); - __classPrivateFieldSet2(this, _BetaToolRunner_options, { - ...options, - headers: buildHeaders2([ - helperHeader("BetaToolRunner"), - collected.length ? { [STAINLESS_HELPER_HEADER]: collected.join(", ") } : void 0, - options?.headers - ]) - }, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); - } - async *[(_BetaToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_mutated = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_state = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_options = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_message = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_stream = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolResponse = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_completion = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_iterationCount = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_compaction = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_calls = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_lastStopReason = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolOverrides = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_pendingToolChanges = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - var _a6; - if (__classPrivateFieldGet2(this, _BetaToolRunner_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed stream"); - } - __classPrivateFieldSet2(this, _BetaToolRunner_consumed, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - try { - while (true) { - try { - if (__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.max_iterations && __classPrivateFieldGet2(this, _BetaToolRunner_iterationCount, "f") >= __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.max_iterations) { - break; - } - __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_flushPendingToolChanges).call(this); - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "scheduled" && determineNextStepFromStopReason(__classPrivateFieldGet2(this, _BetaToolRunner_lastStopReason, "f")) !== "resume") { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").config); - continue; - } - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, false, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_iterationCount, (_a6 = __classPrivateFieldGet2(this, _BetaToolRunner_iterationCount, "f"), _a6++, _a6), "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_message, void 0, "f"); - const { max_iterations, runToolsEagerly, ...params } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, params); - if (!__classPrivateFieldGet2(this, _BetaToolRunner_mutated, "f")) { - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - const nextStep = determineNextStepFromStopReason(message.stop_reason); - __classPrivateFieldSet2(this, _BetaToolRunner_lastStopReason, message.stop_reason, "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push({ - role: message.role, - content: asContentParam(message.content) - }); - const { container } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - if (message.container) { - if (container == null) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.container = message.container.id; - } else if (typeof container === "object" && container.id == null) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.container = { ...container, id: message.container.id }; - } - } - if (nextStep === "stop") { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); - break; - } - if (nextStep === "resume") { - continue; - } - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_lastStopReason, null, "f"); - } - const toolMessage = await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.at(-1)); - if (toolMessage) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push(toolMessage); - } else if (!__classPrivateFieldGet2(this, _BetaToolRunner_mutated, "f")) { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); - break; - } - } finally { - __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f")?.abort(); - __classPrivateFieldSet2(this, _BetaToolRunner_stream, void 0, "f"); - } - } - await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); - if (!__classPrivateFieldGet2(this, _BetaToolRunner_message, "f")) { - throw new AnthropicError("ToolRunner concluded without a message from the server"); - } - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").resolve(await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f")); - } catch (error) { - __classPrivateFieldSet2(this, _BetaToolRunner_consumed, false, "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").promise.catch(() => { - }); - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").reject(error); - __classPrivateFieldSet2(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); - throw error; - } - } - setMessagesParams(paramsOrMutator) { - const params = typeof paramsOrMutator === "function" ? paramsOrMutator(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params) : paramsOrMutator; - rejectCompactionParam(params); - rejectRunToolsEagerlyWithoutStream(params); - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status !== "idle") { - rejectCompactionEdit(params); - } - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "in_flight" && params.messages !== __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages) { - throw new AnthropicError("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead."); - } - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params = params; - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - } - setRequestOptions(optionsOrMutator) { - if (typeof optionsOrMutator === "function") { - __classPrivateFieldSet2(this, _BetaToolRunner_options, optionsOrMutator(__classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_options, { ...__classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), ...optionsOrMutator }, "f"); - } - } - /** - * Get the tool response for the last message from the assistant. - * Avoids redundant tool executions by caching results. With `runToolsEagerly`, it reuses the calls of - * the reply that have started and runs the rest, including the ones `deferToolCall()` is holding, so that no - * call runs twice. - * - * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed - * - * @example - * const toolResponse = await runner.generateToolResponse(); - * if (toolResponse) { - * console.log('Tool results:', toolResponse.content); - * } - */ - async generateToolResponse(signal = __classPrivateFieldGet2(this, _BetaToolRunner_options, "f").signal) { - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f") ?? this.params.messages.at(-1); - if (!message) { - return null; - } - return __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, message, signal); - } - /** - * Hold a tool call of the current reply until you are done with the reply, which is when it runs without - * streaming: at the end of the loop body, or when you call `generateToolResponse()`. - * - * With `runToolsEagerly` the runner otherwise starts each call while the reply streams, as soon as - * the model has moved on from it: when the next block starts, or the reply stops with `tool_use`. A call - * never starts before your stream listeners and any `for await` over the stream have handled that event, so - * you can call this from either once you have seen the call. The other calls of the reply still start early. - * It does nothing for a call that has started, outside the loop body, and without `runToolsEagerly`. - * - * @param toolUse - The `tool_use` block of the call, or its id - * - * @example - * for await (const stream of runner) { - * stream.on('contentBlock', (block) => { - * if (block.type === 'tool_use' && block.name === 'delete_file') { - * runner.deferToolCall(block); - * } - * }); - * await stream.finalMessage(); - * // No `delete_file` call has started yet. - * } - */ - deferToolCall(toolUse) { - const id = typeof toolUse === "string" ? toolUse : toolUse.id; - if (__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f") && !__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f").has(id)) { - __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f").set(id, { status: "held" }); - } - } - /** - * The tool calls of the current reply that `deferToolCall()` is holding, in the model's order, as their - * `tool_use` blocks. A call is in the list once its block has finished streaming, so read the list when you - * are done with the stream. A call that has started is not in it. It is empty without - * `runToolsEagerly`. - * - * Held calls are listed whatever the reply's `stop_reason`, because `generateToolResponse()` runs them - * whatever it is. After `max_tokens` the input of the last call can be cut off. - * - * @example - * for await (const stream of runner) { - * stream.on('contentBlock', (block) => { - * if (block.type === 'tool_use' && block.name === 'delete_file') { - * runner.deferToolCall(block); - * } - * }); - * await stream.finalMessage(); - * - * const held = runner.deferredToolCalls; - * if (held.length > 0 && !(await confirm(held))) break; - * } - */ - get deferredToolCalls() { - const stream4 = __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f"); - const calls = __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f"); - if (!(stream4 instanceof BetaToolRunnerStream) || !calls) { - return []; - } - return stream4.toolCalls.filter((toolUse) => calls.get(toolUse.id)?.status === "held"); - } - /** - * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and - * will wait for an instance to start and go to completion. - * - * @returns A promise that resolves to the final BetaMessage when the iterator completes - * - * @example - * // Start consuming the iterator - * for await (const message of runner) { - * console.log('Message:', message.content); - * } - * - * // Meanwhile, wait for completion from another part of the code - * const finalMessage = await runner.done(); - * console.log('Final response:', finalMessage.content); - */ - done() { - return __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").promise; - } - /** - * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream: - * * If the iterator has not been consumed, consume the entire iterator and return the final message from the - * assistant. - * * If the iterator has been consumed, waits for it to complete and returns the final message. - * - * @returns A promise that resolves to the final BetaMessage from the conversation - * @throws {AnthropicError} If no messages were processed during the conversation - * - * @example - * const finalMessage = await runner.runUntilDone(); - * console.log('Final response:', finalMessage.content); - */ - async runUntilDone() { - if (!__classPrivateFieldGet2(this, _BetaToolRunner_consumed, "f")) { - for await (const _ of this) { - } - } - return this.done(); - } - /** - * Get the current parameters being used by the ToolRunner. - * - * @returns A readonly view of the current ToolRunnerParams - * - * @example - * const currentParams = runner.params; - * console.log('Current model:', currentParams.model); - * console.log('Message count:', currentParams.messages.length); - */ - get params() { - return __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - } - /** - * Add one or more messages to the conversation history. - * - * @param messages - One or more BetaMessageParam objects to add to the conversation - * - * @example - * runner.pushMessages( - * { role: 'user', content: 'Also, what about the weather in NYC?' } - * ); - * - * @example - * // Adding multiple messages - * runner.pushMessages( - * { role: 'user', content: 'What about NYC?' }, - * { role: 'user', content: 'And Boston?' } - * ); - */ - pushMessages(...messages) { - this.setMessagesParams((params) => ({ - ...params, - messages: [...params.messages, ...messages] - })); - } - /** - * Schedule a compaction of the conversation. Once the current turn has finished, including any tool - * calls, the runner requests a summary and replaces the message history with the compaction response, - * which is yielded like any other message. Requires the `compact-2026-09-04` beta. - * - * @param compaction - The config to send, as `messages.create()` takes it. Defaults to `{ type: 'summarize' }` - * - * @example - * for await (const message of runner) { - * if (message.usage.input_tokens > 100_000) { - * runner.compactBeforeNextTurn(); - * } - * } - */ - compactBeforeNextTurn(compaction) { - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "in_flight") { - return; - } - rejectCompactionEdit(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "scheduled", config: compaction ?? { type: "summarize" } }, "f"); - } - /** - * Give the model more tools without changing `params.tools`, which would miss the prompt cache. - * - * Each tool's whole definition is sent in a `tool_addition` block with the next request, and a - * runnable tool replaces a runnable tool of the same name straight away, even for a call already in - * the message being handled. A call that started while the reply streamed keeps the old one. A raw - * definition is only sent: the runner never runs it, and stops running a tool of the same name. - * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. - * - * @param tools - Runnable tools (for example from `betaZodTool()`) or raw tool definitions - * - * @example - * runner.addTools(queryDatabaseTool); - */ - addTools(...tools) { - for (const tool of tools) { - if ("name" in tool) { - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(tool.name, "run" in tool ? tool : null); - } - __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool }); - } - } - /** - * Take tools away from the model without changing `params.tools`, which would miss the prompt cache. - * - * The tools stop being run straight away: a call to one of them, even one in the message being - * handled, gets the same "not found" error result as a call to an unknown tool. A call that started - * while the reply streamed finishes as usual. The model is told in a `tool_removal` block with the - * next request. Use {@link addTools} to bring a tool back. - * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. - * - * @param tools - The tools to remove, or their names - * - * @example - * runner.removeTools('query_database'); - */ - removeTools(...tools) { - for (const tool of tools) { - const name = typeof tool === "string" ? tool : tool.name; - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(name, null); - __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "removal", name }); - } - } - /** - * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone() - * This allows using `await runner` instead of `await runner.runUntilDone()` - */ - then(onfulfilled, onrejected) { - return this.runUntilDone().then(onfulfilled, onrejected); - } - } - _BetaToolRunner_send = /** - * Sends one request and yields its message, or its stream when streaming. `#message` and `#stream` are set - * before the yield, so they are there while the caller handles the item; the loop aborts the stream at the - * end of the iteration. - */ - async function* _BetaToolRunner_send2(params) { - await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); - __classPrivateFieldSet2(this, _BetaToolRunner_calls, void 0, "f"); - if (params.stream) { - __classPrivateFieldSet2(this, _BetaToolRunner_stream, __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.runToolsEagerly ? __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_streamThatStartsTools).call(this, params) : this.client.beta.messages.stream({ ...params }, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_message, __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f").finalMessage(), "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_message, "f").catch(() => { - }); - yield __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f"); - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_message, this.client.beta.messages.create({ ...params, stream: false }, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - yield __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - } - }, _BetaToolRunner_streamThatStartsTools = function _BetaToolRunner_streamThatStartsTools2(params) { - const calls = /* @__PURE__ */ new Map(); - __classPrivateFieldSet2(this, _BetaToolRunner_calls, calls, "f"); - return BetaToolRunnerStream.start(this.client.beta.messages, params, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), (toolUse) => { - if (calls.has(toolUse.id)) { - return; - } - const result = runToolCall(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), toolUse, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")); - result.catch(() => { - }); - calls.set(toolUse.id, { status: "started", result }); - }); - }, _BetaToolRunner_startedCallsSettled = /** Waits for the calls of the last streamed reply that have started, whether or not their results were sent. */ - async function _BetaToolRunner_startedCallsSettled2() { - const started = [...__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f")?.values() ?? []].filter((call) => call.status === "started"); - await Promise.allSettled(started.map((call) => call.result)); - }, _BetaToolRunner_compact = async function* _BetaToolRunner_compact2(compaction) { - rejectCompactionEdit(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params); - const { max_iterations, runToolsEagerly, ...requestParams } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - const params = withoutCompactionIncompatibleParams(requestParams); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "in_flight" }, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - const lastMessage = __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - try { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, { ...params, compaction }); - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - if (message.content.some((block) => block.type === "compaction" && block.content)) { - __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_recordRemovalsFromHistory).call(this); - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages = [{ role: message.role, content: message.content }]; - } else { - loggerFor2(this.client).warn("Compaction produced no summary; keeping the conversation as it is."); - __classPrivateFieldSet2(this, _BetaToolRunner_message, lastMessage, "f"); - } - } finally { - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); - } - }, _BetaToolRunner_runnableTools = function _BetaToolRunner_runnableTools2() { - const runnable = /* @__PURE__ */ new Map(); - for (const tool of __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.tools) { - if ("run" in tool) { - runnable.set(tool.name, tool); - } - } - for (const [name, tool] of __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f")) { - if (tool) { - runnable.set(name, tool); - } else { - runnable.delete(name); - } - } - return runnable; - }, _BetaToolRunner_availableToolNames = function _BetaToolRunner_availableToolNames2() { - const available = new Set(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()); - for (const message of [...__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages, __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)]) { - if (typeof message.content === "string") { - continue; - } - for (const block of message.content) { - if (message.role === "system") { - applyToolChange(block, available); - } else if (message.role === "assistant" && block.type === "compaction") { - for (const change of block.tool_changes ?? []) { - applyToolChange(change, available); - } - } - } - } - return available; - }, _BetaToolRunner_recordRemovalsFromHistory = function _BetaToolRunner_recordRemovalsFromHistory2() { - const available = __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this); - for (const name of __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()) { - if (!available.has(name)) { - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(name, null); - } - } - }, _BetaToolRunner_compactAfterFinalTurn = async function* _BetaToolRunner_compactAfterFinalTurn2() { - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status !== "scheduled") { - return; - } - const lastContent = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.at(-1)?.content; - if (Array.isArray(lastContent) && lastContent.some((block) => block.type === "tool_use")) { - loggerFor2(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); - return; - } - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").config); - }, _BetaToolRunner_generateToolResponse = async function _BetaToolRunner_generateToolResponse2(lastMessage, signal = __classPrivateFieldGet2(this, _BetaToolRunner_options, "f").signal) { - if (__classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f") !== void 0) { - return __classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f"); - } - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, generateToolResponse(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), lastMessage, { ...__classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), signal }, __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f")), "f"); - return __classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f"); - }, _BetaToolRunner_flushPendingToolChanges = function _BetaToolRunner_flushPendingToolChanges2() { - if (__classPrivateFieldGet2(this, _BetaToolRunner_lastStopReason, "f") === "pause_turn" || __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").length === 0) { - return; - } - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)); - __classPrivateFieldSet2(this, _BetaToolRunner_pendingToolChanges, [], "f"); - }, _BetaToolRunner_pendingToolChangesMessage = function _BetaToolRunner_pendingToolChangesMessage2() { - const content = []; - for (const change of __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f")) { - if (change.type === "removal") { - content.push({ type: "tool_removal", tool: { type: "tool_reference", name: change.name } }); - continue; - } - let definition = change.tool; - if ("run" in change.tool) { - const { run: run2, parse: parse2, close, ...rest } = change.tool; - definition = rest; - } - content.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); - } - return { role: "system", content }; - }; - return BetaToolRunner2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs -function transformOutputFormat(params) { - if (!params.output_format) { - return params; - } - if (params.output_config?.format) { - throw new AnthropicError("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated)."); - } - const { output_format, ...rest } = params; - return { - ...rest, - output_config: { - ...params.output_config, - format: output_format - } - }; -} -var DEPRECATED_MODELS, MODELS_TO_WARN_WITH_THINKING_ENABLED, Messages3; -var init_messages3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs"() { - init_error4(); - init_batches2(); - init_resource2(); - init_constants(); - init_headers3(); - init_stainless_helper_header(); - init_beta_parser(); - init_BetaMessageStream(); - init_BetaToolRunner(); - init_ToolError(); - init_batches2(); - DEPRECATED_MODELS = {}; - MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-mythos-preview", "claude-opus-4-6"]; - Messages3 = /* @__PURE__ */ (() => { - class Messages5 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches2(this._client); - } - create(params, options) { - const modifiedParams = transformOutputFormat(params); - const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; - if (body.model in DEPRECATED_MODELS) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) && body.thinking && body.thinking.type === "enabled") { - console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); - } - let timeout = options?.timeout ?? this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); - return this._client.post("/v1/messages?beta=true", { - body, - timeout: timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - helperHeader2, - options?.headers - ]), - stream: modifiedParams.stream ?? false - }); - } - /** - * Send a structured list of input messages with text and/or image content, along with an expected `output_format` and - * the response will be automatically parsed and available in the `parsed_output` property of the message. - * - * @example - * ```ts - * const message = await client.beta.messages.parse({ - * model: 'claude-3-5-sonnet-20241022', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'), - * }); - * - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - parse(params, options) { - options = { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...params.betas ?? [], "structured-outputs-2025-12-15"].toString() }, - options?.headers - ]) - }; - return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console })); - } - /** - * Create a Message stream - */ - stream(body, options) { - return BetaMessageStream.createMessage(this, body, options); - } - /** - * Count the number of tokens in a Message. - * - * The Token Count API can be used to count the number of tokens in a Message, - * including tools, images, and documents, without creating it. - * - * Learn more about token counting in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) - * - * @example - * ```ts - * const betaMessageTokensCount = - * await client.beta.messages.countTokens({ - * messages: [{ content: 'Hello, world', role: 'user' }], - * model: 'claude-opus-5', - * }); - * ``` - */ - countTokens(params, options) { - const modifiedParams = transformOutputFormat(params); - const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; - return this._client.post("/v1/messages/count_tokens?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "token-counting-2024-11-01"].toString(), - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - toolRunner(body, options) { - return new BetaToolRunner(this._client, body, options); - } - } - Messages5.Batches = Batches2; - Messages5.BetaToolRunner = BetaToolRunner; - Messages5.ToolError = ToolError; - return Messages5; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs -var APIKeys3; -var init_api_keys3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - APIKeys3 = class extends APIResource2 { - /** - * Get API Key - * - * @example - * ```ts - * const betaAPIKey = - * await client.beta.organization.apiKeys.retrieve( - * 'api_key_id', - * ); - * ``` - */ - retrieve(apiKeyID, options) { - return this._client.get(path3`/v1/organizations/api_keys/${apiKeyID}?beta=true`, options); - } - /** - * Update API Key - * - * @example - * ```ts - * const betaAPIKey = - * await client.beta.organization.apiKeys.update( - * 'api_key_id', - * ); - * ``` - */ - update(apiKeyID, body, options) { - return this._client.post(path3`/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options }); - } - /** - * List API Keys - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/api_keys?beta=true", Page2, { - query, - ...options - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs -var ComplianceSettings; -var init_compliance_settings = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs"() { - init_resource2(); - ComplianceSettings = class extends APIResource2 { - /** - * Retrieve your organization's Compliance Settings. - * - * Compliance Settings is a singleton resource: there is exactly one per - * organization, addressed without an identifier. The `state` field reflects - * whether the Compliance API is enabled. An organization with a parent - * organization reads the state inherited from the parent's configuration. - * - * @example - * ```ts - * const betaComplianceSettings = - * await client.beta.organization.complianceSettings.retrieve(); - * ``` - */ - retrieve(options) { - return this._client.get("/v1/organizations/compliance_settings?beta=true", options); - } - /** - * Update your organization's Compliance Settings. - * - * Setting `state` to `enabled` turns on the Compliance API and begins capturing - * organization activity events. Setting it to `disabled` turns both off. `state` - * reflects whether the Compliance API is enabled. - * - * A request that sets `state` to its current value succeeds and leaves the - * resource unchanged. A `disabled` request stays in effect until a later `enabled` - * request or the organization's next provisioning action that enables Access - * Transparency: enabling Access Transparency also enables the Compliance API, - * which serves its activity events, so such provisioning (including re-runs) - * re-enables the Compliance API even after a `disabled` request. Automated - * provisioning never disables compliance settings. - * - * @example - * ```ts - * const betaComplianceSettings = - * await client.beta.organization.complianceSettings.update({ - * state: { type: 'enabled' }, - * }); - * ``` - */ - update(body, options) { - return this._client.post("/v1/organizations/compliance_settings?beta=true", { body, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs -var ExternalKeys; -var init_external_keys = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - ExternalKeys = class extends APIResource2 { - /** - * Create an external key config owned by the caller's organization. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.create({ - * provider_config: { - * kms_arn: - * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222', - * type: 'aws', - * }, - * }); - * ``` - */ - create(body, options) { - return this._client.post("/v1/organizations/external_keys?beta=true", { body, ...options }); - } - /** - * Retrieve a single external key config in the caller's organization by ID. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.retrieve( - * 'external_key_id', - * ); - * ``` - */ - retrieve(externalKeyID, options) { - return this._client.get(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); - } - /** - * Partially update an external key config. Omitted fields are left unchanged. - * - * `display_name` is always editable. `geo` and `provider_config` cannot be changed - * once any workspace references this config, because previously encrypted data - * requires the original key identity to decrypt. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.update( - * 'external_key_id', - * ); - * ``` - */ - update(externalKeyID, body, options) { - return this._client.post(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, { - body, - ...options - }); - } - /** - * List external key configs in the caller's organization. - * - * Results are ordered by creation time (newest first). Use the `next_page` cursor - * from the response to fetch subsequent pages. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/external_keys?beta=true", PageCursor, { - query, - ...options - }); - } - /** - * Delete an external key config. - * - * The request is rejected if any workspace still references this config. - * - * @example - * ```ts - * const externalKey = - * await client.beta.organization.externalKeys.delete( - * 'external_key_id', - * ); - * ``` - */ - delete(externalKeyID, options) { - return this._client.delete(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); - } - /** - * Validate an external key config against the customer's KMS. - * - * Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key - * and waits up to 30 seconds for the result. The response status is `success` if - * the roundtrip succeeded, or `failure` with an error message if it failed or - * timed out. - * - * @example - * ```ts - * const response = - * await client.beta.organization.externalKeys.validate( - * 'external_key_id', - * ); - * ``` - */ - validate(externalKeyID, options) { - return this._client.post(path3`/v1/organizations/external_keys/${externalKeyID}/validate?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs -var Invites2; -var init_invites2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Invites2 = class extends APIResource2 { - /** - * Invite a user to join the organization by email. - * - * On plans that draw members from a finite pool of purchased seats, the invite - * automatically consumes a seat from the lowest tier with availability; there is - * no seat-tier parameter. When no seat is free the request fails with a 400 error - * rather than purchasing a seat. - * - * @example - * ```ts - * const betaOrganizationInvite = - * await client.beta.organization.invites.create({ - * email: 'user@emaildomain.com', - * role: 'user', - * }); - * ``` - */ - create(body, options) { - return this._client.post("/v1/organizations/invites?beta=true", { body, ...options }); - } - /** - * Retrieve an invite by ID. - * - * @example - * ```ts - * const betaOrganizationInvite = - * await client.beta.organization.invites.retrieve( - * 'invite_id', - * ); - * ``` - */ - retrieve(inviteID, options) { - return this._client.get(path3`/v1/organizations/invites/${inviteID}?beta=true`, options); - } - /** - * List the organization's invites. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationInvite of client.beta.organization.invites.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/invites?beta=true", Page2, { - query, - ...options - }); - } - /** - * Delete a pending invite. - * - * @example - * ```ts - * const invite = - * await client.beta.organization.invites.delete( - * 'invite_id', - * ); - * ``` - */ - delete(inviteID, options) { - return this._client.delete(path3`/v1/organizations/invites/${inviteID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs -var RateLimits2; -var init_rate_limits2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs"() { - init_resource2(); - init_pagination2(); - RateLimits2 = class extends APIResource2 { - /** - * List Messages API rate limits for your organization. - * - * Each entry corresponds to one rate-limit group (either a model family or an - * API-surface category such as the Files API or Message Batches) and contains the - * set of limiter values that apply to it. - * - * When `limit` is omitted, every matching entry is returned in a single page; when - * `limit` truncates the result, follow `next_page` to fetch the remaining entries. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationRateLimit of client.beta.organization.rateLimits.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs -var Users4; -var init_users4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Users4 = class extends APIResource2 { - /** - * Retrieve a member of the organization by user ID. - * - * @example - * ```ts - * const betaOrganizationUser = - * await client.beta.organization.users.retrieve('user_id'); - * ``` - */ - retrieve(userID, options) { - return this._client.get(path3`/v1/organizations/users/${userID}?beta=true`, options); - } - /** - * Update a member's organization role. - * - * @example - * ```ts - * const betaOrganizationUser = - * await client.beta.organization.users.update('user_id', { - * role: 'user', - * }); - * ``` - */ - update(userID, body, options) { - return this._client.post(path3`/v1/organizations/users/${userID}?beta=true`, { body, ...options }); - } - /** - * List the organization's members. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationUser of client.beta.organization.users.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/users?beta=true", Page2, { - query, - ...options - }); - } - /** - * Remove a member from the organization. - * - * @example - * ```ts - * const user = await client.beta.organization.users.remove( - * 'user_id', - * ); - * ``` - */ - remove(userID, options) { - return this._client.delete(path3`/v1/organizations/users/${userID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs -var Issuers; -var init_issuers = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Issuers = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Register an OIDC issuer that Anthropic will trust for workload identity - * federation in your organization. - * - * The `jwks` field controls how the issuer's signing keys are obtained and takes - * one of three shapes selected by `type`: `discovery` (resolve keys through OIDC - * discovery), `explicit_url` (fetch keys from a fixed JWKS URL), or `inline` - * (provide a static key set). When `jwks.type` is `discovery` and no - * `discovery_base` is set, the issuer URL must be publicly reachable over HTTPS so - * Anthropic can fetch the discovery document; for `explicit_url` and `inline` - * modes the issuer URL is only matched as the JWT's `iss` claim and is not - * fetched. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.create({ - * issuer_url: 'x', - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/federation_issuers?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a federation issuer by its ID (`fdis_...`). - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.retrieve( - * 'federation_issuer_id', - * ); - * ``` - */ - retrieve(federationIssuerID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Partially update a federation issuer. - * - * Setting `jwks` replaces the full JWKS shape at once. Archived issuers cannot be - * updated; this returns 400. Create a new issuer instead. - * - * Updating an issuer that backs a rule with a scope outside `workspace:developer` - * or `workspace:inference` requires a Console session. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.update( - * 'federation_issuer_id', - * ); - * ``` - */ - update(federationIssuerID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List federation issuers in your organization. - * - * Archived issuers are excluded unless `include_archived=true`. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationIssuer of client.beta.organization.federation.issuers.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a federation issuer. - * - * Idempotent; re-archiving returns the issuer with its original `archived_at`. - * Rejected with 400 if any live (non-archived) federation rule still references - * the issuer; archive those rules first (a rule's issuer cannot be changed), or - * recreate them against another issuer. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.archive( - * 'federation_issuer_id', - * ); - * ``` - */ - archive(federationIssuerID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/federation_issuers/${federationIssuerID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs -var Workspaces; -var init_workspaces = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List workspaces where this federation rule is enabled. - * - * Returns all workspace enablements in a single response; the `limit` and `page` - * parameters are accepted but have no effect, and `next_page` is always `null`. - * Returns explicit per-workspace enablements only; for rules with - * `applies_to_all_workspaces` or a legacy single `workspace_id`, check those - * fields on the rule itself. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationRuleWorkspace of client.beta.organization.federation.rules.workspaces.list( - * 'federation_rule_id', - * )) { - * // ... - * } - * ``` - */ - list(federationRuleID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Enable a federation rule for a workspace. - * - * Idempotent; re-enabling returns the existing enablement. The rule and workspace - * must both belong to your organization. Membership of the rule's target service - * account in this workspace is not checked at enablement: token exchange into this - * workspace is rejected unless the target is a member (it is implicitly a member - * of the default workspace). Archived rules are rejected with 400. OAuth callers - * may only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRuleWorkspace = - * await client.beta.organization.federation.rules.workspaces.add( - * 'federation_rule_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - add(federationRuleID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Disable a federation rule for a workspace. - * - * Idempotent; succeeds even if the enablement was already removed. OAuth callers - * may only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const workspace = - * await client.beta.organization.federation.rules.workspaces.remove( - * 'workspace_id', - * { federation_rule_id: 'federation_rule_id' }, - * ); - * ``` - */ - remove(workspaceID, params, options) { - const { federation_rule_id, betas } = params; - return this._client.delete(path3`/v1/organizations/federation_rules/${federation_rule_id}/workspaces/${workspaceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs -var Rules; -var init_rules = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs"() { - init_resource2(); - init_workspaces(); - init_workspaces(); - init_pagination2(); - init_headers3(); - init_path2(); - Rules = /* @__PURE__ */ (() => { - class Rules2 extends APIResource2 { - constructor() { - super(...arguments); - this.workspaces = new Workspaces(this._client); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Create a federation rule owned by your organization. - * - * The referenced issuer and the target service account must already exist in the - * same organization; invalid references are rejected with a 400 error. The - * workspace reference is validated. Membership is not checked at rule creation: - * token exchange resolves a single enabled workspace per call and is rejected - * unless the target service account is a member of that workspace (it is - * implicitly a member of the default workspace). Rules on well-known shared - * issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, Google) must - * constrain tenant identity via an identity-bearing claim, a tenant-pinning - * subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition referencing one - * of those identity claims (e.g. `claims.repository_owner`). OAuth callers may - * only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.create({ - * issuer_id: 'issuer_id', - * match: {}, - * name: 'x', - * oauth_scope: 'x', - * target: { - * service_account_id: 'svac_01SDCCSbTxrXDpWc1phhtcfK', - * type: 'service_account', - * }, - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/federation_rules?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a federation rule by its ID (`fdrl_...`). - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.retrieve( - * 'federation_rule_id', - * ); - * ``` - */ - retrieve(federationRuleID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Partially update a federation rule. - * - * `issuer_id` is immutable. `match` and `target` are replaced as whole objects - * when set. Referenced service accounts and workspaces must exist in your - * organization; invalid references are rejected with a 400 error. Archived rules - * cannot be updated; this returns 400. Create a new rule instead. Rules on - * well-known shared issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, - * Google) must constrain tenant identity via an identity-bearing claim, a - * tenant-pinning subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition - * referencing one of those identity claims (e.g. `claims.repository_owner`). On - * these issuers the requirement is re-checked on every update; if an existing - * rule's stored match does not yet constrain tenant identity, any update (even a - * rename or description change) must also supply a conforming `match` in the same - * request. OAuth callers may only manage rules whose `oauth_scope` is - * `workspace:developer` or `workspace:inference`; other scopes require a Console - * session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.update( - * 'federation_rule_id', - * ); - * ``` - */ - update(federationRuleID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List federation rules in your organization. - * - * Optionally filter by issuer with `issuer_id`. Archived rules are excluded unless - * `include_archived=true`. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationRule of client.beta.organization.federation.rules.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/federation_rules?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a federation rule. - * - * Token exchange through this rule stops immediately. Idempotent; re-archiving - * returns the rule with its original `archived_at`. Archiving clears the rule's - * workspace targeting (`workspace_id` and `workspace_ids` are emptied). Tokens - * already minted before archive remain valid until they expire. OAuth callers may - * only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.archive( - * 'federation_rule_id', - * ); - * ``` - */ - archive(federationRuleID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - } - Rules2.Workspaces = Workspaces; - return Rules2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs -var Federation; -var init_federation = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs"() { - init_resource2(); - init_issuers(); - init_issuers(); - init_rules(); - init_rules(); - Federation = /* @__PURE__ */ (() => { - class Federation2 extends APIResource2 { - constructor() { - super(...arguments); - this.issuers = new Issuers(this._client); - this.rules = new Rules(this._client); - } - } - Federation2.Issuers = Issuers; - Federation2.Rules = Rules; - return Federation2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs -var Workspaces2; -var init_workspaces2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces2 = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List the workspaces a service account is a member of. - * - * Each entry includes the service account's `workspace_role` in that workspace. - * Use `limit` and the `next_page` cursor to paginate. When the service account has - * no explicit default-workspace membership, the implicit (`implicit: true`) - * membership is returned as the first entry on the first page; with `limit=1` the - * first page may return up to 2 entries (the implicit entry plus one explicit - * membership) so a pagination cursor can be derived. Memberships are returned only - * while the service account is active. Without a `page` cursor, an archived - * service account returns an empty list. A `page` cursor that does not match an - * active membership returns a 400 invalid-request error. A cursor stops matching - * when the membership is removed, the workspace is deleted, or the service account - * is archived. Restart pagination from the first page to recover. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.serviceAccounts.workspaces.list( - * 'service_account_id', - * )) { - * // ... - * } - * ``` - */ - list(serviceAccountID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Add a service account to a workspace with the given `workspace_role`. - * - * Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed from the - * service-account side; both create the same membership. If the service account is - * already an explicit member of the workspace, its `workspace_role` is replaced - * with the value supplied here. Archived workspaces return 400. Archived service - * accounts cannot be added and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.serviceAccounts.workspaces.add( - * 'service_account_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(serviceAccountID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Remove a service account from a workspace. - * - * Mirror of - * `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`, - * addressed from the service-account side. Removal is idempotent (returns 200 even - * if the membership was already removed). A DELETE against the implicit - * default-workspace membership returns 200 but is a no-op and the membership - * persists; deleting an explicit default-workspace row reverts to the implicit - * `workspace_user` membership. Archived workspaces return 400. - * - * @example - * ```ts - * const workspace = - * await client.beta.organization.serviceAccounts.workspaces.remove( - * 'workspace_id', - * { service_account_id: 'service_account_id' }, - * ); - * ``` - */ - remove(workspaceID, params, options) { - const { service_account_id, betas } = params; - return this._client.delete(path3`/v1/organizations/service_accounts/${service_account_id}/workspaces/${workspaceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs -var ServiceAccounts2; -var init_service_accounts2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs"() { - init_resource2(); - init_workspaces2(); - init_workspaces2(); - init_pagination2(); - init_headers3(); - init_path2(); - ServiceAccounts2 = /* @__PURE__ */ (() => { - class ServiceAccounts4 extends APIResource2 { - constructor() { - super(...arguments); - this.workspaces = new Workspaces2(this._client); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Create a service account. - * - * A service account is a named workload identity that federation rules target. - * `organization_role` is `developer` (default) or `admin`; a rule may only be - * created or retargeted to grant `org:admin` scope when the target's - * `organization_role` is `admin`. Creating an `admin`-role service account - * requires an interactive credential (a user OAuth token or a Console session) — a - * workload may only create `developer`-role service accounts. - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.create({ - * name: 'ci-deploy-bot', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/service_accounts?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a service account by its ID (`svac_...`). - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.retrieve( - * 'service_account_id', - * ); - * ``` - */ - retrieve(serviceAccountID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Update a service account. - * - * Only `description` and `organization_role` are mutable; `name` cannot be - * changed. Archived service accounts cannot be updated; this returns 400. Setting - * `organization_role` to `admin` (even when unchanged) requires an interactive - * credential (a user OAuth token or a Console session). - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.update( - * 'service_account_id', - * ); - * ``` - */ - update(serviceAccountID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List service accounts in the caller's organization. - * - * Results are ordered by creation time, newest first. Use `limit` and the - * `next_page` cursor to paginate; set `include_archived=true` to include archived - * service accounts. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/service_accounts?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a service account. - * - * Idempotent; re-archiving returns the service account with its original - * `archived_at`. Rejected with 400 if any live (non-archived) federation rule - * still targets this service account, same as issuer archival; archive those rules - * first or change their target to another service account. - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.archive( - * 'service_account_id', - * ); - * ``` - */ - archive(serviceAccountID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - } - ServiceAccounts4.Workspaces = Workspaces2; - return ServiceAccounts4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs -var Members; -var init_members = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Members = class extends APIResource2 { - /** - * Get Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.retrieve( - * 'user_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - retrieve(userID, params, options) { - const { workspace_id } = params; - return this._client.get(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); - } - /** - * Update Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.update( - * 'user_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - update(userID, params, options) { - const { workspace_id, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, { - body, - ...options - }); - } - /** - * List Workspace Members - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspaceMember of client.beta.organization.workspaces.members.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, query = {}, options) { - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page2, { query, ...options }); - } - /** - * Create Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.add( - * 'workspace_id', - * { - * user_id: 'user_01WCz1FkmYMm4gnmykNKUu3Q', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(workspaceID, body, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, { - body, - ...options - }); - } - /** - * Delete Workspace Member - * - * @example - * ```ts - * const member = - * await client.beta.organization.workspaces.members.remove( - * 'user_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - remove(userID, params, options) { - const { workspace_id } = params; - return this._client.delete(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs -var RateLimits3; -var init_rate_limits3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - RateLimits3 = class extends APIResource2 { - /** - * List a workspace's rate limits. - * - * By default, returns only the groups and limiter types that have a - * workspace-level override. With `include_inherited=true`, returns every group - * with organization-level limits the workspace can see, listing for each the - * values it inherits from the organization as well as its own overrides. Each - * value's `source` says which it is. - * - * When `limit` is omitted, every matching entry is returned in a single page; when - * `limit` truncates the result, follow `next_page` to fetch the remaining entries. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspaceRateLimit of client.beta.organization.workspaces.rateLimits.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, query = {}, options) { - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs -var ServiceAccounts3; -var init_service_accounts3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - ServiceAccounts3 = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a service account's membership in a workspace. - * - * Returns the membership record, including the service account's `workspace_role` - * in this workspace. Archived workspaces return 400. For the default workspace, - * returns the implicit (`implicit: true`) membership when no explicit membership - * exists; an explicitly added membership is returned with its assigned role. An - * archived service account returns 404. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.retrieve( - * 'service_account_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - retrieve(serviceAccountID, params, options) { - const { workspace_id, betas } = params; - return this._client.get(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Change a service account's role in a workspace. - * - * The new `workspace_role` replaces the current one. Only explicit memberships can - * be updated; to set a role on the implicit default-workspace membership, add the - * service account explicitly with - * `POST /workspaces/{workspace_id}/service_accounts`. Archived workspaces - * return 400. Archived service accounts cannot be updated and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.update( - * 'service_account_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - update(serviceAccountID, params, options) { - const { workspace_id, betas, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List the service accounts that are members of a workspace. - * - * Each entry includes the service account's `workspace_role`. Use `limit` and the - * `next_page` cursor to paginate. Archived workspaces return 400; use - * `GET /service_accounts/{id}/workspaces` to audit memberships of an archived - * workspace. The implicit default-workspace membership is not included in this - * list. Memberships of archived service accounts are omitted from the results. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.workspaces.serviceAccounts.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Add a service account to a workspace with the given `workspace_role`. - * - * The role determines what the service account can do in the workspace and which - * workspace-scoped permissions it can be granted when authenticating through - * federation. Every service account is already an implicit `workspace_user` member - * of the default workspace; adding it explicitly assigns a chosen role. If the - * service account is already an explicit member of the workspace, its - * `workspace_role` is replaced with the value supplied here. Archived workspaces - * return 400. Archived service accounts cannot be added and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.add( - * 'workspace_id', - * { - * service_account_id: 'service_account_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(workspaceID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Remove a service account from a workspace. - * - * Removal is idempotent (returns 200 even if the membership was already removed). - * A DELETE against the implicit default-workspace membership returns 200 but is a - * no-op and the membership persists; deleting an explicit default-workspace row - * reverts to the implicit `workspace_user` membership. Archived workspaces - * return 400. - * - * @example - * ```ts - * const serviceAccount = - * await client.beta.organization.workspaces.serviceAccounts.remove( - * 'service_account_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - remove(serviceAccountID, params, options) { - const { workspace_id, betas } = params; - return this._client.delete(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs -var Workspaces3; -var init_workspaces3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs"() { - init_resource2(); - init_members(); - init_members(); - init_rate_limits3(); - init_rate_limits3(); - init_service_accounts3(); - init_service_accounts3(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces3 = /* @__PURE__ */ (() => { - class Workspaces4 extends APIResource2 { - constructor() { - super(...arguments); - this.rateLimits = new RateLimits3(this._client); - this.members = new Members(this._client); - this.serviceAccounts = new ServiceAccounts3(this._client); - } - /** - * Create Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.create({ - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/workspaces?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * Get Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.retrieve( - * 'workspace_id', - * ); - * ``` - */ - retrieve(workspaceID, options) { - return this._client.get(path3`/v1/organizations/workspaces/${workspaceID}?beta=true`, options); - } - /** - * Update Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.update( - * 'workspace_id', - * ); - * ``` - */ - update(workspaceID, body, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}?beta=true`, { - body, - ...options - }); - } - /** - * List Workspaces - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspace of client.beta.organization.workspaces.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/workspaces?beta=true", Page2, { - query, - ...options - }); - } - /** - * Archive Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.archive( - * 'workspace_id', - * ); - * ``` - */ - archive(workspaceID, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/archive?beta=true`, options); - } - } - Workspaces4.RateLimits = RateLimits3; - Workspaces4.Members = Members; - Workspaces4.ServiceAccounts = ServiceAccounts3; - return Workspaces4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs -var Organization2; -var init_organization2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs"() { - init_resource2(); - init_api_keys3(); - init_api_keys3(); - init_compliance_settings(); - init_compliance_settings(); - init_external_keys(); - init_external_keys(); - init_invites2(); - init_invites2(); - init_rate_limits2(); - init_rate_limits2(); - init_users4(); - init_users4(); - init_federation(); - init_federation(); - init_service_accounts2(); - init_service_accounts2(); - init_workspaces3(); - init_workspaces3(); - Organization2 = /* @__PURE__ */ (() => { - class Organization3 extends APIResource2 { - constructor() { - super(...arguments); - this.apiKeys = new APIKeys3(this._client); - this.externalKeys = new ExternalKeys(this._client); - this.federation = new Federation(this._client); - this.invites = new Invites2(this._client); - this.serviceAccounts = new ServiceAccounts2(this._client); - this.users = new Users4(this._client); - this.workspaces = new Workspaces3(this._client); - this.rateLimits = new RateLimits2(this._client); - this.complianceSettings = new ComplianceSettings(this._client); - } - /** - * Retrieve information about the organization associated with the authenticated - * API key. - * - * @example - * ```ts - * const betaOrganization = - * await client.beta.organization.retrieve(); - * ``` - */ - retrieve(options) { - return this._client.get("/v1/organizations/me?beta=true", options); - } - } - Organization3.APIKeys = APIKeys3; - Organization3.ExternalKeys = ExternalKeys; - Organization3.Federation = Federation; - Organization3.Invites = Invites2; - Organization3.ServiceAccounts = ServiceAccounts2; - Organization3.Users = Users4; - Organization3.Workspaces = Workspaces3; - Organization3.RateLimits = RateLimits2; - Organization3.ComplianceSettings = ComplianceSettings; - return Organization3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs -var Events2; -var init_events2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - init_SessionToolRunner(); - Events2 = /* @__PURE__ */ (() => { - class Events4 extends APIResource2 { - /** - * List Events - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.events.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Send Events - * - * @example - * ```ts - * const betaManagedAgentsSendSessionEvents = - * await client.beta.sessions.events.send( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * { - * events: [ - * { - * content: [ - * { - * text: 'Where is my order #1234?', - * type: 'text', - * }, - * ], - * type: 'user.message', - * }, - * ], - * }, - * ); - * ``` - */ - send(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}/events?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stream Events - * - * @example - * ```ts - * const betaManagedAgentsStreamSessionEvents = - * await client.beta.sessions.events.stream( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - stream(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.get(path3`/v1/sessions/${sessionID}/events/stream?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true - }); - } - /** - * Attach to a session and dispatch every incoming `agent.tool_use` and - * `agent.custom_tool_use` event to a local tool registry, sending the matching - * result back (`user.tool_result` / `user.custom_tool_result`). The - * sessions-side counterpart to `client.beta.messages.toolRunner`: yields one - * entry per completed tool call so callers can observe each dispatch (and - * `break` to abort cleanly). - * - * @example - * ```ts - * import { betaAgentToolset20260401 } from '@anthropic-ai/sdk/tools/agent-toolset/node'; - * - * for await (const call of client.beta.sessions.events.toolRunner(work.data.id, { - * tools: [...betaAgentToolset20260401({ workdir }), myTool], - * })) { - * console.log(`${call.name} -> ${call.isError ? 'error' : 'ok'}`); - * } - * ``` - */ - toolRunner(sessionID, opts) { - return new SessionToolRunner(sessionID, { ...opts, client: this._client }); - } - } - Events4.SessionToolRunner = SessionToolRunner; - return Events4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs -var Resources; -var init_resources2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Resources = class extends APIResource2 { - /** - * Get Session Resource - * - * @example - * ```ts - * const resource = - * await client.beta.sessions.resources.retrieve( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - retrieve(resourceID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Session Resource - * - * @example - * ```ts - * const resource = - * await client.beta.sessions.resources.update( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { - * session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * authorization_token: 'ghp_exampletoken', - * }, - * ); - * ``` - */ - update(resourceID, params, options) { - const { session_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Session Resources - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionResource of client.beta.sessions.resources.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Session Resource - * - * @example - * ```ts - * const betaManagedAgentsDeleteSessionResource = - * await client.beta.sessions.resources.delete( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - delete(resourceID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Add Session Resource - * - * @example - * ```ts - * const betaManagedAgentsFileResource = - * await client.beta.sessions.resources.add( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * { - * file_id: 'file_011CNha8iCJcU1wXNR6q4V8w', - * type: 'file', - * }, - * ); - * ``` - */ - add(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}/resources?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs -var Events3; -var init_events3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Events3 = class extends APIResource2 { - /** - * List Session Thread Events - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.threads.events.list( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * )) { - * // ... - * } - * ``` - */ - list(threadID, params, options) { - const { session_id, betas, workspace_id, ...query } = params; - return this._client.getAPIList(path3`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stream Session Thread Events - * - * @example - * ```ts - * const betaManagedAgentsStreamSessionThreadEvents = - * await client.beta.sessions.threads.events.stream( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - stream(threadID, params, options) { - const { session_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs -var Threads3; -var init_threads3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs"() { - init_resource2(); - init_events3(); - init_events3(); - init_pagination2(); - init_headers3(); - init_path2(); - Threads3 = /* @__PURE__ */ (() => { - class Threads4 extends APIResource2 { - constructor() { - super(...arguments); - this.events = new Events3(this._client); - } - /** - * Get Session Thread - * - * @example - * ```ts - * const betaManagedAgentsSessionThread = - * await client.beta.sessions.threads.retrieve( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - retrieve(threadID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Session Threads - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionThread of client.beta.sessions.threads.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Session Thread - * - * @example - * ```ts - * const betaManagedAgentsSessionThread = - * await client.beta.sessions.threads.archive( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - archive(threadID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Threads4.Events = Events3; - return Threads4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs -var Sessions5; -var init_sessions5 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs"() { - init_resource2(); - init_events2(); - init_events2(); - init_resources2(); - init_resources2(); - init_threads3(); - init_threads3(); - init_pagination2(); - init_headers3(); - init_path2(); - Sessions5 = /* @__PURE__ */ (() => { - class Sessions6 extends APIResource2 { - constructor() { - super(...arguments); - this.events = new Events2(this._client); - this.resources = new Resources(this._client); - this.threads = new Threads3(this._client); - } - /** - * Create Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.create({ - * agent: 'agent_011CZkYpogX7uDKUyvBTophP', - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/sessions?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.retrieve( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - retrieve(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/sessions/${sessionID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.update( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - update(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Sessions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSession of client.beta.sessions.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/sessions?beta=true", BidirectionalPageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Session - * - * @example - * ```ts - * const betaManagedAgentsDeletedSession = - * await client.beta.sessions.delete( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - delete(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/sessions/${sessionID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.archive( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - archive(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/sessions/${sessionID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Sessions6.Events = Events2; - Sessions6.Resources = Resources; - Sessions6.Threads = Threads3; - return Sessions6; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs -var Versions3; -var init_versions3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Versions3 = class extends APIResource2 { - /** - * Create Skill Version - * - * @example - * ```ts - * const betaSkillVersion = - * await client.beta.skills.versions.create('skill_id', { - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(skillID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill Version - * - * @example - * ```ts - * const betaSkillVersion = - * await client.beta.skills.versions.retrieve('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - retrieve(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Skill Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSkillVersion of client.beta.skills.versions.list( - * 'skill_id', - * )) { - * // ... - * } - * ``` - */ - list(skillID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/skills/${skillID}/versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Skill Version - * - * @example - * ```ts - * const betaDeletedSkillVersion = - * await client.beta.skills.versions.delete('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - delete(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/skills/${skill_id}/versions/${version}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Download a skill version's content as a zip archive. - * - * @example - * ```ts - * const response = await client.beta.skills.versions.download( - * 'version', - * { skill_id: 'skill_id' }, - * ); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}/content?beta=true`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs -var Skills2; -var init_skills2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs"() { - init_resource2(); - init_versions3(); - init_versions3(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Skills2 = /* @__PURE__ */ (() => { - class Skills4 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions3(this._client); - } - /** - * Create Skill - * - * @example - * ```ts - * const betaSkill = await client.beta.skills.create({ - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/skills?beta=true", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill - * - * @example - * ```ts - * const betaSkill = await client.beta.skills.retrieve( - * 'skill_id', - * ); - * ``` - */ - retrieve(skillID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/skills/${skillID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Skills - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSkill of client.beta.skills.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/skills?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Skill - * - * @example - * ```ts - * const betaDeletedSkill = await client.beta.skills.delete( - * 'skill_id', - * ); - * ``` - */ - delete(skillID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/skills/${skillID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Skills4.Versions = Versions3; - return Skills4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs -var Certificates3; -var init_certificates3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Certificates3 = class extends APIResource2 { - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's - * server certificate against this CA when it terminates the inner TLS session. A - * tunnel holds at most two non-archived certificates. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.create( - * 'tunnel_id', - * { ca_certificate_pem: 'ca_certificate_pem' }, - * ); - * ``` - */ - create(tunnelID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/tunnels/${tunnelID}/certificates?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Fetches a tunnel certificate by ID. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.retrieve( - * 'certificate_id', - * { tunnel_id: 'tunnel_id' }, - * ); - * ``` - */ - retrieve(certificateID, params, options) { - const { tunnel_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/tunnels/${tunnel_id}/certificates/${certificateID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Lists the certificates registered on a tunnel. Archived certificates are - * excluded unless include_archived is set. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaTunnelCertificate of client.beta.tunnels.certificates.list( - * 'tunnel_id', - * )) { - * // ... - * } - * ``` - */ - list(tunnelID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/tunnels/${tunnelID}/certificates?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Archives a tunnel certificate, removing it from the set Anthropic trusts for the - * tunnel. The certificate record is retained. Archiving the last non-archived - * certificate is permitted; the tunnel rejects MCP traffic until a new certificate - * is added. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.archive( - * 'certificate_id', - * { tunnel_id: 'tunnel_id' }, - * ); - * ``` - */ - archive(certificateID, params, options) { - const { tunnel_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/tunnels/${tunnel_id}/certificates/${certificateID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs -var Tunnels; -var init_tunnels = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs"() { - init_resource2(); - init_certificates3(); - init_certificates3(); - init_pagination2(); - init_headers3(); - init_path2(); - Tunnels = /* @__PURE__ */ (() => { - class Tunnels2 extends APIResource2 { - constructor() { - super(...arguments); - this.certificates = new Certificates3(this._client); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; - * it is not idempotent. The new tunnel rejects MCP traffic until at least one CA - * certificate is added. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.create(); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/tunnels?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Fetches a tunnel by ID. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.retrieve( - * 'tunnel_id', - * ); - * ``` - */ - retrieve(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/tunnels/${tunnelID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Lists tunnels. Results are ordered by creation time, newest first; archived - * tunnels are excluded unless include_archived is set. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaTunnel of client.beta.tunnels.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/tunnels?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Archives a tunnel. Archival is irreversible: every non-archived certificate on - * the tunnel is archived in the same operation, the hostname is retired and never - * re-allocated, and the tunnel token is invalidated. Retrying against an - * already-archived tunnel returns the existing record unchanged. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.archive( - * 'tunnel_id', - * ); - * ``` - */ - archive(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/tunnels/${tunnelID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Reveals a tunnel's connector token. The value is fetched live on each call; - * Anthropic does not store it. Repeated calls return the same value until the - * token is rotated. Exposed as POST so the token does not appear in intermediary - * access logs. - * - * @example - * ```ts - * const betaTunnelToken = - * await client.beta.tunnels.revealToken('tunnel_id'); - * ``` - */ - revealToken(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/tunnels/${tunnelID}/reveal_token?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Rotates a tunnel's connector token. Rotation invalidates the current token for - * new connections and returns a fresh value; established connections are not - * severed. A connector restarted after rotation must use the new value. - * - * @example - * ```ts - * const betaTunnelToken = - * await client.beta.tunnels.rotateToken('tunnel_id'); - * ``` - */ - rotateToken(tunnelID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/tunnels/${tunnelID}/rotate_token?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Tunnels2.Certificates = Certificates3; - return Tunnels2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs -var Credentials2; -var init_credentials3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Credentials2 = class extends APIResource2 { - /** - * Create Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.create( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * { - * auth: { - * token: 'bearer_exampletoken', - * mcp_server_url: - * 'https://example-server.modelcontextprotocol.io/sse', - * type: 'static_bearer', - * }, - * }, - * ); - * ``` - */ - create(vaultID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vaultID}/credentials?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.retrieve( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - retrieve(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.update( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - update(credentialID, params, options) { - const { vault_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Credentials - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * )) { - * // ... - * } - * ``` - */ - list(vaultID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Credential - * - * @example - * ```ts - * const betaManagedAgentsDeletedCredential = - * await client.beta.vaults.credentials.delete( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - delete(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.archive( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - archive(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Validate Credential - * - * @example - * ```ts - * const betaManagedAgentsCredentialValidation = - * await client.beta.vaults.credentials.mcpOAuthValidate( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - mcpOAuthValidate(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs -var Vaults2; -var init_vaults2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs"() { - init_resource2(); - init_credentials3(); - init_credentials3(); - init_pagination2(); - init_headers3(); - init_path2(); - Vaults2 = /* @__PURE__ */ (() => { - class Vaults3 extends APIResource2 { - constructor() { - super(...arguments); - this.credentials = new Credentials2(this._client); - } - /** - * Create Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.create({ - * display_name: 'Example vault', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/vaults?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.retrieve( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - retrieve(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/vaults/${vaultID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.update( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - update(vaultID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vaultID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Vaults - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsVault of client.beta.vaults.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/vaults?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Vault - * - * @example - * ```ts - * const betaManagedAgentsDeletedVault = - * await client.beta.vaults.delete( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - delete(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/vaults/${vaultID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.archive( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - archive(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/vaults/${vaultID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Vaults3.Credentials = Credentials2; - return Vaults3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs -var Beta2; -var init_beta2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs"() { - init_resource2(); - init_deployment_runs(); - init_deployment_runs(); - init_deployments(); - init_deployments(); - init_dreams(); - init_dreams(); - init_files5(); - init_files5(); - init_models3(); - init_models3(); - init_user_profiles(); - init_user_profiles(); - init_webhooks2(); - init_webhooks2(); - init_agents2(); - init_agents2(); - init_environments2(); - init_environments2(); - init_memory_stores(); - init_memory_stores(); - init_messages3(); - init_messages3(); - init_organization2(); - init_organization2(); - init_sessions5(); - init_sessions5(); - init_skills2(); - init_skills2(); - init_tunnels(); - init_tunnels(); - init_vaults2(); - init_vaults2(); - Beta2 = /* @__PURE__ */ (() => { - class Beta3 extends APIResource2 { - constructor() { - super(...arguments); - this.models = new Models2(this._client); - this.messages = new Messages3(this._client); - this.agents = new Agents2(this._client); - this.environments = new Environments2(this._client); - this.sessions = new Sessions5(this._client); - this.deployments = new Deployments(this._client); - this.deploymentRuns = new DeploymentRuns(this._client); - this.vaults = new Vaults2(this._client); - this.memoryStores = new MemoryStores(this._client); - this.files = new Files5(this._client); - this.skills = new Skills2(this._client); - this.webhooks = new Webhooks2(this._client); - this.userProfiles = new UserProfiles(this._client); - this.dreams = new Dreams(this._client); - this.tunnels = new Tunnels(this._client); - this.organization = new Organization2(this._client); - } - } - Beta3.Models = Models2; - Beta3.Messages = Messages3; - Beta3.Agents = Agents2; - Beta3.Environments = Environments2; - Beta3.Sessions = Sessions5; - Beta3.Deployments = Deployments; - Beta3.DeploymentRuns = DeploymentRuns; - Beta3.Vaults = Vaults2; - Beta3.MemoryStores = MemoryStores; - Beta3.Files = Files5; - Beta3.Skills = Skills2; - Beta3.Webhooks = Webhooks2; - Beta3.UserProfiles = UserProfiles; - Beta3.Dreams = Dreams; - Beta3.Tunnels = Tunnels; - Beta3.Organization = Organization2; - return Beta3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/completions.mjs -var Completions3; -var init_completions4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/completions.mjs"() { - init_resource2(); - init_headers3(); - Completions3 = class extends APIResource2 { - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/complete", { - body, - timeout: this._client._options.timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: params.stream ?? false - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/files.mjs -var Files6; -var init_files6 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/files.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_stainless_helper_header(); - init_uploads4(); - init_path2(); - Files6 = class extends APIResource2 { - /** - * List Files - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const fileMetadata of client.files.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/files", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete File - * - * @example - * ```ts - * const deletedFile = await client.files.delete('file_id'); - * ``` - */ - delete(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Download File - * - * @example - * ```ts - * const response = await client.files.download('file_id'); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}/content`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - /** - * Get File Metadata - * - * @example - * ```ts - * const fileMetadata = await client.files.retrieveMetadata( - * 'file_id', - * ); - * ``` - */ - retrieveMetadata(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Upload File - * - * @example - * ```ts - * const fileMetadata = await client.files.upload({ - * file: fs.createReadStream('path/to/file'), - * }); - * ``` - */ - upload(params, options) { - const { workspace_id, ...body } = params; - return this._client.post("/v1/files", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - stainlessHelperHeaderFromFile(body.file), - options?.headers - ]) - }, this._client)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/parser.mjs -function getOutputFormat2(params) { - return params?.output_config?.format; -} -function maybeParseMessage(message, params, opts) { - const outputFormat = getOutputFormat2(params); - if (!params || !("parse" in (outputFormat ?? {}))) { - return { - ...message, - content: message.content.map((block) => { - if (block.type === "text") { - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: null, - enumerable: false - }); - return parsedBlock; - } - return block; - }), - parsed_output: null - }; - } - return parseMessage(message, params, opts); -} -function parseMessage(message, params, opts) { - let firstParsedOutput = null; - const content = message.content.map((block) => { - if (block.type === "text") { - const parsedOutput = parseOutputFormat(params, block.text); - if (firstParsedOutput === null) { - firstParsedOutput = parsedOutput; - } - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: parsedOutput, - enumerable: false - }); - return parsedBlock; - } - return block; - }); - return { - ...message, - content, - parsed_output: firstParsedOutput - }; -} -function parseOutputFormat(params, content) { - const outputFormat = getOutputFormat2(params); - if (outputFormat?.type !== "json_schema") { - return null; - } - try { - if ("parse" in outputFormat) { - return outputFormat.parse(content); - } - return JSON.parse(content); - } catch (error) { - throw new AnthropicError(`Failed to parse structured output: ${error}`); - } -} -var init_parser4 = __esm({ - "node_modules/@anthropic-ai/sdk/lib/parser.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs -function tracksToolInput2(content) { - return content.type === "tool_use" || content.type === "server_tool_use"; -} -var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_params, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_workspace_id, _MessageStream_logger, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage, MessageStream; -var init_MessageStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_errors2(); - init_values2(); - init_error4(); - init_streaming4(); - init_parser4(); - init_message_stream_utils(); - MessageStream = /* @__PURE__ */ (() => { - class MessageStream2 { - constructor(params, opts) { - _MessageStream_instances.add(this); - this.messages = []; - this.receivedMessages = []; - _MessageStream_currentMessageSnapshot.set(this, void 0); - _MessageStream_params.set(this, null); - this.controller = new AbortController(); - _MessageStream_connectedPromise.set(this, void 0); - _MessageStream_resolveConnectedPromise.set(this, () => { - }); - _MessageStream_rejectConnectedPromise.set(this, () => { - }); - _MessageStream_endPromise.set(this, void 0); - _MessageStream_resolveEndPromise.set(this, () => { - }); - _MessageStream_rejectEndPromise.set(this, () => { - }); - _MessageStream_listeners.set(this, {}); - _MessageStream_ended.set(this, false); - _MessageStream_errored.set(this, false); - _MessageStream_aborted.set(this, false); - _MessageStream_catchingPromiseCreated.set(this, false); - _MessageStream_response.set(this, void 0); - _MessageStream_request_id.set(this, void 0); - _MessageStream_workspace_id.set(this, void 0); - _MessageStream_logger.set(this, void 0); - _MessageStream_handleError.set(this, (error) => { - __classPrivateFieldSet2(this, _MessageStream_errored, true, "f"); - if (isAbortError2(error)) { - error = new APIUserAbortError2(); - } - if (error instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _MessageStream_aborted, true, "f"); - return this._emit("abort", error); - } - if (error instanceof AnthropicError) { - return this._emit("error", error); - } - if (error instanceof Error) { - const anthropicError = new AnthropicError(error.message); - anthropicError.cause = error; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError(String(error))); - }); - __classPrivateFieldSet2(this, _MessageStream_connectedPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_resolveConnectedPromise, resolve2, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectConnectedPromise, reject2, "f"); - }), "f"); - __classPrivateFieldSet2(this, _MessageStream_endPromise, new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_resolveEndPromise, resolve2, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectEndPromise, reject2, "f"); - }), "f"); - __classPrivateFieldGet2(this, _MessageStream_connectedPromise, "f").catch(() => { - }); - __classPrivateFieldGet2(this, _MessageStream_endPromise, "f").catch(() => { - }); - __classPrivateFieldSet2(this, _MessageStream_params, params, "f"); - __classPrivateFieldSet2(this, _MessageStream_logger, opts?.logger ?? console, "f"); - } - get response() { - return __classPrivateFieldGet2(this, _MessageStream_response, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _MessageStream_request_id, "f"); - } - get workspace_id() { - return __classPrivateFieldGet2(this, _MessageStream_workspace_id, "f"); - } - /** - * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, - * returned vie the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * This is the same as the `APIPromise.withResponse()` method. - * - * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` - * as no `Response` is available. - */ - async withResponse() { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - const response = await __classPrivateFieldGet2(this, _MessageStream_connectedPromise, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - /** - * Intended for use on the frontend, consuming a stream produced with - * `.toReadableStream()` on the backend. - * - * Note that messages sent to the model do not appear in `.on('message')` - * in this context. - */ - static fromReadableStream(stream4) { - const runner = new MessageStream2(null); - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options, { logger } = {}) { - const runner = new MessageStream2(params, { logger }); - for (const message of params.messages) { - runner._addMessageParam(message); - } - __classPrivateFieldSet2(runner, _MessageStream_params, { ...params, stream: true }, "f"); - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _MessageStream_handleError, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit2 = true) { - this.receivedMessages.push(message); - if (emit2) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_response, response, "f"); - __classPrivateFieldSet2(this, _MessageStream_request_id, response?.headers.get("request-id"), "f"); - __classPrivateFieldSet2(this, _MessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveConnectedPromise, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _MessageStream_ended, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _MessageStream_errored, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _MessageStream_aborted, "f"); - } - abort() { - this.controller.abort(); - } - /** - * Adds the listener function to the end of the listeners array for the event. - * No checks are made to see if the listener has already been added. Multiple calls passing - * the same combination of event and listener will result in the listener being added, and - * called, multiple times. - * @returns this MessageStream, so that calls can be chained - */ - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); - listeners.push({ listener }); - return this; - } - /** - * Removes the specified listener from the listener array for the event. - * off() will remove, at most, one instance of a listener from the listener array. If any single - * listener has been added multiple times to the listener array for the specified event, then - * off() must be called multiple times to remove each instance. - * @returns this MessageStream, so that calls can be chained - */ - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - /** - * Adds a one-time listener function for the event. The next time the event is triggered, - * this listener is removed and then invoked. - * @returns this MessageStream, so that calls can be chained - */ - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - /** - * This is similar to `.once()`, but returns a Promise that resolves the next time - * the event is triggered, instead of calling a listener callback. - * @returns a Promise that resolves the next time given event is triggered, - * or rejects if an error is emitted. (If you request the 'error' event, - * returns a promise that resolves with the error). - * - * Example: - * - * const message = await stream.emitted('message') // rejects if the stream errors - */ - emitted(event) { - return new Promise((resolve2, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - if (event !== "error") - this.once("error", reject2); - this.once(event, resolve2); - }); - } - async done() { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet2(this, _MessageStream_endPromise, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - } - /** - * @returns a promise that resolves with the the final assistant Message response, - * or rejects if an error occurred or the stream ended prematurely without producing a Message. - * If structured outputs were used, this will be a ParsedMessage with a `parsed_output` field. - */ - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); - } - /** - * @returns a promise that resolves with the the final assistant Message's text response, concatenated - * together if there are more than one text blocks. - * Rejects if an error occurred or the stream ended prematurely without producing a Message. - */ - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _MessageStream_ended, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _MessageStream_ended, true, "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveEndPromise, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - return; - } - if (event === "error") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - [(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_params = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_response = /* @__PURE__ */ new WeakMap(), _MessageStream_request_id = /* @__PURE__ */ new WeakMap(), _MessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _MessageStream_logger = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _MessageStream_getFinalText = function _MessageStream_getFinalText2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); - }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if (tracksToolInput2(content) && __classPrivateFieldGet2(this, _MessageStream_listeners, "f").inputJson?.length) { - this._emit("inputJson", event.delta.partial_json, content.input); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - default: - checkNever(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(maybeParseMessage(messageSnapshot, __classPrivateFieldGet2(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _MessageStream_logger, "f") }), true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _MessageStream_endRequest = function _MessageStream_endRequest2() { - if (this.ended) { - throw new AnthropicError(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - if (!snapshot) { - throw new AnthropicError(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); - return maybeParseMessage(snapshot, __classPrivateFieldGet2(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _MessageStream_logger, "f") }); - }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { - let snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.stop_details = event.delta.stop_details; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.delta.container != null) { - snapshot.container = event.delta.container; - } - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - if (event.usage.output_tokens_details != null) { - snapshot.usage.output_tokens_details = event.usage.output_tokens_details; - } - return snapshot; - case "content_block_start": - snapshot.content.push({ ...event.content_block }); - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - text: (snapshotContent.text || "") + event.delta.text - }; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - citations: [...snapshotContent.citations ?? [], event.delta.citation] - }; - } - break; - } - case "input_json_delta": { - if (snapshotContent && tracksToolInput2(snapshotContent)) { - const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; - snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - thinking: snapshotContent.thinking + event.delta.thinking - }; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - signature: event.delta.signature - }; - } - break; - } - default: - checkNever(event.delta); - } - return snapshot; - } - case "content_block_stop": { - const snapshotContent = snapshot.content.at(event.index); - if (snapshotContent && tracksToolInput2(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { - Object.defineProperty(snapshotContent, "input", { - value: snapshotContent.input, - enumerable: true, - configurable: true, - writable: true - }); - } - return snapshot; - } - } - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); - } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - } - return MessageStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs -var Batches3; -var init_batches3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_jsonl(); - init_error4(); - init_path2(); - Batches3 = class extends APIResource2 { - /** - * Send a batch of Message creation requests. - * - * The Message Batches API can be used to process multiple Messages API requests at - * once. Once a Message Batch is created, it begins processing immediately. Batches - * can take up to 24 hours to complete. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.create({ - * requests: [ - * { - * custom_id: 'my-custom-id-1', - * params: { - * max_tokens: 1024, - * messages: [ - * { content: 'Hello, world', role: 'user' }, - * ], - * model: 'claude-opus-5', - * }, - * }, - * ], - * }); - * ``` - */ - create(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/batches", { - body, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * This endpoint is idempotent and can be used to poll for Message Batch - * completion. To access the results of a Message Batch, make a request to the - * `results_url` field in the response. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.retrieve( - * 'message_batch_id', - * ); - * ``` - */ - retrieve(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/messages/batches/${messageBatchID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List all Message Batches within a Workspace. Most recently created batches are - * returned first. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const messageBatch of client.messages.batches.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/messages/batches", Page2, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete a Message Batch. - * - * Message Batches can only be deleted once they've finished processing. If you'd - * like to delete an in-progress batch, you must first cancel it. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const deletedMessageBatch = - * await client.messages.batches.delete('message_batch_id'); - * ``` - */ - delete(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/messages/batches/${messageBatchID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Batches may be canceled any time before processing ends. Once cancellation is - * initiated, the batch enters a `canceling` state, at which time the system may - * complete any in-progress, non-interruptible requests before finalizing - * cancellation. - * - * The number of canceled requests is specified in `request_counts`. To determine - * which requests were canceled, check the individual results within the batch. - * Note that cancellation may not result in any canceled requests if they were - * non-interruptible. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.cancel( - * 'message_batch_id', - * ); - * ``` - */ - cancel(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.post(path3`/v1/messages/batches/${messageBatchID}/cancel`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Streams the results of a Message Batch as a `.jsonl` file. - * - * Each line in the file is a JSON object containing the result of a single request - * in the Message Batch. Results are not guaranteed to be in the same order as - * requests. Use the `custom_id` field to match results to requests. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatchIndividualResponse = - * await client.messages.batches.results('message_batch_id'); - * ``` - */ - async results(messageBatchID, params = {}, options) { - const batch = await this.retrieve(messageBatchID, params, options); - if (!batch.results_url) { - throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - const { workspace_id } = params ?? {}; - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs -var Messages4, DEPRECATED_MODELS2, MODELS_TO_WARN_WITH_THINKING_ENABLED2; -var init_messages4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs"() { - init_resource2(); - init_headers3(); - init_stainless_helper_header(); - init_MessageStream(); - init_parser4(); - init_batches3(); - init_batches3(); - init_constants(); - Messages4 = /* @__PURE__ */ (() => { - class Messages5 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches3(this._client); - } - create(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - if (body.model in DEPRECATED_MODELS2) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS2[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - if (MODELS_TO_WARN_WITH_THINKING_ENABLED2.includes(body.model) && body.thinking && body.thinking.type === "enabled") { - console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); - } - let timeout = options?.timeout ?? this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); - return this._client.post("/v1/messages", { - body, - timeout: timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - helperHeader2, - options?.headers - ]), - stream: params.stream ?? false - }); - } - /** - * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and - * the response will be automatically parsed and available in the `parsed_output` property of the message. - * - * @example - * ```ts - * const message = await client.messages.parse({ - * model: 'claude-sonnet-4-5-20250929', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_config: { - * format: zodOutputFormat(z.object({ answer: z.number() })), - * }, - * }); - * - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - parse(params, options) { - return this.create(params, options).then((message) => parseMessage(message, params, { logger: this._client.logger ?? console })); - } - /** - * Create a Message stream. - * - * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`), - * the final message will include a `parsed_output` property with the parsed content. - * - * @example - * ```ts - * const stream = client.messages.stream({ - * model: 'claude-sonnet-4-5-20250929', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_config: { - * format: zodOutputFormat(z.object({ answer: z.number() })), - * }, - * }); - * - * const message = await stream.finalMessage(); - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - stream(body, options) { - return MessageStream.createMessage(this, body, options, { logger: this._client.logger ?? console }); - } - /** - * Count the number of tokens in a Message. - * - * The Token Count API can be used to count the number of tokens in a Message, - * including tools, images, and documents, without creating it. - * - * Learn more about token counting in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) - * - * @example - * ```ts - * const messageTokensCount = - * await client.messages.countTokens({ - * messages: [{ content: 'Hello, world', role: 'user' }], - * model: 'claude-opus-5', - * }); - * ``` - */ - countTokens(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/count_tokens", { - body, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Messages5.Batches = Batches3; - return Messages5; - })(); - DEPRECATED_MODELS2 = {}; - MODELS_TO_WARN_WITH_THINKING_ENABLED2 = ["claude-mythos-preview", "claude-opus-4-6"]; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/models.mjs -var Models3; -var init_models4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/models.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Models3 = class extends APIResource2 { - /** - * Get a specific model. - * - * The Models API response can be used to determine information about a specific - * model or resolve a model alias to a model ID. - * - * @example - * ```ts - * const modelInfo = await client.models.retrieve('model_id'); - * ``` - */ - retrieve(modelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/models/${modelID}`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List available models. - * - * The Models API response can be used to determine which models are available for - * use in the API. More recently released models are listed first. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const modelInfo of client.models.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs -var Versions4; -var init_versions4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Versions4 = class extends APIResource2 { - /** - * Create Skill Version - * - * @example - * ```ts - * const skillVersion = await client.skills.versions.create( - * 'skill_id', - * { files: [fs.createReadStream('path/to/file')] }, - * ); - * ``` - */ - create(skillID, params, options) { - const { workspace_id, ...body } = params; - return this._client.post(path3`/v1/skills/${skillID}/versions`, multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill Version - * - * @example - * ```ts - * const skillVersion = await client.skills.versions.retrieve( - * 'version', - * { skill_id: 'skill_id' }, - * ); - * ``` - */ - retrieve(version, params, options) { - const { skill_id, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List Skill Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const skillVersion of client.skills.versions.list( - * 'skill_id', - * )) { - * // ... - * } - * ``` - */ - list(skillID, params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/skills/${skillID}/versions`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete Skill Version - * - * @example - * ```ts - * const deletedSkillVersion = - * await client.skills.versions.delete('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - delete(version, params, options) { - const { skill_id, workspace_id } = params; - return this._client.delete(path3`/v1/skills/${skill_id}/versions/${version}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs -var Skills3; -var init_skills3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs"() { - init_resource2(); - init_versions4(); - init_versions4(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Skills3 = /* @__PURE__ */ (() => { - class Skills4 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions4(this._client); - } - /** - * Create Skill - * - * @example - * ```ts - * const skill = await client.skills.create({ - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(params, options) { - const { workspace_id, ...body } = params; - return this._client.post("/v1/skills", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill - * - * @example - * ```ts - * const skill = await client.skills.retrieve('skill_id'); - * ``` - */ - retrieve(skillID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/skills/${skillID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List Skills - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const skill of client.skills.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/skills", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete Skill - * - * @example - * ```ts - * const deletedSkill = await client.skills.delete('skill_id'); - * ``` - */ - delete(skillID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/skills/${skillID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - } - Skills4.Versions = Versions4; - return Skills4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/index.mjs -var init_resources3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/index.mjs"() { - init_shared2(); - init_beta2(); - init_completions4(); - init_files6(); - init_messages4(); - init_models4(); - init_skills3(); - } -}); - -// node_modules/@anthropic-ai/sdk/client.mjs -var _BaseAnthropic_instances, _a5, _BaseAnthropic_encoder, _BaseAnthropic_baseURLOverridden, HUMAN_PROMPT, AI_PROMPT, BaseAnthropic, Anthropic; -var init_client2 = __esm({ - "node_modules/@anthropic-ai/sdk/client.mjs"() { - init_tslib2(); - init_values2(); - init_sleep2(); - init_errors2(); - init_detect_platform2(); - init_request_signal(); - init_shims2(); - init_request_options2(); - init_query2(); - init_version3(); - init_error3(); - init_types(); - init_token_cache(); - init_credential_chain(); - init_middleware(); - init_pagination2(); - init_uploads5(); - init_resources3(); - init_api_promise2(); - init_completions4(); - init_files6(); - init_models4(); - init_beta2(); - init_messages4(); - init_skills3(); - init_detect_platform2(); - init_headers3(); - init_env2(); - init_log2(); - init_values2(); - HUMAN_PROMPT = "\\n\\nHuman:"; - AI_PROMPT = "\\n\\nAssistant:"; - BaseAnthropic = /* @__PURE__ */ (() => { - class BaseAnthropic2 { - /** - * The active credential provider. Default credential resolution runs once - * at construction time. If it fails, the error is surfaced on every - * request and the client must be reconstructed — there is no retry path. - * - * Clones returned by {@link withOptions} share the parent's auth state - * (provider, token cache, pending resolution, and any resolution error) - * unless the caller passes an explicit `apiKey`, `authToken`, - * `credentials`, `config`, or `profile` override. - */ - get credentials() { - return this._authState.provider; - } - /** - * API Client for interfacing with the Anthropic API. - * - * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null] - * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null] - * @param {string | null | undefined} [opts.webhookKey=process.env['ANTHROPIC_WEBHOOK_SIGNING_KEY'] ?? null] - * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API. - * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. - * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. - * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. - * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. - * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. - * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. - * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. - */ - constructor({ baseURL = readEnv2("ANTHROPIC_BASE_URL"), apiKey, authToken, webhookKey = readEnv2("ANTHROPIC_WEBHOOK_SIGNING_KEY") ?? null, ...opts } = {}) { - _BaseAnthropic_instances.add(this); - this._requestAuthFlags = /* @__PURE__ */ new WeakMap(); - _BaseAnthropic_encoder.set(this, void 0); - if (apiKey === void 0) { - apiKey = opts.profile != null ? null : readEnv2("ANTHROPIC_API_KEY") ?? null; - } - if (authToken === void 0) { - authToken = opts.profile != null ? null : readEnv2("ANTHROPIC_AUTH_TOKEN") ?? null; - } - if (opts.profile != null && (opts.credentials != null || opts.config != null)) { - throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`."); - } - const options = { - apiKey, - authToken, - webhookKey, - ...opts, - baseURL: baseURL || `https://api.anthropic.com` - }; - if (!options.dangerouslyAllowBrowser && isRunningInBrowser2()) { - throw new AnthropicError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n"); - } - this.baseURL = options.baseURL; - this._baseURLIsExplicit = opts.__baseURLIsExplicit ?? !!baseURL; - this.timeout = options.timeout ?? _a5.DEFAULT_TIMEOUT; - this.logger = options.logger ?? console; - this.logLevel = defaultLogLevel; - this.logLevel = parseLogLevel2(options.logLevel, "ClientOptions.logLevel", loggerFor2(this)) ?? parseLogLevel2(readEnv2("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", loggerFor2(this)) ?? defaultLogLevel; - this.fetchOptions = options.fetchOptions; - this.maxRetries = validatePositiveInteger2("maxRetries", options.maxRetries ?? 2); - this.fetch = options.fetch ?? getDefaultFetch2(); - __classPrivateFieldSet2(this, _BaseAnthropic_encoder, FallbackEncoder2, "f"); - this.middleware = [...options.middleware ?? []]; - const customHeadersEnv = readEnv2("ANTHROPIC_CUSTOM_HEADERS"); - if (customHeadersEnv) { - const parsed = {}; - for (const line of customHeadersEnv.split("\n")) { - const colon = line.indexOf(":"); - if (colon >= 0) { - parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); - } - } - options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; - } - const inherited = opts.__auth; - delete options.__auth; - delete options.__baseURLIsExplicit; - this._options = options; - this.apiKey = typeof apiKey === "string" ? apiKey : null; - this.authToken = authToken; - this.webhookKey = webhookKey; - if (inherited) { - this._authState = inherited; - if (!this._baseURLIsExplicit && inherited.baseURL) { - this.baseURL = inherited.baseURL; - } - } else { - this._authState = { provider: null, tokenCache: null, resolution: null, error: null, extraHeaders: {} }; - if (this.apiKey == null && this.authToken == null) { - const credentials = options.credentials ?? null; - if (credentials) { - this._authState.provider = credentials; - this._authState.tokenCache = this._makeTokenCache(credentials); - } else if (options.config != null) { - const result = resolveCredentialsFromConfig(options.config, this._credentialResolverOptions()); - this._authState.provider = result.provider; - this._authState.tokenCache = this._makeTokenCache(result.provider); - this._authState.extraHeaders = result.extraHeaders; - this._applyCredentialBaseURL(result.baseURL); - } else if (options.profile != null) { - this._authState.resolution = this._resolveDefaultCredentials(options.profile); - } else if (this._shouldResolveDefaultCredentials()) { - this._authState.resolution = this._resolveDefaultCredentials(); - } - } - } - } - /** - * Whether to lazily resolve auth from the default credential chain when no - * explicit auth is configured. Called once from the constructor, so - * overrides must not depend on subclass instance state. Subclasses that - * bring their own auth scheme return false so unrelated local credentials - * are never resolved or allowed to supply a base URL. - */ - _shouldResolveDefaultCredentials() { - return true; - } - /** - * Stores a profile/config-supplied base URL on the shared auth state and, if - * the caller did not pin `baseURL` via constructor option or env, adopts it - * as this client's outbound API host. Precedence: ctor opt > env > profile > - * hardcoded default. - */ - _applyCredentialBaseURL(baseURL) { - if (!baseURL) - return; - const normalized = baseURL.replace(/\/+$/, ""); - this._authState.baseURL = normalized; - if (!this._baseURLIsExplicit) { - this.baseURL = normalized; - } - } - /** - * Options bag passed into the credential chain. `baseURL` here is only the - * fallback host for the token-exchange POST when the config itself omits - * `base_url`; the chain returns the config's own `base_url` (if any) on - * {@link CredentialResult.baseURL}, which {@link _applyCredentialBaseURL} - * then adopts for outbound API requests. The two are deliberately decoupled - * so this fallback never round-trips into precedence. - */ - _credentialResolverOptions() { - return { - baseURL: this.baseURL, - fetch: this._credentialsFetch(), - userAgent: this.getUserAgent(), - onCacheWriteError: (err) => { - loggerFor2(this).debug("credential cache write failed (best-effort)", err); - }, - onSafetyWarning: (msg) => { - loggerFor2(this).warn(msg); - } - }; - } - /** - * A `Fetch` for first-party credential token-exchange requests (OIDC - * federation jwt-bearer grants, user-OAuth refresh grants) that routes - * through this client's middleware chain, so middleware observes token - * traffic like any other request. Only client-level middleware applies: - * a minted token is shared across requests, so attributing the exchange - * to any one request's per-request middleware would be arbitrary. For the - * same reason, `ctx.options` is undefined for these requests. - */ - _credentialsFetch() { - return wrapFetchWithMiddleware(this.fetch, this.middleware, void 0, this); - } - _makeTokenCache(provider2) { - return new TokenCache(provider2, (err) => { - loggerFor2(this).debug("advisory token refresh failed; serving cached token", err); - }); - } - /** - * Create a new client instance re-using the same options given to the - * current client with optional overriding. - */ - withOptions(options) { - const overridesStructuredAuth = "credentials" in options || "config" in options || "profile" in options; - const overridesAuth = "apiKey" in options || "authToken" in options || overridesStructuredAuth; - const internal = { - ...this._options, - // Only forward baseURL when the caller (or env) explicitly chose it. - // For a non-explicit parent, this.baseURL may have been mutated to the - // profile-resolved host; pinning that as the clone's options.baseURL - // would make _options on the clone misreport caller intent and would - // leave the clone stuck on the parent's host across an auth override. - // The clone instead receives the construction-time value via - // ...this._options above and re-adopts the profile host through the - // shared _authState.baseURL + __baseURLIsExplicit=false path. - ...this._baseURLIsExplicit ? { baseURL: this.baseURL } : {}, - maxRetries: this.maxRetries, - timeout: this.timeout, - logger: this.logger, - logLevel: this.logLevel, - fetch: this.fetch, - fetchOptions: this.fetchOptions, - middleware: this.middleware, - apiKey: this.apiKey, - authToken: this.authToken, - webhookKey: this.webhookKey, - // credentials: this.credentials is a no-op when __auth is shared (the - // ctor takes the inherited path and ignores options.credentials); when - // overridesAuth is true via apiKey/authToken only, it lets the clone - // build a fresh TokenCache around the parent's provider. - credentials: this.credentials, - // When the caller passes a structured-credential override, drop inherited - // structured-credential options so only `...options` supplies them — - // otherwise an inherited `credentials`/`config`/`profile` would trip the - // mutual-exclusion check or precedence over the override. - ...overridesStructuredAuth ? { credentials: void 0, config: void 0, profile: void 0 } : {}, - ...options, - // Always set __auth so any stale value from ...this._options is - // overwritten. undefined means "build fresh auth from these options". - __auth: overridesAuth ? void 0 : this._authState, - __baseURLIsExplicit: "baseURL" in options ? true : this._baseURLIsExplicit - }; - return new this.constructor(internal); - } - /** - * Lazily resolves credentials from config files or environment variables. - * Called once from the constructor when no explicit auth is provided, or - * when an explicit `profile` was passed (in which case a missing/unresolved - * profile is surfaced as an error instead of falling through to "no auth"). - * The returned promise is stored and awaited on the first request. - */ - async _resolveDefaultCredentials(profile) { - try { - const result = await defaultCredentials(this._credentialResolverOptions(), profile); - if (result) { - this._authState.provider = result.provider; - this._authState.tokenCache = this._makeTokenCache(result.provider); - this._authState.extraHeaders = result.extraHeaders; - this._applyCredentialBaseURL(result.baseURL); - } else if (profile != null) { - throw new AnthropicError(`Profile "${profile}" could not be resolved (no /configs/${profile}.json found).`); - } - } catch (err) { - this._authState.error = err; - } finally { - this._authState.resolution = null; - } - } - defaultQuery() { - return this._options.defaultQuery; - } - validateHeaders({ values, nulls }) { - if (values.get("x-api-key") || values.get("authorization")) { - return; - } - if (this._authState.error) { - throw this._authState.error; - } - if (this._authState.tokenCache || this._authState.resolution) { - return; - } - if (this.apiKey && values.get("x-api-key")) { - return; - } - if (nulls.has("x-api-key")) { - return; - } - if (this.authToken && values.get("authorization")) { - return; - } - if (nulls.has("authorization")) { - return; - } - throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); - } - _authFlags(opts) { - let flags = this._requestAuthFlags.get(opts); - if (!flags) { - flags = { usedTokenCache: false, didRefreshFor401: false }; - this._requestAuthFlags.set(opts, flags); - } - return flags; - } - async authHeaders(opts) { - if (this._authState.resolution) { - await this._authState.resolution; - } - if (this._authState.error) { - return void 0; - } - if (this._authState.tokenCache && this.apiKey == null) { - const token = await this._authState.tokenCache.getToken(); - this._authFlags(opts).usedTokenCache = true; - return buildHeaders2([{ Authorization: `Bearer ${token}` }]); - } - return buildHeaders2([await this.apiKeyAuth(opts), await this.bearerAuth(opts)]); - } - async apiKeyAuth(opts) { - if (this.apiKey == null) { - return void 0; - } - return buildHeaders2([{ "X-Api-Key": this.apiKey }]); - } - async bearerAuth(opts) { - if (this.authToken == null) { - return void 0; - } - return buildHeaders2([{ Authorization: `Bearer ${this.authToken}` }]); - } - stringifyQuery(query) { - return stringifyQuery2(query); - } - getUserAgent() { - return `Anthropic/JS ${VERSION2}`; - } - makeStatusError(status, error, message, headers) { - return APIError2.generate(status, error, message, headers); - } - buildURL(path5, query, defaultBaseURL) { - const baseURL = !__classPrivateFieldGet2(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; - const url = isAbsoluteURL2(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); - const defaultQuery = this.defaultQuery(); - const pathQuery = Object.fromEntries(url.searchParams); - if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) { - query = { ...pathQuery, ...defaultQuery, ...query }; - } - if (typeof query === "object" && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query); - } - return url.toString(); - } - _calculateNonstreamingTimeout(maxTokens) { - const defaultTimeout = 10 * 60; - const expectedTimeout = 60 * 60 * maxTokens / 128e3; - if (expectedTimeout > defaultTimeout) { - throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details"); - } - return defaultTimeout * 1e3; - } - /** - * Used as a callback for mutating the given `FinalRequestOptions` object. - */ - async prepareOptions(options) { - } - /** - * Used as a callback for mutating the given `RequestInit` object. - * - * This is useful for cases where you want to add certain headers based off of - * the request properties, e.g. `method` or `url`. - * - * Runs after all middleware (including {@link backendMiddleware}), - * immediately before each underlying fetch call, so it sees exactly what - * goes over the wire. Middleware may replay a request by calling `next()` - * more than once, so this hook can run multiple times per attempt: - * overrides must be idempotent and overwrite headers from a previous - * invocation rather than append to them. - */ - async prepareRequest(request2, { url, options }) { - if (this._authState.tokenCache && this.apiKey == null) { - const headers = request2.headers instanceof Headers ? request2.headers : new Headers(request2.headers); - for (const [k, v] of Object.entries(this._authState.extraHeaders)) { - if (!headers.has(k)) - headers.set(k, v); - } - const existing = headers.get("anthropic-beta")?.split(",").map((s) => s.trim()); - if (!existing?.includes(OAUTH_API_BETA_HEADER)) { - headers.set("anthropic-beta", [...existing ?? [], OAUTH_API_BETA_HEADER].join(",")); - } - request2.headers = headers; - } - } - /** - * Internal {@link Middleware} composed innermost in the chain — inside both - * client-level and per-request middleware, immediately around the underlying - * `fetch`. Subclasses for third-party backends override this to adapt the - * canonical Anthropic-shaped request to the backend's wire shape (URL/body - * rewriting, request signing) and to normalize the wire response back to the - * canonical shape (e.g. AWS EventStream to SSE). - * - * Running inside the user's middleware means user middleware always observes - * canonical Anthropic-shaped traffic, and the adaptation re-runs (e.g. - * re-signs) on every `next()` invocation, covering whatever the middleware - * mutated. - * - * Errors thrown here follow the middleware error policy: they propagate to - * the caller as-is — no retries, no `APIConnectionError` wrapping — unless - * retryable (see {@link Middleware}); throw a `RetryableError` to opt into - * the retry path. - */ - backendMiddleware() { - return []; - } - get(path5, opts) { - return this.methodRequest("get", path5, opts); - } - post(path5, opts) { - return this.methodRequest("post", path5, opts); - } - patch(path5, opts) { - return this.methodRequest("patch", path5, opts); - } - put(path5, opts) { - return this.methodRequest("put", path5, opts); - } - delete(path5, opts) { - return this.methodRequest("delete", path5, opts); - } - methodRequest(method2, path5, opts) { - return this.request(Promise.resolve(opts).then((opts2) => { - return { method: method2, path: path5, ...opts2 }; - })); - } - request(options, remainingRetries = null) { - return new APIPromise2(this, this.makeRequest(options, remainingRetries, void 0)); - } - async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) { - const options = await optionsInput; - let maxRetries = validatePositiveInteger2("maxRetries", options.maxRetries ?? this.maxRetries); - if (this.isStreamBody(options.body)) { - maxRetries = 0; - } - if (retriesRemaining == null) { - retriesRemaining = maxRetries; - this._requestAuthFlags.delete(options); - } - await this.prepareOptions(options); - const { req, url, timeout } = await this.buildRequest(options, { - retryCount: maxRetries - retriesRemaining - }); - const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); - const retryLogStr = retryOfRequestLogID === void 0 ? "" : `, retryOf: ${retryOfRequestLogID}`; - const startTime = Date.now(); - if (options.signal?.aborted) { - throw new APIUserAbortError2(); - } - const controller = new AbortController(); - const response = await this.fetchWithTimeout(url, req, timeout, controller, options, { - requestLogID, - retryOfRequestLogID - }).catch(castToError2); - const headersTime = Date.now(); - if (response instanceof globalThis.Error) { - releaseRequestSignal(controller); - const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; - if (options.signal?.aborted) { - throw new APIUserAbortError2(); - } - const isTimeout = isAbortError2(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); - const hasMiddleware = this.middleware.length > 0 || !!options.middleware?.length || this.backendMiddleware().length > 0; - if (hasMiddleware && !isTimeout && !isRetryableError(response)) { - loggerFor2(this).info(`[${requestLogID}] middleware error (not retryable)`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] middleware error (not retryable)`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - throw response; - } - if (retriesRemaining) { - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); - } - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - if (isTimeout) { - throw new APIConnectionTimeoutError2(); - } - if (hasMiddleware && !isFetchOriginError(response)) { - throw response; - } - throw new APIConnectionError2({ cause: response }); - } - const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "request-id" || name === "anthropic-workspace-id").map(([name, value2]) => ", " + name + ": " + JSON.stringify(value2)).join(""); - const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; - if (!response.ok) { - const shouldRetry = await this.shouldRetry(response, options); - if (retriesRemaining && shouldRetry) { - const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; - await CancelReadableStream2(response.body); - releaseRequestSignal(controller); - loggerFor2(this).info(`${responseInfo} - ${retryMessage2}`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response error (${retryMessage2})`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - durationMs: headersTime - startTime - }); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers); - } - const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; - loggerFor2(this).info(`${responseInfo} - ${retryMessage}`); - const errText = await response.text().catch((err2) => castToError2(err2).message); - const errJSON = safeJSON2(errText); - const errMessage = errJSON ? void 0 : errText; - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response error (${retryMessage})`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - message: errMessage, - durationMs: Date.now() - startTime - }); - releaseRequestSignal(controller); - const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); - throw err; - } - loggerFor2(this).info(responseInfo); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response start`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - durationMs: headersTime - startTime - }); - armAbandonmentBackstop(response.body ?? response, controller); - return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; - } - getAPIList(path5, Page3, opts) { - return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path5, ...opts2 })) : { method: "get", path: path5, ...opts }); - } - requestAPIList(Page3, options) { - const request2 = this.makeRequest(options, null, void 0); - return new PagePromise2(this, request2, Page3); - } - async fetchWithTimeout(url, init, ms, controller, requestOptions, logCtx) { - const { signal, method: method2, ...options } = init || {}; - const abort = this._makeAbort(controller); - if (signal) { - signal.addEventListener("abort", abort, { once: true }); - registerRequestSignalCleanup(controller, signal, abort); - } - const isReadableBody = globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream || typeof options.body === "object" && options.body !== null && Symbol.asyncIterator in options.body; - const fetchOptions = { - signal: controller.signal, - ...isReadableBody ? { duplex: "half" } : {}, - method: "GET", - ...options - }; - if (method2) { - fetchOptions.method = method2.toUpperCase(); - } - const baseFetch = this.fetch; - const timedFetch = async (innerUrl, innerInit) => { - const timeout = setTimeout(abort, ms); - try { - return await baseFetch.call(void 0, innerUrl, innerInit); - } finally { - clearTimeout(timeout); - } - }; - const innerFetch = requestOptions === void 0 ? timedFetch : (async (innerUrl, innerInit = {}) => { - const innerUrlStr = typeof innerUrl === "string" ? innerUrl : innerUrl instanceof URL ? innerUrl.href : innerUrl.url; - innerInit.headers = innerInit.headers instanceof Headers ? innerInit.headers : new Headers(innerInit.headers); - await this.prepareRequest(innerInit, { url: innerUrlStr, options: requestOptions }); - if (logCtx) { - debugLogRequestDetails(loggerFor2(this), `[${logCtx.requestLogID}] sending request`, { - retryOfRequestLogID: logCtx.retryOfRequestLogID, - method: innerInit.method, - url: innerUrlStr, - options: requestOptions, - headers: innerInit.headers - }); - } - return timedFetch(innerUrl, innerInit); - }); - const requestMiddleware = requestOptions?.middleware; - const backendMiddleware = this.backendMiddleware(); - const allMiddleware = requestMiddleware?.length || backendMiddleware.length ? [...this.middleware, ...requestMiddleware ?? [], ...backendMiddleware] : this.middleware; - return await wrapFetchWithMiddleware(innerFetch, allMiddleware, requestOptions, this)(url, fetchOptions); - } - async shouldRetry(response, options) { - const flags = this._authFlags(options); - if (response.status === 401 && this._authState.tokenCache && flags.usedTokenCache && !flags.didRefreshFor401) { - flags.didRefreshFor401 = true; - this._authState.tokenCache.invalidate(); - return true; - } - const shouldRetryHeader = response.headers.get("x-should-retry"); - if (shouldRetryHeader === "true") - return true; - if (shouldRetryHeader === "false") - return false; - if (response.status === 408) - return true; - if (response.status === 409) - return true; - if (response.status === 429) - return true; - if (response.status >= 500) - return true; - return false; - } - async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { - let timeoutMillis; - const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); - if (retryAfterMillisHeader) { - const timeoutMs = parseFloat(retryAfterMillisHeader); - if (!Number.isNaN(timeoutMs)) { - timeoutMillis = timeoutMs; - } - } - const retryAfterHeader = responseHeaders?.get("retry-after"); - if (retryAfterHeader && !timeoutMillis) { - const timeoutSeconds = parseFloat(retryAfterHeader); - if (!Number.isNaN(timeoutSeconds)) { - timeoutMillis = timeoutSeconds * 1e3; - } else { - timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); - } - } - if (timeoutMillis === void 0 || !(timeoutMillis > 0 && timeoutMillis <= 2 ** 31 - 1)) { - const maxRetries = options.maxRetries ?? this.maxRetries; - timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); - } - await sleep2(timeoutMillis, options.signal ?? void 0); - return this.makeRequest(options, retriesRemaining - 1, requestLogID); - } - calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { - const initialRetryDelay = 0.5; - const maxRetryDelay = 8; - const numRetries = maxRetries - retriesRemaining; - const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay); - const jitter2 = 1 - Math.random() * 0.25; - return sleepSeconds * jitter2 * 1e3; - } - calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) { - const maxTime = 60 * 60 * 1e3; - const defaultTime = 60 * 10 * 1e3; - const expectedTime = maxTime * maxTokens / 128e3; - if (expectedTime > defaultTime || maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens) { - throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details"); - } - return defaultTime; - } - async buildRequest(inputOptions, { retryCount = 0 } = {}) { - const options = { ...inputOptions }; - const { method: method2, path: path5, query, defaultBaseURL } = options; - if (this._authState.resolution) { - await this._authState.resolution; - } - if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) { - this.baseURL = this._authState.baseURL; - } - const url = this.buildURL(path5, query, defaultBaseURL); - if ("timeout" in options) - validatePositiveInteger2("timeout", options.timeout); - options.timeout = options.timeout ?? this.timeout; - const { bodyHeaders, body } = this.buildBody({ options }); - const reqHeaders = await this.buildHeaders({ - options: inputOptions, - method: method2, - bodyHeaders, - retryCount, - timeout: options.timeout - }); - const req = { - method: method2, - headers: reqHeaders, - ...options.signal && { signal: options.signal }, - ...globalThis.ReadableStream && body instanceof globalThis.ReadableStream && { duplex: "half" }, - ...body && { body }, - ...this.fetchOptions ?? {}, - ...options.fetchOptions ?? {} - }; - return { req, url, timeout: options.timeout }; - } - async buildHeaders({ options, method: method2, bodyHeaders, retryCount, timeout }) { - const headers = buildHeaders2([ - { - Accept: "application/json", - "User-Agent": this.getUserAgent(), - "X-Stainless-Retry-Count": String(retryCount), - "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)), - ...getPlatformHeaders2(), - ...this._options.dangerouslyAllowBrowser ? { "anthropic-dangerous-direct-browser-access": "true" } : void 0, - "anthropic-version": "2023-06-01" - }, - await this.authHeaders(options), - this._options.defaultHeaders, - bodyHeaders, - options.headers - ]); - this.validateHeaders(headers); - return headers.values; - } - _makeAbort(controller) { - return () => controller.abort(); - } - buildBody({ options: { body, headers: rawHeaders } }) { - if (!body) { - return { bodyHeaders: void 0, body: void 0 }; - } - const headers = buildHeaders2([rawHeaders]); - if ( - // Pass raw type verbatim - ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && // Preserve legacy string encoding behavior for now - headers.values.has("content-type") || // `Blob` is superset of `File` - globalThis.Blob && body instanceof globalThis.Blob || // `FormData` -> `multipart/form-data` - body instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` - body instanceof URLSearchParams || // Send chunked stream (each chunk has own `length`) - globalThis.ReadableStream && body instanceof globalThis.ReadableStream - ) { - return { bodyHeaders: void 0, body }; - } else if (this.isStreamBody(body)) { - return { bodyHeaders: void 0, body: ReadableStreamFrom2(body) }; - } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { - return { - bodyHeaders: { "content-type": "application/x-www-form-urlencoded" }, - body: this.stringifyQuery(body) - }; - } else { - return __classPrivateFieldGet2(this, _BaseAnthropic_encoder, "f").call(this, { body, headers }); - } - } - /** - * Whether `body` is sent as a stream, which can be read only once: - * a `ReadableStream`, an async iterable or an iterator. - */ - isStreamBody(body) { - if (globalThis.ReadableStream && body instanceof globalThis.ReadableStream) { - return true; - } - return typeof body === "object" && body !== null && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function"); - } - } - _a5 = BaseAnthropic2, _BaseAnthropic_encoder = /* @__PURE__ */ new WeakMap(), _BaseAnthropic_instances = /* @__PURE__ */ new WeakSet(), _BaseAnthropic_baseURLOverridden = function _BaseAnthropic_baseURLOverridden2() { - return this.baseURL !== "https://api.anthropic.com"; - }; - BaseAnthropic2.Anthropic = _a5; - BaseAnthropic2.DEFAULT_TIMEOUT = 6e5; - BaseAnthropic2.AnthropicError = AnthropicError; - BaseAnthropic2.APIError = APIError2; - BaseAnthropic2.APIConnectionError = APIConnectionError2; - BaseAnthropic2.APIConnectionTimeoutError = APIConnectionTimeoutError2; - BaseAnthropic2.APIUserAbortError = APIUserAbortError2; - BaseAnthropic2.NotFoundError = NotFoundError2; - BaseAnthropic2.ConflictError = ConflictError2; - BaseAnthropic2.RateLimitError = RateLimitError2; - BaseAnthropic2.BadRequestError = BadRequestError2; - BaseAnthropic2.AuthenticationError = AuthenticationError2; - BaseAnthropic2.InternalServerError = InternalServerError2; - BaseAnthropic2.PermissionDeniedError = PermissionDeniedError2; - BaseAnthropic2.UnprocessableEntityError = UnprocessableEntityError2; - BaseAnthropic2.toFile = toFile2; - BaseAnthropic2.HUMAN_PROMPT = HUMAN_PROMPT; - BaseAnthropic2.AI_PROMPT = AI_PROMPT; - return BaseAnthropic2; - })(); - Anthropic = /* @__PURE__ */ (() => { - class Anthropic2 extends BaseAnthropic { - constructor() { - super(...arguments); - this.completions = new Completions3(this); - this.messages = new Messages4(this); - this.models = new Models3(this); - this.files = new Files6(this); - this.skills = new Skills3(this); - this.beta = new Beta2(this); - } - } - Anthropic2.Completions = Completions3; - Anthropic2.Messages = Messages4; - Anthropic2.Models = Models3; - Anthropic2.Files = Files6; - Anthropic2.Skills = Skills3; - Anthropic2.Beta = Beta2; - return Anthropic2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/index.mjs -var init_sdk = __esm({ - "node_modules/@anthropic-ai/sdk/index.mjs"() { - init_client2(); - } -}); - -// node_modules/@earendil-works/pi-ai/dist/env-api-keys.js -var __rewriteRelativeImportExtension3, _existsSync, _homedir, _join, dynamicImport, NODE_FS_SPECIFIER, NODE_OS_SPECIFIER, NODE_PATH_SPECIFIER, ANTHROPIC_AUTH_TOKEN_ENV, ANTHROPIC_OAUTH_TOKEN_ENV, ANTHROPIC_API_KEY_ENV, ANTHROPIC_FEDERATION_RULE_ID_ENV, ANTHROPIC_ORGANIZATION_ID_ENV, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, ANTHROPIC_WORKSPACE_ID_ENV; -var init_env_api_keys = __esm({ - "node_modules/@earendil-works/pi-ai/dist/env-api-keys.js"() { - __rewriteRelativeImportExtension3 = function(path5, preserveJsx) { - if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { - return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return path5; - }; - _existsSync = null; - _homedir = null; - _join = null; - dynamicImport = (specifier) => import(__rewriteRelativeImportExtension3(specifier)); - NODE_FS_SPECIFIER = "node:fs"; - NODE_OS_SPECIFIER = "node:os"; - NODE_PATH_SPECIFIER = "node:path"; - if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) { - dynamicImport(NODE_FS_SPECIFIER).then((m) => { - _existsSync = m.existsSync; - }); - dynamicImport(NODE_OS_SPECIFIER).then((m) => { - _homedir = m.homedir; - }); - dynamicImport(NODE_PATH_SPECIFIER).then((m) => { - _join = m.join; - }); - } - ANTHROPIC_AUTH_TOKEN_ENV = "ANTHROPIC_AUTH_TOKEN"; - ANTHROPIC_OAUTH_TOKEN_ENV = "ANTHROPIC_OAUTH_TOKEN"; - ANTHROPIC_API_KEY_ENV = "ANTHROPIC_API_KEY"; - ANTHROPIC_FEDERATION_RULE_ID_ENV = "ANTHROPIC_FEDERATION_RULE_ID"; - ANTHROPIC_ORGANIZATION_ID_ENV = "ANTHROPIC_ORGANIZATION_ID"; - ANTHROPIC_SERVICE_ACCOUNT_ID_ENV = "ANTHROPIC_SERVICE_ACCOUNT_ID"; - ANTHROPIC_IDENTITY_TOKEN_FILE_ENV = "ANTHROPIC_IDENTITY_TOKEN_FILE"; - ANTHROPIC_WORKSPACE_ID_ENV = "ANTHROPIC_WORKSPACE_ID"; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js -function isValidCost(value2) { - return typeof value2 === "number" && Number.isFinite(value2) && value2 >= 0; -} -function isOpenRouterModel(model2) { - return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); -} -function applyOpenRouterReportedCost(usage, reported) { - if (!isValidCost(reported.cost)) - return; - if (reported.is_byok === false) { - usage.cost.total = reported.cost; - usage.cost.totalFromProvider = true; - return; - } - if (reported.is_byok === true) { - const details = reported.cost_details; - if (!details) - return; - let upstreamCost = details.upstream_inference_cost; - if (upstreamCost === null) { - if (!isValidCost(details.upstream_inference_prompt_cost) || !isValidCost(details.upstream_inference_completions_cost)) { - return; - } - upstreamCost = details.upstream_inference_prompt_cost + details.upstream_inference_completions_cost; - } - if (!isValidCost(upstreamCost)) - return; - usage.cost.total = reported.cost + upstreamCost; - usage.cost.totalFromProvider = true; - } -} -var init_openrouter_cost = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js"() { - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js -var anthropic_messages_exports = {}; -__export(anthropic_messages_exports, { - stream: () => stream3, - streamSimple: () => streamSimple2 -}); -function resolveCacheRetention2(cacheRetention, env) { - if (cacheRetention) { - return cacheRetention; - } - if (getProviderEnvValue("PI_CACHE_RETENTION", env) === "long") { - return "long"; - } - return "short"; -} -function getCacheControl(model2, cacheRetention, env) { - const retention = resolveCacheRetention2(cacheRetention, env); - if (retention === "none") { - return { retention }; - } - const ttl = retention === "long" && getAnthropicCompat(model2).supportsLongCacheRetention ? "1h" : void 0; - return { - retention, - cacheControl: { type: "ephemeral", ...ttl && { ttl } } - }; -} -function convertImageBlock(image) { - return { - type: "image", - source: { - type: "base64", - media_type: image.mimeType, - data: image.data - } - }; -} -function convertContentBlocks(content) { - const hasImages = content.some((c) => c.type === "image"); - if (!hasImages) { - return sanitizeSurrogates(content.map((c) => c.text).join("\n")); - } - const blocks = content.map((block) => { - if (block.type === "text") { - return { - type: "text", - text: sanitizeSurrogates(block.text) - }; - } - return convertImageBlock(block); - }); - const hasText = blocks.some((b) => b.type === "text"); - if (!hasText) { - blocks.unshift({ - type: "text", - text: "(see attached image)" - }); - } - return blocks; -} -function shouldUseServerSideFallbackBeta(model2) { - return (model2.compat?.allowedFallbackModels?.length ?? 0) > 0; -} -function getAnthropicCompat(model2) { - const isOpenRouter2 = model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); - return { - supportsEagerToolInputStreaming: model2.compat?.supportsEagerToolInputStreaming ?? true, - supportsLongCacheRetention: model2.compat?.supportsLongCacheRetention ?? true, - sendSessionAffinityHeaders: model2.compat?.sendSessionAffinityHeaders ?? isOpenRouter2, - sessionAffinityFormat: model2.compat?.sessionAffinityFormat ?? (isOpenRouter2 ? "openrouter" : void 0), - supportsCacheControlOnTools: model2.compat?.supportsCacheControlOnTools ?? true, - supportsTemperature: model2.compat?.supportsTemperature ?? true, - allowEmptySignature: model2.compat?.allowEmptySignature ?? false, - supportsStrictTools: model2.compat?.supportsStrictTools ?? false, - supportsMidConvoSystemMessages: model2.compat?.supportsMidConvoSystemMessages ?? false, - supportsMidConvoToolChanges: model2.compat?.supportsMidConvoToolChanges ?? false - }; -} -function mergeHeaders2(...headerSources) { - const merged = {}; - for (const headers of headerSources) { - if (headers) { - Object.assign(merged, headers); - } - } - return merged; -} -function hasHeader2(headers, name) { +// node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +var openai_completions_exports = {}; +__export(openai_completions_exports, { + convertMessages: () => convertMessages2, + stream: () => stream4, + streamSimple: () => streamSimple3 +}); +function hasHeader3(headers, name) { if (!headers) return false; const expected = name.toLowerCase(); @@ -40178,650 +41007,789 @@ function hasHeader2(headers, name) { } return false; } -function hasRequestAuth(apiKey, headers) { - return !!apiKey || hasHeader2(headers, "authorization") || hasHeader2(headers, "x-api-key") || hasHeader2(headers, "cf-aig-authorization"); +function getClientApiKey2(provider2, apiKey, headers) { + if (apiKey) + return apiKey; + if (hasHeader3(headers, "authorization") || hasHeader3(headers, "cf-aig-authorization")) + return "unused"; + throw new Error(`No API key for provider: ${provider2}`); } -function assertRequestAuth(provider2, apiKey, headers) { - if (!hasRequestAuth(apiKey, headers)) - throw new Error(`No API key for provider: ${provider2}`); -} -function getAnthropicFederation(model2, apiKey, headers, env) { - if (model2.provider !== "anthropic" || hasRequestAuth(apiKey, headers)) - return void 0; - const federationRuleId = getProviderEnvValue(ANTHROPIC_FEDERATION_RULE_ID_ENV, env); - const organizationId = getProviderEnvValue(ANTHROPIC_ORGANIZATION_ID_ENV, env); - const identityTokenFile = getProviderEnvValue(ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, env); - if (!federationRuleId || !organizationId || !identityTokenFile) - return void 0; - return { - organization_id: organizationId, - workspace_id: getProviderEnvValue(ANTHROPIC_WORKSPACE_ID_ENV, env), - authentication: { - type: "oidc_federation", - federation_rule_id: federationRuleId, - service_account_id: getProviderEnvValue(ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, env), - identity_token: { source: "file", path: identityTokenFile } +function hasToolHistory(messages) { + for (const msg of messages) { + if (msg.role === "toolResult") { + return true; } - }; -} -function flushSseEvent(state2) { - if (!state2.event && state2.data.length === 0) { - return null; - } - const event = { - event: state2.event, - data: state2.data.join("\n"), - raw: [...state2.raw] - }; - state2.event = null; - state2.data = []; - state2.raw = []; - return event; -} -function decodeSseLine(line, state2) { - if (line === "") { - return flushSseEvent(state2); - } - state2.raw.push(line); - if (line.startsWith(":")) { - return null; - } - const delimiterIndex = line.indexOf(":"); - const fieldName = delimiterIndex === -1 ? line : line.slice(0, delimiterIndex); - let value2 = delimiterIndex === -1 ? "" : line.slice(delimiterIndex + 1); - if (value2.startsWith(" ")) { - value2 = value2.slice(1); - } - if (fieldName === "event") { - state2.event = value2; - } else if (fieldName === "data") { - state2.data.push(value2); - } - return null; -} -function nextLineBreakIndex(text2) { - const carriageReturnIndex = text2.indexOf("\r"); - const newlineIndex = text2.indexOf("\n"); - if (carriageReturnIndex === -1) { - return newlineIndex; - } - if (newlineIndex === -1) { - return carriageReturnIndex; - } - return Math.min(carriageReturnIndex, newlineIndex); -} -function consumeLine(text2) { - const lineBreakIndex = nextLineBreakIndex(text2); - if (lineBreakIndex === -1) { - return null; - } - let nextIndex = lineBreakIndex + 1; - if (text2[lineBreakIndex] === "\r" && text2[nextIndex] === "\n") { - nextIndex += 1; - } - return { - line: text2.slice(0, lineBreakIndex), - rest: text2.slice(nextIndex) - }; -} -async function* iterateSseMessages(body, signal) { - const reader = body.getReader(); - const decoder5 = new TextDecoder(); - const state2 = { event: null, data: [], raw: [] }; - let buffer = ""; - try { - while (true) { - if (signal?.aborted) { - throw new Error("Request was aborted"); - } - const { value: value2, done } = await reader.read(); - if (done) { - break; - } - buffer += decoder5.decode(value2, { stream: true }); - let consumed2 = consumeLine(buffer); - while (consumed2) { - buffer = consumed2.rest; - const event = decodeSseLine(consumed2.line, state2); - if (event) { - yield event; - } - consumed2 = consumeLine(buffer); + if (msg.role === "assistant") { + if (msg.content.some((block) => block.type === "toolCall")) { + return true; } } - buffer += decoder5.decode(); - let consumed = consumeLine(buffer); - while (consumed) { - buffer = consumed.rest; - const event = decodeSseLine(consumed.line, state2); - if (event) { - yield event; - } - consumed = consumeLine(buffer); - } - if (buffer.length > 0) { - const event = decodeSseLine(buffer, state2); - if (event) { - yield event; - } - } - const trailingEvent = flushSseEvent(state2); - if (trailingEvent) { - yield trailingEvent; - } - } finally { - reader.releaseLock(); } + return false; } -async function* iterateAnthropicEvents(response, signal) { - if (!response.body) { - throw new Error("Attempted to iterate over an Anthropic response with no body"); - } - let sawMessageStart = false; - let sawMessageEnd = false; - for await (const sse of iterateSseMessages(response.body, signal)) { - if (sse.event === "error") { - throw new Error(sse.data); - } - if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) { - continue; - } - try { - const event = parseJsonWithRepair(sse.data); - if (event.type === "message_start") { - sawMessageStart = true; - } else if (event.type === "message_stop") { - sawMessageEnd = true; - } - yield event; - } catch (error) { - const message = error instanceof Error ? error.message : String(error); - throw new Error(`Could not parse Anthropic SSE event ${sse.event}: ${message}; data=${sse.data}; raw=${sse.raw.join("\\n")}`); - } - } - if (sawMessageStart && !sawMessageEnd) { - throw new Error("Anthropic stream ended before message_stop"); - } +function isTextContentBlock(block) { + return block.type === "text"; } -function mapThinkingLevelToEffort(model2, level) { - const mapped = level ? model2.thinkingLevelMap?.[level] : void 0; - if (typeof mapped === "string") - return mapped; - switch (level) { - case "minimal": - case "low": - return "low"; - case "medium": - return "medium"; - case "high": - return "high"; +function isThinkingContentBlock(block) { + return block.type === "thinking"; +} +function isToolCallBlock(block) { + return block.type === "toolCall"; +} +function isImageContentBlock(block) { + return block.type === "image"; +} +function isReasoningDetailObject(detail) { + return typeof detail === "object" && detail !== null && !Array.isArray(detail); +} +function hasValidCommonReasoningDetailFields(candidate) { + return (candidate.id === void 0 || candidate.id === null || typeof candidate.id === "string") && (candidate.format === void 0 || typeof candidate.format === "string") && (candidate.index === void 0 || typeof candidate.index === "number"); +} +function isOpenAIReasoningDetail(detail) { + if (!isReasoningDetailObject(detail) || !hasValidCommonReasoningDetailFields(detail)) { + return false; + } + switch (detail.type) { + case "reasoning.summary": + return typeof detail.summary === "string"; + case "reasoning.encrypted": + return typeof detail.data === "string"; + case "reasoning.text": + return typeof detail.text === "string" && (detail.signature === void 0 || detail.signature === null || typeof detail.signature === "string"); default: - return "high"; + return false; } } -function isOAuthToken(apiKey) { - return apiKey.includes("sk-ant-oat"); +function parseOpenAIReasoningDetails(signature) { + if (!signature) + return void 0; + try { + const parsed = JSON.parse(signature); + return Array.isArray(parsed) && parsed.length > 0 && parsed.every(isOpenAIReasoningDetail) ? parsed : void 0; + } catch { + return void 0; + } } -function createClient2(model2, apiKey, optionsHeaders, fetch2, dynamicHeaders, sessionId, federation, identity) { +function parseLegacyEncryptedReasoningDetail(signature) { + if (!signature) + return void 0; + try { + const parsed = JSON.parse(signature); + return isOpenAIReasoningDetail(parsed) && parsed.type === "reasoning.encrypted" && typeof parsed.id === "string" && parsed.id.length > 0 && parsed.data.length > 0 ? parsed : void 0; + } catch { + return void 0; + } +} +function fillMissingCommonReasoningDetailFields(target, source) { + target.id ??= source.id; + target.format ||= source.format; + target.index ??= source.index; +} +function appendOpenAIReasoningDetail(details, detail) { + const lastDetail = details[details.length - 1]; + if (detail.type === "reasoning.text" && lastDetail?.type === "reasoning.text") { + lastDetail.text += detail.text; + lastDetail.signature ||= detail.signature; + fillMissingCommonReasoningDetailFields(lastDetail, detail); + return; + } + if (detail.type === "reasoning.summary" && lastDetail?.type === "reasoning.summary") { + lastDetail.summary += detail.summary; + fillMissingCommonReasoningDetailFields(lastDetail, detail); + return; + } + details.push({ ...detail }); +} +function isOpenAICompletionsReasoningField(field) { + return OPENAI_COMPLETIONS_REASONING_FIELDS.includes(field); +} +function resolveCacheRetention3(cacheRetention, env) { + if (cacheRetention) { + return cacheRetention; + } + if (getProviderEnvValue("PI_CACHE_RETENTION", env) === "long") { + return "long"; + } + return "short"; +} +function createClient3(model2, context, apiKey, optionsHeaders, identity, fetch2, sessionId, compat = getCompat2(model2)) { + const headers = { ...getIdentityHeaders(model2, identity), ...model2.headers }; if (model2.provider === "github-copilot") { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: apiKey ?? null, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2, - defaultHeaders: mergeHeaders2(getIdentityHeaders(model2, identity), { - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true" - }, model2.headers, dynamicHeaders, optionsHeaders) + const hasImages = hasCopilotVisionInput(context.messages); + const copilotHeaders = buildCopilotDynamicHeaders({ + messages: context.messages, + hasImages }); - return { client: client2, isOAuthToken: false }; + Object.assign(headers, copilotHeaders); } - if (apiKey && isOAuthToken(apiKey)) { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: apiKey, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2, - defaultHeaders: mergeHeaders2({ - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true", - "user-agent": `claude-cli/${claudeCodeVersion}`, - "x-app": "cli" - }, model2.headers, optionsHeaders) - }); - return { client: client2, isOAuthToken: true }; - } - const compat = getAnthropicCompat(model2); - const sessionAffinityHeaders = {}; if (sessionId && compat.sendSessionAffinityHeaders) { - const header = compat.sessionAffinityFormat === "openrouter" ? "x-session-id" : "x-session-affinity"; - sessionAffinityHeaders[header] = sessionId; - } - const defaultHeaders = mergeHeaders2(getIdentityHeaders(model2, identity), { - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true" - }, sessionAffinityHeaders, model2.headers, optionsHeaders); - if (federation) { - const key = JSON.stringify([model2.baseUrl, federation]); - if (federationClient?.key !== key || federationClient.fetch !== fetch2) { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: null, - config: federation, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2 - }); - federationClient = { key, fetch: fetch2, client: client2 }; + if (compat.sessionAffinityFormat === "openrouter") { + headers["x-session-id"] = sessionId; + } else { + if (compat.sessionAffinityFormat === "openai") { + headers.session_id = sessionId; + } + headers["x-client-request-id"] = sessionId; + headers["x-session-affinity"] = sessionId; } - return { client: federationClient.client.withOptions({ defaultHeaders }), isOAuthToken: false }; } - const client = new PiAnthropic({ - apiKey: apiKey ?? null, - authToken: null, + if (optionsHeaders) { + Object.assign(headers, optionsHeaders); + } + return new OpenAI({ + apiKey, baseURL: model2.baseUrl, dangerouslyAllowBrowser: true, fetch: fetch2, - defaultHeaders + defaultHeaders: headers }); - return { client, isOAuthToken: false }; } -function getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options) { - let configuredFeatures; - for (const headers of [model2.headers, options?.headers]) { - for (const [name, value2] of Object.entries(headers ?? {})) { - if (name.toLowerCase() === "anthropic-beta") - configuredFeatures = value2; - } - } - if (configuredFeatures === null) - return []; - if (configuredFeatures !== void 0) { - return [ - ...new Set(configuredFeatures.split(",").map((feature) => feature.trim()).filter((feature) => feature.length > 0)) - ]; - } - const features = []; - if (isOAuthToken2) - features.push("claude-code-20250219", "oauth-2025-04-20"); - if (shouldUseFineGrainedToolStreamingBeta(model2, context)) - features.push(FINE_GRAINED_TOOL_STREAMING_BETA); - if (model2.reasoning && options?.thinkingEnabled === true && (options.interleavedThinking ?? true) && model2.compat?.forceAdaptiveThinking !== true) { - features.push(INTERLEAVED_THINKING_BETA); - } - if (shouldUseServerSideFallbackBeta(model2)) - features.push(SERVER_SIDE_FALLBACK_BETA); - if (model2.compat?.supportsMidConvoEffort === true) { - features.push(MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA); - } - if (nativeToolChanges) - features.push(INLINE_TOOLS_BETA); - return [...new Set(features)]; -} -function buildParams2(model2, context, isOAuthToken2, options, disablePreferredStrictTools = false) { - const { cacheControl } = getCacheControl(model2, options?.cacheRetention, options?.env); - const compat = getAnthropicCompat(model2); - const initialSystemMessage = getInitialSystemMessage(context.messages); - const initialSystemText = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : ""; - const transformedMessages = transformMessages(context.messages, model2, normalizeToolCallId); - const conversationMessages = initialSystemMessage ? transformedMessages.slice(1) : transformedMessages; - let hasPreferredStrictTools = false; - const convertToolDefinitions = (tools, toolCacheControl2) => { - const definitions = convertTools(tools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl2, disablePreferredStrictTools); - if (definitions.some((definition, index) => definition.strict === true && prefersJsonSchemaStrictSampling(tools[index]))) { - hasPreferredStrictTools = true; - } - return definitions; - }; - const initialTools = initialSystemMessage?.toolsAdded ?? []; - const nativeToolChanges = compat.supportsMidConvoSystemMessages && compat.supportsMidConvoToolChanges && initialTools.length > 0; - const thinkingDisabled = model2.reasoning && options?.thinkingEnabled === false && model2.thinkingLevelMap?.off !== null; - const effortMessages = model2.compat?.supportsMidConvoEffort === true && !thinkingDisabled; - const converted = convertMessages(conversationMessages, isOAuthToken2, cacheControl, compat.allowEmptySignature, effortMessages ? model2.provider : void 0, nativeToolChanges ? convertToolDefinitions : void 0); - const activeEffort = options?.effort ?? "high"; - const betaFeatures = getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options); +function buildParams3(model2, context, options, compat = getCompat2(model2), cacheRetention = resolveCacheRetention3(options?.cacheRetention, options?.env), grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(context.messages), compat.supportsOpenAIGrammarTools)) { + const transcriptTools = resolveTranscriptTools(context.messages, compat.supportsMidConvoSystemMessages === true && compat.supportsMidConvoToolAdditions === true ? "additions" : "none"); + const messages = convertMessages2(model2, context, compat, { + grammarToolInputProperties + }); + const cacheControl = getCompatCacheControl(compat, cacheRetention); const params = { model: model2.id, - messages: effortMessages ? insertThinkingLevelMessages(converted, activeEffort) : converted.messages, - max_tokens: options?.maxTokens ?? model2.maxTokens, + messages, stream: true, - ...betaFeatures.length > 0 ? { betas: betaFeatures } : {} + prompt_cache_key: model2.baseUrl.includes("api.openai.com") && cacheRetention !== "none" || cacheRetention === "long" && compat.supportsLongCacheRetention ? clampOpenAIPromptCacheKey(options?.sessionId) : void 0, + prompt_cache_retention: cacheRetention === "long" && compat.supportsLongCacheRetention ? "24h" : void 0 }; - if (isOAuthToken2) { - params.system = [ - { - type: "text", - text: "You are Claude Code, Anthropic's official CLI for Claude.", - ...cacheControl ? { cache_control: cacheControl } : {} - } - ]; - if (initialSystemText) { - params.system.push({ - type: "text", - text: sanitizeSurrogates(initialSystemText), - ...cacheControl ? { cache_control: cacheControl } : {} - }); - } - } else if (initialSystemText) { - params.system = [ - { - type: "text", - text: sanitizeSurrogates(initialSystemText), - ...cacheControl ? { cache_control: cacheControl } : {} - } - ]; + if (compat.supportsUsageInStreaming !== false) { + params.stream_options = { include_usage: true }; } - if (options?.temperature !== void 0 && !options?.thinkingEnabled && model2.compat?.supportsMidConvoEffort !== true && compat.supportsTemperature) { + if (compat.supportsStore) { + params.store = false; + } + if (options?.maxTokens) { + if (compat.maxTokensField === "max_tokens") { + params.max_tokens = options.maxTokens; + } else { + params.max_completion_tokens = options.maxTokens; + } + } + if (options?.temperature !== void 0) { params.temperature = options.temperature; } - const toolCacheControl = compat.supportsCacheControlOnTools ? cacheControl : void 0; - if (nativeToolChanges) { - params.tools = [...convertToolDefinitions(initialTools, toolCacheControl), DEFERRED_TOOL_PLACEHOLDER]; - } else { - const tools = getCurrentTools(context.messages); - if (tools.length > 0) { - params.tools = convertToolDefinitions(tools, toolCacheControl); + if (transcriptTools.requestTools.length > 0) { + params.tools = convertTools2(transcriptTools.requestTools, compat); + if (compat.zaiToolStream) { + params.tool_stream = true; } + } else if (hasToolHistory(context.messages)) { + params.tools = []; } - if (thinkingDisabled) { - params.thinking = { type: "disabled" }; - } else if (effortMessages) { - params.thinking = { - type: "adaptive", - display: options?.thinkingDisplay ?? "summarized", - block_binding: { prefix_mismatch_behavior: "drop_block" } - }; - params.output_config = { effort: "low" }; - } else if (model2.reasoning && options?.thinkingEnabled) { - const display = options.thinkingDisplay ?? "summarized"; - if (model2.compat?.forceAdaptiveThinking === true) { - params.thinking = { type: "adaptive", display }; - if (options.effort) { - params.output_config = { effort: options.effort }; - } - } else { - params.thinking = { - type: "enabled", - budget_tokens: options.thinkingBudgetTokens || 1024, - display - }; - } - } - if (options?.metadata) { - const userId = options.metadata.user_id; - if (typeof userId === "string") { - params.metadata = { user_id: userId }; - } + if (cacheControl) { + applyAnthropicCacheControl(messages, params.tools, cacheControl); } if (options?.toolChoice) { - if (typeof options.toolChoice === "string") { - params.tool_choice = { type: options.toolChoice }; - } else { - params.tool_choice = options.toolChoice; + params.tool_choice = options.toolChoice; + } + if (compat.vllmPriority !== void 0) { + params.priority = compat.vllmPriority; + } + const thinkingTokenBudgetField = resolveThinkingTokenBudgetField(compat); + const thinkingBudget = resolveClampedThinkingBudget(model2, options, params); + if (compat.thinkingFormat === "zai" && model2.reasoning) { + const zaiParams = params; + zaiParams.thinking = options?.reasoningEffort ? { type: "enabled", clear_thinking: false } : { type: "disabled" }; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + const mappedEffort = model2.thinkingLevelMap?.[options.reasoningEffort]; + const effort = mappedEffort === void 0 ? options.reasoningEffort : mappedEffort; + if (typeof effort === "string") { + zaiParams.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "qwen" && model2.reasoning) { + params.enable_thinking = !!options?.reasoningEffort; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + const effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + if (typeof effort === "string") { + params.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "qwen-chat-template" && model2.reasoning) { + params.chat_template_kwargs = { + enable_thinking: !!options?.reasoningEffort, + preserve_thinking: true + }; + } else if (compat.thinkingFormat === "chat-template" && model2.reasoning) { + const chatTemplateKwargs = buildChatTemplateValues(model2, options, compat.chatTemplateKwargs, thinkingBudget); + if (chatTemplateKwargs) { + params.chat_template_kwargs = chatTemplateKwargs; + } + } else if (compat.thinkingFormat === "baseten" && model2.reasoning) { + const basetenParams = params; + const chatTemplateArgs = buildChatTemplateValues(model2, options, compat.chatTemplateArgs, thinkingBudget); + if (chatTemplateArgs) { + basetenParams.chat_template_args = chatTemplateArgs; + } + if (compat.supportsReasoningEffort) { + const requestedEffort = options?.reasoningEffort; + const mappedEffort = requestedEffort ? model2.thinkingLevelMap?.[requestedEffort] : model2.thinkingLevelMap?.off; + const effort = mappedEffort === void 0 ? requestedEffort : mappedEffort; + if (typeof effort === "string") { + basetenParams.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "deepseek" && model2.reasoning) { + if (options?.reasoningEffort) { + params.thinking = { type: "enabled" }; + } else if (model2.thinkingLevelMap?.off !== null) { + params.thinking = { type: "disabled" }; + } + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + params.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } + } else if (compat.thinkingFormat === "openrouter" && model2.reasoning) { + const openRouterParams = params; + if (options?.reasoningEffort) { + openRouterParams.reasoning = { + effort: model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort + }; + } else if (model2.thinkingLevelMap?.off !== null) { + openRouterParams.reasoning = { effort: model2.thinkingLevelMap?.off ?? "none" }; + } + } else if (compat.thinkingFormat === "ant-ling" && model2.reasoning && options?.reasoningEffort) { + const effort = model2.thinkingLevelMap?.[options.reasoningEffort]; + if (typeof effort === "string") { + params.reasoning = { effort }; + } + } else if (compat.thinkingFormat === "together" && model2.reasoning) { + const togetherParams = params; + togetherParams.reasoning = { enabled: !!options?.reasoningEffort }; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + togetherParams.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } + } else if (compat.thinkingFormat === "string-thinking" && model2.reasoning) { + const stringThinkingParams = params; + if (options?.reasoningEffort) { + stringThinkingParams.thinking = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } else if (model2.thinkingLevelMap?.off !== null) { + stringThinkingParams.thinking = model2.thinkingLevelMap?.off ?? "none"; + } + } else if (options?.reasoningEffort && model2.reasoning && compat.supportsReasoningEffort) { + params.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } else if (!options?.reasoningEffort && model2.reasoning && compat.supportsReasoningEffort) { + const offValue = model2.thinkingLevelMap?.off; + if (typeof offValue === "string") { + params.reasoning_effort = offValue; } } - const allowedFallbackModels = model2.compat?.allowedFallbackModels; - if (allowedFallbackModels && allowedFallbackModels.length > 0) { - params.fallbacks = allowedFallbackModels.map((fallback) => ({ model: fallback.model })); + if (thinkingTokenBudgetField && thinkingBudget !== void 0) { + Object.assign(params, { [thinkingTokenBudgetField]: thinkingBudget }); } - return { params, hasPreferredStrictTools, providerThinkingLevel: effortMessages ? activeEffort : void 0 }; + if (model2.compat?.openRouterRouting) { + params.provider = model2.compat.openRouterRouting; + } + if (model2.compat?.vercelGatewayRouting) { + const routing = model2.compat.vercelGatewayRouting; + if (routing.only || routing.order) { + const gatewayOptions = {}; + if (routing.only) + gatewayOptions.only = routing.only; + if (routing.order) + gatewayOptions.order = routing.order; + params.providerOptions = { gateway: gatewayOptions }; + } + } + const samplingParams = resolveSamplingParams(model2, options?.reasoningEffort ?? "off", options?.samplingParams); + if (samplingParams) { + Object.assign(params, samplingParams); + } + return params; } -function normalizeToolCallId(id) { - return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64); +function resolveThinkingTokenBudgetField(compat) { + if (compat.thinkingTokenBudgetField) + return compat.thinkingTokenBudgetField; + if (compat.supportsThinkingTokenBudget) + return "thinking_token_budget"; + return void 0; } -function convertToolResult(msg, content = msg.content) { - return { - type: "tool_result", - tool_use_id: msg.toolCallId, - content: convertContentBlocks(content), - is_error: msg.isError - }; +function resolveClampedThinkingBudget(model2, options, params) { + if (!options?.reasoningEffort || !model2.reasoning) + return void 0; + const ceiling = params.max_tokens ?? params.max_completion_tokens ?? model2.maxTokens; + const budget = clampThinkingBudgetToAnswerRoom(thinkingBudgetForLevel(options.reasoningEffort, options.thinkingBudgets), ceiling); + return budget > 0 ? budget : void 0; } -function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, convertToolDefinitions) { +function buildChatTemplateValues(model2, options, values, thinkingBudget) { + const resolvedValues = {}; + for (const [key, value2] of Object.entries(values)) { + const resolved = resolveChatTemplateKwargValue(model2, options, value2, thinkingBudget); + if (resolved !== void 0) { + resolvedValues[key] = resolved; + } + } + return Object.keys(resolvedValues).length > 0 ? resolvedValues : void 0; +} +function resolveChatTemplateKwargValue(model2, options, value2, thinkingBudget) { + if (typeof value2 !== "object" || value2 === null) { + return value2; + } + const reasoningEffort = options?.reasoningEffort; + if (!reasoningEffort && value2.omitWhenOff) { + return void 0; + } + if (value2.$var === "thinking.enabled") { + return !!reasoningEffort; + } + if (value2.$var === "thinking.budget") { + return thinkingBudget; + } + const mappedValue = reasoningEffort ? model2.thinkingLevelMap?.[reasoningEffort] : model2.thinkingLevelMap?.off; + return mappedValue === void 0 ? reasoningEffort : typeof mappedValue === "string" ? mappedValue : void 0; +} +function getCompatCacheControl(compat, cacheRetention) { + if (compat.cacheControlFormat !== "anthropic" || cacheRetention === "none") { + return void 0; + } + const ttl = cacheRetention === "long" && compat.supportsLongCacheRetention ? "1h" : void 0; + return { type: "ephemeral", ...ttl ? { ttl } : {} }; +} +function applyAnthropicCacheControl(messages, tools, cacheControl) { + addCacheControlToSystemPrompt(messages, cacheControl); + addCacheControlToLastTool(tools, cacheControl); + addCacheControlToLastConversationMessage(messages, cacheControl); +} +function addCacheControlToSystemPrompt(messages, cacheControl) { + for (const message of messages) { + if (message.role === "system" || message.role === "developer") { + addCacheControlToInstructionMessage(message, cacheControl); + return; + } + } +} +function addCacheControlToLastConversationMessage(messages, cacheControl) { + for (let i = messages.length - 1; i >= 0; i--) { + const message = messages[i]; + if (message.role === "user" || message.role === "assistant" || message.role === "tool") { + if (addCacheControlToMessage(message, cacheControl)) { + return; + } + } + } +} +function addCacheControlToLastTool(tools, cacheControl) { + if (!tools || tools.length === 0) { + return; + } + const lastTool = tools[tools.length - 1]; + lastTool.cache_control = cacheControl; +} +function addCacheControlToInstructionMessage(message, cacheControl) { + return addCacheControlToTextContent(message, cacheControl); +} +function addCacheControlToMessage(message, cacheControl) { + if (message.role === "user" || message.role === "assistant" || message.role === "tool") { + return addCacheControlToTextContent(message, cacheControl); + } + return false; +} +function addCacheControlToTextContent(message, cacheControl) { + const content = message.content; + if (typeof content === "string") { + if (content.length === 0) { + return false; + } + message.content = [ + { + type: "text", + text: content, + cache_control: cacheControl + } + ]; + return true; + } + if (!Array.isArray(content)) { + return false; + } + for (let i = content.length - 1; i >= 0; i--) { + const part = content[i]; + if (part?.type === "text") { + const textPart = part; + textPart.cache_control = cacheControl; + return true; + } + } + return false; +} +function convertMessages2(model2, context, compat, options) { + const normalizedContext = resolveTranscript(context, compat.supportsMidConvoSystemMessages); const params = []; - const assistantLevels = /* @__PURE__ */ new Map(); - const pendingSystemMessages = []; - const flushPendingSystemMessages = () => { - params.push(...pendingSystemMessages); - pendingSystemMessages.length = 0; + const normalizeToolCallId2 = (id) => { + if (id.includes("|")) { + const separatorIndex = id.indexOf("|"); + const callId = id.slice(0, separatorIndex).replace(/[^a-zA-Z0-9_-]/g, "_"); + const itemId = id.slice(separatorIndex + 1).replace(/[^a-zA-Z0-9_-]/g, "_"); + const combinedId = itemId.length > 0 ? `${callId}_${itemId}` : callId; + if (combinedId.length <= 40) { + return combinedId; + } + const hash = shortHash(id).slice(0, 8); + const prefix = callId.slice(0, Math.max(1, 40 - hash.length - 1)); + return `${prefix}_${hash}`; + } + if (model2.provider === "openai") + return id.length > 40 ? id.slice(0, 40) : id; + return id; }; + const transformedMessages = transformMessages(normalizedContext.messages, model2, (id) => normalizeToolCallId2(id)); + const transcriptTools = resolveTranscriptTools(normalizedContext.messages, compat.supportsMidConvoSystemMessages === true && compat.supportsMidConvoToolAdditions === true ? "additions" : "none"); + const instructionRole = model2.reasoning && compat.supportsDeveloperRole ? "developer" : "system"; + let lastRole = null; + let systemIndex = 0; for (let i = 0; i < transformedMessages.length; i++) { const msg = transformedMessages[i]; + if (compat.requiresAssistantAfterToolResult && lastRole === "toolResult" && msg.role === "user") { + params.push({ + role: "assistant", + content: "I have processed the tool results." + }); + } if (msg.role === "system") { - const text2 = renderSystemMessageUpdate(msg); - const blocks = []; - if (text2.length > 0) - blocks.push({ type: "text", text: sanitizeSurrogates(text2) }); - if (convertToolDefinitions) { - const added = msg.toolsAdded ?? []; - const redefined = new Set(added.map((tool) => tool.name)); - for (const tool of msg.toolsRemoved ?? []) { - if (redefined.has(tool.name)) - continue; - blocks.push({ - type: "tool_removal", - tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name } - }); - } - for (const definition of convertToolDefinitions(added)) { - blocks.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); - } + const addedTools = systemIndex++ >= transcriptTools.foldedSystemMessages ? msg.toolsAdded ?? [] : []; + if (addedTools.length > 0) { + const kimiToolMessage = { + role: "system", + tools: convertTools2(addedTools, compat) + }; + params.push(kimiToolMessage); + } + const text2 = i === 0 ? getSystemMessageText(msg) : renderSystemMessageUpdate(msg); + if (text2.length > 0) { + params.push({ role: instructionRole, content: sanitizeSurrogates(text2) }); } - if (blocks.length > 0) - pendingSystemMessages.push({ role: "system", content: blocks }); } else if (msg.role === "user") { if (typeof msg.content === "string") { - if (msg.content.trim().length > 0) { - params.push({ - role: "user", - content: sanitizeSurrogates(msg.content) - }); - } + params.push({ + role: "user", + content: sanitizeSurrogates(msg.content) + }); } else { - const blocks = msg.content.map((item) => { + const content = msg.content.filter((item) => item.type !== "text" || item.text.length > 0).map((item) => { if (item.type === "text") { return { type: "text", text: sanitizeSurrogates(item.text) }; } else { - return convertImageBlock(item); + return { + type: "image_url", + image_url: { + url: `data:${item.mimeType};base64,${item.data}` + } + }; } }); - const filteredBlocks = blocks.filter((b) => { - if (b.type === "text") { - return b.text.trim().length > 0; - } - return true; - }); - if (filteredBlocks.length === 0) + if (content.length === 0) continue; params.push({ role: "user", - content: filteredBlocks + content }); } } else if (msg.role === "assistant") { - const blocks = []; - for (const block of msg.content) { - if (block.type === "text") { - if (block.text.trim().length === 0) - continue; - blocks.push({ - type: "text", - text: sanitizeSurrogates(block.text) - }); - } else if (block.type === "thinking") { - if (block.redacted) { - blocks.push({ - type: "redacted_thinking", - data: block.thinkingSignature - }); - continue; - } - const thinkingSignature = block.thinkingSignature; - const hasThinkingSignature = !!thinkingSignature && thinkingSignature.trim().length > 0; - if (block.thinking.trim().length === 0 && !hasThinkingSignature) - continue; - if (!hasThinkingSignature) { - blocks.push(allowEmptySignature ? { - type: "thinking", - thinking: sanitizeSurrogates(block.thinking), - signature: "" - } : { - type: "text", - text: sanitizeSurrogates(block.thinking) - }); - } else { - blocks.push({ - type: "thinking", - thinking: sanitizeSurrogates(block.thinking), - signature: thinkingSignature - }); - } - } else if (block.type === "toolCall") { - blocks.push({ - type: "tool_use", - id: block.id, - name: isOAuthToken2 ? toClaudeCodeName(block.name) : block.name, - input: block.arguments ?? {} - }); - } - } - if (blocks.length === 0) - continue; - flushPendingSystemMessages(); - const messageIndex = params.length; - params.push({ + const assistantMsg = { role: "assistant", - content: blocks - }); - if (managedProvider !== void 0 && msg.api === "anthropic-messages" && msg.provider === managedProvider && isAnthropicEffort(msg.providerThinkingLevel)) { - assistantLevels.set(messageIndex, msg.providerThinkingLevel); + content: compat.requiresAssistantAfterToolResult ? "" : null + }; + const assistantTextParts = msg.content.filter(isTextContentBlock).filter((block) => block.text.trim().length > 0).map((block) => ({ + type: "text", + text: sanitizeSurrogates(block.text) + })); + const assistantText = assistantTextParts.map((part) => part.text).join(""); + const thinkingBlocks = msg.content.filter(isThinkingContentBlock); + const toolCalls = msg.content.filter(isToolCallBlock); + const signedReasoningDetails = thinkingBlocks.map((block) => parseOpenAIReasoningDetails(block.thinkingSignature)).find((details) => details !== void 0); + const legacyReasoningDetails = toolCalls.map((toolCall) => parseLegacyEncryptedReasoningDetail(toolCall.thoughtSignature)).filter((detail) => detail !== void 0); + const preservedReasoningDetails = signedReasoningDetails ?? (legacyReasoningDetails.length > 0 ? legacyReasoningDetails : void 0); + const nonEmptyThinkingBlocks = thinkingBlocks.filter((block) => block.thinking.trim().length > 0); + if (nonEmptyThinkingBlocks.length > 0) { + if (compat.requiresThinkingAsText) { + const thinkingText = nonEmptyThinkingBlocks.map((block) => sanitizeSurrogates(block.thinking)).join("\n\n"); + assistantMsg.content = [{ type: "text", text: thinkingText }, ...assistantTextParts]; + } else { + if (assistantText.length > 0) { + assistantMsg.content = assistantText; + } + if (!preservedReasoningDetails) { + let signature = nonEmptyThinkingBlocks[0].thinkingSignature; + if (model2.provider === "opencode-go" && signature === "reasoning") { + signature = "reasoning_content"; + } + if (signature && isOpenAICompletionsReasoningField(signature)) { + assistantMsg[signature] = nonEmptyThinkingBlocks.map((block) => block.thinking).join("\n"); + } + } + } + } else if (assistantText.length > 0) { + assistantMsg.content = assistantText; } + if (toolCalls.length > 0) { + assistantMsg.tool_calls = toolCalls.map((tc) => { + const customInputProperty = options?.grammarToolInputProperties?.get(tc.name); + if (customInputProperty !== void 0) { + return { + id: tc.id, + type: "custom", + custom: { + name: tc.name, + input: sanitizeSurrogates(getGrammarToolInput(tc.name, tc.arguments, customInputProperty)) + } + }; + } + return { + id: tc.id, + type: "function", + function: { + name: tc.name, + arguments: JSON.stringify(tc.arguments) + } + }; + }); + } + if (preservedReasoningDetails) { + assistantMsg.reasoning_details = preservedReasoningDetails; + } + if (compat.requiresReasoningContentOnAssistantMessages && model2.reasoning && assistantMsg.reasoning_content === void 0) { + assistantMsg.reasoning_content = ""; + } + const content = assistantMsg.content; + const hasContent = content !== null && content !== void 0 && (typeof content === "string" ? content.length > 0 : content.length > 0); + if (!hasContent && !assistantMsg.tool_calls) { + continue; + } + params.push(assistantMsg); } else if (msg.role === "toolResult") { - const toolResults = []; - const errorImages = []; + const imageBlocks = []; let j = i; - while (j < transformedMessages.length && transformedMessages[j].role === "toolResult") { + for (; j < transformedMessages.length && transformedMessages[j].role === "toolResult"; j++) { const toolMsg = transformedMessages[j]; - const split = splitErrorToolResultImages(toolMsg); - toolResults.push(convertToolResult(toolMsg, split?.content)); - if (split) { - errorImages.push({ type: "text", text: split.caption }, ...split.images.map(convertImageBlock)); + const textResult = toolMsg.content.filter(isTextContentBlock).map((block) => block.text).join("\n"); + const hasImages = toolMsg.content.some((c) => c.type === "image"); + const hasText = textResult.trim().length > 0; + const toolResultText = hasText ? textResult : hasImages ? "(see attached image)" : "(no tool output)"; + const toolResultMsg = { + role: "tool", + content: sanitizeSurrogates(toolResultText), + tool_call_id: toolMsg.toolCallId + }; + if (compat.requiresToolResultName && toolMsg.toolName) { + toolResultMsg.name = toolMsg.toolName; + } + params.push(toolResultMsg); + if (hasImages && model2.input.includes("image")) { + for (const block of toolMsg.content) { + if (isImageContentBlock(block)) { + imageBlocks.push({ + type: "image_url", + image_url: { + url: `data:${block.mimeType};base64,${block.data}` + } + }); + } + } } - j++; } i = j - 1; - params.push({ - role: "user", - content: [...toolResults, ...errorImages] - }); - } - } - flushPendingSystemMessages(); - if (cacheControl && params.length > 0) { - const lastMessage = params[params.length - 1]; - if (lastMessage.role === "user" || lastMessage.role === "system") { - if (Array.isArray(lastMessage.content)) { - const lastBlock = lastMessage.content[lastMessage.content.length - 1]; - if (lastBlock && (lastBlock.type === "text" || lastBlock.type === "image" || lastBlock.type === "tool_result" || lastBlock.type === "tool_addition" || lastBlock.type === "tool_removal")) { - lastBlock.cache_control = cacheControl; + if (imageBlocks.length > 0) { + if (compat.requiresAssistantAfterToolResult) { + params.push({ + role: "assistant", + content: "I have processed the tool results." + }); } - } else if (typeof lastMessage.content === "string") { - lastMessage.content = [ - { - type: "text", - text: lastMessage.content, - cache_control: cacheControl - } - ]; + params.push({ + role: "user", + content: [ + { + type: "text", + text: "Attached image(s) from tool result:" + }, + ...imageBlocks + ] + }); + lastRole = "user"; + } else { + lastRole = "toolResult"; } + continue; } + lastRole = msg.role; } - return { messages: params, assistantLevels }; + return params; } -function isAnthropicEffort(value2) { - return value2 === "low" || value2 === "medium" || value2 === "high" || value2 === "xhigh" || value2 === "max"; -} -function insertThinkingLevelMessages(converted, activeEffort) { - const messages = []; - for (let index = 0; index < converted.messages.length; index++) { - const historicalEffort = converted.assistantLevels.get(index); - if (historicalEffort !== void 0) { - messages.push({ role: "system", content: [], output_config: { effort: historicalEffort } }); +function convertTools2(tools, compat) { + return tools.map((tool) => { + const grammar = resolveGrammarConstrainedSampling(tool, compat.supportsOpenAIGrammarTools); + if (grammar) { + return { + type: "custom", + custom: { + name: tool.name, + description: tool.description, + format: { + type: "grammar", + grammar: { + syntax: grammar.format, + definition: grammar.definition + } + } + } + }; } - messages.push(converted.messages[index]); - } - messages.push({ role: "system", content: [], output_config: { effort: activeEffort } }); - return messages; -} -function shouldUseFineGrainedToolStreamingBeta(model2, context) { - return getCurrentTools(context.messages).length > 0 && !getAnthropicCompat(model2).supportsEagerToolInputStreaming; -} -function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl, disablePreferredStrictTools = false) { - if (!tools) - return []; - return tools.map((tool, index) => { - const strict = disablePreferredStrictTools && prefersJsonSchemaStrictSampling(tool) ? void 0 : resolveJsonSchemaStrictSampling(tool, supportsStrictTools, isAnthropicStrictUnsupportedKeyword); - const parameters = getJsonSchemaToolParameters(tool, strict); - const schema4 = parameters; - const legacyInputSchema = { - type: "object", - properties: schema4.properties ?? {}, - required: schema4.required ?? [] - }; - const inputSchema = strict === true ? { - ...parameters, - ...legacyInputSchema - } : legacyInputSchema; + const strict = resolveJsonSchemaStrictSampling(tool, compat.supportsStrictMode !== false); return { - name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name, - description: tool.description, - ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {}, - ...strict === true ? { strict: true } : {}, - input_schema: inputSchema, - ...cacheControl && index === tools.length - 1 ? { cache_control: cacheControl } : {} + type: "function", + function: { + name: tool.name, + description: tool.description, + parameters: getJsonSchemaToolParameters(tool, strict), + // Only include strict if provider supports it. Some reject unknown fields. + ...compat.supportsStrictMode !== false && { strict: strict ?? false } + } }; }); } -function mapStopReason2(reason, stopDetails) { +function parseChunkUsage(rawUsage, model2) { + const promptTokens = rawUsage.prompt_tokens || 0; + const cacheReadTokens = rawUsage.prompt_tokens_details?.cached_tokens ?? rawUsage.prompt_cache_hit_tokens ?? rawUsage.cached_tokens ?? 0; + const cacheWriteTokens = rawUsage.prompt_tokens_details?.cache_write_tokens || 0; + const input = Math.max(0, promptTokens - cacheReadTokens - cacheWriteTokens); + const outputTokens = rawUsage.completion_tokens || 0; + const usage = { + input, + output: outputTokens, + cacheRead: cacheReadTokens, + cacheWrite: cacheWriteTokens, + reasoning: rawUsage.completion_tokens_details?.reasoning_tokens || 0, + totalTokens: input + outputTokens + cacheReadTokens + cacheWriteTokens, + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } + }; + calculateCost(model2, usage); + if (isOpenRouterModel(model2)) { + applyOpenRouterReportedCost(usage, rawUsage); + } + return usage; +} +function mapStopReason3(reason) { + if (reason === null) + return { stopReason: "stop" }; switch (reason) { - case "end_turn": + case "stop": + case "end": return { stopReason: "stop" }; - case "max_tokens": + case "length": return { stopReason: "length" }; - case "tool_use": + case "function_call": + case "tool_calls": return { stopReason: "toolUse" }; - case "refusal": + case "content_filter": + return { stopReason: "error", errorMessage: "Provider finish_reason: content_filter" }; + case "network_error": + return { stopReason: "error", errorMessage: "Provider finish_reason: network_error" }; + default: return { stopReason: "error", - errorMessage: stopDetails?.explanation || `The model refused to complete the request` + errorMessage: `Provider finish_reason: ${reason}` }; - case "pause_turn": - return { stopReason: "stop" }; - case "stop_sequence": - return { stopReason: "stop" }; - // We don't supply stop sequences, so this should never happen - case "sensitive": - return { stopReason: "error", errorMessage: "Provider stopped with: sensitive" }; - default: - throw new Error(`Unhandled stop reason: ${reason}`); } } -var claudeCodeVersion, claudeCodeTools, ccToolLookup, toClaudeCodeName, fromClaudeCodeName, FINE_GRAINED_TOOL_STREAMING_BETA, INTERLEAVED_THINKING_BETA, SERVER_SIDE_FALLBACK_BETA, MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA, INLINE_TOOLS_BETA, DEFERRED_TOOL_PLACEHOLDER, PiAnthropic, federationClient, ANTHROPIC_MESSAGE_EVENTS, stream3, streamSimple2, ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS, ANTHROPIC_STRICT_STRING_FORMATS, isAnthropicStrictUnsupportedKeyword; -var init_anthropic_messages = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js"() { - init_sdk(); - init_env_api_keys(); +function detectCompat(model2) { + const provider2 = model2.provider; + const baseUrl = model2.baseUrl; + const isZai = provider2 === "zai" || provider2 === "zai-coding-cn" || baseUrl.includes("api.z.ai") || baseUrl.includes("open.bigmodel.cn"); + const isTogether = provider2 === "together" || baseUrl.includes("api.together.ai") || baseUrl.includes("api.together.xyz"); + const isMoonshot = provider2 === "moonshotai" || provider2 === "moonshotai-cn" || baseUrl.includes("api.moonshot."); + const isOpenRouter2 = provider2 === "openrouter" || baseUrl.includes("openrouter.ai"); + const isCloudflareWorkersAI = provider2 === "cloudflare-workers-ai" || baseUrl.includes("api.cloudflare.com"); + const isCloudflareAiGateway = provider2 === "cloudflare-ai-gateway" || baseUrl.includes("gateway.ai.cloudflare.com"); + const isNvidia = provider2 === "nvidia" || baseUrl.includes("integrate.api.nvidia.com"); + const isAntLing = provider2 === "ant-ling" || baseUrl.includes("api.ant-ling.com"); + const isCerebras = provider2 === "cerebras" || baseUrl.includes("cerebras.ai"); + const isDeepSeek = provider2 === "deepseek" || baseUrl.toLowerCase().includes("deepseek.com"); + const isNonStandard = isNvidia || isCerebras || provider2 === "xai" || baseUrl.includes("api.x.ai") || isTogether || baseUrl.includes("chutes.ai") || isDeepSeek || isZai || isMoonshot || provider2 === "opencode" || baseUrl.includes("opencode.ai") || isCloudflareWorkersAI || isCloudflareAiGateway || isAntLing; + const useMaxTokens = baseUrl.includes("chutes.ai") || isDeepSeek || isMoonshot || isCloudflareAiGateway || isTogether || isNvidia || isAntLing || isZai; + const isGrok = provider2 === "xai" || baseUrl.includes("api.x.ai"); + const isOpenRouterDeveloperRoleModel = isOpenRouter2 && (model2.id.startsWith("anthropic/") || model2.id.startsWith("openai/")); + const cacheControlFormat = provider2 === "openrouter" && model2.id.startsWith("anthropic/") ? "anthropic" : void 0; + return { + supportsStore: !isNonStandard, + supportsDeveloperRole: isOpenRouterDeveloperRoleModel || !isNonStandard && !isOpenRouter2, + supportsReasoningEffort: !isGrok && !isZai && !isMoonshot && !isTogether && !isCloudflareAiGateway && !isNvidia && !isAntLing, + supportsUsageInStreaming: true, + supportsFinishReason: true, + maxTokensField: useMaxTokens ? "max_tokens" : "max_completion_tokens", + requiresToolResultName: false, + requiresAssistantAfterToolResult: false, + requiresThinkingAsText: false, + requiresReasoningContentOnAssistantMessages: isDeepSeek, + thinkingFormat: isDeepSeek ? "deepseek" : isZai ? "zai" : isTogether ? "together" : isAntLing ? "ant-ling" : isOpenRouter2 ? "openrouter" : "openai", + openRouterRouting: {}, + vercelGatewayRouting: {}, + chatTemplateKwargs: {}, + chatTemplateArgs: {}, + zaiToolStream: false, + supportsThinkingTokenBudget: false, + thinkingTokenBudgetField: void 0, + // OpenAI compatibility alone does not imply strict JSON-schema tool support. + supportsStrictMode: false, + supportsOpenAIGrammarTools: false, + supportsMidConvoSystemMessages: false, + supportsMidConvoToolAdditions: false, + cacheControlFormat, + sendSessionAffinityHeaders: isOpenRouter2, + sessionAffinityFormat: isOpenRouter2 ? "openrouter" : "openai", + supportsLongCacheRetention: !(isTogether || isCloudflareWorkersAI || isCloudflareAiGateway || isNvidia || isAntLing) + }; +} +function getCompat2(model2) { + const detected = detectCompat(model2); + if (!model2.compat) + return detected; + return { + supportsStore: model2.compat.supportsStore ?? detected.supportsStore, + supportsDeveloperRole: model2.compat.supportsDeveloperRole ?? detected.supportsDeveloperRole, + supportsReasoningEffort: model2.compat.supportsReasoningEffort ?? detected.supportsReasoningEffort, + supportsUsageInStreaming: model2.compat.supportsUsageInStreaming ?? detected.supportsUsageInStreaming, + supportsFinishReason: model2.compat.supportsFinishReason ?? detected.supportsFinishReason, + maxTokensField: model2.compat.maxTokensField ?? detected.maxTokensField, + requiresToolResultName: model2.compat.requiresToolResultName ?? detected.requiresToolResultName, + requiresAssistantAfterToolResult: model2.compat.requiresAssistantAfterToolResult ?? detected.requiresAssistantAfterToolResult, + requiresThinkingAsText: model2.compat.requiresThinkingAsText ?? detected.requiresThinkingAsText, + requiresReasoningContentOnAssistantMessages: model2.compat.requiresReasoningContentOnAssistantMessages ?? detected.requiresReasoningContentOnAssistantMessages, + thinkingFormat: model2.compat.thinkingFormat ?? detected.thinkingFormat, + openRouterRouting: model2.compat.openRouterRouting ?? {}, + vercelGatewayRouting: model2.compat.vercelGatewayRouting ?? detected.vercelGatewayRouting, + chatTemplateKwargs: model2.compat.chatTemplateKwargs ?? detected.chatTemplateKwargs, + chatTemplateArgs: model2.compat.chatTemplateArgs ?? detected.chatTemplateArgs, + zaiToolStream: model2.compat.zaiToolStream ?? detected.zaiToolStream, + supportsThinkingTokenBudget: model2.compat.supportsThinkingTokenBudget ?? detected.supportsThinkingTokenBudget, + thinkingTokenBudgetField: model2.compat.thinkingTokenBudgetField ?? detected.thinkingTokenBudgetField, + supportsStrictMode: model2.compat.supportsStrictMode ?? detected.supportsStrictMode, + supportsOpenAIGrammarTools: model2.compat.supportsOpenAIGrammarTools ?? detected.supportsOpenAIGrammarTools, + supportsMidConvoSystemMessages: model2.compat.supportsMidConvoSystemMessages ?? detected.supportsMidConvoSystemMessages, + supportsMidConvoToolAdditions: model2.compat.supportsMidConvoToolAdditions ?? detected.supportsMidConvoToolAdditions, + cacheControlFormat: model2.compat.cacheControlFormat ?? detected.cacheControlFormat, + sendSessionAffinityHeaders: model2.compat.sendSessionAffinityHeaders ?? detected.sendSessionAffinityHeaders, + sessionAffinityFormat: model2.compat.sessionAffinityFormat ?? detected.sessionAffinityFormat, + supportsLongCacheRetention: model2.compat.supportsLongCacheRetention ?? detected.supportsLongCacheRetention, + vllmPriority: model2.compat.vllmPriority + }; +} +var OPENAI_COMPLETIONS_REASONING_FIELDS, stream4, streamSimple3; +var init_openai_completions = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js"() { + init_openai(); init_models(); - init_diagnostics(); + init_error_body(); init_event_stream(); - init_headers(); + init_hash(); + init_headers2(); init_identity(); - init_json_parse(); init_openrouter_cost(); init_provider_env(); init_provider_retry(); @@ -40831,68 +41799,13 @@ var init_anthropic_messages = __esm({ init_transcript(); init_constrained_sampling(); init_github_copilot_headers(); + init_openai_prompt_cache(); init_simple_options(); init_transform_messages(); - claudeCodeVersion = "2.1.280"; - claudeCodeTools = [ - "Read", - "Write", - "Edit", - "Bash", - "Grep", - "Glob", - "AskUserQuestion", - "EnterPlanMode", - "ExitPlanMode", - "KillShell", - "NotebookEdit", - "Skill", - "Task", - "TaskOutput", - "TodoWrite", - "WebFetch", - "WebSearch" - ]; - ccToolLookup = new Map(claudeCodeTools.map((t) => [t.toLowerCase(), t])); - toClaudeCodeName = (name) => ccToolLookup.get(name.toLowerCase()) ?? name; - fromClaudeCodeName = (name, tools) => { - if (tools && tools.length > 0) { - const lowerName = name.toLowerCase(); - const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName); - if (matchedTool) - return matchedTool.name; - } - return name; - }; - FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14"; - INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14"; - SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01"; - MID_CONVERSATION_OUTPUT_CONFIG_BETA = "mid-conversation-output-config-2026-07-01"; - THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"; - INLINE_TOOLS_BETA = "inline-tools-2026-09-15"; - DEFERRED_TOOL_PLACEHOLDER = { - name: "__pi_deferred_placeholder__", - description: "Reserved placeholder. Never available. Never call this.", - input_schema: { type: "object", properties: {}, required: [] }, - defer_loading: true - }; - PiAnthropic = class extends Anthropic { - _shouldResolveDefaultCredentials() { - return false; - } - }; - ANTHROPIC_MESSAGE_EVENTS = /* @__PURE__ */ new Set([ - "message_start", - "message_delta", - "message_stop", - "content_block_start", - "content_block_delta", - "content_block_stop" - ]); - stream3 = (model2, context, options) => { - const stream4 = new AssistantMessageEventStream(); - const normalizedContext = resolveTranscript(context, getAnthropicCompat(model2).supportsMidConvoSystemMessages); - const currentTools = getCurrentTools(normalizedContext.messages); + OPENAI_COMPLETIONS_REASONING_FIELDS = ["reasoning", "reasoning_content", "reasoning_text"]; + stream4 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); + const normalizedContext = resolveTranscript(context, getCompat2(model2).supportsMidConvoSystemMessages); (async () => { const output = { role: "assistant", @@ -40911,343 +41824,317 @@ var init_anthropic_messages = __esm({ stopReason: "pending", timestamp: Date.now() }; + let streamedReasoningDetails; + const applyStreamedReasoningDetails = (block) => { + if (streamedReasoningDetails !== void 0) { + block.thinkingSignature = JSON.stringify(streamedReasoningDetails); + } + }; try { - let client; - let isOAuth; - let usageModel = model2; - let inputTransformations; - if (options?.client) { - client = options.client; - isOAuth = false; - } else { - const apiKey = options?.apiKey; - const federation = getAnthropicFederation(model2, apiKey, options?.headers, options?.env); - if (!federation) - assertRequestAuth(model2.provider, apiKey, options?.headers); - let copilotDynamicHeaders; - if (model2.provider === "github-copilot") { - const hasImages = hasCopilotVisionInput(normalizedContext.messages); - copilotDynamicHeaders = buildCopilotDynamicHeaders({ - messages: normalizedContext.messages, - hasImages - }); - } - const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); - const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; - const created = createClient2(model2, apiKey, options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId, federation, options?.identity); - client = created.client; - isOAuth = created.isOAuthToken; + const apiKey = getClientApiKey2(model2.provider, options?.apiKey, options?.headers); + const compat = getCompat2(model2); + const grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(normalizedContext.messages), compat.supportsOpenAIGrammarTools); + const cacheRetention = resolveCacheRetention3(options?.cacheRetention, options?.env); + const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; + const client = createClient3(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId, compat); + let params = buildParams3(model2, normalizedContext, options, compat, cacheRetention, grammarToolInputProperties); + const nextParams = await options?.onPayload?.(params, model2); + if (nextParams !== void 0) { + params = nextParams; } const requestOptions = { ...options?.signal ? { signal: options.signal } : {}, ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {}, maxRetries: 0 }; - let disablePreferredStrictTools = false; - let response; - for (; ; ) { - options?.signal?.throwIfAborted(); - const built = buildParams2(model2, normalizedContext, isOAuth, options, disablePreferredStrictTools); - if (built.providerThinkingLevel) - output.providerThinkingLevel = built.providerThinkingLevel; - let params = built.params; - const nextParams = await options?.onPayload?.(params, model2); - if (nextParams !== void 0) { - params = { ...nextParams, stream: true }; + const { data: openaiStream, response } = await retryProviderRequest(() => client.chat.completions.create(params, requestOptions).withResponse(), { + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + signal: options?.signal + }); + await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); + stream5.push({ type: "start", partial: output }); + let textBlock = null; + let thinkingBlock = null; + let hasFinishReason = false; + const toolCallBlocksByIndex = /* @__PURE__ */ new Map(); + const toolCallBlocksById = /* @__PURE__ */ new Map(); + const toolCallStates = /* @__PURE__ */ new Map(); + const blocks = output.content; + const getContentIndex = (block) => blocks.indexOf(block); + const customInput2 = (property) => ({ + kind: "custom", + property, + buffer: { input: "", started: false, closed: false } + }); + const finishBlock = (block) => { + const contentIndex = getContentIndex(block); + if (contentIndex === -1) { + return; } - try { - response = await retryProviderRequest(() => client.beta.messages.create(params, requestOptions).asResponse(), { - maxRetries: options?.maxRetries, - maxRetryDelayMs: options?.maxRetryDelayMs, - signal: options?.signal + if (block.type === "text") { + stream5.push({ + type: "text_end", + contentIndex, + content: block.text, + partial: output }); - break; - } catch (error) { - if (options?.signal?.aborted || disablePreferredStrictTools || !built.hasPreferredStrictTools || !(error instanceof Anthropic.APIError) || error.status !== 400 || error.type !== "invalid_request_error" || !isStrictToolLimitErrorMessage(error.message)) { - throw error; + } else if (block.type === "thinking") { + applyStreamedReasoningDetails(block); + stream5.push({ + type: "thinking_end", + contentIndex, + content: block.thinking, + partial: output + }); + } else if (block.type === "toolCall") { + const input = toolCallStates.get(block).input; + toolCallStates.delete(block); + if (input.kind === "custom") { + const delta = closeGrammarToolInputJson(input.buffer, input.property, void 0); + if (delta !== void 0) { + stream5.push({ + type: "toolcall_delta", + contentIndex, + delta, + partial: output + }); + } + } else { + Object.assign(block, input.arguments.finish()); } - disablePreferredStrictTools = true; - appendAssistantMessageDiagnostic(output, { - type: "anthropic_strict_tools_fallback", - timestamp: Date.now(), - error: { message: error.message }, - details: { reason: "strict_tool_limits_exceeded" } + stream5.push({ + type: "toolcall_end", + contentIndex, + toolCall: block, + partial: output }); } + }; + const ensureTextBlock = () => { + if (!textBlock) { + textBlock = { type: "text", text: "" }; + blocks.push(textBlock); + stream5.push({ type: "text_start", contentIndex: getContentIndex(textBlock), partial: output }); + } + return textBlock; + }; + const ensureThinkingBlock = (thinkingSignature) => { + if (!thinkingBlock) { + thinkingBlock = { + type: "thinking", + thinking: "", + thinkingSignature + }; + blocks.push(thinkingBlock); + stream5.push({ type: "thinking_start", contentIndex: getContentIndex(thinkingBlock), partial: output }); + } + return thinkingBlock; + }; + const ensureToolCallBlock = (toolCall) => { + const streamIndex = typeof toolCall.index === "number" ? toolCall.index : void 0; + const name = toolCall.function?.name ?? toolCall.custom?.name ?? ""; + let block = streamIndex !== void 0 ? toolCallBlocksByIndex.get(streamIndex) : void 0; + if (!block && toolCall.id) { + block = toolCallBlocksById.get(toolCall.id); + } + if (!block) { + const customInputProperty = toolCall.custom && !toolCall.function ? grammarToolInputProperties.get(name) ?? "input" : void 0; + block = { + type: "toolCall", + id: toolCall.id || "", + name, + arguments: customInputProperty !== void 0 ? { [customInputProperty]: "" } : {} + }; + toolCallStates.set(block, { + streamIndex, + input: customInputProperty !== void 0 ? customInput2(customInputProperty) : { kind: "json", arguments: new ToolCallArgumentsStream() } + }); + if (streamIndex !== void 0) { + toolCallBlocksByIndex.set(streamIndex, block); + } + if (toolCall.id) { + toolCallBlocksById.set(toolCall.id, block); + } + blocks.push(block); + stream5.push({ + type: "toolcall_start", + contentIndex: getContentIndex(block), + partial: output + }); + } + const state2 = toolCallStates.get(block); + if (streamIndex !== void 0 && state2.streamIndex === void 0) { + state2.streamIndex = streamIndex; + toolCallBlocksByIndex.set(streamIndex, block); + } + if (toolCall.id) { + toolCallBlocksById.set(toolCall.id, block); + } + if (!block.name && name) { + block.name = name; + } + if (toolCall.custom && !toolCall.function && state2.input.kind !== "custom") { + const customInputProperty = grammarToolInputProperties.get(block.name) ?? "input"; + block.arguments = { [customInputProperty]: "" }; + state2.input = customInput2(customInputProperty); + } + return { block, state: state2 }; + }; + for await (const chunk of openaiStream) { + await options?.onProviderStreamEvent?.(chunk, model2); + if (!chunk || typeof chunk !== "object") + continue; + output.responseId ||= chunk.id; + if (typeof chunk.model === "string" && chunk.model.length > 0 && chunk.model !== model2.id) { + output.responseModel ||= chunk.model; + } + if (chunk.usage) { + output.usage = parseChunkUsage(chunk.usage, model2); + } + const choice = Array.isArray(chunk.choices) ? chunk.choices[0] : void 0; + if (!choice) + continue; + if (!chunk.usage && choice.usage) { + output.usage = parseChunkUsage(choice.usage, model2); + } + if (choice.finish_reason) { + output.rawStopReason = choice.finish_reason; + const finishReasonResult = mapStopReason3(choice.finish_reason); + output.stopReason = finishReasonResult.stopReason; + if (finishReasonResult.errorMessage) { + output.errorMessage = finishReasonResult.errorMessage; + } + hasFinishReason = true; + } + if (choice.delta) { + const reasoningFields = ["reasoning_content", "reasoning", "reasoning_text"]; + const deltaFields = choice.delta; + let foundReasoningField = null; + for (const field of reasoningFields) { + const value2 = deltaFields[field]; + if (typeof value2 === "string" && value2.length > 0) { + foundReasoningField = field; + break; + } + } + if (foundReasoningField) { + const delta = deltaFields[foundReasoningField]; + if (typeof delta === "string" && delta.length > 0) { + const thinkingSignature = model2.provider === "opencode-go" && foundReasoningField === "reasoning" ? "reasoning_content" : foundReasoningField; + const block = ensureThinkingBlock(thinkingSignature); + block.thinking += delta; + stream5.push({ + type: "thinking_delta", + contentIndex: getContentIndex(block), + delta, + partial: output + }); + } + } + const reasoningDetails = choice.delta.reasoning_details; + if (Array.isArray(reasoningDetails)) { + for (const detail of reasoningDetails) { + if (!isOpenAIReasoningDetail(detail)) + continue; + ensureThinkingBlock(""); + streamedReasoningDetails ??= []; + appendOpenAIReasoningDetail(streamedReasoningDetails, detail); + } + } + if (choice.delta.content !== null && choice.delta.content !== void 0 && choice.delta.content.length > 0) { + const block = ensureTextBlock(); + block.text += choice.delta.content; + stream5.push({ + type: "text_delta", + contentIndex: getContentIndex(block), + delta: choice.delta.content, + partial: output + }); + } + if (choice?.delta?.tool_calls) { + for (const toolCall of choice.delta.tool_calls) { + const { block, state: state2 } = ensureToolCallBlock(toolCall); + if (!block.id && toolCall.id) { + block.id = toolCall.id; + toolCallBlocksById.set(toolCall.id, block); + } + const name = toolCall.function?.name ?? toolCall.custom?.name; + if (!block.name && name) { + block.name = name; + } + let delta = ""; + const input = state2.input; + if (toolCall.function?.arguments && input.kind === "json") { + delta = toolCall.function.arguments; + block.arguments = input.arguments.append(delta); + } else if (toolCall.custom?.input && input.kind === "custom") { + delta = appendGrammarToolInputJsonDelta(input.buffer, input.property, toolCall.custom.input) ?? ""; + block.arguments = { [input.property]: input.buffer.input }; + } + stream5.push({ + type: "toolcall_delta", + contentIndex: getContentIndex(block), + delta, + partial: output + }); + } + } + } } - await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - stream4.push({ type: "start", partial: output }); - const openBlocks = /* @__PURE__ */ new Map(); - const openBlock = (anthropicIndex) => { - const open = openBlocks.get(anthropicIndex); - return open === void 0 ? void 0 : { ...open, block: output.content[open.contentIndex] }; - }; - for await (const event of iterateAnthropicEvents(response, options?.signal)) { - await options?.onProviderStreamEvent?.(event, model2); - if (event.type === "message_start") { - output.responseId = event.message.id; - const transformations = event.message.input_transformations; - if (Array.isArray(transformations)) - inputTransformations = transformations; - const responseModel = event.message.model; - if (responseModel !== model2.id) - output.responseModel = responseModel; - const fallbackCost = responseModel === model2.id ? void 0 : model2.compat?.allowedFallbackModels?.find((fallback) => fallback.provider === model2.provider && fallback.model === responseModel)?.cost; - usageModel = fallbackCost ? { ...model2, id: responseModel, cost: fallbackCost } : model2; - output.usage.input = event.message.usage.input_tokens || 0; - output.usage.output = event.message.usage.output_tokens || 0; - output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0; - output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0; - output.usage.cacheWrite1h = event.message.usage.cache_creation?.ephemeral_1h_input_tokens || 0; - output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; - calculateCost(usageModel, output.usage); - } else if (event.type === "content_block_start") { - if (event.content_block.type === "fallback") { - if (output.content.length > 0) { - throw new Error("Anthropic performed an unsupported mid-output model fallback"); - } - continue; - } - if (event.content_block.type === "text") { - output.content.push({ type: "text", text: event.content_block.text ?? "" }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "thinking") { - output.content.push({ - type: "thinking", - thinking: event.content_block.thinking ?? "", - thinkingSignature: event.content_block.signature ?? "" - }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "redacted_thinking") { - output.content.push({ - type: "thinking", - thinking: "[Reasoning redacted]", - thinkingSignature: event.content_block.data, - redacted: true - }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "tool_use") { - output.content.push({ - type: "toolCall", - id: event.content_block.id, - name: isOAuth ? fromClaudeCodeName(event.content_block.name, currentTools) : event.content_block.name, - arguments: event.content_block.input ?? {} - }); - openBlocks.set(event.index, { - contentIndex: output.content.length - 1, - arguments: new ToolCallArgumentsStream() - }); - stream4.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output }); - } - } else if (event.type === "content_block_delta") { - const open = openBlock(event.index); - if (event.delta.type === "text_delta") { - if (open?.block.type === "text") { - open.block.text += event.delta.text; - stream4.push({ - type: "text_delta", - contentIndex: open.contentIndex, - delta: event.delta.text, - partial: output - }); - } - } else if (event.delta.type === "thinking_delta") { - if (open?.block.type === "thinking") { - open.block.thinking += event.delta.thinking; - stream4.push({ - type: "thinking_delta", - contentIndex: open.contentIndex, - delta: event.delta.thinking, - partial: output - }); - } - } else if (event.delta.type === "input_json_delta") { - if (open?.block.type === "toolCall" && open.arguments !== void 0) { - open.block.arguments = open.arguments.append(event.delta.partial_json); - stream4.push({ - type: "toolcall_delta", - contentIndex: open.contentIndex, - delta: event.delta.partial_json, - partial: output - }); - } - } else if (event.delta.type === "signature_delta") { - if (open?.block.type === "thinking") { - open.block.thinkingSignature = open.block.thinkingSignature || ""; - open.block.thinkingSignature += event.delta.signature; - } - } - } else if (event.type === "content_block_stop") { - const open = openBlock(event.index); - openBlocks.delete(event.index); - if (open) { - const { block, contentIndex: index } = open; - if (block.type === "text") { - stream4.push({ - type: "text_end", - contentIndex: index, - content: block.text, - partial: output - }); - } else if (block.type === "thinking") { - stream4.push({ - type: "thinking_end", - contentIndex: index, - content: block.thinking, - partial: output - }); - } else if (block.type === "toolCall" && open.arguments !== void 0) { - Object.assign(block, open.arguments.finish()); - stream4.push({ - type: "toolcall_end", - contentIndex: index, - toolCall: block, - partial: output - }); - } - } - } else if (event.type === "message_delta") { - const transformations = event.input_transformations; - if (Array.isArray(transformations)) - inputTransformations = transformations; - if (event.delta.stop_reason) { - output.rawStopReason = event.delta.stop_reason; - const stopReasonResult = mapStopReason2(event.delta.stop_reason, event.delta.stop_details); - output.stopReason = stopReasonResult.stopReason; - if (stopReasonResult.errorMessage) { - output.errorMessage = stopReasonResult.errorMessage; - } - } - if (event.usage) { - if (event.usage.input_tokens != null) { - output.usage.input = event.usage.input_tokens; - } - if (event.usage.output_tokens != null) { - output.usage.output = event.usage.output_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - output.usage.cacheRead = event.usage.cache_read_input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - output.usage.cacheWrite = event.usage.cache_creation_input_tokens; - } - const cacheCreation = event.usage.cache_creation; - if (cacheCreation?.ephemeral_1h_input_tokens != null) { - output.usage.cacheWrite1h = cacheCreation.ephemeral_1h_input_tokens; - } - const thinkingTokens = event.usage.output_tokens_details?.thinking_tokens; - if (thinkingTokens != null) { - output.usage.reasoning = thinkingTokens; - } - } - output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; - calculateCost(usageModel, output.usage); - if (isOpenRouterModel(model2) && event.usage) { - applyOpenRouterReportedCost(output.usage, event.usage); - } - } + for (const block of blocks) { + finishBlock(block); } if (options?.signal?.aborted) { throw new Error("Request was aborted"); } - if (output.stopReason === "pending") { - throw new Error("Anthropic stream ended without a stop reason"); + if (output.stopReason === "aborted") { + throw new Error("Request was aborted"); } - if (output.stopReason === "aborted" || output.stopReason === "error") { - throw new Error(output.errorMessage || "An unknown error occurred"); + if (!hasFinishReason && !compat.supportsFinishReason) { + output.stopReason = output.content.some((block) => block.type === "toolCall") ? "toolUse" : "stop"; } - if (inputTransformations && inputTransformations.length > 0) { - appendAssistantMessageDiagnostic(output, { - type: "anthropic_input_transformations", - timestamp: Date.now(), - details: { - transformations: inputTransformations.map((transformation) => ({ - type: transformation.type ?? void 0, - path: transformation.path ?? void 0, - reason: transformation.reason ?? void 0 - })) - } - }); + if (output.stopReason === "error") { + throw new Error(output.errorMessage || "Provider returned an error stop reason"); } - stream4.push({ type: "done", reason: output.stopReason, message: output }); - stream4.end(); + if (compat.supportsFinishReason && !hasFinishReason || output.stopReason === "pending") { + throw new Error("Stream ended without finish_reason"); + } + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); } catch (error) { + for (const block of output.content) { + if (block.type === "thinking") { + applyStreamedReasoningDetails(block); + } + } output.stopReason = options?.signal?.aborted ? "aborted" : "error"; - output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error); - stream4.push({ type: "error", reason: output.stopReason, error: output }); - stream4.end(); + output.errorMessage = formatProviderError(normalizeProviderError(error)); + const rawMetadata = error?.error?.metadata?.raw; + if (rawMetadata && !output.errorMessage.includes(String(rawMetadata))) { + output.errorMessage += ` +${rawMetadata}`; + } + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); } })(); - return stream4; + return stream5; }; - streamSimple2 = (model2, context, options) => { - if (!getAnthropicFederation(model2, options?.apiKey, options?.headers, options?.env)) { - assertRequestAuth(model2.provider, options?.apiKey, options?.headers); - } + streamSimple3 = (model2, context, options) => { + getClientApiKey2(model2.provider, options?.apiKey, options?.headers); const base = { ...buildBaseOptions(model2, context, options, options?.apiKey), toolChoice: options?.toolChoice }; - if (!options?.reasoning) { - return stream3(model2, context, { - ...base, - thinkingEnabled: false - }); - } - if (model2.compat?.forceAdaptiveThinking === true) { - const effort = mapThinkingLevelToEffort(model2, options.reasoning); - return stream3(model2, context, { - ...base, - thinkingEnabled: true, - effort - }); - } - const adjusted = adjustMaxTokensForThinking(base.maxTokens, model2.maxTokens, options.reasoning, options.thinkingBudgets); - const maxTokens = clampMaxTokensToContext(model2, context, adjusted.maxTokens); - return stream3(model2, context, { + const clampedReasoning = options?.reasoning ? clampThinkingLevel(model2, options.reasoning) : void 0; + const reasoningEffort = clampedReasoning === "off" ? void 0 : clampedReasoning; + return stream4(model2, context, { ...base, - maxTokens, - thinkingEnabled: true, - thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)) + reasoningEffort, + thinkingBudgets: options?.thinkingBudgets }); }; - ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS = /* @__PURE__ */ new Set([ - "minimum", - "maximum", - "exclusiveMinimum", - "exclusiveMaximum", - "multipleOf", - "maxItems", - "uniqueItems", - "minContains", - "maxContains", - "minProperties", - "maxProperties" - ]); - ANTHROPIC_STRICT_STRING_FORMATS = /* @__PURE__ */ new Set([ - "date-time", - "time", - "date", - "duration", - "email", - "hostname", - "uri", - "ipv4", - "ipv6", - "uuid" - ]); - isAnthropicStrictUnsupportedKeyword = (key, value2) => { - if (ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS.has(key)) - return true; - if (key === "minItems") - return value2 !== 0 && value2 !== 1; - if (key === "format") - return typeof value2 !== "string" || !ANTHROPIC_STRICT_STRING_FORMATS.has(value2); - return false; - }; } }); @@ -41364,287 +42251,95 @@ function abortError(signal) { return reason instanceof Error ? reason : new DOMException("The operation was aborted", "AbortError"); } -// proxy-models.ts +// models.ts init_models(); -// node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js -var openAIDecisionsApi = () => ({ - classify: async (model2, context, options) => (await Promise.resolve().then(() => (init_openai_decisions(), openai_decisions_exports))).classify(model2, context, options) -}); - -// node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js -init_lazy(); -var openAIResponsesApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_responses(), openai_responses_exports))); - -// node_modules/@earendil-works/pi-ai/dist/auth/helpers.js -function envApiKeyAuth(name, envVars) { - return { - name, - login: async (interaction) => { - interaction.signal.throwIfAborted(); - const key = await interaction.prompt({ type: "secret", message: `Enter ${name}` }); - interaction.signal.throwIfAborted(); - return { type: "api_key", key }; - }, - resolve: async ({ ctx, credential, signal }) => { - signal.throwIfAborted(); - if (credential?.key) { - return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" }; - } - for (const envVar of envVars) { - const value2 = await ctx.env(envVar); - signal.throwIfAborted(); - if (value2) - return { auth: { apiKey: value2 }, source: envVar }; - } - return void 0; - } - }; -} -function lazyOAuth(input) { - let promise; - const loaded = () => { - promise ??= input.load(); - return promise; - }; - return { - name: input.name, - isSubscription: input.isSubscription, - loginLabel: input.loginLabel, - login: async (interaction, options) => (await loaded()).login(interaction, options), - refresh: async (credential, signal) => (await loaded()).refresh(credential, signal), - toAuth: async (credential) => (await loaded()).toAuth(credential) - }; -} - -// node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js -var __rewriteRelativeImportExtension2 = function(path5, preserveJsx) { - if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { - return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return path5; -}; -var importOAuthModule = (specifier) => { - const runtimeSpecifier = import.meta.url.endsWith(".js") ? specifier.replace(/\.ts$/, ".js") : specifier; - return import(__rewriteRelativeImportExtension2(runtimeSpecifier)); -}; -var bundledLoaders; -var loadAnthropicOAuth = async () => { - if (bundledLoaders) - return bundledLoaders.anthropic(); - return (await importOAuthModule("./anthropic.ts")).anthropicOAuth; -}; -var loadOpenAIChatGPTOAuth = async () => { - if (bundledLoaders) - return bundledLoaders.openaiChatGPT(); - return (await importOAuthModule("./openai-chatgpt.ts")).openaiChatGPTOAuth; -}; - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.js -init_models(); - -// node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json -var openai_default = { "openai-decisions": { "classifier:gpt-6-luna": { type: "classifier", id: "gpt-6-luna", name: "GPT-6 Luna", api: "openai-decisions", provider: "openai", baseUrl: "https://api.openai.com/v1", input: ["text", "image"], cost: { input: 0.1, output: 0, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 0.2, output: 0, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 922e3 } }, "openai-responses": { "chat:chat-latest": { id: "chat-latest", name: "Chat Latest", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4": { 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, compat: { supportsStrictMode: true }, type: "chat" }, "chat:gpt-4-turbo": { 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: 128e3, maxTokens: 4096, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1-mini": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1-nano": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-05-13": { 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: 128e3, maxTokens: 4096, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-08-06": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-11-20": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-mini": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5": { id: "gpt-5", name: "GPT-5", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-chat-latest": { id: "gpt-5-chat-latest", name: "GPT-5 Chat Latest", api: "openai-responses", baseUrl: "https://api.openai.com/v1", provider: "openai", reasoning: false, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 128e3, maxTokens: 16384, thinkingLevelMap: { off: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-mini": { id: "gpt-5-mini", name: "GPT-5 Mini", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.25, output: 2, cacheRead: 0.025, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-nano": { id: "gpt-5-nano", name: "GPT-5 Nano", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.05, output: 0.4, cacheRead: 5e-3, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-pro": { id: "gpt-5-pro", name: "GPT-5 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 15, output: 120, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: null, high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.1": { id: "gpt-5.1", name: "GPT-5.1", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.2": { id: "gpt-5.2", name: "GPT-5.2", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.2-pro": { id: "gpt-5.2-pro", name: "GPT-5.2 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 21, output: 168, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.3-codex": { id: "gpt-5.3-codex", name: "GPT-5.3 Codex", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.3-codex-spark": { 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, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 128e3, maxTokens: 32e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4": { id: "gpt-5.4", name: "GPT-5.4", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 5, output: 22.5, cacheRead: 0.5, cacheWrite: 0 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-mini": { id: "gpt-5.4-mini", name: "GPT-5.4 mini", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-nano": { id: "gpt-5.4-nano", name: "GPT-5.4 nano", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.2, output: 1.25, cacheRead: 0.02, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-pro": { id: "gpt-5.4-pro", name: "GPT-5.4 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 30, output: 180, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 60, output: 270, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.5": { id: "gpt-5.5", name: "GPT-5.5", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 10, output: 45, cacheRead: 1, cacheWrite: 0 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.5-pro": { id: "gpt-5.5-pro", name: "GPT-5.5 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 30, output: 180, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 60, output: 270, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-cyber": { id: "gpt-5.6-cyber", name: "GPT-5.6 Cyber", 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: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-luna": { id: "gpt-5.6-luna", name: "GPT-5.6 Luna", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25, tiers: [{ inputTokensAbove: 272e3, input: 0.4, output: 1.8, cacheRead: 0.04, cacheWrite: 0.5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-sol": { id: "gpt-5.6-sol", name: "GPT-5.6 Sol", 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, tiers: [{ inputTokensAbove: 272e3, input: 8, output: 30, cacheRead: 0.8, cacheWrite: 10 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-terra": { id: "gpt-5.6-terra", name: "GPT-5.6 Terra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 18, cacheRead: 0.4, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-astra": { id: "gpt-6-astra", name: "GPT-6 Astra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5, tiers: [{ inputTokensAbove: 272e3, input: 20, output: 75, cacheRead: 2, cacheWrite: 25 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-luna": { id: "gpt-6-luna", name: "GPT-6 Luna", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125, tiers: [{ inputTokensAbove: 272e3, input: 0.2, output: 0.75, cacheRead: 0.02, cacheWrite: 0.25 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-sol": { id: "gpt-6-sol", name: "GPT-6 Sol", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 15, cacheRead: 0.4, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6.1-sol": { id: "gpt-6.1-sol", name: "GPT-6.1 Sol", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 15, cacheRead: 0.2, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6.1-terra": { id: "gpt-6.1-terra", name: "GPT-6.1 Terra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1, output: 5, cacheRead: 0.05, cacheWrite: 1.25, tiers: [{ inputTokensAbove: 272e3, input: 2, output: 7.5, cacheRead: 0.1, cacheWrite: 2.5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-daybreak-blue-latest": { 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, tiers: [{ inputTokensAbove: 272e3, input: 8, output: 30, cacheRead: 0.8, cacheWrite: 10 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-daybreak-red-latest": { 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: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o1": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o1-pro": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o3": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o3-mini": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, type: "chat" }, "chat:o3-pro": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o4-mini": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" } } }; - -// node_modules/@earendil-works/pi-ai/dist/model-catalog.js -function flattenModelCatalog(groups, type) { - return Object.fromEntries(Object.values(groups).flatMap((models2) => Object.values(models2)).filter((model2) => model2.type === type).map((model2) => [model2.id, model2])); -} -function flattenChatModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "chat"); -} -function flattenImageModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "image"); -} -function flattenClassifierModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "classifier"); -} - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js -var OPENAI_MODELS = flattenChatModelCatalog("openai", openai_default); -var OPENAI_IMAGE_MODELS = flattenImageModelCatalog("openai", openai_default); -var OPENAI_CLASSIFIER_MODELS = flattenClassifierModelCatalog("openai", openai_default); - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.js -function openaiProvider() { - return createProvider({ - id: "openai", - name: "OpenAI", - baseUrl: "https://api.openai.com/v1", - auth: { - apiKey: envApiKeyAuth("OpenAI API key", ["OPENAI_API_KEY"]), - oauth: lazyOAuth({ - name: "OpenAI (ChatGPT subscription)", - isSubscription: true, - loginLabel: "Sign in with ChatGPT", - load: loadOpenAIChatGPTOAuth - }) - }, - models: [ - ...Object.values(OPENAI_MODELS), - ...Object.values(OPENAI_CLASSIFIER_MODELS) - ], - // Sign in with ChatGPT tokens only reach the Responses API; the Decisions API rejects them. - filterAllModels: (models2, credential) => credential?.type === "oauth" ? models2.filter((model2) => !isModelType(model2, "classifier")) : models2, - api: openAIResponsesApi(), - classifiers: { - "openai-decisions": openAIDecisionsApi() - } - }); -} - // node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js init_lazy(); var anthropicMessagesApi = () => lazyApi(() => Promise.resolve().then(() => (init_anthropic_messages(), anthropic_messages_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js -init_env_api_keys(); -init_models(); +// node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js +init_lazy(); +var openAIResponsesApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_responses(), openai_responses_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json -var anthropic_default = { "anthropic-messages": { "chat:claude-fable-5": { id: "claude-fable-5", name: "Claude Fable 5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true, allowedFallbackModels: [{ provider: "anthropic", model: "claude-opus-4-8", cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 } }, { provider: "anthropic", model: "claude-opus-5", cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 } }] }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-fable-5-1": { id: "claude-fable-5-1", name: "Claude Fable 5.1", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-4-5-20251001": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-5-5": { id: "claude-haiku-5-5", name: "Claude Haiku 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125, tiers: [{ inputTokensAbove: 1e5, input: 0.5, output: 2.5, cacheRead: 0.05, cacheWrite: 0.625 }] }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-5-20251101": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-6": { id: "claude-opus-4-6", name: "Claude Opus 4.6", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-7": { id: "claude-opus-4-7", name: "Claude Opus 4.7", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-8": { id: "claude-opus-4-8", name: "Claude Opus 4.8", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-5": { id: "claude-opus-5", name: "Claude Opus 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-5-5": { id: "claude-opus-5-5", name: "Claude Opus 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-5-20250929": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-6": { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-5": { id: "claude-sonnet-5", name: "Claude Sonnet 5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-5-5": { id: "claude-sonnet-5-5", name: "Claude Sonnet 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" } } }; +// node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js +init_lazy(); +var openAICompletionsApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_completions(), openai_completions_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js -var ANTHROPIC_MODELS = flattenChatModelCatalog("anthropic", anthropic_default); -var ANTHROPIC_IMAGE_MODELS = flattenImageModelCatalog("anthropic", anthropic_default); -var ANTHROPIC_CLASSIFIER_MODELS = flattenClassifierModelCatalog("anthropic", anthropic_default); - -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js -function anthropicApiKeyAuth() { +// models.ts +var CONFIG = "/etc/sausage/config.yaml"; +var adapters = { + "anthropic-messages": anthropicMessagesApi, + "openai-responses": openAIResponsesApi, + "openai-chat-completions": openAICompletionsApi +}; +function resolveModel(provider2, settings, entry2, catalog) { + const override = typeof entry2 === "string" ? { id: entry2 } : entry2; + const id = override.id; + const known = catalog[settings.catalog ?? provider2]?.models?.[id]; + const metadata = { + context_window: known?.limit?.context, + max_tokens: known?.limit?.output, + reasoning: known?.reasoning, + cost: known?.cost, + ...override + }; + const cost = { ...known?.cost, ...override.cost }; + const missing = ["context_window", "max_tokens", "reasoning"].filter((key) => metadata[key] === void 0); + for (const key of ["input", "output", "cache_read", "cache_write"]) if (cost[key] === void 0) missing.push(`cost.${key}`); + if (missing.length) throw new Error(`${CONFIG}: ${provider2}/${id} lacks ${missing.join(", ")}`); + const extra = Object.keys(override).filter((key) => !["id", "context_window", "max_tokens", "reasoning", "cost"].includes(key)); + const extraCost = Object.keys(override.cost ?? {}).filter((key) => !["input", "output", "cache_read", "cache_write"].includes(key)); + if (extra.length || extraCost.length) throw new Error(`${CONFIG}: invalid overrides for ${provider2}/${id}: ${[...extra, ...extraCost].join(", ")}`); return { - name: "Anthropic API key", - login: async (interaction) => { - interaction.signal.throwIfAborted(); - const key = await interaction.prompt({ type: "secret", message: "Enter Anthropic API key" }); - interaction.signal.throwIfAborted(); - return { type: "api_key", key }; - }, - resolve: async ({ ctx, credential, signal }) => { - signal.throwIfAborted(); - if (credential?.key) { - return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" }; - } - const authToken = await ctx.env(ANTHROPIC_AUTH_TOKEN_ENV); - signal.throwIfAborted(); - if (authToken) { - return { - auth: { headers: { Authorization: `Bearer ${authToken}` } }, - source: ANTHROPIC_AUTH_TOKEN_ENV - }; - } - for (const envVar of [ANTHROPIC_OAUTH_TOKEN_ENV, ANTHROPIC_API_KEY_ENV]) { - const apiKey = await ctx.env(envVar); - signal.throwIfAborted(); - if (apiKey) - return { auth: { apiKey }, source: envVar }; - } - const federation = {}; - for (const envVar of [ - ANTHROPIC_FEDERATION_RULE_ID_ENV, - ANTHROPIC_ORGANIZATION_ID_ENV, - ANTHROPIC_IDENTITY_TOKEN_FILE_ENV - ]) { - const value2 = await ctx.env(envVar); - signal.throwIfAborted(); - if (!value2) - return void 0; - federation[envVar] = value2; - } - for (const envVar of [ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_WORKSPACE_ID_ENV]) { - const value2 = await ctx.env(envVar); - signal.throwIfAborted(); - if (value2) - federation[envVar] = value2; - } - return { auth: {}, env: federation, source: "workload identity federation" }; - } + id, + name: known?.name ?? id, + provider: provider2, + api: settings.type === "openai-chat-completions" ? "openai-completions" : settings.type, + baseUrl: settings.base_url, + contextWindow: metadata.context_window, + maxTokens: metadata.max_tokens, + reasoning: metadata.reasoning, + input: known?.modalities?.input?.filter((type) => ["text", "image"].includes(type)) ?? ["text"], + cost: { input: cost.input, output: cost.output, cacheRead: cost.cache_read, cacheWrite: cost.cache_write } }; } -function anthropicProvider() { - return createProvider({ - id: "anthropic", - name: "Anthropic", - baseUrl: "https://api.anthropic.com", - auth: { - apiKey: anthropicApiKeyAuth(), - oauth: lazyOAuth({ - name: "Anthropic (Claude Pro/Max)", - isSubscription: true, - load: loadAnthropicOAuth - }) - }, - models: Object.values(ANTHROPIC_MODELS), - api: anthropicMessagesApi() - }); -} - -// proxy-models.ts -async function proxyModels(proxy2, readProxy = async () => proxy2) { - const models2 = createModels(); - const base = proxy2.base_url.replace(/\/$/, ""); - let catalog = []; +async function modelCatalog() { + let updated; try { - if (proxy2.base_url && proxy2.api_key) { - const response = await fetch(`${base}/v1/models`, { - headers: { Authorization: `Bearer ${proxy2.api_key}` }, - signal: AbortSignal.timeout(5e3) - }); - if (response.ok) catalog = (await response.json()).data ?? []; - } + const response = await fetch("https://models.dev/api.json", { signal: AbortSignal.timeout(5e3) }); + if (response.ok) updated = await response.json(); } catch { } - for (const [provider2, api2, path5, fallback] of [ - [openaiProvider(), "openai-responses", "/v1/responses", "gpt-6.1-sol"], - [anthropicProvider(), "anthropic-messages", "/apis/anthropic/v1/messages", "claude-opus-5-5"] - ]) { - const rows = catalog.filter((row) => row.creator === provider2.id && row.endpoints?.some((endpoint) => endpoint.api === api2)); - const entries2 = (rows.length ? rows : [{ id: fallback }]).map((row) => { - const endpoint = row.endpoints?.find((endpoint2) => endpoint2.api === api2)?.path ?? path5; - const suffix = api2 === "anthropic-messages" ? "/v1/messages" : "/responses"; - const baseUrl = `${base}${endpoint.slice(0, -suffix.length)}`; - const price = row.providers?.[0]?.pricing; - const scale = price?.currency === "USD" ? 1e6 / price.unit_tokens : 0; - return { - id: row.id, - name: row.name ?? row.id, - provider: provider2.id, - api: api2, - baseUrl, - reasoning: row.capabilities?.reasoning ?? true, - input: ["text"], - thinkingLevelMap: { - off: null, - minimal: null, - ...Object.fromEntries((row.capabilities?.reasoning_options?.find((option) => option.type === "effort")?.values ?? []).map((level) => [level, level])) - }, - compat: api2 === "anthropic-messages" ? { forceAdaptiveThinking: row.capabilities?.reasoning_options?.some((option) => option.type === "effort") ?? true } : void 0, - cost: { - input: (price?.input ?? 0) * scale, - output: (price?.output ?? 0) * scale, - cacheRead: (price?.cached_input ?? 0) * scale, - cacheWrite: (price?.cache_write ?? 0) * scale - }, - contextWindow: row.limits?.context_window ?? 2e5, - maxTokens: 4096 - }; - }); - models2.setProvider({ - ...provider2, - baseUrl: entries2[0].baseUrl, - getModels: () => entries2, - auth: { apiKey: { name: "Sausage proxy", resolve: async () => { - const current = await readProxy(); - if (!current.base_url || !current.api_key) throw new Error("Set proxy.base_url and proxy.api_key in /etc/sausage/config.yaml before a model request"); - return { auth: { - apiKey: current.api_key, - baseUrl: current.base_url.replace(/\/$/, "") + entries2[0].baseUrl.slice(base.length), - headers: { "Shopify-Usage-Tag": JSON.stringify(["pi", "sausage"]) } - }, source: "/etc/sausage/config.yaml" }; - } } } - }); - } + return Deno.core.ops.op_model_catalog(updated ?? null); +} +async function configuredModels(readProviders, catalog) { + const models2 = createModels(); + let installed = /* @__PURE__ */ new Set(); + models2.refreshConfig = async () => { + const settings = await readProviders(); + const next = new Set(Object.keys(settings)); + for (const name of installed) if (!next.has(name)) models2.deleteProvider(name); + for (const [name, value2] of Object.entries(settings)) { + const adapter = adapters[value2.type]; + if (!adapter) throw new Error(`${CONFIG}: unknown API type for provider ${name}: ${value2.type}`); + const entries2 = (value2.models ?? []).map((entry2) => resolveModel(name, value2, entry2, catalog)); + models2.setProvider(createProvider({ + id: name, + name, + baseUrl: value2.base_url, + models: entries2, + api: adapter(), + auth: { apiKey: { name: `${name} API key`, resolve: async () => { + const current = (await readProviders())[name]; + if (!current?.api_key || !current.base_url) throw new Error(`${CONFIG}: set providers.${name}.api_key and base_url before a model request`); + return { auth: { apiKey: current.api_key, baseUrl: current.base_url }, source: CONFIG }; + } } } + })); + } + installed = next; + }; + await models2.refreshConfig(); return models2; } @@ -50982,8 +51677,8 @@ function inflateMessage(data) { return `${head.slice(0, -1)},${JSON.stringify(field)}:${zlib.inflateRawSync(bytes2).toString("utf8")}}`; } async function inflate(bytes2) { - const stream4 = new Blob([bytes2]).stream().pipeThrough(new DecompressionStream("deflate-raw")); - return JSON.parse(await new Response(stream4).text()); + const stream5 = new Blob([bytes2]).stream().pipeThrough(new DecompressionStream("deflate-raw")); + return JSON.parse(await new Response(stream5).text()); } function parseFrame(data) { const frame = unpackObject(JSON.parse(data)); @@ -54516,7 +55211,7 @@ var ResetEntry = defineEntry("pi.reset"); var CompactionEntry = defineEntry("pi.compaction"); // node_modules/@earendil-works/pi-durable/dist/errors.js -function errorMessage2(error) { +function errorMessage(error) { if (error instanceof Error) return error.message; try { @@ -58272,10 +58967,10 @@ async function retryAssistantCall(produce, policy, signal, callbacks) { function isRetryableAssistantError(message) { if (message.stopReason !== "error" || !message.errorMessage) return false; - const errorMessage3 = message.errorMessage; - if (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage3)) + const errorMessage2 = message.errorMessage; + if (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage2)) return false; - return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage3); + return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage2); } // node_modules/@earendil-works/pi-durable/dist/tasks.js @@ -58728,7 +59423,7 @@ function assignJson(target, key, value2, plan) { const slots = target; const current = key === "__proto__" && !Object.hasOwn(slots, key) ? void 0 : slots[key]; const fields = plan?.kind === "fields" ? plan.fields : void 0; - if (isRecord2(current) && isRecord2(value2)) { + if (isRecord(current) && isRecord(value2)) { for (const name of Object.keys(current)) if (!Object.hasOwn(value2, name)) delete current[name]; @@ -58753,7 +59448,7 @@ function assignJson(target, key, value2, plan) { if (current !== value2) slots[key] = value2; } -function isRecord2(value2) { +function isRecord(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } @@ -58786,7 +59481,7 @@ var PartialChanges = class { if (call === void 0) return; for (const change of call.parser.append(event.delta)) { - if (change.path.length === 0 && !isRecord3(change.kind === "set" ? value(change) : null)) { + if (change.path.length === 0 && !isRecord2(change.kind === "set" ? value(change) : null)) { this.#toolCalls.delete(event.contentIndex); return; } @@ -58873,7 +59568,7 @@ function applyChange2(block, change) { const key = change.path.at(-1); if (key === void 0) { const root = change.kind === "set" ? value(change) : void 0; - if (isRecord3(root)) + if (isRecord2(root)) block.arguments = root; return; } @@ -58892,7 +59587,7 @@ function applyChange2(block, change) { function value(change) { return change.value; } -function isRecord3(value2) { +function isRecord2(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } @@ -61316,7 +62011,7 @@ var TaskScheduler = class { } if (step.kind === "fault") { fault = { error: step.error }; - const message = errorMessage2(step.error); + const message = errorMessage(step.error); invocation.fault = { status: "faulted", error: { message } }; await this.#terminate(tx, current, invocation.fault); } @@ -62774,12 +63469,12 @@ function validateToolArguments(tool, toolCall) { return result.value; } const errors = result.errors.map((error) => ` - ${formatValidationPath(error.path)}: ${error.message}`).join("\n"); - const errorMessage3 = `Validation failed for tool "${toolCall.name}": + const errorMessage2 = `Validation failed for tool "${toolCall.name}": ${errors} Received arguments: ${JSON.stringify(toolCall.arguments, null, 2)}`; - throw new Error(errorMessage3); + throw new Error(errorMessage2); } // node_modules/@earendil-works/pi-durable/dist/truncate.js @@ -62969,7 +63664,7 @@ var ToolTask = defineTask({ } catch (error) { if (runtime.signal.aborted) throw error; - block = errorMessage2(error); + block = errorMessage(error); } }); if (block !== void 0) { @@ -63086,14 +63781,14 @@ function prepare(tool, args) { try { return { args: tool.prepareArguments(args) }; } catch (error) { - return { error: errorMessage2(error) }; + return { error: errorMessage(error) }; } } function validate(tool, call, args) { try { return { args: validateToolArguments(tool, { ...call, arguments: args }) }; } catch (error) { - return { error: errorMessage2(error) }; + return { error: errorMessage(error) }; } } function invalid2(message) { @@ -63216,7 +63911,7 @@ async function run(runtime, input, call, tool, args, context) { waiter.reject(error); throw error; } - result = { isError: true, diagnostics: [toolDiagnostic("tool_error", errorMessage2(error))] }; + result = { isError: true, diagnostics: [toolDiagnostic("tool_error", errorMessage(error))] }; ending = { status: "failed", message: `Tool ${call.name} threw` }; } ended = true; @@ -63722,7 +64417,7 @@ var GenerationTask = defineTask({ }; const message = await streamResponse(runtime, model2, messages, options, attempt, context); const request2 = { attempt, compacted, model: ref, thinkingLevel, cutoff, messages: view2.messages }; - await classify2(runtime, request2, message, context); + await classify(runtime, request2, message, context); }, /** After the backoff's sleep; a run before `until` (an early wake, or a record of an earlier version) sleeps again. */ retry: async (task, runtime, context) => { @@ -63763,7 +64458,7 @@ var GenerationTask = defineTask({ telemetry: context.telemetry }); const request2 = { attempt, compacted, model: ref, thinkingLevel, cutoff, pollAt }; - await classify2(runtime, request2, message, context); + await classify(runtime, request2, message, context); }, tools: async (task, runtime, context) => { if (cutOffTooOften(task, runtime)) @@ -64065,7 +64760,7 @@ async function streamResponse(runtime, model2, messages, options, attempt, conte await inFlight; } } -async function classify2(runtime, request2, message, context) { +async function classify(runtime, request2, message, context) { runtime.signal.throwIfAborted(); const conversationId = runtime.conversationId; const { attempt, compacted, model: ref, thinkingLevel, cutoff } = request2; @@ -68766,8 +69461,8 @@ function environment(cwd = "/", conversation2, invocation) { exec: async (command, options, context) => { let spillPath; let pending = "", bytes2 = 0, lines2 = 0; - const output = async (text2, stream4) => { - options?.onOutput?.(text2, context, { stream: stream4 }); + const output = async (text2, stream5) => { + options?.onOutput?.(text2, context, { stream: stream5 }); if (!options?.spill) return; bytes2 += new TextEncoder().encode(text2).length; lines2 += text2.split("\n").length - 1; @@ -68806,9 +69501,9 @@ function environment(cwd = "/", conversation2, invocation) { await output(decoders[chunk.stream].decode(new Uint8Array(chunk.bytes), { stream: true }), chunk.stream); } if (result.error) throw new Error(result.error); - for (const stream4 of ["stdout", "stderr"]) { - const text2 = decoders[stream4].decode(); - if (text2) await output(text2, stream4); + for (const stream5 of ["stdout", "stderr"]) { + const text2 = decoders[stream5].decode(); + if (text2) await output(text2, stream5); } return ok({ exitCode: result.exitCode, ...spillPath ? { spillPath } : {} }); } catch (error) { @@ -76588,6 +77283,49 @@ __export(dist_exports5, { init_lazy(); init_context(); init_credential_store(); + +// node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +function envApiKeyAuth(name, envVars) { + return { + name, + login: async (interaction) => { + interaction.signal.throwIfAborted(); + const key = await interaction.prompt({ type: "secret", message: `Enter ${name}` }); + interaction.signal.throwIfAborted(); + return { type: "api_key", key }; + }, + resolve: async ({ ctx, credential, signal }) => { + signal.throwIfAborted(); + if (credential?.key) { + return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" }; + } + for (const envVar of envVars) { + const value2 = await ctx.env(envVar); + signal.throwIfAborted(); + if (value2) + return { auth: { apiKey: value2 }, source: envVar }; + } + return void 0; + } + }; +} +function lazyOAuth(input) { + let promise; + const loaded = () => { + promise ??= input.load(); + return promise; + }; + return { + name: input.name, + isSubscription: input.isSubscription, + loginLabel: input.loginLabel, + login: async (interaction, options) => (await loaded()).login(interaction, options), + refresh: async (credential, signal) => (await loaded()).refresh(credential, signal), + toAuth: async (credential) => (await loaded()).toAuth(credential) + }; +} + +// node_modules/@earendil-works/pi-ai/dist/index.js init_models(); init_models_store(); @@ -76810,38 +77548,38 @@ function scheduleChunk(chunk, tokensPerSecond) { const delayMs = estimateTokens(chunk) / tokensPerSecond * 1e3; return new Promise((resolve2) => setTimeout(resolve2, delayMs)); } -async function streamWithDeltas(stream4, message, minTokenSize, maxTokenSize, tokensPerSecond, signal) { +async function streamWithDeltas(stream5, message, minTokenSize, maxTokenSize, tokensPerSecond, signal) { const partial2 = { ...message, content: [], stopReason: "pending" }; if (signal?.aborted) { const aborted = createAbortedMessage(partial2); - stream4.push({ type: "error", reason: "aborted", error: aborted }); - stream4.end(aborted); + stream5.push({ type: "error", reason: "aborted", error: aborted }); + stream5.end(aborted); return; } - stream4.push({ type: "start", partial: { ...partial2 } }); + stream5.push({ type: "start", partial: { ...partial2 } }); for (let index = 0; index < message.content.length; index++) { if (signal?.aborted) { const aborted = createAbortedMessage(partial2); - stream4.push({ type: "error", reason: "aborted", error: aborted }); - stream4.end(aborted); + stream5.push({ type: "error", reason: "aborted", error: aborted }); + stream5.end(aborted); return; } const block = message.content[index]; if (block.type === "thinking") { partial2.content = [...partial2.content, { type: "thinking", thinking: "" }]; - stream4.push({ type: "thinking_start", contentIndex: index, partial: { ...partial2 } }); + stream5.push({ type: "thinking_start", contentIndex: index, partial: { ...partial2 } }); for (const chunk of splitStringByTokenSize(block.thinking, minTokenSize, maxTokenSize)) { await scheduleChunk(chunk, tokensPerSecond); if (signal?.aborted) { const aborted = createAbortedMessage(partial2); - stream4.push({ type: "error", reason: "aborted", error: aborted }); - stream4.end(aborted); + stream5.push({ type: "error", reason: "aborted", error: aborted }); + stream5.end(aborted); return; } partial2.content[index].thinking += chunk; - stream4.push({ type: "thinking_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); + stream5.push({ type: "thinking_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); } - stream4.push({ + stream5.push({ type: "thinking_end", contentIndex: index, content: block.thinking, @@ -76851,48 +77589,48 @@ async function streamWithDeltas(stream4, message, minTokenSize, maxTokenSize, to } if (block.type === "text") { partial2.content = [...partial2.content, { type: "text", text: "" }]; - stream4.push({ type: "text_start", contentIndex: index, partial: { ...partial2 } }); + stream5.push({ type: "text_start", contentIndex: index, partial: { ...partial2 } }); for (const chunk of splitStringByTokenSize(block.text, minTokenSize, maxTokenSize)) { await scheduleChunk(chunk, tokensPerSecond); if (signal?.aborted) { const aborted = createAbortedMessage(partial2); - stream4.push({ type: "error", reason: "aborted", error: aborted }); - stream4.end(aborted); + stream5.push({ type: "error", reason: "aborted", error: aborted }); + stream5.end(aborted); return; } partial2.content[index].text += chunk; - stream4.push({ type: "text_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); + stream5.push({ type: "text_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); } - stream4.push({ type: "text_end", contentIndex: index, content: block.text, partial: { ...partial2 } }); + stream5.push({ type: "text_end", contentIndex: index, content: block.text, partial: { ...partial2 } }); continue; } partial2.content = [...partial2.content, { type: "toolCall", id: block.id, name: block.name, arguments: {} }]; - stream4.push({ type: "toolcall_start", contentIndex: index, partial: { ...partial2 } }); + stream5.push({ type: "toolcall_start", contentIndex: index, partial: { ...partial2 } }); const toolArguments = new ToolCallArgumentsStream(); for (const chunk of splitStringByTokenSize(JSON.stringify(block.arguments), minTokenSize, maxTokenSize)) { await scheduleChunk(chunk, tokensPerSecond); if (signal?.aborted) { const aborted = createAbortedMessage(partial2); - stream4.push({ type: "error", reason: "aborted", error: aborted }); - stream4.end(aborted); + stream5.push({ type: "error", reason: "aborted", error: aborted }); + stream5.end(aborted); return; } partial2.content[index].arguments = toolArguments.append(chunk); - stream4.push({ type: "toolcall_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); + stream5.push({ type: "toolcall_delta", contentIndex: index, delta: chunk, partial: { ...partial2 } }); } partial2.content[index].arguments = block.arguments; - stream4.push({ type: "toolcall_end", contentIndex: index, toolCall: block, partial: { ...partial2 } }); + stream5.push({ type: "toolcall_end", contentIndex: index, toolCall: block, partial: { ...partial2 } }); } if (message.stopReason === "pending") { throw new Error("Faux response ended without a stop reason"); } if (message.stopReason === "error" || message.stopReason === "aborted") { - stream4.push({ type: "error", reason: message.stopReason, error: message }); - stream4.end(message); + stream5.push({ type: "error", reason: message.stopReason, error: message }); + stream5.end(message); return; } - stream4.push({ type: "done", reason: message.stopReason, message }); - stream4.end(message); + stream5.push({ type: "done", reason: message.stopReason, message }); + stream5.end(message); } function createFauxCore(options) { const api2 = options.api ?? randomId(DEFAULT_API); @@ -76932,7 +77670,7 @@ function createFauxCore(options) { const resolved = typeof step === "function" ? await step(context, streamOptions, state2, requestModel) : step; return withUsageEstimate(cloneMessage(resolved, api2, provider2, requestModel.id), context, streamOptions, promptCache); }; - const stream4 = (requestModel, context, streamOptions) => { + const stream5 = (requestModel, context, streamOptions) => { const outer = createAssistantMessageEventStream(); const step = pendingResponses.shift(); state2.callCount++; @@ -76976,7 +77714,7 @@ function createFauxCore(options) { }); return outer; }; - const streamSimple3 = (streamModel, context, streamOptions) => stream4(streamModel, context, streamOptions); + const streamSimple4 = (streamModel, context, streamOptions) => stream5(streamModel, context, streamOptions); const fetchDeferred = (requestModel, handle, fetchOptions) => { const outer = createAssistantMessageEventStream(); state2.deferredFetchCount++; @@ -77028,8 +77766,8 @@ function createFauxCore(options) { api: api2, provider: provider2, models: models2, - stream: stream4, - streamSimple: streamSimple3, + stream: stream5, + streamSimple: streamSimple4, fetchDeferred, cancelDeferred: cancelDeferred2, getModel, @@ -77328,10 +78066,10 @@ async function exec(command, options) { if (!chunk.stream) { if (chunk.error) throw new Error(chunk.error); result.code = chunk.exitCode; - for (const stream4 of ["stdout", "stderr"]) { - const text3 = decoders[stream4].decode(); - result[stream4] += text3; - if (text3) options.onOutput?.(text3, stream4); + for (const stream5 of ["stdout", "stderr"]) { + const text3 = decoders[stream5].decode(); + result[stream5] += text3; + if (text3) options.onOutput?.(text3, stream5); } return result; } @@ -77578,10 +78316,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state2 }), async standing() { + return { reload: enqueue2, state: () => ({ ...state2 }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -77665,7 +78403,7 @@ function harnessApi(harness2, models2, extensions2, context) { }; try { if (input.method === "GET" && path5 === "/conversations") { - const standing2 = await extensions2.standing?.() ?? null; + const mainAgent2 = await extensions2.mainAgent?.() ?? null; const records = await harness2.commit(async (tx) => { const all = []; let cursor; @@ -77684,7 +78422,7 @@ function harnessApi(harness2, models2, extensions2, context) { const started = await harness2.snapshot(Started2, record2.id, context); return { ...record2, title: metadata?.title ?? "", agent, starter: started?.by ?? null, concluded: concluded.has(record2.id), running: !!live?.run }; })); - reply(200, { conversations, standing: standing2 }); + reply(200, { conversations, main_agent: mainAgent2 }); return; } if (input.method === "GET" && path5 === "/events") { @@ -77697,6 +78435,7 @@ function harnessApi(harness2, models2, extensions2, context) { return; } if (input.method === "GET" && path5 === "/models") { + await models2.refreshConfig?.(); reply(200, { models: models2.getAllModels().map(({ id, name, provider: provider2, contextWindow, maxTokens, reasoning, cost }) => ({ id, name, provider: provider2, contextWindow, maxTokens, reasoning, cost })) }); return; } @@ -77750,8 +78489,7 @@ function harnessApi(harness2, models2, extensions2, context) { } // main.ts -var proxy = await Deno.core.ops.op_model_proxy(); -var models = await proxyModels(proxy, () => Deno.core.ops.op_model_proxy()); +var models = await configuredModels(() => Deno.core.ops.op_model_providers(), await modelCatalog()); var registry2 = createRegistry(); registry2.install(CodingTools2); registry2.install(CredentialRequests); @@ -77768,9 +78506,9 @@ var chain = conversationChains(harness, BACKGROUND_CONTEXT); await harness.root(BACKGROUND_CONTEXT, { agent: { cwd: "/src/sausage" } }); var stopRequests = await startRequests(harness, BACKGROUND_CONTEXT); var extensions = await loadExtensions(harness, registry2, storage, models, BACKGROUND_CONTEXT, [CodingTools2, CredentialRequests]); -var standing = await extensions.standing(); -if (!standing) throw new Error("The world needs the models and subagents extensions for its standing agent"); -var conversation = await harness.conversation(standing.conversationId, BACKGROUND_CONTEXT); +var mainAgent = await extensions.mainAgent(); +if (!mainAgent) throw new Error("The world needs the models and subagents extensions for its main agent"); +var conversation = await harness.conversation(mainAgent.conversationId, BACKGROUND_CONTEXT); var watch = await conversation.watch(BACKGROUND_CONTEXT); var emitted = /* @__PURE__ */ new Map(); var partial = ""; @@ -77803,7 +78541,7 @@ await serve(harness, BACKGROUND_CONTEXT, globalThis.consoleEnabled ? async () => render(final.value); await final.stop(); Deno.core.ops.op_output("\n"); -} : void 0, api, async () => (await extensions.standing()).conversationId); +} : void 0, api, async () => (await extensions.mainAgent()).conversationId); await api.close(); await extensions.close(); await stopRequests(); diff --git a/host/js/core-ext-test-bundle.js b/host/js/core-ext-test-bundle.js index 5ad929f..eb3772c 100644 --- a/host/js/core-ext-test-bundle.js +++ b/host/js/core-ext-test-bundle.js @@ -654,13 +654,13 @@ function lazyApi(load, capabilities) { } // node_modules/@earendil-works/pi-ai/dist/auth/context.js -var __rewriteRelativeImportExtension = function(path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +var __rewriteRelativeImportExtension = function(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path; + return path2; }; var importNodeModule = (specifier) => import(__rewriteRelativeImportExtension(specifier)); function getProcessEnv() { @@ -673,10 +673,10 @@ function defaultProviderAuthContext() { const value2 = getProcessEnv()?.[name]; return typeof value2 === "string" && value2.trim().length > 0 ? value2 : void 0; }, - async fileExists(path) { + async fileExists(path2) { try { const fs2 = await importNodeModule("node:fs/promises"); - let resolved = path; + let resolved = path2; if (resolved.startsWith("~")) { const os = await importNodeModule("node:os"); resolved = os.homedir() + resolved.slice(1); @@ -859,7 +859,7 @@ async function resolveProviderAuthWithSignal(provider2, credentials, authContext function overlayEnvAuthContext(base, env) { return { env: async (name) => env[name] || await base.env(name), - fileExists: (path) => base.fileExists(path) + fileExists: (path2) => base.fileExists(path2) }; } var DEFAULT_OAUTH_MINIMUM_VALIDITY_MS = 5 * 60 * 1e3; @@ -2451,11 +2451,11 @@ var StreamingJsonParser = class { return; } const slot = this.#valueSlot(); - const path = this.#reportedPath(slot); - this.#string = { target: "value", slot, text: "", escape: "", path, change: void 0 }; + const path2 = this.#reportedPath(slot); + this.#string = { target: "value", slot, text: "", escape: "", path: path2, change: void 0 }; this.#place(slot, ""); - if (path !== void 0) - this.#string.change = this.#report({ kind: "set", path, value: "" }); + if (path2 !== void 0) + this.#string.change = this.#report({ kind: "set", path: path2, value: "" }); } /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ #reportedPath(slot) { @@ -2540,9 +2540,9 @@ var StreamingJsonParser = class { const value2 = scalarValue(token); if (value2 !== void 0) { this.#place(slot, value2); - const path = this.#reportedPath(slot); - if (path !== void 0) - this.#report({ kind: "set", path, value: value2 }); + const path2 = this.#reportedPath(slot); + if (path2 !== void 0) + this.#report({ kind: "set", path: path2, value: value2 }); } this.#valueEnded(this.#stack.at(-1)); } @@ -2557,21 +2557,21 @@ var StreamingJsonParser = class { } #openContainer(container) { const slot = this.#valueSlot(); - const path = this.#reportedPath(slot); + const path2 = this.#reportedPath(slot); this.#place(slot, container); this.#stack.push({ container, slot, - path, - reportsInside: path !== void 0 && path.length < MAX_REPORTED_DEPTH, + path: path2, + reportsInside: path2 !== void 0 && path2.length < MAX_REPORTED_DEPTH, size: 0, key: void 0, phase: Array.isArray(container) ? "value" : "key" }); this.#pathCost += 1; this.#dirty = true; - if (path !== void 0) - this.#report({ kind: "set", path, value: Array.isArray(container) ? [] : {} }); + if (path2 !== void 0) + this.#report({ kind: "set", path: path2, value: Array.isArray(container) ? [] : {} }); } #closeContainer() { const frame = this.#stack.pop(); @@ -5215,11 +5215,11 @@ var Explainer = class { return this.c.check(node, base)(v); } // For $dynamicRef schemas this check runs outside the original dynamic scope, so their errors are approximate. - walk(node, base, v, path, out) { + walk(node, base, v, path2, out) { if (node === true) return; if (node === false) { - out.push({ path, keyword: "false", message: "no value is allowed here" }); + out.push({ path: path2, keyword: "false", message: "no value is allowed here" }); return; } if (!isSchemaObject(node)) @@ -5228,11 +5228,11 @@ var Explainer = class { if (this.ok(node, b, v)) return; const start = out.length; - const push = (keyword, message, at = path) => { + const push = (keyword, message, at = path2) => { out.push({ path: at, keyword, message }); }; if (this.c.draft === "7" && typeof node.$ref === "string") { - this.walkRef(node.$ref, b, v, path, out); + this.walkRef(node.$ref, b, v, path2, out); return; } if (node.type !== void 0) { @@ -5254,56 +5254,56 @@ var Explainer = class { if (typeof v === "number") this.walkNumber(node, v, push); if (isObject(v)) - this.walkObject(node, b, v, path, out, push); + this.walkObject(node, b, v, path2, out, push); if (Array.isArray(v)) - this.walkArray(node, b, v, path, out, push); + this.walkArray(node, b, v, path2, out, push); if (Array.isArray(node.allOf)) for (const s of node.allOf) - this.walk(s, b, v, path, out); + this.walk(s, b, v, path2, out); if (Array.isArray(node.anyOf)) - this.walkUnion(node.anyOf, b, v, path, out, false); + this.walkUnion(node.anyOf, b, v, path2, out, false); if (Array.isArray(node.oneOf)) - this.walkUnion(node.oneOf, b, v, path, out, true); + this.walkUnion(node.oneOf, b, v, path2, out, true); if (node.not !== void 0 && this.ok(node.not, b, v)) push("not", "must not match the schema in not"); if (node.if !== void 0) { const branch = this.ok(node.if, b, v) ? node.then : node.else; if (branch !== void 0) - this.walk(branch, b, v, path, out); + this.walk(branch, b, v, path2, out); } if (typeof node.$ref === "string") - this.walkRef(node.$ref, b, v, path, out); + this.walkRef(node.$ref, b, v, path2, out); if (out.length === start && (node.unevaluatedProperties !== void 0 || node.unevaluatedItems !== void 0)) { - this.walkUnevaluated(node, b, v, path, out); + this.walkUnevaluated(node, b, v, path2, out); } if (out.length === start && typeof node.$dynamicRef === "string") { push("$dynamicRef", "does not match the dynamically referenced schema"); } } - walkRef(ref, base, v, path, out) { + walkRef(ref, base, v, path2, out) { const target = this.c.r.resolve(ref, base); if (target.node === false && this.c.r.isUnresolved(ref, base)) { - out.push({ path, keyword: "$ref", message: `unresolved reference ${ref}` }); + out.push({ path: path2, keyword: "$ref", message: `unresolved reference ${ref}` }); return; } if (!isSchemaObject(target.node) || typeof v !== "object" || v === null) { - this.walk(target.node, target.base, v, path, out); + this.walk(target.node, target.base, v, path2, out); return; } this.memo ??= /* @__PURE__ */ new Map(); let values = this.memo.get(target.node); const known = values?.get(v); - if (known !== void 0 && known.path === path) { + if (known !== void 0 && known.path === path2) { out.push(...known.errors); return; } const errors = []; - this.walk(target.node, target.base, v, path, errors); + this.walk(target.node, target.base, v, path2, errors); if (values === void 0) { values = /* @__PURE__ */ new Map(); this.memo.set(target.node, values); } - values.set(v, { path, errors }); + values.set(v, { path: path2, errors }); out.push(...errors); } walkString(node, v, push) { @@ -5345,16 +5345,16 @@ var Explainer = class { push("multipleOf", `expected a multiple of ${node.multipleOf}`); } } - walkObject(node, b, v, path, out, push) { + walkObject(node, b, v, path2, out, push) { const properties = isSchemaObject(node.properties) ? node.properties : {}; const required = Array.isArray(node.required) ? node.required : []; for (const k of required) { if (typeof k === "string" && (!Object.hasOwn(v, k) || v[k] === void 0)) - push("required", "missing", pointer(path, k)); + push("required", "missing", pointer(path2, k)); } for (const k of Object.keys(properties)) { if (Object.hasOwn(v, k) && v[k] !== void 0) - this.walk(properties[k], b, v[k], pointer(path, k), out); + this.walk(properties[k], b, v[k], pointer(path2, k), out); } const patterns = isSchemaObject(node.patternProperties) ? Object.entries(node.patternProperties) : []; for (const k of Object.keys(v)) { @@ -5362,17 +5362,17 @@ var Explainer = class { for (const [p, s] of patterns) { if (sharedRegex(p).test(k)) { matched = true; - this.walk(s, b, v[k], pointer(path, k), out); + this.walk(s, b, v[k], pointer(path2, k), out); } } if (!matched && node.additionalProperties !== void 0) { if (node.additionalProperties === false) - push("additionalProperties", "unknown field", pointer(path, k)); + push("additionalProperties", "unknown field", pointer(path2, k)); else - this.walk(node.additionalProperties, b, v[k], pointer(path, k), out); + this.walk(node.additionalProperties, b, v[k], pointer(path2, k), out); } if (node.propertyNames !== void 0 && !this.ok(node.propertyNames, b, k)) { - push("propertyNames", "invalid property name", pointer(path, k)); + push("propertyNames", "invalid property name", pointer(path2, k)); } } const count = Object.keys(v).length; @@ -5390,19 +5390,19 @@ var Explainer = class { if (!Object.hasOwn(v, k)) continue; if (!Array.isArray(d)) - this.walk(d, b, v, path, out); + this.walk(d, b, v, path2, out); else for (const r of d) if (!Object.hasOwn(v, r)) - push("dependentRequired", `required when ${k} is present`, pointer(path, r)); + push("dependentRequired", `required when ${k} is present`, pointer(path2, r)); } if (this.c.draft !== "7" && isSchemaObject(node.dependentSchemas)) { for (const [k, s] of Object.entries(node.dependentSchemas)) if (Object.hasOwn(v, k)) - this.walk(s, b, v, path, out); + this.walk(s, b, v, path2, out); } } - walkArray(node, b, v, path, out, push) { + walkArray(node, b, v, path2, out, push) { let prefix = []; let rest; if (Array.isArray(node.items)) { @@ -5416,7 +5416,7 @@ var Explainer = class { for (let i = 0; i < v.length; i++) { const s = i < prefix.length ? prefix[i] : rest; if (s !== void 0) - this.walk(s, b, v[i], `${path}/${i}`, out); + this.walk(s, b, v[i], `${path2}/${i}`, out); } if (typeof node.minItems === "number" && v.length < node.minItems) { push("minItems", `expected at least ${node.minItems} items`); @@ -5435,13 +5435,13 @@ var Explainer = class { } } } - walkUnion(branches, b, v, path, out, exactlyOne) { + walkUnion(branches, b, v, path2, out, exactlyOne) { const matches = branches.filter((s) => this.ok(s, b, v)).length; if (matches === 1 || !exactlyOne && matches > 0) return; const keyword = exactlyOne ? "oneOf" : "anyOf"; if (matches > 1) { - out.push({ path, keyword, message: "matches more than one alternative" }); + out.push({ path: path2, keyword, message: "matches more than one alternative" }); return; } const tag = this.tagOf(branches, b); @@ -5449,18 +5449,18 @@ var Explainer = class { const i = tag.values.indexOf(v[tag.key]); if (i < 0) out.push({ - path: pointer(path, tag.key), + path: pointer(path2, tag.key), keyword, message: `expected one of ${listValues(tag.values)}` }); else - this.walk(branches[i], b, v, path, out); + this.walk(branches[i], b, v, path2, out); return; } let best; for (const s of branches) { const errors = []; - this.walk(s, b, v, path, errors); + this.walk(s, b, v, path2, errors); if (errors.length === 0) continue; const declared = isObject(v) ? this.declaredKeys(s, b, v) : 0; @@ -5468,7 +5468,7 @@ var Explainer = class { if (better) best = { errors, declared }; } - out.push(...best?.errors ?? [{ path, keyword, message: "matches no alternative" }]); + out.push(...best?.errors ?? [{ path: path2, keyword, message: "matches no alternative" }]); } /** How many of the keys of `v` the branch `s` (through a `$ref`) declares in `properties`. */ declaredKeys(s, b, v) { @@ -5492,7 +5492,7 @@ var Explainer = class { } return void 0; } - walkUnevaluated(node, b, v, path, out) { + walkUnevaluated(node, b, v, path2, out) { const { unevaluatedProperties: unevaluatedProperties2, unevaluatedItems: unevaluatedItems2, ...rest } = node; const a = newAnnotations(); this.c.annotating(rest, b)(v, a); @@ -5501,9 +5501,9 @@ var Explainer = class { if (a.props?.has(k)) continue; if (unevaluatedProperties2 === false) { - out.push({ path: pointer(path, k), keyword: "unevaluatedProperties", message: "unknown field" }); + out.push({ path: pointer(path2, k), keyword: "unevaluatedProperties", message: "unknown field" }); } else - this.walk(unevaluatedProperties2, b, v[k], pointer(path, k), out); + this.walk(unevaluatedProperties2, b, v[k], pointer(path2, k), out); } } if (Array.isArray(v) && unevaluatedItems2 !== void 0 && !a.allItems) { @@ -5511,9 +5511,9 @@ var Explainer = class { if (a.indexes?.has(i)) continue; if (unevaluatedItems2 === false) { - out.push({ path: `${path}/${i}`, keyword: "unevaluatedItems", message: "unexpected item" }); + out.push({ path: `${path2}/${i}`, keyword: "unevaluatedItems", message: "unexpected item" }); } else - this.walk(unevaluatedItems2, b, v[i], `${path}/${i}`, out); + this.walk(unevaluatedItems2, b, v[i], `${path2}/${i}`, out); } } } @@ -5532,8 +5532,8 @@ function containsMessage(min, max) { return `expected at most ${max} matching ${max === 1 ? "item" : "items"}`; return `expected between ${min} and ${max} matching items`; } -function pointer(path, key) { - return `${path}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`; +function pointer(path2, key) { + return `${path2}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`; } function typeName(v) { if (v === null) @@ -6243,11 +6243,11 @@ var emitOperation = (operations, operation) => { operations.push(operation); }; var isContainer = (value2) => value2 !== null && typeof value2 === "object"; -var emitSet = (path, value2, operations) => { - if (path.length === 0) +var emitSet = (path2, value2, operations) => { + if (path2.length === 0) emitOperation(operations, ["r", value2]); else - emitOperation(operations, ["s", path, value2]); + emitOperation(operations, ["s", path2, value2]); }; var equalJson = (left, right) => { if (left === right) @@ -6295,21 +6295,21 @@ var permutation = (before, after) => { } return result; }; -var emitString = (before, after, path, operations) => { +var emitString = (before, after, path2, operations) => { if (before === after) return; if (after.length > before.length && after.slice(0, before.length) === before) { - emitOperation(operations, ["a", path, ownedSlice2(after, before.length)]); + emitOperation(operations, ["a", path2, ownedSlice2(after, before.length)]); return; } const shared = overlap(before, after, DEFAULT_OVERLAP_SCAN); if (shared === 0) { - emitOperation(operations, ["s", path, after]); + emitOperation(operations, ["s", path2, after]); return; } - emitOperation(operations, ["t", path, before.length - shared]); + emitOperation(operations, ["t", path2, before.length - shared]); if (after.length > shared) - emitOperation(operations, ["a", path, ownedSlice2(after, shared)]); + emitOperation(operations, ["a", path2, ownedSlice2(after, shared)]); }; var MAX_IDENTITY_CANDIDATES = 2e5; var MAX_SEMANTIC_CELLS = 65536; @@ -6460,27 +6460,27 @@ var identityAnchors = (before, beforeStart, beforeEnd, after, afterStart, afterE matches.reverse(); return matches; }; -var processArrayMatches = (before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, matches) => { +var processArrayMatches = (before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, matches) => { let beforeAt = beforeStart; let afterAt = afterStart; let outputAt = outputStart; for (const [beforeMatch, afterMatch] of matches) { if (overflowedBatches.has(operations)) return; - diffArrayRegion(before, after, path, operations, beforeAt, beforeMatch, afterAt, afterMatch, outputAt); + diffArrayRegion(before, after, path2, operations, beforeAt, beforeMatch, afterAt, afterMatch, outputAt); outputAt += afterMatch - afterAt; if (!sameValue(before[beforeMatch], after[afterMatch])) { - diffValue(before[beforeMatch], after[afterMatch], [...path, outputAt], operations); + diffValue(before[beforeMatch], after[afterMatch], [...path2, outputAt], operations); } outputAt += 1; beforeAt = beforeMatch + 1; afterAt = afterMatch + 1; } if (!overflowedBatches.has(operations)) { - diffArrayRegion(before, after, path, operations, beforeAt, beforeEnd, afterAt, afterEnd, outputAt); + diffArrayRegion(before, after, path2, operations, beforeAt, beforeEnd, afterAt, afterEnd, outputAt); } }; -function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart) { +function diffArrayRegion(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart) { if (overflowedBatches.has(operations)) return; while (beforeStart < beforeEnd && afterStart < afterEnd && sameValue(before[beforeStart], after[afterStart])) { @@ -6497,7 +6497,7 @@ function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd if (beforeCount === 0 && afterCount === 0) return; if (beforeCount === 0 || afterCount === 0) { - emitOperation(operations, ["p", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); + emitOperation(operations, ["p", path2, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); return; } if (beforeCount === afterCount) { @@ -6508,83 +6508,83 @@ function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd } } if (positional.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, positional); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, positional); return; } } const subsequence = identitySubsequence(before, beforeStart, beforeEnd, after, afterStart, afterEnd); if (subsequence !== void 0 && subsequence.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, subsequence); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, subsequence); return; } const identity = identityAnchors(before, beforeStart, beforeEnd, after, afterStart, afterEnd); if (identity.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, identity); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, identity); return; } const semantic = lcsMatches(before.slice(beforeStart, beforeEnd), after.slice(afterStart, afterEnd), semanticallyAligned, MAX_SEMANTIC_CELLS); if (semantic !== void 0 && semantic.length > 0) { const absolute = semantic.map(([beforeIndex, afterIndex]) => [beforeStart + beforeIndex, afterStart + afterIndex]); - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, absolute); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, absolute); return; } if (beforeCount === 1 && afterCount === 1) { - diffValue(before[beforeStart], after[afterStart], [...path, outputStart], operations); + diffValue(before[beforeStart], after[afterStart], [...path2, outputStart], operations); return; } - emitOperation(operations, ["p", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); + emitOperation(operations, ["p", path2, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); } -var diffArray = (before, after, path, operations) => { +var diffArray = (before, after, path2, operations) => { if (before === after || equalJson(before, after)) return; if (before.length === after.length && before.length > 1 && !sameValue(before[0], after[0]) && !sameValue(before[before.length - 1], after[after.length - 1])) { const order = permutation(before, after); if (order !== void 0) { - emitOperation(operations, ["m", path, order]); + emitOperation(operations, ["m", path2, order]); return; } } - diffArrayRegion(before, after, path, operations, 0, before.length, 0, after.length, 0); + diffArrayRegion(before, after, path2, operations, 0, before.length, 0, after.length, 0); }; -var diffObject = (before, after, path, operations) => { +var diffObject = (before, after, path2, operations) => { const beforeKeys = Object.keys(before); const afterKeys = Object.keys(after); if ([...beforeKeys, ...afterKeys].some((key) => RESERVED_SEGMENTS.has(key))) { if (!equalJson(before, after)) - emitSet(path, after, operations); + emitSet(path2, after, operations); return; } for (const key of afterKeys) { if (overflowedBatches.has(operations)) return; if (Object.hasOwn(before, key)) - diffValue(before[key], after[key], [...path, key], operations); + diffValue(before[key], after[key], [...path2, key], operations); else - emitSet([...path, key], after[key], operations); + emitSet([...path2, key], after[key], operations); } for (const key of beforeKeys) { if (overflowedBatches.has(operations)) return; if (!Object.hasOwn(after, key)) - emitOperation(operations, ["d", [...path, key]]); + emitOperation(operations, ["d", [...path2, key]]); } }; -var diffValue = (before, after, path, operations) => { +var diffValue = (before, after, path2, operations) => { if (before === after || overflowedBatches.has(operations)) return; - if (typeof before === "string" && typeof after === "string" && path.length > 0) { - emitString(before, after, path, operations); + if (typeof before === "string" && typeof after === "string" && path2.length > 0) { + emitString(before, after, path2, operations); return; } if (Array.isArray(before) && Array.isArray(after)) { - diffArray(before, after, path, operations); + diffArray(before, after, path2, operations); return; } if (isContainer(before) && isContainer(after) && !Array.isArray(before) && !Array.isArray(after)) { - diffObject(before, after, path, operations); + diffObject(before, after, path2, operations); return; } - emitSet(path, after, operations); + emitSet(path2, after, operations); }; var jsonCost = (value2) => { if (value2 === null) @@ -6608,10 +6608,10 @@ var jsonCost = (value2) => { } return cost; }; -var pathCost = (path) => { +var pathCost = (path2) => { let cost = 2; - for (let index = 0; index < path.length; index++) { - const segment = path[index]; + for (let index = 0; index < path2.length; index++) { + const segment = path2[index]; cost += (typeof segment === "string" ? segment.length + 2 : String(segment).length) + (index === 0 ? 0 : 1); } return cost; @@ -6792,10 +6792,10 @@ function applyImmutableTrusted(target, operations) { permuteTrusted(copied2.target, operation[2]); continue; } - const path = operation[1]; - const copied = copyPath(root, path, path.length - 1, owned); + const path2 = operation[1]; + const copied = copyPath(root, path2, path2.length - 1, owned); root = copied.root; - const key = path[path.length - 1]; + const key = path2[path2.length - 1]; switch (operation[0]) { case "s": defineData2(copied.target, key, operation[2]); @@ -6826,7 +6826,7 @@ function applyImmutableTrusted(target, operations) { } return root; } -function copyPath(root, path, length, owned) { +function copyPath(root, path2, length, owned) { if (!isContainer2(root)) throw new TypeError("Trusted operation root is not a container"); let copiedRoot = root; @@ -6836,7 +6836,7 @@ function copyPath(root, path, length, owned) { } let destination = copiedRoot; for (let index = 0; index < length; index++) { - const segment = path[index]; + const segment = path2[index]; const child = read(destination, segment); if (!isContainer2(child)) throw new TypeError("Trusted operation path is not a container"); @@ -8303,8 +8303,8 @@ function emitOperations(context) { } const denseRegions = /* @__PURE__ */ new Map(); for (const [array, candidates] of denseIndices) { - const path = resolvePath(array); - if (path === void 0 || path.some((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment))) { + const path2 = resolvePath(array); + if (path2 === void 0 || path2.some((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment))) { continue; } const regions = buildDenseRegions(candidates); @@ -8312,50 +8312,50 @@ function emitOperations(context) { denseRegions.set(array, regions); } for (const node of context.dirty) { - const path = resolvePath(node); - if (path === void 0) + const path2 = resolvePath(node); + if (path2 === void 0) continue; - if (hasCoveringDenseRegion(node, path, denseRegions)) + if (hasCoveringDenseRegion(node, path2, denseRegions)) continue; - emissionPaths.set(node, path); + emissionPaths.set(node, path2); if (!Array.isArray(nodeBase(node)) && hasReservedMutation(node)) - forcedFolds.set(node, path); - const reservedAt = path.findIndex((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment)); + forcedFolds.set(node, path2); + const reservedAt = path2.findIndex((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment)); if (reservedAt >= 0) { let ancestor = node; - for (let depth = path.length; depth > reservedAt; depth--) + for (let depth = path2.length; depth > reservedAt; depth--) ancestor = nodeParent(ancestor); - forcedFolds.set(ancestor, path.slice(0, reservedAt)); + forcedFolds.set(ancestor, path2.slice(0, reservedAt)); } } - for (const [node, path] of forcedFolds) - emissionPaths.set(node, path); + for (const [node, path2] of forcedFolds) + emissionPaths.set(node, path2); for (const node of denseRegions.keys()) { - const path = resolvePath(node); - if (path !== void 0 && !hasCoveringDenseRegion(node, path, denseRegions)) - emissionPaths.set(node, path); + const path2 = resolvePath(node); + if (path2 !== void 0 && !hasCoveringDenseRegion(node, path2, denseRegions)) + emissionPaths.set(node, path2); } let maxDepth = 0; - for (const path of emissionPaths.values()) - maxDepth = Math.max(maxDepth, path.length); + for (const path2 of emissionPaths.values()) + maxDepth = Math.max(maxDepth, path2.length); const buckets = Array.from({ length: maxDepth + 1 }, () => []); - for (const [node, path] of emissionPaths) - buckets[path.length].push(node); + for (const [node, path2] of emissionPaths) + buckets[path2.length].push(node); const folded = /* @__PURE__ */ new Set(); for (const bucket of buckets) { for (const node of bucket) { - const path = emissionPaths.get(node); + const path2 = emissionPaths.get(node); if (hasPlacementAncestor(node) || hasFoldedAncestor(node, folded)) continue; if (forcedFolds.has(node)) { - emitSet2(operations, path, cloneNode(node)); + emitSet2(operations, path2, cloneNode(node)); folded.add(node); continue; } if (Array.isArray(nodeBase(node))) - emitArrayOperations(node, path, operations, denseRegions.get(node)); + emitArrayOperations(node, path2, operations, denseRegions.get(node)); else - emitObjectOperations(node, path, operations); + emitObjectOperations(node, path2, operations); if (operations.length > MAX_DELTA_OPERATIONS2) { locatedDenseArray = void 0; return [["r", cloneNode(context.root)]]; @@ -8374,10 +8374,10 @@ function emitSimpleObjectOperations(context) { if (Array.isArray(nodeBase(parent))) return void 0; } - const path = resolvePath(node); - if (path === void 0) + const path2 = resolvePath(node); + if (path2 === void 0) continue; - for (const segment of path) { + for (const segment of path2) { if (typeof segment === "string" && RESERVED_SEGMENTS.has(segment)) return void 0; } @@ -8428,24 +8428,24 @@ function locateDenseArrayPosition(node) { } return false; } -function hasCoveringDenseRegion(node, path, denseRegions) { +function hasCoveringDenseRegion(node, path2, denseRegions) { for (let parent = nodeParent(node); parent !== void 0; parent = nodeParent(parent)) { const regions = denseRegions.get(parent); if (regions === void 0) continue; const parentPath = resolvePath(parent); - if (parentPath === void 0 || path.length <= parentPath.length) + if (parentPath === void 0 || path2.length <= parentPath.length) continue; let matches = true; for (let index2 = 0; index2 < parentPath.length; index2++) { - if (path[index2] !== parentPath[index2]) { + if (path2[index2] !== parentPath[index2]) { matches = false; break; } } if (!matches) continue; - const index = path[parentPath.length]; + const index = path2[parentPath.length]; if (typeof index === "number" && regionContaining(regions, index)) return true; } @@ -8539,8 +8539,8 @@ function hasPlacementAncestor(node) { } return false; } -function emitObjectWrite(node, path, operations, key, value2) { - const nextPath = [...path, key]; +function emitObjectWrite(node, path2, operations, key, value2) { + const nextPath = [...path2, key]; const appended = node.appends?.get(key); if (appended !== void 0) { operations.push(["a", nextPath, appended]); @@ -8551,33 +8551,33 @@ function emitObjectWrite(node, path, operations, key, value2) { const emitted = emitChangedValue(operations, nextPath, before, after); return isContainer3(before) && isContainer3(after) && !emitted; } -function emitObjectOperations(node, path, operations) { +function emitObjectOperations(node, path2, operations) { if (node.readded !== void 0) { for (const key of node.readded) { if (Object.hasOwn(nodeBase(node), key)) - operations.push(["d", [...path, key]]); + operations.push(["d", [...path2, key]]); } } let normalizedContainerWrite = false; if (node.writeKey !== void 0) - normalizedContainerWrite = emitObjectWrite(node, path, operations, node.writeKey, objectValue(node, node.writeKey)); + normalizedContainerWrite = emitObjectWrite(node, path2, operations, node.writeKey, objectValue(node, node.writeKey)); if (node.writes !== void 0) { for (const [key, valueIndex] of node.writes) { if (operations.length > MAX_DELTA_OPERATIONS2) return normalizedContainerWrite; - if (emitObjectWrite(node, path, operations, key, storedValue(node.context, valueIndex))) + if (emitObjectWrite(node, path2, operations, key, storedValue(node.context, valueIndex))) normalizedContainerWrite = true; } } if (node.deleteKey !== void 0 && Object.hasOwn(nodeBase(node), node.deleteKey)) { - operations.push(["d", [...path, node.deleteKey]]); + operations.push(["d", [...path2, node.deleteKey]]); } if (node.deletes !== void 0) { for (const key of node.deletes) { if (operations.length > MAX_DELTA_OPERATIONS2) return normalizedContainerWrite; if (Object.hasOwn(nodeBase(node), key)) - operations.push(["d", [...path, key]]); + operations.push(["d", [...path2, key]]); } } return normalizedContainerWrite; @@ -8673,14 +8673,14 @@ function rangeLength(pieces, start, end) { length += pieces[index].length; return length; } -function emitArrayOperations(node, path, operations, denseRegions) { +function emitArrayOperations(node, path2, operations, denseRegions) { const overlay = arrayOverlay(node); const base = nodeBase(node); if (denseRegions !== void 0) { for (const region of denseRegions) { if (operations.length > MAX_DELTA_OPERATIONS2) return; - operations.push(["p", path, region.start, region.length, cloneArrayRegion(node, region)]); + operations.push(["p", path2, region.start, region.length, cloneArrayRegion(node, region)]); } } if (overlay.structural) { @@ -8688,10 +8688,10 @@ function emitArrayOperations(node, path, operations, denseRegions) { for (let index = 0; index < plan.removeRuns.length; index += 2) { if (operations.length > MAX_DELTA_OPERATIONS2) return; - operations.push(["p", path, plan.removeRuns[index], plan.removeRuns[index + 1], []]); + operations.push(["p", path2, plan.removeRuns[index], plan.removeRuns[index + 1], []]); } if (plan.permutation !== void 0) - operations.push(["m", path, plan.permutation]); + operations.push(["m", path2, plan.permutation]); const pieces = piecesOf(overlay); for (let run2 = 0; run2 < plan.insertRuns.length; run2 += 3) { if (operations.length > MAX_DELTA_OPERATIONS2) @@ -8705,7 +8705,7 @@ function emitArrayOperations(node, path, operations, denseRegions) { items.push(cloneStored(entryValueAt(node, piece, sourceIndex), node.context)); } } - operations.push(["p", path, logicalIndex, 0, items]); + operations.push(["p", path2, logicalIndex, 0, items]); } } for (const [baseIndex, valueIndex] of overlay.baseOverrides ?? []) { @@ -8714,7 +8714,7 @@ function emitArrayOperations(node, path, operations, denseRegions) { const index = findEntryIndex(overlay, 1, baseIndex, void 0); if (index === void 0 || denseRegions !== void 0 && regionContaining(denseRegions, index)) continue; - emitChangedValue(operations, [...path, index], base[baseIndex], cloneStored(storedValue(node.context, valueIndex), node.context)); + emitChangedValue(operations, [...path2, index], base[baseIndex], cloneStored(storedValue(node.context, valueIndex), node.context)); } } function cloneArrayRegion(node, region) { @@ -8727,32 +8727,32 @@ function cloneArrayRegion(node, region) { } return result; } -function emitChangedValue(operations, path, before, after) { +function emitChangedValue(operations, path2, before, after) { if (!isContainer3(after) && before === after) return false; if (isContainer3(before) && isContainer3(after) && equalTrustedJson(before, after)) return false; if (typeof before === "string" && typeof after === "string") { if (after.length > before.length && after.slice(0, before.length) === before) { - operations.push(["a", path, ownedSlice2(after, before.length)]); + operations.push(["a", path2, ownedSlice2(after, before.length)]); return true; } const shared = overlap(before, after, 65536); if (shared > 0) { - operations.push(["t", path, before.length - shared]); + operations.push(["t", path2, before.length - shared]); if (after.length > shared) - operations.push(["a", path, ownedSlice2(after, shared)]); + operations.push(["a", path2, ownedSlice2(after, shared)]); return true; } } - operations.push(["s", path, after]); + operations.push(["s", path2, after]); return true; } -function emitSet2(operations, path, value2) { - if (path.length === 0) +function emitSet2(operations, path2, value2) { + if (path2.length === 0) operations.push(["r", value2]); else - operations.push(["s", path, value2]); + operations.push(["s", path2, value2]); } function resolvePath(node) { if (node.preparedPath !== void 0) @@ -9042,8 +9042,8 @@ function mergeLeaf(op2, folding) { folding.leaves.set(key, folding.ops.length); return false; } -function pathKey(path) { - return JSON.stringify(path); +function pathKey(path2) { + return JSON.stringify(path2); } function merge2(previous, next) { if (next[0] === "s") @@ -9245,8 +9245,8 @@ function assertValidWireOp(op2) { throw new TypeError(`unknown op verb: ${String(verb)}`); } } -function assertSafePath(path) { - for (const seg of path) { +function assertSafePath(path2) { + for (const seg of path2) { if (typeof seg === "string") { if (RESERVED_SEGMENTS.has(seg)) throw new UnsafePathError(seg); @@ -9261,9 +9261,9 @@ function assertIndexInRange(parent, index) { } var PathError = class extends Error { path; - constructor(path) { - super(`unresolvable path: ${JSON.stringify(path)}`); - this.path = path; + constructor(path2) { + super(`unresolvable path: ${JSON.stringify(path2)}`); + this.path = path2; this.name = "PathError"; } }; @@ -9278,12 +9278,12 @@ function applyOps(target, ops3) { root = op2[1]; continue; } - const path = op2[1]; - assertSafePath(path); + const path2 = op2[1]; + assertSafePath(path2); if (op2[0] === "p") { - const target_ = path.length === 0 ? root : resolve(root, path); + const target_ = path2.length === 0 ? root : resolve(root, path2); if (!Array.isArray(target_)) - throw new PathError(path); + throw new PathError(path2); target_.splice(op2[2], op2[3]); const chunkSize = 1e4; for (let offset = 0; offset < op2[4].length; offset += chunkSize) { @@ -9292,16 +9292,16 @@ function applyOps(target, ops3) { continue; } if (op2[0] === "m") { - const target_ = path.length === 0 ? root : resolve(root, path); + const target_ = path2.length === 0 ? root : resolve(root, path2); if (!Array.isArray(target_) || target_.length !== op2[2].length) - throw new PathError(path); + throw new PathError(path2); const previous = target_.slice(); for (let index = 0; index < op2[2].length; index++) target_[index] = previous[op2[2][index]]; continue; } - const parent = resolve(root, path.slice(0, -1)); - const key = path[path.length - 1]; + const parent = resolve(root, path2.slice(0, -1)); + const key = path2[path2.length - 1]; if (Array.isArray(parent)) { if (typeof key !== "number") throw new UnsafePathError(key); @@ -9318,7 +9318,7 @@ function applyOps(target, ops3) { case "d": if (Array.isArray(parent)) { if (typeof key !== "number" || key >= parent.length) - throw new PathError(path); + throw new PathError(path2); parent.splice(key, 1); } else delete parent[key]; @@ -9326,14 +9326,14 @@ function applyOps(target, ops3) { case "a": { const current = read2(); if (typeof current !== "string") - throw new PathError(path); + throw new PathError(path2); write(`${current}${op2[2]}`); break; } case "t": { const current = read2(); if (typeof current !== "string") - throw new PathError(path); + throw new PathError(path2); write(current.slice(op2[2])); break; } @@ -9368,11 +9368,11 @@ function applyImmutableBatches(target, batches) { return root; } function appendCopy(root, op2, owned) { - const [, path, index, deleteCount, items] = op2; + const [, path2, index, deleteCount, items] = op2; if (deleteCount !== 0) return void 0; let target = root; - for (const segment of path) { + for (const segment of path2) { const valid = typeof segment === "string" ? !RESERVED_SEGMENTS.has(segment) && isObj(target) && !Array.isArray(target) : Number.isInteger(segment) && segment >= 0 && Array.isArray(target); if (!valid || !Object.hasOwn(target, segment)) return void 0; @@ -9382,11 +9382,11 @@ function appendCopy(root, op2, owned) { return void 0; const appended = target.concat(items); owned.add(appended); - if (path.length === 0) + if (path2.length === 0) return appended; - const parentPath = path.slice(0, -1); + const parentPath = path2.slice(0, -1); const copiedRoot = copyContainers(root, parentPath, owned); - Object.defineProperty(resolve(copiedRoot, parentPath), path[path.length - 1], { + Object.defineProperty(resolve(copiedRoot, parentPath), path2[path2.length - 1], { value: appended, writable: true, enumerable: true, @@ -9394,16 +9394,16 @@ function appendCopy(root, op2, owned) { }); return copiedRoot; } -function copyContainers(root, path, owned) { +function copyContainers(root, path2, owned) { const copy2 = (value2) => { if (Array.isArray(value2)) return value2.slice(); if (!isObj(value2)) - throw new PathError(path); + throw new PathError(path2); return Object.getPrototypeOf(value2) === null ? Object.assign(/* @__PURE__ */ Object.create(null), value2) : { ...value2 }; }; if (!isObj(root)) - throw new PathError(path); + throw new PathError(path2); let copiedRoot; if (owned.has(root)) copiedRoot = root; @@ -9412,14 +9412,14 @@ function copyContainers(root, path, owned) { owned.add(copiedRoot); } let destination = copiedRoot; - for (const segment of path) { + for (const segment of path2) { if (!Object.hasOwn(destination, segment)) - throw new PathError(path); + throw new PathError(path2); if (Array.isArray(destination) && typeof segment !== "number") throw new UnsafePathError(segment); const child = destination[segment]; if (!isObj(child)) - throw new PathError(path); + throw new PathError(path2); if (owned.has(child)) { destination = child; continue; @@ -9436,26 +9436,26 @@ function copyContainers(root, path, owned) { } return copiedRoot; } -function resolveValue(root, path) { +function resolveValue(root, path2) { let node = root; - for (const seg of path) { + for (const seg of path2) { if (!isObj(node)) - throw new PathError(path); + throw new PathError(path2); if (Array.isArray(node) && typeof seg !== "number") throw new UnsafePathError(seg); if (!Object.hasOwn(node, seg)) - throw new PathError(path); + throw new PathError(path2); node = node[seg]; } return node; } -function resolve(root, path) { - const node = resolveValue(root, path); +function resolve(root, path2) { + const node = resolveValue(root, path2); if (!isObj(node)) - throw new PathError(path); + throw new PathError(path2); return node; } -var pathKey2 = (path) => JSON.stringify(path); +var pathKey2 = (path2) => JSON.stringify(path2); function encoder() { const seen = /* @__PURE__ */ new Set(); const ids = /* @__PURE__ */ new Map(); @@ -9474,8 +9474,8 @@ function encoder() { previous = void 0; continue; } - const path = op2[1]; - const key = pathKey2(path); + const path2 = op2[1]; + const key = pathKey2(path2); if (key === previous) { switch (op2[0]) { case "s": @@ -9499,14 +9499,14 @@ function encoder() { } continue; } - let ref = path; + let ref = path2; const existing = ids.get(key); if (existing !== void 0) { ref = existing; } else if (seen.has(key)) { const id = nextId++; ids.set(key, id); - out.push(["#", id, path]); + out.push(["#", id, path2]); ref = id; } else { seen.add(key); @@ -9557,45 +9557,45 @@ function decoder() { continue; } const short = op2[0] === "d" && op2.length === 1 || op2[0] !== "d" && op2[0] !== "p" && op2.length === 2 || op2[0] === "p" && op2.length === 4; - let path; + let path2; if (short) { if (previous === void 0) throw new PathError([]); - path = previous; + path2 = previous; } else { const ref = op2[1]; if (typeof ref === "number") { const resolved = paths.get(ref); if (resolved === void 0) throw new PathError(ref); - path = resolved; + path2 = resolved; } else { - path = ref; + path2 = ref; } - previous = path; + previous = path2; } - if (op2[0] !== "p" && op2[0] !== "m" && path.length === 0) - throw new PathError(path); + if (op2[0] !== "p" && op2[0] !== "m" && path2.length === 0) + throw new PathError(path2); switch (op2[0]) { case "s": - out.push(["s", path, short ? op2[1] : op2[2]]); + out.push(["s", path2, short ? op2[1] : op2[2]]); break; case "d": - out.push(["d", path]); + out.push(["d", path2]); break; case "a": - out.push(["a", path, short ? op2[1] : op2[2]]); + out.push(["a", path2, short ? op2[1] : op2[2]]); break; case "t": - out.push(["t", path, short ? op2[1] : op2[2]]); + out.push(["t", path2, short ? op2[1] : op2[2]]); break; case "p": { const [i, r, items] = short ? [op2[1], op2[2], op2[3]] : [op2[2], op2[3], op2[4]]; - out.push(["p", path, i, r, items]); + out.push(["p", path2, i, r, items]); break; } case "m": - out.push(["m", path, short ? op2[1] : op2[2]]); + out.push(["m", path2, short ? op2[1] : op2[2]]); break; } } @@ -9720,21 +9720,21 @@ function unbox(ops3, value2) { for (const op2 of ops3) { if (op2[0] === "r" || op2[1].length === 0) return [["r", value2]]; - const path = op2[1].slice(1); + const path2 = op2[1].slice(1); switch (op2[0]) { case "p": - result.push(["p", path, op2[2], op2[3], op2[4]]); + result.push(["p", path2, op2[2], op2[3], op2[4]]); break; case "m": - result.push(["m", path, op2[2]]); + result.push(["m", path2, op2[2]]); break; default: - if (path.length === 0) + if (path2.length === 0) return [["r", value2]]; if (op2[0] === "d") - result.push(["d", path]); + result.push(["d", path2]); else - result.push([op2[0], path, op2[2]]); + result.push([op2[0], path2, op2[2]]); } } return result; @@ -23031,7 +23031,7 @@ var TaskScheduler = class { from.set(id, via); pending.push(id); }; - const path = (end) => { + const path2 = (end) => { const steps = []; for (let at = end; at !== void 0; at = from.get(at)) steps.unshift(at); @@ -23041,7 +23041,7 @@ var TaskScheduler = class { reach(id, void 0); for (let id = pending.pop(); id !== void 0; id = pending.pop()) { if (id === task) - return path(id); + return path2(id); const record2 = overlay.tasks.get(id) ?? this.#liveRecord(id); if (record2 === void 0 || record2.state.status === "terminal") continue; @@ -24958,8 +24958,8 @@ function structuredOutputError(tool, result) { if (validator.check(value2)) return void 0; const [first] = validator.errors(value2); - const path = first?.path.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") || "root"; - return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path}: ${first?.message ?? "invalid"}`; + const path2 = first?.path.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") || "root"; + return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path2}: ${first?.message ?? "invalid"}`; } async function settle2(runtime, input, call, ending, result, context, durationMs) { const nestedIds = (await runtime.ownedTasks(context)).filter((record2) => record2.kind === ToolTask.definition.name && record2.input.kind === "nested").map((record2) => record2.id); @@ -27193,19 +27193,19 @@ function advance2(id, mount, publication, context, report2) { const kind = change.record.kind; if (!MOUNTED_KINDS.has(kind) || change.record.key !== void 0) continue; - const path = ["docs", kind]; + const path2 = ["docs", kind]; const mounted = mount.incarnations.get(kind); if (change.kind === "retire") { if (mounted?.id !== change.record.id) continue; mount.incarnations.delete(kind); - docOps.push(["d", path]); + docOps.push(["d", path2]); } else if (mounted?.id === change.record.id && mounted.version === change.version) { for (const op2 of change.ops) - docOps.push(prefixed(op2, path)); + docOps.push(prefixed(op2, path2)); } else { mount.incarnations.set(kind, { id: change.record.id, version: change.version }); - docOps.push(["s", path, change.value]); + docOps.push(["s", path2, change.value]); } } if (docOps.length === 0 && appended.length === 0) @@ -27235,7 +27235,7 @@ function advance2(id, mount, publication, context, report2) { } } function prefixed(op2, prefix) { - const at = (path) => [...prefix, ...path]; + const at = (path2) => [...prefix, ...path2]; switch (op2[0]) { case "r": return ["s", prefix, op2[1]]; @@ -29532,8 +29532,8 @@ var SqliteStorage = class _SqliteStorage { // sqlite.ts var op = (kind, sql = "", params = []) => Deno.core.ops.op_sql(kind, sql, params.map((p) => p instanceof Uint8Array ? Array.from(p) : typeof p === "bigint" ? Number(p) : p)); -async function openStorage(path) { - op("open", path); +async function openStorage(path2) { + op("open", path2); let tail = Promise.resolve(); const queue2 = (call) => { const result = tail.then(call); @@ -29692,17 +29692,17 @@ function visit(node, visitor) { visit.BREAK = BREAK; visit.SKIP = SKIP; visit.REMOVE = REMOVE; -function visit_(key, node, visitor, path) { - const ctrl = callVisitor(key, node, visitor, path); +function visit_(key, node, visitor, path2) { + const ctrl = callVisitor(key, node, visitor, path2); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visit_(key, ctrl, visitor, path); + replaceNode(key, path2, ctrl); + return visit_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path = Object.freeze(path.concat(node)); + path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = visit_(i, node.items[i], visitor, path); + const ci = visit_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -29713,13 +29713,13 @@ function visit_(key, node, visitor, path) { } } } else if (isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = visit_("key", node.key, visitor, path); + path2 = Object.freeze(path2.concat(node)); + const ck = visit_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = visit_("value", node.value, visitor, path); + const cv = visit_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -29740,17 +29740,17 @@ async function visitAsync(node, visitor) { visitAsync.BREAK = BREAK; visitAsync.SKIP = SKIP; visitAsync.REMOVE = REMOVE; -async function visitAsync_(key, node, visitor, path) { - const ctrl = await callVisitor(key, node, visitor, path); +async function visitAsync_(key, node, visitor, path2) { + const ctrl = await callVisitor(key, node, visitor, path2); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visitAsync_(key, ctrl, visitor, path); + replaceNode(key, path2, ctrl); + return visitAsync_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path = Object.freeze(path.concat(node)); + path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = await visitAsync_(i, node.items[i], visitor, path); + const ci = await visitAsync_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -29761,13 +29761,13 @@ async function visitAsync_(key, node, visitor, path) { } } } else if (isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path); + path2 = Object.freeze(path2.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path); + const cv = await visitAsync_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -29794,23 +29794,23 @@ function initVisitor(visitor) { } return visitor; } -function callVisitor(key, node, visitor, path) { +function callVisitor(key, node, visitor, path2) { if (typeof visitor === "function") - return visitor(key, node, path); + return visitor(key, node, path2); if (isMap(node)) - return visitor.Map?.(key, node, path); + return visitor.Map?.(key, node, path2); if (isSeq(node)) - return visitor.Seq?.(key, node, path); + return visitor.Seq?.(key, node, path2); if (isPair(node)) - return visitor.Pair?.(key, node, path); + return visitor.Pair?.(key, node, path2); if (isScalar(node)) - return visitor.Scalar?.(key, node, path); + return visitor.Scalar?.(key, node, path2); if (isAlias(node)) - return visitor.Alias?.(key, node, path); + return visitor.Alias?.(key, node, path2); return void 0; } -function replaceNode(key, path, node) { - const parent = path[path.length - 1]; +function replaceNode(key, path2, node) { + const parent = path2[path2.length - 1]; if (isCollection(parent)) { parent.items[key] = node; } else if (isPair(parent)) { @@ -30341,10 +30341,10 @@ function createNode2(value2, tagName, ctx) { } // node_modules/yaml/browser/dist/nodes/Collection.js -function collectionFromPath(schema4, path, value2) { +function collectionFromPath(schema4, path2, value2) { let v = value2; - for (let i = path.length - 1; i >= 0; --i) { - const k = path[i]; + for (let i = path2.length - 1; i >= 0; --i) { + const k = path2[i]; if (typeof k === "number" && Number.isInteger(k) && k >= 0) { const a = []; a[k] = v; @@ -30363,7 +30363,7 @@ function collectionFromPath(schema4, path, value2) { sourceObjects: /* @__PURE__ */ new Map() }); } -var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done; +var isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done; var Collection = class extends NodeBase { constructor(type, schema4) { super(type); @@ -30393,11 +30393,11 @@ var Collection = class extends NodeBase { * be a Pair instance or a `{ key, value }` object, which may not have a key * that already exists in the map. */ - addIn(path, value2) { - if (isEmptyPath(path)) + addIn(path2, value2) { + if (isEmptyPath(path2)) this.add(value2); else { - const [key, ...rest] = path; + const [key, ...rest] = path2; const node = this.get(key, true); if (isCollection(node)) node.addIn(rest, value2); @@ -30411,8 +30411,8 @@ var Collection = class extends NodeBase { * Removes a value from the collection. * @returns `true` if the item was found and removed. */ - deleteIn(path) { - const [key, ...rest] = path; + deleteIn(path2) { + const [key, ...rest] = path2; if (rest.length === 0) return this.delete(key); const node = this.get(key, true); @@ -30426,8 +30426,8 @@ var Collection = class extends NodeBase { * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ - getIn(path, keepScalar) { - const [key, ...rest] = path; + getIn(path2, keepScalar) { + const [key, ...rest] = path2; const node = this.get(key, true); if (rest.length === 0) return !keepScalar && isScalar(node) ? node.value : node; @@ -30445,8 +30445,8 @@ var Collection = class extends NodeBase { /** * Checks if the collection includes a value with the key `key`. */ - hasIn(path) { - const [key, ...rest] = path; + hasIn(path2) { + const [key, ...rest] = path2; if (rest.length === 0) return this.has(key); const node = this.get(key, true); @@ -30456,8 +30456,8 @@ var Collection = class extends NodeBase { * Sets a value in this collection. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ - setIn(path, value2) { - const [key, ...rest] = path; + setIn(path2, value2) { + const [key, ...rest] = path2; if (rest.length === 0) { this.set(key, value2); } else { @@ -32596,9 +32596,9 @@ var Document = class _Document { this.contents.add(value2); } /** Adds a value to the document. */ - addIn(path, value2) { + addIn(path2, value2) { if (assertCollection(this.contents)) - this.contents.addIn(path, value2); + this.contents.addIn(path2, value2); } /** * Create a new `Alias` node, ensuring that the target `node` has the required anchor. @@ -32673,14 +32673,14 @@ var Document = class _Document { * Removes a value from the document. * @returns `true` if the item was found and removed. */ - deleteIn(path) { - if (isEmptyPath(path)) { + deleteIn(path2) { + if (isEmptyPath(path2)) { if (this.contents == null) return false; this.contents = null; return true; } - return assertCollection(this.contents) ? this.contents.deleteIn(path) : false; + return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false; } /** * Returns item at `key`, or `undefined` if not found. By default unwraps @@ -32695,10 +32695,10 @@ var Document = class _Document { * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ - getIn(path, keepScalar) { - if (isEmptyPath(path)) + getIn(path2, keepScalar) { + if (isEmptyPath(path2)) return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents; - return isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0; + return isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0; } /** * Checks if the document includes a value with the key `key`. @@ -32709,10 +32709,10 @@ var Document = class _Document { /** * Checks if the document includes a value at `path`. */ - hasIn(path) { - if (isEmptyPath(path)) + hasIn(path2) { + if (isEmptyPath(path2)) return this.contents !== void 0; - return isCollection(this.contents) ? this.contents.hasIn(path) : false; + return isCollection(this.contents) ? this.contents.hasIn(path2) : false; } /** * Sets a value in this document. For `!!set`, `value` needs to be a @@ -32729,13 +32729,13 @@ var Document = class _Document { * Sets a value in this document. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ - setIn(path, value2) { - if (isEmptyPath(path)) { + setIn(path2, value2) { + if (isEmptyPath(path2)) { this.contents = value2; } else if (this.contents == null) { - this.contents = collectionFromPath(this.schema, Array.from(path), value2); + this.contents = collectionFromPath(this.schema, Array.from(path2), value2); } else if (assertCollection(this.contents)) { - this.contents.setIn(path, value2); + this.contents.setIn(path2, value2); } } /** @@ -34532,9 +34532,9 @@ function visit2(cst, visitor) { visit2.BREAK = BREAK2; visit2.SKIP = SKIP2; visit2.REMOVE = REMOVE2; -visit2.itemAtPath = (cst, path) => { +visit2.itemAtPath = (cst, path2) => { let item = cst; - for (const [field, index] of path) { + for (const [field, index] of path2) { const tok = item?.[field]; if (tok && "items" in tok) { item = tok.items[index]; @@ -34543,23 +34543,23 @@ visit2.itemAtPath = (cst, path) => { } return item; }; -visit2.parentCollection = (cst, path) => { - const parent = visit2.itemAtPath(cst, path.slice(0, -1)); - const field = path[path.length - 1][0]; +visit2.parentCollection = (cst, path2) => { + const parent = visit2.itemAtPath(cst, path2.slice(0, -1)); + const field = path2[path2.length - 1][0]; const coll = parent?.[field]; if (coll && "items" in coll) return coll; throw new Error("Parent collection not found"); }; -function _visit(path, item, visitor) { - let ctrl = visitor(item, path); +function _visit(path2, item, visitor) { + let ctrl = visitor(item, path2); if (typeof ctrl === "symbol") return ctrl; for (const field of ["key", "value"]) { const token = item[field]; if (token && "items" in token) { for (let i = 0; i < token.items.length; ++i) { - const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor); + const ci = _visit(Object.freeze(path2.concat([[field, i]])), token.items[i], visitor); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK2) @@ -34570,10 +34570,10 @@ function _visit(path, item, visitor) { } } if (typeof ctrl === "function" && field === "key") - ctrl = ctrl(item, path); + ctrl = ctrl(item, path2); } } - return typeof ctrl === "function" ? ctrl(item, path) : ctrl; + return typeof ctrl === "function" ? ctrl(item, path2) : ctrl; } // node_modules/yaml/browser/dist/parse/cst.js @@ -36448,16 +36448,16 @@ var Diff = class { } } } - addToPath(path, added, removed, oldPosInc, options) { - const last = path.lastComponent; + addToPath(path2, added, removed, oldPosInc, options) { + const last = path2.lastComponent; if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { return { - oldPos: path.oldPos + oldPosInc, + oldPos: path2.oldPos + oldPosInc, lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent } }; } else { return { - oldPos: path.oldPos + oldPosInc, + oldPos: path2.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, previousComponent: last } }; } @@ -36914,38 +36914,38 @@ function countOccurrences(content, oldText) { const fuzzyOldText = normalizeForFuzzyMatch(oldText); return fuzzyContent.split(fuzzyOldText).length - 1; } -function getNotFoundError(path, editIndex, totalEdits) { +function getNotFoundError(path2, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`); + return new Error(`Could not find the exact text in ${path2}. The old text must match exactly including all whitespace and newlines.`); } - return new Error(`Could not find edits[${editIndex}] in ${path}. The oldText must match exactly including all whitespace and newlines.`); + return new Error(`Could not find edits[${editIndex}] in ${path2}. The oldText must match exactly including all whitespace and newlines.`); } -function getDuplicateError(path, editIndex, totalEdits, occurrences) { +function getDuplicateError(path2, editIndex, totalEdits, occurrences) { if (totalEdits === 1) { - return new Error(`Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of the text in ${path2}. The text must be unique. Please provide more context to make it unique.`); } - return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path}. Each oldText must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path2}. Each oldText must be unique. Please provide more context to make it unique.`); } -function getEmptyOldTextError(path, editIndex, totalEdits) { +function getEmptyOldTextError(path2, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`oldText must not be empty in ${path}.`); + return new Error(`oldText must not be empty in ${path2}.`); } - return new Error(`edits[${editIndex}].oldText must not be empty in ${path}.`); + return new Error(`edits[${editIndex}].oldText must not be empty in ${path2}.`); } -function getNoChangeError(path, totalEdits) { +function getNoChangeError(path2, totalEdits) { if (totalEdits === 1) { - return new Error(`No changes made to ${path}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); + return new Error(`No changes made to ${path2}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); } - return new Error(`No changes made to ${path}. The replacements produced identical content.`); + return new Error(`No changes made to ${path2}. The replacements produced identical content.`); } -function applyEditsToNormalizedContent(normalizedContent, edits, path) { +function applyEditsToNormalizedContent(normalizedContent, edits, path2) { const normalizedEdits = edits.map((edit) => ({ oldText: normalizeToLF(edit.oldText), newText: normalizeToLF(edit.newText) })); for (let i = 0; i < normalizedEdits.length; i++) { if (normalizedEdits[i].oldText.length === 0) { - throw getEmptyOldTextError(path, i, normalizedEdits.length); + throw getEmptyOldTextError(path2, i, normalizedEdits.length); } } const initialMatches = normalizedEdits.map((edit) => fuzzyFindText(normalizedContent, edit.oldText)); @@ -36956,11 +36956,11 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path) { const edit = normalizedEdits[i]; const matchResult = fuzzyFindText(replacementBaseContent, edit.oldText); if (!matchResult.found) { - throw getNotFoundError(path, i, normalizedEdits.length); + throw getNotFoundError(path2, i, normalizedEdits.length); } const occurrences = countOccurrences(replacementBaseContent, edit.oldText); if (occurrences > 1) { - throw getDuplicateError(path, i, normalizedEdits.length, occurrences); + throw getDuplicateError(path2, i, normalizedEdits.length, occurrences); } matchedEdits.push({ editIndex: i, @@ -36974,18 +36974,18 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path) { const previous = matchedEdits[i - 1]; const current = matchedEdits[i]; if (previous.matchIndex + previous.matchLength > current.matchIndex) { - throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path}. Merge them into one edit or target disjoint regions.`); + throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path2}. Merge them into one edit or target disjoint regions.`); } } const baseContent = normalizedContent; const newContent = usedFuzzyMatch ? applyReplacementsPreservingUnchangedLines(normalizedContent, replacementBaseContent, matchedEdits) : applyReplacements(replacementBaseContent, matchedEdits); if (baseContent === newContent) { - throw getNoChangeError(path, normalizedEdits.length); + throw getNoChangeError(path2, normalizedEdits.length); } return { baseContent, newContent }; } -function generateUnifiedPatch(path, oldContent, newContent, contextLines = 4) { - return createTwoFilesPatch(path, path, oldContent, newContent, void 0, void 0, { +function generateUnifiedPatch(path2, oldContent, newContent, contextLines = 4) { + return createTwoFilesPatch(path2, path2, oldContent, newContent, void 0, void 0, { context: contextLines, headerOptions: FILE_HEADERS_ONLY }); @@ -37109,8 +37109,8 @@ function getOrThrow(result) { // node_modules/@earendil-works/pi-durable/dist/tools/file-mutation-queue.js var queues = /* @__PURE__ */ new Map(); -async function mutationKey(env, path, context) { - const absolutePath = getOrThrow(await env.absolutePath(path, context)); +async function mutationKey(env, path2, context) { + const absolutePath = getOrThrow(await env.absolutePath(path2, context)); return `${env.id}\0${await canonical(env, absolutePath, context)}`; } async function canonical(env, absolutePath, context) { @@ -37127,8 +37127,8 @@ async function canonical(env, absolutePath, context) { const name = absolutePath.slice(parent.length + (/[/\\]$/.test(parent) ? 0 : 1)); return getOrThrow(await env.joinPath([await canonical(env, parent, context), name], context)); } -async function withFileMutationQueue(env, path, fn, context) { - const key = await mutationKey(env, path, context); +async function withFileMutationQueue(env, path2, fn, context) { + const key = await mutationKey(env, path2, context); const previous = queues.get(key) ?? Promise.resolve(); let release = () => { }; @@ -37150,15 +37150,15 @@ async function withFileMutationQueue(env, path, fn, context) { // node_modules/@earendil-works/pi-durable/dist/tools/path-utils.js var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g; var NARROW_NO_BREAK_SPACE = "\u202F"; -function normalizeToolPath(path) { - const normalized = path.replace(UNICODE_SPACES, " "); +function normalizeToolPath(path2) { + const normalized = path2.replace(UNICODE_SPACES, " "); return normalized.startsWith("@") ? normalized.slice(1) : normalized; } -async function resolveToolPath(env, path, context) { - return getOrThrow(await env.absolutePath(normalizeToolPath(path), context)); +async function resolveToolPath(env, path2, context) { + return getOrThrow(await env.absolutePath(normalizeToolPath(path2), context)); } -async function resolveReadToolPath(env, path, context) { - const resolved = await resolveToolPath(env, path, context); +async function resolveReadToolPath(env, path2, context) { + const resolved = await resolveToolPath(env, path2, context); const variants = [ resolved, resolved.replace(/ (AM|PM)\./gi, `${NARROW_NO_BREAK_SPACE}$1.`), @@ -37223,8 +37223,8 @@ function validateEditInput(input) { } return { path: input.path, edits: input.edits }; } -function editAccessError(path, error) { - return new Error(`Could not edit file: ${path}. Error code: ${error.code}.`, { cause: error }); +function editAccessError(path2, error) { + return new Error(`Could not edit file: ${path2}. Error code: ${error.code}.`, { cause: error }); } function createEditTool() { return defineTool({ @@ -37233,43 +37233,43 @@ function createEditTool() { parameters: editSchema, prepareArguments: prepareEditArguments, async execute(args, api, context) { - const { path, edits } = validateEditInput(args); + const { path: path2, edits } = validateEditInput(args); const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path, context); + const absolutePath = await resolveToolPath(env, path2, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const info = await env.fileInfo(absolutePath, context); if (!info.ok) - throw editAccessError(path, info.error); + throw editAccessError(path2, info.error); if (info.value.kind !== "file" && info.value.kind !== "symlink") { - throw new Error(`Could not edit file: ${path}. Path is not a file.`); + throw new Error(`Could not edit file: ${path2}. Path is not a file.`); } const readResult = await env.readTextFile(absolutePath, context); if (!readResult.ok) - throw editAccessError(path, readResult.error); + throw editAccessError(path2, readResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const { bom, text: content } = stripBom(readResult.value); const originalEnding = detectLineEnding(content); const normalizedContent = normalizeToLF(content); - const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path); + const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path2); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const finalContent = bom + restoreLineEndings(newContent, originalEnding); const writeResult = await env.writeFile(absolutePath, finalContent, context); if (!writeResult.ok) - throw editAccessError(path, writeResult.error); + throw editAccessError(path2, writeResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const diffResult = generateDiffString(baseContent, newContent); const details = { diff: diffResult.diff, - patch: generateUnifiedPatch(path, baseContent, newContent), + patch: generateUnifiedPatch(path2, baseContent, newContent), ...diffResult.firstChangedLine === void 0 ? {} : { firstChangedLine: diffResult.firstChangedLine } }; return { - output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path}.` }], + output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path2}.` }], details }; }, context); @@ -37491,9 +37491,9 @@ function createReadTool(options = {}) { parameters: readSchema, structuredOutputSchema: readStructuredOutputSchema, async execute(args, api, context) { - const { path, offset, limit } = args; + const { path: path2, offset, limit } = args; const env = requireEnv(api); - const absolutePath = await resolveReadToolPath(env, path, context); + const absolutePath = await resolveReadToolPath(env, path2, context); const reader = getOrThrow(await env.openBinaryReader(absolutePath, void 0, context)); try { for (let attempt = 0; ; attempt++) { @@ -37502,13 +37502,13 @@ function createReadTool(options = {}) { size: before.size, read: async (position, length) => getOrThrow(await reader.read(position, length, context)) }); - const result = mimeType === void 0 ? await readText(reader, path, offset, limit, context) : await readImage(reader, before, path, mimeType, options.images, await imageModel(api, context), context); + const result = mimeType === void 0 ? await readText(reader, path2, offset, limit, context) : await readImage(reader, before, path2, mimeType, options.images, await imageModel(api, context), context); const after = getOrThrow(await reader.info(context)); const unchanged = after.size === before.size && after.mtimeMs === before.mtimeMs; if (unchanged || mimeType === void 0 && after.size > before.size) return result; if (attempt === 1) - throw new Error(`${path} changed while it was read`); + throw new Error(`${path2} changed while it was read`); } } finally { await reader.close(context); @@ -37516,14 +37516,14 @@ function createReadTool(options = {}) { } }); } -async function readImage(reader, info, path, mimeType, processor, { vision, limits }, context) { +async function readImage(reader, info, path2, mimeType, processor, { vision, limits }, context) { let image; const notes = []; if (processor !== void 0) { const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const prepared = await processor.prepare(bytes2, mimeType, limits); if (prepared === void 0) - return imageError(`${path} is an image (${mimeType}) that cannot be prepared for the model`); + return imageError(`${path2} is an image (${mimeType}) that cannot be prepared for the model`); image = prepared; if (prepared.convertedFrom !== void 0) notes.push(`Converted from ${prepared.convertedFrom} to ${prepared.mimeType}.`); @@ -37534,18 +37534,18 @@ async function readImage(reader, info, path, mimeType, processor, { vision, limi } } else { if (!INLINE_IMAGE_TYPES.has(mimeType)) { - return imageError(`${path} is an image (${mimeType}) that needs converting, and no image processor is configured`); + return imageError(`${path2} is an image (${mimeType}) that needs converting, and no image processor is configured`); } const unshrinkable = "and no image processor is configured to shrink it"; if (base64Length(info.size) > limits.maxBytes) { - return imageError(`${path} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); + return imageError(`${path2} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); } const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const size = imageDimensions(bytes2, mimeType); if (size === void 0) - return imageError(`${path} is an image (${mimeType}) whose size cannot be read`); + return imageError(`${path2} is an image (${mimeType}) whose size cannot be read`); if (size.width > limits.maxWidth || size.height > limits.maxHeight) { - return imageError(`${path} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); + return imageError(`${path2} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); } image = { data: toBase64(bytes2), mimeType }; } @@ -37573,7 +37573,7 @@ async function imageModel(api, context) { function imageError(message) { return { output: [], isError: true, diagnostics: [{ severity: "error", code: "unsupported_image", message }] }; } -async function readText(reader, path, offset, limit, context) { +async function readText(reader, path2, offset, limit, context) { const startLine = offset ? Math.max(0, offset - 1) : 0; const startLineDisplay = startLine + 1; const sliceStart = sliceIndex(startLine); @@ -37618,7 +37618,7 @@ async function readText(reader, path, offset, limit, context) { diagnostics.push({ severity: "warn", code: "truncated", - message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path} | tail -c +${end + 1}` + message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path2} | tail -c +${end + 1}` }); details = { truncation: { ...truncation, outputBytes: end, outputLines: 1 } }; } else if (truncation.truncated) { @@ -37658,16 +37658,16 @@ function createWriteTool() { description: "Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.", parameters: writeSchema, async execute(args, api, context) { - const { path, content } = args; + const { path: path2, content } = args; const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path, context); + const absolutePath = await resolveToolPath(env, path2, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); getOrThrow(await env.writeFile(absolutePath, content, context)); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); - return { output: [{ type: "text", text: `Successfully wrote to ${path}` }] }; + return { output: [{ type: "text", text: `Successfully wrote to ${path2}` }] }; }, context); } }); @@ -38051,20 +38051,20 @@ var encoder4 = new TextEncoder(); var decoder4 = new TextDecoder(); var ExtensionState = defineDoc({ kind: "sausage.extensions", version: 1, scope: "session", checkpointWhen: () => false, initial: () => ({ good: null, current: null, error: null }) }); var Metadata = defineDoc({ kind: "sausage.metadata", version: 1, scope: "conversation", history: "latest", fork: "current", initial: () => ({ label: "", title: "" }), checkpointWhen: () => false }); -async function file(kind, path, bytes2 = []) { - const result = await ops2.op_file(kind, path, bytes2); +async function file(kind, path2, bytes2 = []) { + const result = await ops2.op_file(kind, path2, bytes2); if (!result.ok) throw Object.assign(new Error(result.error.message), result.error); return result.value; } var fs = { - read: async (path) => decoder4.decode(new Uint8Array(await file("read", path))), - write: (path, text) => file("write", path, Array.from(encoder4.encode(text))), - append: (path, text) => file("append", path, Array.from(encoder4.encode(text))), - list: (path) => file("list", path), - stat: (path) => file("stat", path), - lstat: (path) => file("lstat", path), - mkdir: (path) => file("mkdir", path), - remove: (path) => file("remove", path), + read: async (path2) => decoder4.decode(new Uint8Array(await file("read", path2))), + write: (path2, text) => file("write", path2, Array.from(encoder4.encode(text))), + append: (path2, text) => file("append", path2, Array.from(encoder4.encode(text))), + list: (path2) => file("list", path2), + stat: (path2) => file("stat", path2), + lstat: (path2) => file("lstat", path2), + mkdir: (path2) => file("mkdir", path2), + remove: (path2) => file("remove", path2), rename: (from, to) => file("rename", from, Array.from(encoder4.encode(to))) }; async function exec(command, options) { @@ -38223,9 +38223,9 @@ async function loadExtensions(harness2, registry2, storage2, models2, context, b const staged = /* @__PURE__ */ new Map(); try { const snapshot = `/run/sausage/extensions/${sha}`; - for (const path of ["/run/sausage", "/run/sausage/extensions"]) { + for (const path2 of ["/run/sausage", "/run/sausage/extensions"]) { try { - await fs.mkdir(path); + await fs.mkdir(path2); } catch (error) { if (error.code !== "already_exists") throw error; } @@ -38253,16 +38253,16 @@ async function loadExtensions(harness2, registry2, storage2, models2, context, b throw error; })) { if (entry2.kind !== "directory") continue; - const path = `${snapshot}/extensions/${entry2.name}/server.ts`; + const path2 = `${snapshot}/extensions/${entry2.name}/server.ts`; try { - await fs.stat(path); + await fs.stat(path2); } catch (error) { if (error.code === "not_found") continue; throw error; } const module = await import( /* @vite-ignore */ - `file://${path}` + `file://${path2}` ); modules.push({ name: entry2.name, module }); } @@ -38336,10 +38336,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38356,6 +38356,65 @@ Last good: ${fallback}` : failed; } }; } +// ../../extensions/core/agents.ts +var thinkingLevels = ["off", "minimal", "low", "medium", "high", "xhigh", "max"]; +function parseFrontmatter(text) { + const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(text); + if (!match) throw new Error("Expected frontmatter fields between --- lines"); + return { frontmatter: parse(match[1]), body: match[2].trim() }; +} +function parseDefinition(text, path2, inherited) { + const { frontmatter, body } = parseFrontmatter(text); + const name = path2.split("/").pop().replace(/\.md$/, ""); + const settings = { ...inherited ?? {}, ...frontmatter }; + const instructions = inherited && frontmatter.addTools !== void 0 ? [inherited.instructions, body].filter(Boolean).join("\n\n## Project additions\n\n") : body; + const definition = { ...settings, name, path: path2, instructions }; + if (!/^[a-zA-Z0-9_-]+$/.test(name)) throw new Error(`${path2}: invalid roster name`); + for (const key of ["description", "model", "instructions"]) if (typeof definition[key] !== "string" || !definition[key].trim()) throw new Error(`${path2}: ${key} is required`); + if (definition.thinking !== void 0 && !thinkingLevels.includes(definition.thinking)) throw new Error(`${path2}: invalid thinking`); + for (const key of ["tools", "addTools", "denyTools"]) if (definition[key] !== void 0 && (!Array.isArray(definition[key]) || !definition[key].every((tool) => typeof tool === "string"))) throw new Error(`${path2}: ${key} must be a list of tool names`); + if (inherited && frontmatter.addTools !== void 0) definition.tools = toolsFor(definition, inherited.tools ?? []); + definitionRuns(definition); + return definition; +} +function definitionRuns(definition) { + if (!/^[^/\s]+\/\S+$/.test(definition.model)) throw new Error(`${definition.path}: invalid model for ${definition.name}`); + const slash = definition.model.indexOf("/"); + return { model: { provider: definition.model.slice(0, slash), modelId: definition.model.slice(slash + 1) }, thinking: definition.thinking }; +} +function toolsFor(definition, parent) { + return [.../* @__PURE__ */ new Set([...definition.tools ?? parent, ...definition.addTools ?? []])].filter((tool) => !definition.denyTools?.includes(tool)); +} + +// roster-fixture.ts +var directory = "/etc/sausage/roster"; +var path = "/etc/sausage/config.yaml"; +async function readTestConfig(fs2) { + const config = parse(await fs2.read(path)); + config.roster = []; + for (const entry2 of await fs2.list(directory)) { + if (!entry2.name.endsWith(".md")) continue; + const definition = parseDefinition(await fs2.read(`${directory}/${entry2.name}`), `${directory}/${entry2.name}`); + const { instructions, ...fields } = definition; + config.roster.push({ ...fields, prompt: instructions }); + } + return config; +} +async function writeTestConfig(fs2, value2) { + const { roster, ...config } = value2; + await fs2.mkdir(directory); + for (const entry2 of await fs2.list(directory)) if (entry2.name.endsWith(".md")) await fs2.remove(`${directory}/${entry2.name}`); + for (const entry2 of roster) { + const { name, prompt, path: _path, ...fields } = entry2; + await fs2.write(`${directory}/${name}.md`, `--- +${stringify3(fields)}--- + +${prompt} +`); + } + await fs2.write(path, stringify3(config)); +} + // core-ext-test.ts var assert = (ok, message) => { if (!ok) throw new Error(message); @@ -38365,10 +38424,6 @@ var assert = (ok, message) => { var models = createModels(); var faux = fauxProvider({ tokensPerSecond: 1e5 }); models.setProvider(faux.provider); -var proxyTemplate = { ...models.getModels("faux")[0], provider: "openai", baseUrl: "https://proxy.invalid/v1" }; -models.setProvider({ ...faux.provider, id: "openai", getModels: () => [proxyTemplate] }); -models.setProvider({ ...faux.provider, id: "anthropic", getModels: () => [{ ...proxyTemplate, provider: "anthropic", baseUrl: "https://proxy.invalid/apis/anthropic" }] }); -var proxyAuth = models.getProvider("openai").auth; var storage = await openStorage(globalThis.storagePath); var registry = createRegistry(); var harness = await Harness.open(storage, { models, registry, settings: { retry: { enabled: false }, get extensions() { @@ -38379,10 +38434,10 @@ var loader = await loadExtensions(harness, registry, storage, models, BACKGROUND try { assert(!loader.state().error, `loader: ${loader.state().error ?? "loaded"}`); const { selection, conversations, State, metadata } = globalThis.core; - const config = parse(await fs.read("/etc/sausage/config.yaml")); - config.standing = "worker"; + const config = await readTestConfig(fs); + config.main_agent_name = "worker"; config.roster = [{ name: "worker", description: "Worker", model: "faux/faux-1", thinking: "low", tools: ["read", "write"], prompt: "Worker body" }]; - const save = () => fs.write("/etc/sausage/config.yaml", JSON.stringify(config)); + const save = () => writeTestConfig(fs, config); await save(); const worker = await selection.start({ agent: "worker", cwd: "/project/sub" }, BACKGROUND_CONTEXT); let agent = await worker.agent(BACKGROUND_CONTEXT); @@ -38445,28 +38500,18 @@ try { faux.setResponses([fauxAssistantMessage("second")]); await (await worker.submit({ type: "input", content: "second" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); assert((await harness.snapshot(AgentDoc, worker.id, BACKGROUND_CONTEXT)).model.modelId === "second", "edited roster changes next model without restart"); - config.roster[0].model = "openai/new"; - await save(); - faux.setResponses([fauxAssistantMessage("proxy")]); - await (await worker.submit({ type: "input", content: "proxy" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); - assert(models.getModel("openai", "new").baseUrl === proxyTemplate.baseUrl && models.getModel("openai", "new").cost.input === 0 && models.getProvider("openai").auth === proxyAuth, "new model retains proxy transport and auth"); - config.roster[0].model = "anthropic/new"; - await save(); - faux.setResponses([fauxAssistantMessage("anthropic")]); - await (await worker.submit({ type: "input", content: "anthropic" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); - assert(models.getModel("anthropic", "new").baseUrl === "https://proxy.invalid/apis/anthropic", "new Anthropic model retains its own provider transport"); globalThis.modelPin = { provider: "faux", modelId: "faux-1" }; faux.setResponses([fauxAssistantMessage("pin")]); await (await worker.submit({ type: "input", content: "pin" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); assert((await worker.agent(BACKGROUND_CONTEXT)).model.provider === "faux", "models.pin overrides roster selection"); - await harness.commit((tx) => conversations.setStanding(tx, worker.id, true), BACKGROUND_CONTEXT); + await harness.commit((tx) => conversations.setMainAgent(tx, worker.id, true), BACKGROUND_CONTEXT); let refused = false; try { await harness.commit((tx) => conversations.concludeIn(tx, [worker.id]), BACKGROUND_CONTEXT); } catch { refused = true; } - assert(refused, "standing conversation cannot conclude"); + assert(refused, "mainAgent conversation cannot conclude"); } finally { await loader.close(); await harness.close(BACKGROUND_CONTEXT); diff --git a/host/js/core-ext-test.ts b/host/js/core-ext-test.ts index 9cf5a46..f23d187 100644 --- a/host/js/core-ext-test.ts +++ b/host/js/core-ext-test.ts @@ -5,13 +5,9 @@ import { fauxProvider, fauxAssistantMessage } from '@earendil-works/pi-ai/provid import { Harness, AgentDoc, createRegistry } from '@earendil-works/pi-durable' import { openStorage } from './sqlite' import { loadExtensions, fs } from './extensions' -import { parse } from 'yaml' +import {readTestConfig,writeTestConfig} from './roster-fixture' const assert = (ok:any,message:string)=>{if(!ok)throw new Error(message);Deno.core.ops.op_output(`ok - ${message}\n`)} const models=createModels(), faux=fauxProvider({tokensPerSecond:100000});models.setProvider(faux.provider) -const proxyTemplate={...models.getModels('faux')[0],provider:'openai',baseUrl:'https://proxy.invalid/v1'} -models.setProvider({...faux.provider,id:'openai',getModels:()=>[proxyTemplate]}) -models.setProvider({...faux.provider,id:'anthropic',getModels:()=>[{...proxyTemplate,provider:'anthropic',baseUrl:'https://proxy.invalid/apis/anthropic'}]}) -const proxyAuth=models.getProvider('openai').auth const storage=await openStorage(globalThis.storagePath), registry=createRegistry() const harness=await Harness.open(storage,{models,registry,settings:{retry:{enabled:false},get extensions(){return registry.snapshot().installed()}}},context) await harness.root(context,{agent:{model:{provider:'faux',modelId:'faux-1'}}}) @@ -19,10 +15,10 @@ const loader=await loadExtensions(harness,registry,storage,models,context) try { assert(!loader.state().error,`loader: ${loader.state().error ?? 'loaded'}`) const {selection,conversations,State,metadata}=globalThis.core - const config = parse(await fs.read('/etc/sausage/config.yaml')) - config.standing='worker' + const config = await readTestConfig(fs) + config.main_agent_name='worker' config.roster=[{name:'worker',description:'Worker',model:'faux/faux-1',thinking:'low',tools:['read','write'],prompt:'Worker body'}] - const save = ()=>fs.write('/etc/sausage/config.yaml',JSON.stringify(config)) + const save = ()=>writeTestConfig(fs,config) await save() const worker=await selection.start({agent:'worker',cwd:'/project/sub'},context) let agent=await worker.agent(context) @@ -77,19 +73,11 @@ try { faux.setResponses([fauxAssistantMessage('second')]) await (await worker.submit({type:'input',content:'second'},context)).wait(context) assert((await harness.snapshot(AgentDoc,worker.id,context)).model.modelId==='second','edited roster changes next model without restart') - config.roster[0].model='openai/new';await save() - faux.setResponses([fauxAssistantMessage('proxy')]) - await (await worker.submit({type:'input',content:'proxy'},context)).wait(context) - assert(models.getModel('openai','new').baseUrl===proxyTemplate.baseUrl && models.getModel('openai','new').cost.input===0 && models.getProvider('openai').auth===proxyAuth,'new model retains proxy transport and auth') - config.roster[0].model='anthropic/new';await save() - faux.setResponses([fauxAssistantMessage('anthropic')]) - await (await worker.submit({type:'input',content:'anthropic'},context)).wait(context) - assert(models.getModel('anthropic','new').baseUrl==='https://proxy.invalid/apis/anthropic','new Anthropic model retains its own provider transport') globalThis.modelPin={provider:'faux',modelId:'faux-1'} faux.setResponses([fauxAssistantMessage('pin')]) await (await worker.submit({type:'input',content:'pin'},context)).wait(context) assert((await worker.agent(context)).model.provider==='faux','models.pin overrides roster selection') - await harness.commit(tx=>conversations.setStanding(tx,worker.id,true),context) + await harness.commit(tx=>conversations.setMainAgent(tx,worker.id,true),context) let refused=false;try{await harness.commit(tx=>conversations.concludeIn(tx,[worker.id]),context)}catch{refused=true} - assert(refused,'standing conversation cannot conclude') + assert(refused,'mainAgent conversation cannot conclude') } finally {await loader.close();await harness.close(context)} diff --git a/host/js/dream-test-bundle.js b/host/js/dream-test-bundle.js index 1084d13..5d35701 100644 --- a/host/js/dream-test-bundle.js +++ b/host/js/dream-test-bundle.js @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38403,7 +38403,7 @@ var { Automations } = await import(`${base}/automations/server.ts`); var { ContextUsageDoc } = await import(`${base}/automations/triggers.ts`); var { Fired } = await import(`${base}/automations/refs.ts`); var { Messages } = await import(`${base}/messages/api.ts`); -var primary = await harness.conversation(await globalThis.dreamSubagents.standing("standing", BACKGROUND_CONTEXT), BACKGROUND_CONTEXT); +var primary = await harness.conversation(await globalThis.dreamSubagents.mainAgent("mainAgent", BACKGROUND_CONTEXT), BACKGROUND_CONTEXT); var entries2 = async () => (await primary.context(BACKGROUND_CONTEXT)).entries; var ledger = async () => (await harness.snapshot(Automations, BACKGROUND_CONTEXT))?.automations ?? {}; var requested = async () => (await entries2()).filter((e) => e.kind === "dream.requested"); diff --git a/host/js/dream-test.ts b/host/js/dream-test.ts index c5bf84b..8c7adcb 100644 --- a/host/js/dream-test.ts +++ b/host/js/dream-test.ts @@ -35,7 +35,7 @@ const {Automations}=await import(`${base}/automations/server.ts`) const {ContextUsageDoc}=await import(`${base}/automations/triggers.ts`) const {Fired}=await import(`${base}/automations/refs.ts`) const {Messages}=await import(`${base}/messages/api.ts`) -const primary=(await harness.conversation(await globalThis.dreamSubagents.standing('standing',context),context))! +const primary=(await harness.conversation(await globalThis.dreamSubagents.mainAgent('mainAgent',context),context))! const entries=async()=> (await primary.context(context)).entries const ledger=async()=> (await harness.snapshot(Automations,context))?.automations??{} const requested=async()=> (await entries()).filter((e:any)=>e.kind==='dream.requested') diff --git a/host/js/durable-test-bundle.js b/host/js/durable-test-bundle.js index 36d3111..0b38b06 100644 --- a/host/js/durable-test-bundle.js +++ b/host/js/durable-test-bundle.js @@ -20533,7 +20533,7 @@ registry.install(CredentialRequests); var harness = await Harness.open(await openStorage(globalThis.storagePath), { models, registry }, BACKGROUND_CONTEXT); var root = await harness.root(BACKGROUND_CONTEXT, { agent: { model: { provider: "faux", modelId: "faux-1" }, extensions: [CredentialRequests] } }); await (await root.submit({ type: "input", content: "initial", requestId: "initial" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); -if (globalThis.proxyOnly) { +if (globalThis.providerOnly) { await harness.close(BACKGROUND_CONTEXT); } else { await Deno.core.ops.op_file("write", "/conversation", Array.from(new TextEncoder().encode(root.id))); diff --git a/host/js/durable-test.ts b/host/js/durable-test.ts index 6dc82bd..e0ae322 100644 --- a/host/js/durable-test.ts +++ b/host/js/durable-test.ts @@ -14,7 +14,7 @@ registry.install(CredentialRequests); const harness = await Harness.open(await openStorage(globalThis.storagePath), { models, registry }, context); const root = await harness.root(context, { agent: { model: { provider: 'faux', modelId: 'faux-1' }, extensions: [CredentialRequests] } }); await (await root.submit({ type: 'input', content: 'initial', requestId: 'initial' }, context)).wait(context); -if (globalThis.proxyOnly) { +if (globalThis.providerOnly) { await harness.close(context); } else { await Deno.core.ops.op_file('write', '/conversation', Array.from(new TextEncoder().encode(root.id))); diff --git a/host/js/events-test-bundle.js b/host/js/events-test-bundle.js index 7bb9cc8..7a3ba0b 100644 --- a/host/js/events-test-bundle.js +++ b/host/js/events-test-bundle.js @@ -38336,10 +38336,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); diff --git a/host/js/events.md b/host/js/events.md index 929d0a0..3cd34e8 100644 --- a/host/js/events.md +++ b/host/js/events.md @@ -42,7 +42,7 @@ Event emission updates the feed inside the same transaction. Notices become `sausage.notice` events. The host records each distinct notice once per facet load. -This task does not add Standing agent's build or supervisor startup events. +This task does not add Main agent's build or supervisor startup events. ## Tests diff --git a/host/js/extensions-test-bundle.js b/host/js/extensions-test-bundle.js index 276e5e7..efe7b6f 100644 --- a/host/js/extensions-test-bundle.js +++ b/host/js/extensions-test-bundle.js @@ -38336,10 +38336,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); diff --git a/host/js/extensions.ts b/host/js/extensions.ts index 00f85dc..69caa65 100644 --- a/host/js/extensions.ts +++ b/host/js/extensions.ts @@ -210,10 +210,10 @@ export async function loadExtensions(harness:any, registry:any, storage:any, mod const rid = ops.op_watch([`${repo}/.git/refs/heads/main`,`${repo}/.git/packed-refs`,`${repo}/settings.json`]); await enqueue(); const pending = (async()=> {while(active){await ops.op_watch_next(rid);if(active)await enqueue();}})(); - return {reload:enqueue, state:()=>({...state}), async standing() { + return {reload:enqueue, state:()=>({...state}), async mainAgent() { if (!providers.has('models') || !providers.has('subagents')) return undefined; - const {standing:name}=await providers.get('models').discover(repo); - const conversationId=await providers.get('subagents').standing(name,context); + const {main_agent_name:name}=await providers.get('models').discover(repo); + const conversationId=await providers.get('subagents').mainAgent(name,context); return {name,conversationId}; }, async invoke(name:string,key:string,args:any,signal:AbortSignal,conversationId?:number) { const facet = facets.find(f=>f.extension.name===name); diff --git a/host/js/foundation-test.ts b/host/js/foundation-test.ts index 69f8c3d..19d28b0 100644 --- a/host/js/foundation-test.ts +++ b/host/js/foundation-test.ts @@ -1,4 +1,4 @@ -// Standing agent's input-placement cases, scheduler hold, and the headless channel contract. +// Main agent's input-placement cases, scheduler hold, and the headless channel contract. import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context'; import { createModels } from '@earendil-works/pi-ai/models'; import { fauxProvider, fauxAssistantMessage, fauxToolCall } from '@earendil-works/pi-ai/providers/faux'; diff --git a/host/js/goal-cases.ts b/host/js/goal-cases.ts index 7a968ac..ab323c9 100644 --- a/host/js/goal-cases.ts +++ b/host/js/goal-cases.ts @@ -1,4 +1,4 @@ -/** The seven Standing agent goal cases use overlaid documents and the loaded server modules. */ +/** The seven Main agent goal cases use overlaid documents and the loaded server modules. */ import type { ConversationId, GenerationHooks, Tx } from '@earendil-works/pi-durable' import { BACKGROUND_CONTEXT } from '@earendil-works/chord/context' import { expect, it } from './goal-questions-test-support' @@ -6,7 +6,7 @@ const { reminderTask } = await import(`${globalThis.goalBase}/goal/reminder.ts`) const {default:goalExtension,act,actions,end,Goals,openGoal,start,TRIES} = await import(`${globalThis.goalBase}/goal/server.ts`) import type { Host } from './extensions.ts' -const STANDING = 5 as ConversationId +const MAIN_AGENT = 5 as ConversationId const screenshot = { type: 'image', data: 'aGk=', mimeType: 'image/png' } /** Like the harness's document overlay, a proxy at every level: structuredClone refuses it. */ @@ -18,17 +18,17 @@ const overlay = (value: T): T => }, }) -/** A transaction over overlaid documents and a few entries of @standing's conversation; @standing is conversation 5. */ +/** A transaction over overlaid documents and a few entries of @mainAgent's conversation; @mainAgent is conversation 5. */ function fakeTx( newer: { id: number; conversationId: number; kind?: string; model: object[] }[] = [], ) { const docs = new Map() const entries = [ ...newer, - { id: 30, conversationId: STANDING, model: [{ role: 'user', content: 'no images' }] }, + { id: 30, conversationId: MAIN_AGENT, model: [{ role: 'user', content: 'no images' }] }, { id: 20, - conversationId: STANDING, + conversationId: MAIN_AGENT, model: [{ role: 'toolResult', content: [{ type: 'text', text: 'shot' }, screenshot] }], }, { id: 10, conversationId: 9, model: [{ role: 'user', content: [screenshot] }] }, @@ -47,7 +47,7 @@ function fakeTx( if (!docs.has(key)) docs.set( key, - def.kind === 'standing.standing-agents' ? { '$standing': STANDING } : def.initial(), + def.kind === 'main-agent.index' ? { '$main-agent': MAIN_AGENT } : def.initial(), ) return overlay(docs.get(key)!) }, @@ -120,27 +120,27 @@ it('keeps one goal open at a time and ends it once', async () => { it('blocks a criterion after repeated failed tries and finishes with the outcome', async () => { const tx = fakeTx() - await expect(act(tx, STANDING, { action: 'met', n: 1 }, 0)).rejects.toThrow('No hands-off goal') + await expect(act(tx, MAIN_AGENT, { action: 'met', n: 1 }, 0)).rejects.toThrow('No hands-off goal') await start(tx, 'Goal', 0) - await act(tx, STANDING, { action: 'criteria', criteria: ['Loads in 1s', 'Tests pass'] }, 0) - await expect(act(tx, STANDING, { action: 'met', n: 3 }, 0)).rejects.toThrow('No criterion 3') - for (let i = 1; i < TRIES; i++) await act(tx, STANDING, { action: 'failed', n: 1 }, 0) + await act(tx, MAIN_AGENT, { action: 'criteria', criteria: ['Loads in 1s', 'Tests pass'] }, 0) + await expect(act(tx, MAIN_AGENT, { action: 'met', n: 3 }, 0)).rejects.toThrow('No criterion 3') + for (let i = 1; i < TRIES; i++) await act(tx, MAIN_AGENT, { action: 'failed', n: 1 }, 0) expect((await openGoal(tx))!.criteria[0]).toMatchObject({ status: 'open', tries: TRIES - 1 }) - const last = await act(tx, STANDING, { action: 'failed', n: 1 }, 0) + const last = await act(tx, MAIN_AGENT, { action: 'failed', n: 1 }, 0) expect(last.answer).toContain('blocked') expect((await openGoal(tx))!.criteria[0].status).toBe('blocked') // Rewording keeps what was learned about an unchanged criterion. - await act(tx, STANDING, { action: 'criteria', criteria: ['Loads in 1s', 'Lint passes'] }, 0) + await act(tx, MAIN_AGENT, { action: 'criteria', criteria: ['Loads in 1s', 'Lint passes'] }, 0) expect((await openGoal(tx))!.criteria.map((item) => item.status)).toEqual(['blocked', 'open']) - await expect(act(tx, STANDING, { action: 'finish', summary: 'x' }, 0)).rejects.toThrow('outcome') + await expect(act(tx, MAIN_AGENT, { action: 'finish', summary: 'x' }, 0)).rejects.toThrow('outcome') const done = await act( tx, - STANDING, + MAIN_AGENT, { action: 'finish', outcome: 'blocked', summary: 'Stuck' }, 4, ) expect(done.ended).toMatchObject({ - ended: { by: 'standing', outcome: 'blocked', summary: 'Stuck' }, + ended: { by: 'mainAgent', outcome: 'blocked', summary: 'Stuck' }, }) expect(await openGoal(tx)).toBeUndefined() }) @@ -149,11 +149,11 @@ it('records decisions with the screenshots of its own conversation only', async const tx = fakeTx() await start(tx, 'Goal', 0) await expect( - act(tx, STANDING, { action: 'decide', question: 'Go?', picked: 'Yes' }, 0), + act(tx, MAIN_AGENT, { action: 'decide', question: 'Go?', picked: 'Yes' }, 0), ).rejects.toThrow('reason') await act( tx, - STANDING, + MAIN_AGENT, { action: 'decide', question: 'Approve?', @@ -165,7 +165,7 @@ it('records decisions with the screenshots of its own conversation only', async 1, ) await expect( - act(tx, STANDING, { action: 'decide', question: 'q', picked: 'p', reason: 'r', images: 10 }, 2), + act(tx, MAIN_AGENT, { action: 'decide', question: 'q', picked: 'p', reason: 'r', images: 10 }, 2), ).rejects.toThrow('has no images') expect((await openGoal(tx))!.decisions).toEqual([ { at: 1, question: 'Approve?', picked: 'Yes', reason: 'Meets 1', conversation: 7, images: 20 }, @@ -173,17 +173,17 @@ it('records decisions with the screenshots of its own conversation only', async }) it('never takes an earlier turn\'s screenshot for images: "latest"', async () => { - const tx = fakeTx([{ id: 40, kind: 'pi.user', conversationId: STANDING, model: [] }]) + const tx = fakeTx([{ id: 40, kind: 'pi.user', conversationId: MAIN_AGENT, model: [] }]) await start(tx, 'Goal', 0) const decide = { action: 'decide', question: 'q', picked: 'p', reason: 'r' } as const - await expect(act(tx, STANDING, { ...decide, images: 'latest' }, 1)).rejects.toThrow( + await expect(act(tx, MAIN_AGENT, { ...decide, images: 'latest' }, 1)).rejects.toThrow( 'no images in this turn', ) - await act(tx, STANDING, { ...decide, images: 20 }, 2) + await act(tx, MAIN_AGENT, { ...decide, images: 20 }, 2) expect((await openGoal(tx))!.decisions).toMatchObject([{ images: 20 }]) }) -it("notes the open goal on @standing's runs only, and lets only @standing keep it", async () => { +it("notes the open goal on @mainAgent's runs only, and lets only @mainAgent keep it", async () => { const tx = fakeTx() const extension = goalExtension({ doc: () => undefined, @@ -193,10 +193,10 @@ it("notes the open goal on @standing's runs only, and lets only @standing keep i const hooks = extension.hooks![0].handlers as GenerationHooks const before = (conversationId: number, kind = 'pi.user') => hooks.beforeInput({ kind }, { tx, conversationId } as never, BACKGROUND_CONTEXT) - expect(await before(STANDING)).toBeUndefined() + expect(await before(MAIN_AGENT)).toBeUndefined() await start(tx, 'Make it fast', 0) expect(await before(9)).toBeUndefined() - const note = (await before(STANDING))!.entries![0] + const note = (await before(MAIN_AGENT))!.entries![0] expect(note.kind).toBe('goal.note') expect(note.model![0].content).toContain( 'Hands-off goal 1, granted by the user, who is away: Make it fast', @@ -209,19 +209,19 @@ it("notes the open goal on @standing's runs only, and lets only @standing keep i { conversationId, commit: (fn: (tx: Tx) => unknown) => fn(tx) } as never, undefined as never, ) - await expect(run(9, { action: 'met', n: 1 })).rejects.toThrow('Only the standing agent') - expect(await run(STANDING, { action: 'criteria', criteria: ['Fast'] })).toEqual({ + await expect(run(9, { action: 'met', n: 1 })).rejects.toThrow('Only the main agent') + expect(await run(MAIN_AGENT, { action: 'criteria', criteria: ['Fast'] })).toEqual({ content: [{ type: 'text', text: 'Goal 1 has 1 criteria.' }], }) expect((await tx.doc(Goals, 1 as ConversationId)).goals[0].criteria).toHaveLength(1) // Finishing ends the goal and creates the report's delivery in the same commit; the note stops. - await run(STANDING, { action: 'finish', outcome: 'met', summary: 'Done' }) + await run(MAIN_AGENT, { action: 'finish', outcome: 'met', summary: 'Done' }) expect(tx.tasks).toEqual([ - { name: 'goal.deliver', input: expect.objectContaining({ to: STANDING, kind: 'goal.report' }) }, + { name: 'goal.deliver', input: expect.objectContaining({ to: MAIN_AGENT, kind: 'goal.report' }) }, { name: 'goal.reminder', input: { goal: 1 } }, ]) - expect(await before(STANDING)).toBeUndefined() + expect(await before(MAIN_AGENT)).toBeUndefined() }) it('keeps a reminder while the goal is open: paused while waiting on the user, gone once ended', async () => { @@ -232,7 +232,7 @@ it('keeps a reminder while the goal is open: paused while waiting on the user, g const run = (args: object) => tool.execute( args as never, - { conversationId: STANDING, commit: (fn: (tx: Tx) => unknown) => fn(tx) } as never, + { conversationId: MAIN_AGENT, commit: (fn: (tx: Tx) => unknown) => fn(tx) } as never, undefined as never, ) await actions.start({ text: 'Make it fast' }, { host } as never) @@ -240,7 +240,7 @@ it('keeps a reminder while the goal is open: paused while waiting on the user, g // its key instead of making a second one, and pauses it. await service.create({ name: 'Goal reminder · goal 1', - subscribers: ['@standing'], + subscribers: ['@mainAgent'], key: 'goal.reminder:1', }) ;(await openGoal(tx))!.waiting = { reason: 'Which account?', at: 0 } @@ -249,7 +249,7 @@ it('keeps a reminder while the goal is open: paused while waiting on the user, g { id: 'A1', name: 'Goal reminder · goal 1', - subscribers: ['@standing'], + subscribers: ['@mainAgent'], key: 'goal.reminder:1', enabled: false, }, @@ -261,10 +261,10 @@ it('keeps a reminder while the goal is open: paused while waiting on the user, g // The user renamed it: it stays linked by its id. ledger.get('A1')!.name = 'Night check' - // Its fire tells @standing what to check; other inputs do not. + // Its fire tells @mainAgent what to check; other inputs do not. const hooks = extension.hooks![0].handlers as GenerationHooks const note = async (input: object) => - (await hooks.beforeInput(input as never, { tx, conversationId: STANDING }, BACKGROUND_CONTEXT))! + (await hooks.beforeInput(input as never, { tx, conversationId: MAIN_AGENT }, BACKGROUND_CONTEXT))! .entries![0].model![0].content as string expect(await note({ kind: 'automations.fired', data: { id: 'A1' } })).toContain( 'This is the goal reminder', @@ -315,7 +315,7 @@ it('grants nothing through a start card still queued after the user ended its go expect( await hooks.beforeInput( { kind: 'goal.started' }, - { tx, conversationId: STANDING }, + { tx, conversationId: MAIN_AGENT }, BACKGROUND_CONTEXT, ), ).toBeUndefined() diff --git a/host/js/goal-questions-fixture.ts b/host/js/goal-questions-fixture.ts index 30c5a5e..100136e 100644 --- a/host/js/goal-questions-fixture.ts +++ b/host/js/goal-questions-fixture.ts @@ -17,7 +17,7 @@ export async function fixture(clock: any = {}) { const base=`file:///run/sausage/extensions/${loader.state().good}/extensions` const question=await import(/* @vite-ignore */ `${base}/questions/server.ts`) const {Messages}=await import(/* @vite-ignore */ `${base}/messages/api.ts`) - const {Standing}=await import(/* @vite-ignore */ `${base}/subagents/api.ts`) + const {MainAgent}=await import(/* @vite-ignore */ `${base}/subagents/api.ts`) const observed:string[]=[];let heard:any const route=async(transcript:any)=>{ faux.appendResponses([route]);const last=transcript.messages.at(-1),text=typeof last.content==='string'?last.content:last.content.filter((p:any)=>p.type==='text').map((p:any)=>p.text).join('\n') @@ -30,8 +30,8 @@ export async function fixture(clock: any = {}) { const settled=async()=>{await until(async()=>(await harness.commit((tx:any)=>tx.scanTasks({},1000),context)).items.every((t:any)=>t.state.status==='terminal'));await harness.waitForIdle(context)} const entries=async(id:number)=>(await harness.commit((tx:any)=>tx.scanEntries({conversationId:id},1000),context)).items.toSorted((a:any,b:any)=>a.id-b.id) const type=async(id:number,content:string)=>{const c=await harness.conversation(id,context);await(await c.submit({type:'input',content},context)).wait(context)} - const standing=async()=>{const c=await harness.createConversation({ownership:{kind:'ownerless'}},context);await c.configure({model:{provider:'faux',modelId:'faux-1'}},context);await harness.commit(async(tx:any)=>{(await tx.doc(Standing,root.id))['$standing']=c.id},context);return c.id} + const mainAgent=async()=>{const c=await harness.createConversation({ownership:{kind:'ownerless'}},context);await c.configure({model:{provider:'faux',modelId:'faux-1'}},context);await harness.commit(async(tx:any)=>{(await tx.doc(MainAgent,root.id))['$main-agent']=c.id},context);return c.id} const ask=async(id:number,args:any)=>{await type(id,`SEND ${JSON.stringify({to:'user',...args})}`);await settled();const result=(await entries(id)).findLast((e:any)=>e.kind==='pi.tool-result')?.model?.[0];return {error:result?.isError?result.content.map((p:any)=>p.text).join(''):undefined,message:(await log()).messages.findLast((m:any)=>m.from===id&&m.to==='user')}} const action=(conversationId?:number)=>({host:globalThis.testHost,conversationId,signal:new AbortController().signal}) - return {base,faux,loader,host:globalThis.testHost,opened:{harness,root,close:async()=>{await loader.close();await harness.close(context);await storage.close()}},standing,type,ask,answer:(args:any)=>question.actions.answer(args,action()),dismiss:(messageId:number)=>question.actions.dismiss({messageId},action()),log,entries,observed,settled,hear:(fn:any)=>heard=fn} + return {base,faux,loader,host:globalThis.testHost,opened:{harness,root,close:async()=>{await loader.close();await harness.close(context);await storage.close()}},mainAgent,type,ask,answer:(args:any)=>question.actions.answer(args,action()),dismiss:(messageId:number)=>question.actions.dismiss({messageId},action()),log,entries,observed,settled,hear:(fn:any)=>heard=fn} } diff --git a/host/js/goal-questions-test-bundle.js b/host/js/goal-questions-test-bundle.js index ecc8617..fa2ea18 100644 --- a/host/js/goal-questions-test-bundle.js +++ b/host/js/goal-questions-test-bundle.js @@ -40128,10 +40128,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -40260,7 +40260,7 @@ async function fixture(clock = {}) { /* @vite-ignore */ `${base}/messages/api.ts` ); - const { Standing } = await import( + const { MainAgent } = await import( /* @vite-ignore */ `${base}/subagents/api.ts` ); @@ -40285,11 +40285,11 @@ async function fixture(clock = {}) { const c = await harness.conversation(id, BACKGROUND_CONTEXT); await (await c.submit({ type: "input", content }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); }; - const standing = async () => { + const mainAgent = async () => { const c = await harness.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); await c.configure({ model: { provider: "faux", modelId: "faux-1" } }, BACKGROUND_CONTEXT); await harness.commit(async (tx) => { - (await tx.doc(Standing, root.id))["$standing"] = c.id; + (await tx.doc(MainAgent, root.id))["$main-agent"] = c.id; }, BACKGROUND_CONTEXT); return c.id; }; @@ -40304,7 +40304,7 @@ async function fixture(clock = {}) { await loader.close(); await harness.close(BACKGROUND_CONTEXT); await storage.close(); - } }, standing, type, ask, answer: (args) => question.actions.answer(args, action()), dismiss: (messageId) => question.actions.dismiss({ messageId }, action()), log, entries: entries2, observed, settled, hear: (fn) => heard = fn }; + } }, mainAgent, type, ask, answer: (args) => question.actions.answer(args, action()), dismiss: (messageId) => question.actions.dismiss({ messageId }, action()), log, entries: entries2, observed, settled, hear: (fn) => heard = fn }; } var next; var init_goal_questions_fixture = __esm({ @@ -40326,10 +40326,10 @@ function fakeTx(newer = []) { const docs = /* @__PURE__ */ new Map(); const entries2 = [ ...newer, - { id: 30, conversationId: STANDING, model: [{ role: "user", content: "no images" }] }, + { id: 30, conversationId: MAIN_AGENT, model: [{ role: "user", content: "no images" }] }, { id: 20, - conversationId: STANDING, + conversationId: MAIN_AGENT, model: [{ role: "toolResult", content: [{ type: "text", text: "shot" }, screenshot] }] }, { id: 10, conversationId: 9, model: [{ role: "user", content: [screenshot] }] } @@ -40345,7 +40345,7 @@ function fakeTx(newer = []) { if (!docs.has(key)) docs.set( key, - def.kind === "standing.standing-agents" ? { "$standing": STANDING } : def.initial() + def.kind === "main-agent.index" ? { "$main-agent": MAIN_AGENT } : def.initial() ); return overlay(docs.get(key)); }, @@ -40390,14 +40390,14 @@ function fakeHost(tx) { }; return { host, ledger, service, sync }; } -var reminderTask, goalExtension, act, actions, end, Goals, openGoal, start, TRIES, STANDING, screenshot, overlay; +var reminderTask, goalExtension, act, actions, end, Goals, openGoal, start, TRIES, MAIN_AGENT, screenshot, overlay; var init_goal_cases = __esm({ async "goal-cases.ts"() { init_context(); init_goal_questions_test_support(); ({ reminderTask } = await import(`${globalThis.goalBase}/goal/reminder.ts`)); ({ default: goalExtension, act, actions, end, Goals, openGoal, start, TRIES } = await import(`${globalThis.goalBase}/goal/server.ts`)); - STANDING = 5; + MAIN_AGENT = 5; screenshot = { type: "image", data: "aGk=", mimeType: "image/png" }; overlay = (value2) => new Proxy(value2, { get: (target, key) => { @@ -40421,26 +40421,26 @@ var init_goal_cases = __esm({ }); it("blocks a criterion after repeated failed tries and finishes with the outcome", async () => { const tx = fakeTx(); - await expect(act(tx, STANDING, { action: "met", n: 1 }, 0)).rejects.toThrow("No hands-off goal"); + await expect(act(tx, MAIN_AGENT, { action: "met", n: 1 }, 0)).rejects.toThrow("No hands-off goal"); await start(tx, "Goal", 0); - await act(tx, STANDING, { action: "criteria", criteria: ["Loads in 1s", "Tests pass"] }, 0); - await expect(act(tx, STANDING, { action: "met", n: 3 }, 0)).rejects.toThrow("No criterion 3"); - for (let i = 1; i < TRIES; i++) await act(tx, STANDING, { action: "failed", n: 1 }, 0); + await act(tx, MAIN_AGENT, { action: "criteria", criteria: ["Loads in 1s", "Tests pass"] }, 0); + await expect(act(tx, MAIN_AGENT, { action: "met", n: 3 }, 0)).rejects.toThrow("No criterion 3"); + for (let i = 1; i < TRIES; i++) await act(tx, MAIN_AGENT, { action: "failed", n: 1 }, 0); expect((await openGoal(tx)).criteria[0]).toMatchObject({ status: "open", tries: TRIES - 1 }); - const last = await act(tx, STANDING, { action: "failed", n: 1 }, 0); + const last = await act(tx, MAIN_AGENT, { action: "failed", n: 1 }, 0); expect(last.answer).toContain("blocked"); expect((await openGoal(tx)).criteria[0].status).toBe("blocked"); - await act(tx, STANDING, { action: "criteria", criteria: ["Loads in 1s", "Lint passes"] }, 0); + await act(tx, MAIN_AGENT, { action: "criteria", criteria: ["Loads in 1s", "Lint passes"] }, 0); expect((await openGoal(tx)).criteria.map((item) => item.status)).toEqual(["blocked", "open"]); - await expect(act(tx, STANDING, { action: "finish", summary: "x" }, 0)).rejects.toThrow("outcome"); + await expect(act(tx, MAIN_AGENT, { action: "finish", summary: "x" }, 0)).rejects.toThrow("outcome"); const done = await act( tx, - STANDING, + MAIN_AGENT, { action: "finish", outcome: "blocked", summary: "Stuck" }, 4 ); expect(done.ended).toMatchObject({ - ended: { by: "standing", outcome: "blocked", summary: "Stuck" } + ended: { by: "mainAgent", outcome: "blocked", summary: "Stuck" } }); expect(await openGoal(tx)).toBeUndefined(); }); @@ -40448,11 +40448,11 @@ var init_goal_cases = __esm({ const tx = fakeTx(); await start(tx, "Goal", 0); await expect( - act(tx, STANDING, { action: "decide", question: "Go?", picked: "Yes" }, 0) + act(tx, MAIN_AGENT, { action: "decide", question: "Go?", picked: "Yes" }, 0) ).rejects.toThrow("reason"); await act( tx, - STANDING, + MAIN_AGENT, { action: "decide", question: "Approve?", @@ -40464,23 +40464,23 @@ var init_goal_cases = __esm({ 1 ); await expect( - act(tx, STANDING, { action: "decide", question: "q", picked: "p", reason: "r", images: 10 }, 2) + act(tx, MAIN_AGENT, { action: "decide", question: "q", picked: "p", reason: "r", images: 10 }, 2) ).rejects.toThrow("has no images"); expect((await openGoal(tx)).decisions).toEqual([ { at: 1, question: "Approve?", picked: "Yes", reason: "Meets 1", conversation: 7, images: 20 } ]); }); it(`never takes an earlier turn's screenshot for images: "latest"`, async () => { - const tx = fakeTx([{ id: 40, kind: "pi.user", conversationId: STANDING, model: [] }]); + const tx = fakeTx([{ id: 40, kind: "pi.user", conversationId: MAIN_AGENT, model: [] }]); await start(tx, "Goal", 0); const decide = { action: "decide", question: "q", picked: "p", reason: "r" }; - await expect(act(tx, STANDING, { ...decide, images: "latest" }, 1)).rejects.toThrow( + await expect(act(tx, MAIN_AGENT, { ...decide, images: "latest" }, 1)).rejects.toThrow( "no images in this turn" ); - await act(tx, STANDING, { ...decide, images: 20 }, 2); + await act(tx, MAIN_AGENT, { ...decide, images: 20 }, 2); expect((await openGoal(tx)).decisions).toMatchObject([{ images: 20 }]); }); - it("notes the open goal on @standing's runs only, and lets only @standing keep it", async () => { + it("notes the open goal on @mainAgent's runs only, and lets only @mainAgent keep it", async () => { const tx = fakeTx(); const extension = goalExtension({ doc: () => void 0, @@ -40489,10 +40489,10 @@ var init_goal_cases = __esm({ }); const hooks = extension.hooks[0].handlers; const before = (conversationId, kind = "pi.user") => hooks.beforeInput({ kind }, { tx, conversationId }, BACKGROUND_CONTEXT); - expect(await before(STANDING)).toBeUndefined(); + expect(await before(MAIN_AGENT)).toBeUndefined(); await start(tx, "Make it fast", 0); expect(await before(9)).toBeUndefined(); - const note = (await before(STANDING)).entries[0]; + const note = (await before(MAIN_AGENT)).entries[0]; expect(note.kind).toBe("goal.note"); expect(note.model[0].content).toContain( "Hands-off goal 1, granted by the user, who is away: Make it fast" @@ -40503,17 +40503,17 @@ var init_goal_cases = __esm({ { conversationId, commit: (fn) => fn(tx) }, void 0 ); - await expect(run2(9, { action: "met", n: 1 })).rejects.toThrow("Only the standing agent"); - expect(await run2(STANDING, { action: "criteria", criteria: ["Fast"] })).toEqual({ + await expect(run2(9, { action: "met", n: 1 })).rejects.toThrow("Only the main agent"); + expect(await run2(MAIN_AGENT, { action: "criteria", criteria: ["Fast"] })).toEqual({ content: [{ type: "text", text: "Goal 1 has 1 criteria." }] }); expect((await tx.doc(Goals, 1)).goals[0].criteria).toHaveLength(1); - await run2(STANDING, { action: "finish", outcome: "met", summary: "Done" }); + await run2(MAIN_AGENT, { action: "finish", outcome: "met", summary: "Done" }); expect(tx.tasks).toEqual([ - { name: "goal.deliver", input: expect.objectContaining({ to: STANDING, kind: "goal.report" }) }, + { name: "goal.deliver", input: expect.objectContaining({ to: MAIN_AGENT, kind: "goal.report" }) }, { name: "goal.reminder", input: { goal: 1 } } ]); - expect(await before(STANDING)).toBeUndefined(); + expect(await before(MAIN_AGENT)).toBeUndefined(); }); it("keeps a reminder while the goal is open: paused while waiting on the user, gone once ended", async () => { const tx = fakeTx(); @@ -40522,13 +40522,13 @@ var init_goal_cases = __esm({ const tool = extension.tools.find((candidate) => candidate.name === "goal"); const run2 = (args) => tool.execute( args, - { conversationId: STANDING, commit: (fn) => fn(tx) }, + { conversationId: MAIN_AGENT, commit: (fn) => fn(tx) }, void 0 ); await actions.start({ text: "Make it fast" }, { host }); await service.create({ name: "Goal reminder \xB7 goal 1", - subscribers: ["@standing"], + subscribers: ["@mainAgent"], key: "goal.reminder:1" }); (await openGoal(tx)).waiting = { reason: "Which account?", at: 0 }; @@ -40537,7 +40537,7 @@ var init_goal_cases = __esm({ { id: "A1", name: "Goal reminder \xB7 goal 1", - subscribers: ["@standing"], + subscribers: ["@mainAgent"], key: "goal.reminder:1", enabled: false } @@ -40548,7 +40548,7 @@ var init_goal_cases = __esm({ expect(ledger.get("A1").enabled).toBe(true); ledger.get("A1").name = "Night check"; const hooks = extension.hooks[0].handlers; - const note = async (input) => (await hooks.beforeInput(input, { tx, conversationId: STANDING }, BACKGROUND_CONTEXT)).entries[0].model[0].content; + const note = async (input) => (await hooks.beforeInput(input, { tx, conversationId: MAIN_AGENT }, BACKGROUND_CONTEXT)).entries[0].model[0].content; expect(await note({ kind: "automations.fired", data: { id: "A1" } })).toContain( "This is the goal reminder" ); @@ -40591,7 +40591,7 @@ var init_goal_cases = __esm({ expect( await hooks.beforeInput( { kind: "goal.started" }, - { tx, conversationId: STANDING }, + { tx, conversationId: MAIN_AGENT }, BACKGROUND_CONTEXT ) ).toBeUndefined(); @@ -40645,7 +40645,7 @@ var init_questions_cases = __esm({ describe2("questions on a message", () => { it("are stored as the tool validated them, only on reply-expected messages to the user", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const sent = await f.ask(id, { text: "Decide these.", questions: decisions }); expect(sent.error).toBeUndefined(); expect(sent.message).toMatchObject({ state: "delivered", questions: decisions }); @@ -40662,7 +40662,7 @@ var init_questions_cases = __esm({ }); it("refuses questions the card could not answer, naming the question", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const refused = async (questions, reason) => { const { error } = await f.ask(id, { text: "Decide.", questions }); expect(error).toContain(reason); @@ -40723,7 +40723,7 @@ var init_questions_cases = __esm({ }); it("answers in the message numbering for every kind, with a note after the answers", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const { message } = await f.ask(id, { text: "Decide these.", questions: decisions }); expect(userActions).toEqual(["answer", "dismiss"]); await expect( @@ -40770,7 +40770,7 @@ var init_questions_cases = __esm({ }); it("sends a note on its own, and free text for a message without questions", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const { message } = await f.ask(id, { text: "Decide these.", questions: decisions }); await expect(f.answer({ messageId: message.id, answers: [], note: " " })).rejects.toThrow( "Invalid answers" @@ -40796,9 +40796,9 @@ var init_questions_cases = __esm({ "These questions are no longer open" ); }); - it("keeps @standing's open message open until its card answers it, naming it by its questions", async () => { + it("keeps @mainAgent's open message open until its card answers it, naming it by its questions", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const { message } = await f.ask(id, { text: "Decide these.", questions: decisions }); await f.type( f.opened.root.id, @@ -40826,7 +40826,7 @@ var init_questions_cases = __esm({ }); it("dismisses one open question with a one-way note that starts no run, leaving the others open", async () => { const f = await fixture2(); - const id = await f.standing(); + const id = await f.mainAgent(); const first = (await f.ask(id, { text: "Keep it running?", questions: [decisions[2]] })).message; const second = (await f.ask(id, { text: "Which layout?" })).message; const before = (await f.entries(id)).filter((entry2) => entry2.kind === "pi.assistant").length; @@ -40954,7 +40954,7 @@ var init_goal_reminder_cases = __esm({ return () => timers.delete(timer); } }); try { - const id = await f.standing(); + const id = await f.mainAgent(); const { harness } = f.opened; const goal = await import( /* @vite-ignore */ diff --git a/host/js/goal-questions-test-support.ts b/host/js/goal-questions-test-support.ts index fe26abb..e715638 100644 --- a/host/js/goal-questions-test-support.ts +++ b/host/js/goal-questions-test-support.ts @@ -1,4 +1,4 @@ -/** Minimal assertions for the imported Standing agent cases, without Node or Vitest. */ +/** Minimal assertions for the imported Main agent cases, without Node or Vitest. */ export const cases: {name:string;run:()=>any}[]=[] export const it=(name:string,run:()=>any)=>cases.push({name,run}) export const describe=(_name:string,run:()=>any)=>run() diff --git a/host/js/goal-questions-test.ts b/host/js/goal-questions-test.ts index b4dab34..353db26 100644 --- a/host/js/goal-questions-test.ts +++ b/host/js/goal-questions-test.ts @@ -1,4 +1,4 @@ -/** Standing agent goal and question-card cases execute in the world loader. */ +/** Main agent goal and question-card cases execute in the world loader. */ import {fixture} from './goal-questions-fixture' import {cases,cleanups} from './goal-questions-test-support' const initial=await fixture() diff --git a/host/js/goal-reminder-cases.ts b/host/js/goal-reminder-cases.ts index 9f1804c..39d1830 100644 --- a/host/js/goal-reminder-cases.ts +++ b/host/js/goal-reminder-cases.ts @@ -9,7 +9,7 @@ it('fires one goal reminder through automations',async()=>{ const timer={at:now+delay,callback};timers.add(timer);return()=>timers.delete(timer) }}) try { - const id=await f.standing();const {harness}=f.opened + const id=await f.mainAgent();const {harness}=f.opened const goal=await import(/* @vite-ignore */ `${f.base}/goal/server.ts`) const {Automations}=await import(/* @vite-ignore */ `${f.base}/automations/server.ts`) await goal.actions.start({text:'Ship the goal'},{host:f.host}) diff --git a/host/js/harness-api-test-bundle.js b/host/js/harness-api-test-bundle.js index 7c5665c..e751c90 100644 --- a/host/js/harness-api-test-bundle.js +++ b/host/js/harness-api-test-bundle.js @@ -38336,10 +38336,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f2) => f2.extension.name === name); @@ -38428,7 +38428,7 @@ async function fixture(clock = {}) { /* @vite-ignore */ `${base}/messages/api.ts` ); - const { Standing } = await import( + const { MainAgent } = await import( /* @vite-ignore */ `${base}/subagents/api.ts` ); @@ -38453,11 +38453,11 @@ async function fixture(clock = {}) { const c = await harness2.conversation(id2, BACKGROUND_CONTEXT); await (await c.submit({ type: "input", content }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); }; - const standing = async () => { + const mainAgent = async () => { const c = await harness2.createConversation({ ownership: { kind: "ownerless" } }, BACKGROUND_CONTEXT); await c.configure({ model: { provider: "faux", modelId: "faux-1" } }, BACKGROUND_CONTEXT); await harness2.commit(async (tx) => { - (await tx.doc(Standing, root.id))["$standing"] = c.id; + (await tx.doc(MainAgent, root.id))["$main-agent"] = c.id; }, BACKGROUND_CONTEXT); return c.id; }; @@ -38472,7 +38472,7 @@ async function fixture(clock = {}) { await loader.close(); await harness2.close(BACKGROUND_CONTEXT); await storage.close(); - } }, standing, type, ask, answer: (args) => question2.actions.answer(args, action()), dismiss: (messageId) => question2.actions.dismiss({ messageId }, action()), log, entries: entries2, observed, settled, hear: (fn) => heard = fn }; + } }, mainAgent, type, ask, answer: (args) => question2.actions.answer(args, action()), dismiss: (messageId) => question2.actions.dismiss({ messageId }, action()), log, entries: entries2, observed, settled, hear: (fn) => heard = fn }; } // harness-api.ts @@ -38542,7 +38542,7 @@ function harnessApi(harness2, models, extensions, context) { }; try { if (input.method === "GET" && path === "/conversations") { - const standing = await extensions.standing?.() ?? null; + const mainAgent = await extensions.mainAgent?.() ?? null; const records = await harness2.commit(async (tx) => { const all = []; let cursor; @@ -38561,7 +38561,7 @@ function harnessApi(harness2, models, extensions, context) { const started = await harness2.snapshot(Started2, record2.id, context); return { ...record2, title: metadata?.title ?? "", agent, starter: started?.by ?? null, concluded: concluded.has(record2.id), running: !!live?.run }; })); - reply(200, { conversations, standing }); + reply(200, { conversations, main_agent: mainAgent }); return; } if (input.method === "GET" && path === "/events") { @@ -38574,6 +38574,7 @@ function harnessApi(harness2, models, extensions, context) { return; } if (input.method === "GET" && path === "/models") { + await models.refreshConfig?.(); reply(200, { models: models.getAllModels().map(({ id: id2, name, provider: provider2, contextWindow, maxTokens, reasoning, cost }) => ({ id: id2, name, provider: provider2, contextWindow, maxTokens, reasoning, cost })) }); return; } @@ -38677,12 +38678,12 @@ var curl = async (path, body) => { assert(result.code === 0, `curl failed: ${result.stderr}`); return JSON.parse(result.stdout); }; -var id = await f.standing(); +var id = await f.mainAgent(); var question = await f.ask(id, { text: "Choose.", questions: [{ text: "Name", kind: "text", ref: "1" }] }); assert(question.message, "Question fixture"); var listed = await curl("/conversations"); assert(listed.conversations.some((c) => c.id === id && c.agent && !c.running), "Conversation list"); -assert(listed.standing.name === "standing" && listed.standing.conversationId === id, "Conversation list identifies the configured standing conversation"); +assert(listed.main_agent.name === "mainAgent" && listed.main_agent.conversationId === id, "Conversation list identifies the configured mainAgent conversation"); var initial = await curl(`/conversations/${id}/entries`); var after = initial.entries.at(-1).id; var answer2 = await curl("/extensions/questions/actions/answer", { args: { messageId: question.message.id, answers: [{ question: "Name", answer: "API choice" }] } }); diff --git a/host/js/harness-api-test.ts b/host/js/harness-api-test.ts index dc88a1a..29a142f 100644 --- a/host/js/harness-api-test.ts +++ b/host/js/harness-api-test.ts @@ -14,12 +14,12 @@ const curl=async(path:string,body?:any)=>{ assert(result.code===0,`curl failed: ${result.stderr}`); return JSON.parse(result.stdout); }; -const id=await f.standing(); +const id=await f.mainAgent(); const question=await f.ask(id,{text:'Choose.',questions:[{text:'Name',kind:'text',ref:'1'}]}); assert(question.message,'Question fixture'); const listed=await curl('/conversations'); assert(listed.conversations.some((c:any)=>c.id===id && c.agent && !c.running),'Conversation list'); -assert(listed.standing.name==='standing'&&listed.standing.conversationId===id,'Conversation list identifies the configured standing conversation'); +assert(listed.main_agent.name==='mainAgent'&&listed.main_agent.conversationId===id,'Conversation list identifies the configured mainAgent conversation'); const initial=await curl(`/conversations/${id}/entries`); const after=initial.entries.at(-1).id; const answer=await curl('/extensions/questions/actions/answer',{args:{messageId:question.message.id,answers:[{question:'Name',answer:'API choice'}]}}); diff --git a/host/js/harness-api.ts b/host/js/harness-api.ts index f7ffe2b..b0c5dd8 100644 --- a/host/js/harness-api.ts +++ b/host/js/harness-api.ts @@ -51,7 +51,7 @@ export function harnessApi(harness:any, models:any, extensions:any, context:any) const reply=(status:number,body:any)=>{send(input.id,{status,body});send(input.id,null);}; try { if(input.method==='GET' && path==='/conversations') { - const standing=await extensions.standing?.() ?? null; + const mainAgent=await extensions.mainAgent?.() ?? null; const records=await harness.commit(async(tx:any)=>{ const all:any[]=[];let cursor:any; do {const page=await tx.scanConversations({},256,cursor);all.push(...page.items);cursor=page.next;}while(cursor); @@ -65,14 +65,14 @@ export function harnessApi(harness:any, models:any, extensions:any, context:any) const started:any=await harness.snapshot(Started,record.id,context); return {...record,title:metadata?.title??'',agent,starter:started?.by??null,concluded:concluded.has(record.id),running:!!live?.run}; })); - reply(200,{conversations,standing});return; + reply(200,{conversations,main_agent:mainAgent});return; } if(input.method==='GET' && path==='/events') { const cursor=integer(url.searchParams.get('after'),0); await follow(input,async(after)=>log.recent({since:after,order:'ascending',limit:256}),cursor);return; } if(input.method==='GET' && path==='/extensions') {reply(200,extensions.state());return;} - if(input.method==='GET' && path==='/models') {reply(200,{models:models.getAllModels().map(({id,name,provider,contextWindow,maxTokens,reasoning,cost}:any)=>({id,name,provider,contextWindow,maxTokens,reasoning,cost}))});return;} + if(input.method==='GET' && path==='/models') {await models.refreshConfig?.();reply(200,{models:models.getAllModels().map(({id,name,provider,contextWindow,maxTokens,reasoning,cost}:any)=>({id,name,provider,contextWindow,maxTokens,reasoning,cost}))});return;} const action=/^\/extensions\/([^/]+)\/actions\/([^/]+)$/.exec(path); if(input.method==='POST' && action) { if(data.conversationId!==undefined && (!Number.isSafeInteger(data.conversationId)||data.conversationId<1)) fail(400,'Invalid conversation id'); diff --git a/host/js/main.ts b/host/js/main.ts index 6206639..1bc83ed 100644 --- a/host/js/main.ts +++ b/host/js/main.ts @@ -1,6 +1,6 @@ -// The standing conversation serves the console and chat. SQLite stays outside the world. +// The main agent conversation serves the console and chat. SQLite stays outside the world. import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context'; -import { proxyModels } from './proxy-models'; +import { configuredModels, modelCatalog } from './models'; import { Harness, createRegistry } from '@earendil-works/pi-durable'; import { CodingTools } from './environment'; import { openStorage } from './sqlite'; @@ -9,8 +9,7 @@ import { CredentialRequests, startRequests } from './credentials'; import { serve } from './input'; import { harnessApi } from './harness-api'; import { loadExtensions } from './extensions'; -const proxy = await Deno.core.ops.op_model_proxy(); -const models = await proxyModels(proxy, () => Deno.core.ops.op_model_proxy()); +const models = await configuredModels(() => Deno.core.ops.op_model_providers(), await modelCatalog()); const registry = createRegistry(); registry.install(CodingTools); registry.install(CredentialRequests); @@ -23,9 +22,9 @@ const chain = conversationChains(harness, context); await harness.root(context, {agent:{cwd:'/src/sausage'}}); const stopRequests = await startRequests(harness, context); const extensions = await loadExtensions(harness, registry, storage, models, context, [CodingTools, CredentialRequests]); -const standing = await extensions.standing(); -if (!standing) throw new Error('The world needs the models and subagents extensions for its standing agent'); -const conversation = (await harness.conversation(standing.conversationId, context))!; +const mainAgent = await extensions.mainAgent(); +if (!mainAgent) throw new Error('The world needs the models and subagents extensions for its main agent'); +const conversation = (await harness.conversation(mainAgent.conversationId, context))!; const watch = await conversation.watch(context); const emitted = new Map(); let partial = ''; @@ -57,7 +56,7 @@ await serve(harness, context, globalThis.consoleEnabled ? async () => { render(final.value); await final.stop(); Deno.core.ops.op_output('\n'); -} : undefined, api, async () => (await extensions.standing())!.conversationId); +} : undefined, api, async () => (await extensions.mainAgent())!.conversationId); await api.close(); await extensions.close(); await stopRequests(); diff --git a/host/js/messages-test-bundle.js b/host/js/messages-test-bundle.js index a5614ae..74b54db 100644 --- a/host/js/messages-test-bundle.js +++ b/host/js/messages-test-bundle.js @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38444,7 +38444,7 @@ var { SubmissionLanded } = await import(`${base}/lineage/refs.ts`); var { Tally, abstract } = await import(`${base}/lineage/server.ts`); var { normalizeMemoryOp, parseMemoryOps, applyMemoryOps, readMemory, memorizeTask } = await import(`${base}/lineage/memory.ts`); var { Seen, mainOf } = await import(`${base}/lineage/catchup.ts`); -var primaryId = await globalThis.subagentService.standing("standing", BACKGROUND_CONTEXT); +var primaryId = await globalThis.subagentService.mainAgent("mainAgent", BACKGROUND_CONTEXT); var primary = await harness.conversation(primaryId, BACKGROUND_CONTEXT); var entries2 = async (conversation) => (await conversation.context(BACKGROUND_CONTEXT)).entries; var replies = async () => (await entries2(primary)).filter((e) => e.kind === "board.reply"); diff --git a/host/js/messages-test.ts b/host/js/messages-test.ts index 3bf62db..a256f23 100644 --- a/host/js/messages-test.ts +++ b/host/js/messages-test.ts @@ -59,7 +59,7 @@ const {SubmissionLanded} = await import(`${base}/lineage/refs.ts`); const {Tally, abstract} = await import(`${base}/lineage/server.ts`); const {normalizeMemoryOp, parseMemoryOps, applyMemoryOps, readMemory, memorizeTask} = await import(`${base}/lineage/memory.ts`); const {Seen, mainOf} = await import(`${base}/lineage/catchup.ts`); -const primaryId = await globalThis.subagentService.standing('standing', context); +const primaryId = await globalThis.subagentService.mainAgent('mainAgent', context); const primary = (await harness.conversation(primaryId, context))!; const entries = async (conversation: any) => (await conversation.context(context)).entries; const replies = async () => (await entries(primary)).filter((e: any) => e.kind === 'board.reply'); diff --git a/host/js/models-dev.json b/host/js/models-dev.json new file mode 100644 index 0000000..0c98e49 --- /dev/null +++ b/host/js/models-dev.json @@ -0,0 +1 @@ +{"nearai":{"id":"nearai","env":["NEARAI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://cloud-api.near.ai/v1","name":"NEAR AI Cloud","doc":"https://docs.near.ai/","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":64000},"cost":{"input":1.1,"output":1.1,"cache_read":0.55},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.8,"output":7.5},"canonical_model_id":"alibaba/qwen3.7-max"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4.1-Flash-1017-abliterated":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017-abliterated","name":"DeepSeek V4.1 Flash 1017 Abliterated","description":"NEAR AI's refusal-removed DeepSeek V4.1 Flash 1017 for security research, with text-only reasoning and tool use inside a private TEE","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-29","last_updated":"2026-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006}},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.81,"output":3.85,"cache_read":0.41},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3.3,"output":16.5,"cache_read":0.33},"canonical_model_id":"moonshotai/kimi-k3"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/whisper-large-v3":{"id":"openai/whisper-large-v3","type":"transcription","name":"Whisper Large v3","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"openai/whisper-large-v3"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01},"canonical_model_id":"openai/gpt-6-luna"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"black-forest-labs/FLUX.2-klein-4B":{"id":"black-forest-labs/FLUX.2-klein-4B","type":"image","name":"FLUX.2 Klein 4B","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-01-15","modalities":{"input":["text","image"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0},"canonical_model_id":"black-forest-labs/flux-2-klein-4b"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.8,"output":5.75,"cache_read":0.45},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.08,"output":0.5,"cache_read":0.012},"canonical_model_id":"zhipuai/glm-5.3-flash"},"Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen3-VL 30B-A3B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":8192},"cost":{"input":0.15,"output":0.55,"cache_read":0.03},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"Qwen/Qwen3-Embedding-0.6B":{"id":"Qwen/Qwen3-Embedding-0.6B","type":"embedding","name":"Qwen3 Embedding 0.6B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":1024},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"alibaba/qwen3-embedding-0.6b"},"Qwen/Qwen3-Reranker-0.6B":{"id":"Qwen/Qwen3-Reranker-0.6B","type":"reranking","name":"Qwen3 Reranker 0.6B","description":"Reranking model for improving retrieval quality in search and recommendation systems","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":1024},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"alibaba/qwen3-reranker-0.6b"},"Qwen/Qwen3.8-27B-abliterated":{"id":"Qwen/Qwen3.8-27B-abliterated","name":"Qwen3.8 27B Abliterated","description":"NEAR AI's refusal-removed Qwen3.8 27B for security research, with vision, reasoning and tool use inside a private TEE","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-29","last_updated":"2026-10-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.04,"output":1.35,"cache_read":0.018}},"Qwen/Qwen3.6-35B-A3B-FP8":{"id":"Qwen/Qwen3.6-35B-A3B-FP8","name":"Qwen 3.6 35B A3B FP8","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.17,"output":1.1,"cache_read":0.056},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.04,"output":1.35,"cache_read":0.018},"canonical_model_id":"alibaba/qwen3.8-27b"}}},"tempr":{"id":"tempr","env":["TEMPR_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.temprhq.io/v1","name":"Tempr Gateway","doc":"https://temprhq.io/docs/gateway-reference.html","models":{"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4-5":{"id":"anthropic/claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4-5-20250929":{"id":"anthropic/claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-haiku-4-5-20251001":{"id":"anthropic/claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-5-20251101":{"id":"anthropic/claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"mistral/mistral-large-2512":{"id":"mistral/mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/mistral-small-2603":{"id":"mistral/mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-2603"},"mistral/zai-glm-5-2":{"id":"mistral/zai-glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"mistral/zai-glm-5-3":{"id":"mistral/zai-glm-5-3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"mistral/voxtral-small-latest":{"id":"mistral/voxtral-small-latest","name":"Voxtral Small (latest)","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"mistral/voxtral-small-latest"},"mistral/mistral-small-latest":{"id":"mistral/mistral-small-latest","name":"Mistral Small (latest)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-latest"},"mistral/mistral-medium-latest":{"id":"mistral/mistral-medium-latest","name":"Mistral Medium (latest)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-latest"},"mistral/mistral-medium-2604":{"id":"mistral/mistral-medium-2604","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-2604"},"mistral/mistral-embed":{"id":"mistral/mistral-embed","type":"embedding","name":"Mistral Embed","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"mistral-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":3072},"cost":{"input":0.1,"output":0},"canonical_model_id":"mistral/mistral-embed"},"mistral/mistral-large-latest":{"id":"mistral/mistral-large-latest","name":"Mistral Large (latest)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-latest"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"reasoning":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-flash":{"id":"deepseek/deepseek-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"reasoning":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"google/gemini-flash-lite-latest":{"id":"google/gemini-flash-lite-latest","name":"Gemini Flash-Lite Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-flash-lite-latest"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-flash-latest"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-embedding-001":{"id":"google/gemini-embedding-001","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":1},"cost":{"input":0.15,"output":0},"canonical_model_id":"google/gemini-embedding-001"},"google/gemini-embedding-2":{"id":"google/gemini-embedding-2","type":"embedding","name":"Gemini Embedding 2","description":"Multimodal embedding model mapping text, images, video, audio, and PDFs into a unified embedding space","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-11","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1},"cost":{"input":0.2,"output":0},"canonical_model_id":"google/gemini-embedding-2"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-4.6v-flash":{"id":"zai/glm-4.6v-flash","name":"GLM-4.6V-Flash","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"zai/glm-4.6v":{"id":"zai/glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.05},"canonical_model_id":"zhipuai/glm-4.6v"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-4.5":{"id":"zai/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5.3":{"id":"zai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-5.3-flash":{"id":"zai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5-turbo":{"id":"zai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5-turbo"},"zai/glm-4.5-air":{"id":"zai/glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-4.5v":{"id":"zai/glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"zai/glm-5.3-flashx":{"id":"zai/glm-5.3-flashx","name":"GLM-5.3-FlashX","description":"High-speed GLM-5.3-Flash serving option for coding and agent workflows","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5v-turbo":{"id":"zai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5v-turbo"},"zai/glm-4.7-flashx":{"id":"zai/glm-4.7-flashx","name":"GLM-4.7-FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.07,"output":0.4,"cache_read":0.01,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"},"zai/glm-4.7-flash":{"id":"zai/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"zai/glm-4.5-flash":{"id":"zai/glm-4.5-flash","name":"GLM-4.5-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-flash"},"groq/allam-2-7b":{"id":"groq/allam-2-7b","name":"ALLaM-2-7b","description":"ALLaM-2-7b instruction tuned model by SDAIA","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-01-23","last_updated":"2025-01-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"sdaia/allam-2-7b"},"groq/qwen/qwen3.8-27b":{"id":"groq/qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131042,"output":16384},"cost":{"input":0.8,"output":4,"cache_read":0.4},"canonical_model_id":"alibaba/qwen3.8-27b"},"groq/openai/gpt-oss-20b":{"id":"groq/openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-20b"},"groq/openai/gpt-oss-120b":{"id":"groq/openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-oss-120b"},"moonshot/kimi-k2.6":{"id":"moonshot/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot/kimi-k2.7-code":{"id":"moonshot/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshot/kimi-k2.7-code-highspeed":{"id":"moonshot/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"cerebras/qwen-3.8-27b":{"id":"cerebras/qwen-3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.99,"output":1.49},"canonical_model_id":"alibaba/qwen3.8-27b"},"cerebras/gpt-oss-120b":{"id":"cerebras/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"minimax/MiniMax-M2.7":{"id":"minimax/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"minimax/MiniMax-M3":{"id":"minimax/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"tiers":[{"input":0.6,"output":2.4,"cache_read":0.12,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.6,"output":2.4,"cache_read":0.12}},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/MiniMax-M2.7-highspeed":{"id":"minimax/MiniMax-M2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"xiaomi-mimo/mimo-v2.6-pro":{"id":"xiaomi-mimo/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi-mimo/mimo-v2.6-pro-ultraspeed":{"id":"xiaomi-mimo/mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"xiaomi-mimo/mimo-v2.6-flash":{"id":"xiaomi-mimo/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xai/grok-4.20-0309-non-reasoning":{"id":"xai/grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.20-0309-reasoning":{"id":"xai/grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"xai/grok-build-0.1":{"id":"xai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"}}},"anthropic":{"id":"anthropic","env":["ANTHROPIC_API_KEY"],"npm":"@ai-sdk/anthropic","name":"Anthropic","doc":"https://docs.anthropic.com/en/docs/about-claude/models","models":{"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-29","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5}},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":16,"output":80,"cache_read":0.4,"cache_write":20},"provider":{"body":{"speed":"fast"}}}}},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-07","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25}},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-04","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.4,"cache_write":10},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-14","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"evroc":{"id":"evroc","env":["EVROC_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://models.think.evroc.com/v1","name":"evroc","doc":"https://docs.evroc.com/products/think/overview.html","models":{"evroc/roc":{"id":"evroc/roc","name":"roc","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-06-06","last_updated":"2026-06-06","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":2.875,"output":11.516}},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.144,"output":0.575},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"intfloat/multilingual-e5-large-instruct":{"id":"intfloat/multilingual-e5-large-instruct","type":"embedding","name":"E5 Multi-Lingual Large Embeddings 0.6B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2024-06-01","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":512},"cost":{"input":0.114,"output":0.114}},"mistralai/Voxtral-Small-24B-2507":{"id":"mistralai/Voxtral-Small-24B-2507","type":"transcription","name":"Voxtral Small 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"release_date":"2025-03-01","last_updated":"2025-03-01","modalities":{"input":["audio","text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"provider":{"npm":"@ai-sdk/openai"}},"mistralai/Mistral-Medium-3.5-128B":{"id":"mistralai/Mistral-Medium-3.5-128B","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.725,"output":6.9},"canonical_model_id":"mistral/mistral-medium-2604"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.4375,"output":5.75},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/whisper-large-v3":{"id":"openai/whisper-large-v3","type":"transcription","name":"Whisper 3 Large","description":"Open Whisper checkpoint for robust multilingual transcription and captioning","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":4096},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.0023,"output":0.0023,"output_audio":2.3},"canonical_model_id":"openai/whisper-large-v3"},"openai/whisper-large-v3-turbo":{"id":"openai/whisper-large-v3-turbo","type":"transcription","name":"Whisper Large v3 Turbo","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2024-10-01","last_updated":"2024-10-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.0023,"output":0.0023,"output_audio":2.3},"canonical_model_id":"openai/whisper-large-v3-turbo"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.23,"output":0.92},"canonical_model_id":"openai/gpt-oss-120b"},"KBLab/kb-whisper-large":{"id":"KBLab/kb-whisper-large","type":"transcription","name":"KB Whisper","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"release_date":"2024-10-01","last_updated":"2024-10-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"provider":{"npm":"@ai-sdk/openai"}},"Qwen/Qwen3-Reranker-4B":{"id":"Qwen/Qwen3-Reranker-4B","type":"reranking","name":"Qwen3 Reranker 4B","description":"Reranking model for improving retrieval quality in search and recommendation systems","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"cost":{"input":0.0575,"output":0}},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8-27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.87,"output":3.5},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3-Embedding-8B":{"id":"Qwen/Qwen3-Embedding-8B","type":"embedding","name":"Qwen3 Embedding 8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":4096},"cost":{"input":0.115,"output":0.115},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.345,"output":1.38},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":131072},"cost":{"input":1.4375,"output":5.75},"canonical_model_id":"zhipuai/glm-5.2"},"nvidia/Llama-3.3-70B-Instruct-FP8":{"id":"nvidia/Llama-3.3-70B-Instruct-FP8","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":1.15,"output":1.15},"canonical_model_id":"meta/llama-3.3-70b-instruct"}}},"databricks":{"id":"databricks","env":["DATABRICKS_HOST","DATABRICKS_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://${DATABRICKS_HOST}/ai-gateway/mlflow/v1","name":"Databricks","doc":"https://docs.databricks.com/aws/en/machine-learning/foundation-models/","models":{"databricks-gemini-3-pro":{"id":"databricks-gemini-3-pro","name":"Gemini 3 Pro Preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3-pro-preview"},"databricks-gpt-oss-20b":{"id":"databricks-gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":25000},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"databricks-gpt-5-1":{"id":"databricks-gpt-5-1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"databricks-gpt-5-2":{"id":"databricks-gpt-5-2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":28,"cache_read":0.35},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"databricks-gpt-5":{"id":"databricks-gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"databricks-gpt-5-6-sol":{"id":"databricks-gpt-5-6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"databricks-gpt-5-5":{"id":"databricks-gpt-5-5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"databricks-gpt-5-4":{"id":"databricks-gpt-5-4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"databricks-gemini-3-1-pro":{"id":"databricks-gemini-3-1-pro","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"experimental":{"modes":{"fast":{"cost":{"input":3.6,"output":21.6,"cache_read":0.36,"input_audio":3.6},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":12,"cache_read":0.2,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"databricks-claude-haiku-4-5":{"id":"databricks-claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"databricks-gemini-3-5-flash":{"id":"databricks-gemini-3-5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"experimental":{"modes":{"fast":{"cost":{"input":2.7,"output":16.2,"cache_read":0.27,"input_audio":2.7},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"databricks-gpt-5-4-mini":{"id":"databricks-gpt-5-4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"databricks-gemini-3-1-flash-lite":{"id":"databricks-gemini-3-1-flash-lite","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"experimental":{"modes":{"fast":{"cost":{"input":0.45,"output":2.7,"cache_read":0.045,"input_audio":0.9},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"databricks-claude-opus-4-7":{"id":"databricks-claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"databricks-glm-5-2":{"id":"databricks-glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"experimental":{"modes":{"fast":{"cost":{"input":2.45,"output":7.7,"cache_read":0.455},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"databricks-claude-opus-4-1":{"id":"databricks-claude-opus-4-1","name":"Claude Opus 4.1 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"databricks-claude-sonnet-4":{"id":"databricks-claude-sonnet-4","name":"Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"databricks-claude-sonnet-4-6":{"id":"databricks-claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"databricks-gpt-5-nano":{"id":"databricks-gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"databricks-gpt-5-4-nano":{"id":"databricks-gpt-5-4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"databricks-gpt-5-mini":{"id":"databricks-gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.45,"output":3.6,"cache_read":0.045},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"databricks-gemini-3-flash":{"id":"databricks-gemini-3-flash","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"experimental":{"modes":{"fast":{"cost":{"input":0.9,"output":5.4,"cache_read":0.09,"input_audio":1.8},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"databricks-kimi-k2-7-code":{"id":"databricks-kimi-k2-7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"databricks-gemini-2-5-pro":{"id":"databricks-gemini-2-5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"databricks-claude-opus-4-5":{"id":"databricks-claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"databricks-gpt-5-6-luna":{"id":"databricks-gpt-5-6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"databricks-claude-opus-4-6":{"id":"databricks-claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"databricks-gpt-5-6-terra":{"id":"databricks-gpt-5-6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":24,"cache_read":0.4,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"databricks-claude-sonnet-4-5":{"id":"databricks-claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"databricks-gemini-2-5-flash":{"id":"databricks-gemini-2-5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"databricks-gpt-oss-120b":{"id":"databricks-gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":25000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"}}},"freemodel":{"id":"freemodel","env":["FREEMODEL_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://cc.freemodel.dev/v1","name":"FreeModel","doc":"https://freemodel.dev","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://api.freemodel.dev/v1"},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":5},"canonical_model_id":"openai/gpt-5.5"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://api.freemodel.dev/v1"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075,"cache_write":0.75},"canonical_model_id":"openai/gpt-5.4-mini"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://api.freemodel.dev/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175,"cache_write":1.75},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://api.freemodel.dev/v1"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.4"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"}}},"azure-cognitive-services":{"id":"azure-cognitive-services","env":["AZURE_COGNITIVE_SERVICES_RESOURCE_NAME","AZURE_COGNITIVE_SERVICES_API_KEY"],"npm":"@ai-sdk/azure","name":"Azure Cognitive Services","doc":"https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"Grok 4.1 Fast (Non-Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-06-27","last_updated":"2025-06-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"gpt-3.5-turbo-1106":{"id":"gpt-3.5-turbo-1106","name":"GPT-3.5 Turbo 1106","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":1,"output":2}},"text-embedding-ada-002":{"id":"text-embedding-ada-002","type":"embedding","name":"text-embedding-ada-002","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2022-12-15","last_updated":"2022-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.1,"output":0}},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"cohere-embed-v-4-0":{"id":"cohere-embed-v-4-0","type":"embedding","name":"Embed v4","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":1536},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.12,"output":0}},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"codex-mini":{"id":"codex-mini","name":"Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-05-16","last_updated":"2025-05-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.5,"output":6,"cache_read":0.375}},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"gpt-4-turbo-vision":{"id":"gpt-4-turbo-vision","name":"GPT-4 Turbo Vision","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":10,"output":30}},"gpt-3.5-turbo-instruct":{"id":"gpt-3.5-turbo-instruct","name":"GPT-3.5 Turbo Instruct","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2023-09-21","last_updated":"2023-09-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":4096},"status":"deprecated","cost":{"input":1.5,"output":2}},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-24","last_updated":"2025-08-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":28,"cache_read":0.35},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"o1":{"id":"o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":15,"output":60,"cache_read":7.5}},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-01-14","last_updated":"2026-01-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"model-router":{"id":"model-router","name":"Model Router","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"model-router","attachment":true,"reasoning":false,"tool_call":true,"release_date":"2025-05-19","last_updated":"2025-11-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":16384},"provider":{"npm":"@ai-sdk/azure","shape":"completions"},"cost":{"input":0.14,"output":0}},"phi-4-mini":{"id":"phi-4-mini","name":"Phi-4-mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"phi","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.075,"output":0.3}},"mistral-medium-2505":{"id":"mistral-medium-2505","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.4,"output":2}},"grok-4-20-reasoning":{"id":"grok-4-20-reasoning","name":"Grok 4.20 (Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-04-08","last_updated":"2026-04-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262000,"output":8192},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6}},"mistral-small-2503":{"id":"mistral-small-2503","name":"Mistral Small 3.1","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2025-03-01","last_updated":"2025-03-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"provider":{"shape":"completions"},"cost":{"input":0.1,"output":0.3}},"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","type":"image","name":"GPT Image 2.5 Flare","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-flare"},"text-embedding-3-large":{"id":"text-embedding-3-large","type":"embedding","name":"text-embedding-3-large","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":3072},"cost":{"input":0.13,"output":0}},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-chat-latest":{"id":"gpt-chat-latest","name":"GPT Chat Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-05-05","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"beta","cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5-instant"},"cohere-command-a":{"id":"cohere-command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"provider":{"shape":"completions"},"cost":{"input":2.5,"output":10}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"status":"beta","provider":{"shape":"completions"},"canonical_model_id":"xai/grok-4.7"},"llama-4-scout-17b-16e-instruct":{"id":"llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B 16E Instruct","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.78}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"gpt-image-2":{"id":"gpt-image-2","type":"image","name":"GPT-Image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2"},"phi-4-multimodal":{"id":"phi-4-multimodal","name":"Phi-4-multimodal","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"phi","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.08,"output":0.32,"input_audio":4}},"text-embedding-3-small":{"id":"text-embedding-3-small","type":"embedding","name":"text-embedding-3-small","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.02,"output":0}},"o3-mini":{"id":"o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek-V4.1-Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek-V4-Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":1.74,"output":3.48},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-5-pro":{"id":"gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"phi-4":{"id":"phi-4","name":"Phi-4","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"gpt-image-1.5":{"id":"gpt-image-1.5","type":"image","name":"GPT-Image-1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":32,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1.5"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"claude-mythos-5":{"id":"claude-mythos-5","name":"Claude Mythos 5","description":"Restricted Claude model for advanced cybersecurity and biology research workflows","family":"claude-mythos","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-mythos-5"},"phi-4-reasoning":{"id":"phi-4-reasoning","name":"Phi-4-reasoning","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"Grok 4.1 Fast (Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-06-27","last_updated":"2025-06-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05}},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025}},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025}},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek-V4-Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.19,"output":0.51},"canonical_model_id":"deepseek/deepseek-v4-flash"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"provider":{"shape":"completions"},"cost":{"input":0.71,"output":0.71}},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"grok-4-20-non-reasoning":{"id":"grok-4-20-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-04-08","last_updated":"2026-04-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262000,"output":8192},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"ministral-3b":{"id":"ministral-3b","name":"Ministral 3B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-03","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.04,"output":0.04}},"cohere-embed-v3-english":{"id":"cohere-embed-v3-english","type":"embedding","name":"Embed v3 English","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-07","last_updated":"2023-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":1024},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.1,"output":0}},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"phi-4-reasoning-plus":{"id":"phi-4-reasoning-plus","name":"Phi-4-reasoning-plus","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","type":"image","name":"GPT Image 2.5 Sunburst","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-sunburst"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-07-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}}},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":10,"output":30},"canonical_model_id":"openai/gpt-4-turbo"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"phi-4-mini-reasoning":{"id":"phi-4-mini-reasoning","name":"Phi-4-mini-reasoning","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.075,"output":0.3}},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-31","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5-codex":{"id":"gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.58,"output":1.68}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":24,"cache_read":0.4,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"cohere-embed-v3-multilingual":{"id":"cohere-embed-v3-multilingual","type":"embedding","name":"Embed v3 Multilingual","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-07","last_updated":"2023-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":1024},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.1,"output":0}},"gpt-3.5-turbo-0125":{"id":"gpt-3.5-turbo-0125","name":"GPT-3.5 Turbo 0125","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":0.5,"output":1.5}},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75}},"codestral-2501":{"id":"codestral-2501","name":"Codestral 25.01","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-03","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"provider":{"shape":"completions"},"cost":{"input":0.3,"output":0.9}},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"gpt-image-1":{"id":"gpt-image-1","type":"image","name":"GPT-Image-1","description":"OpenAI image model for production generation, edits, and brand-safe visual workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-24","last_updated":"2025-04-24","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":40,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1"},"deepseek-v3.2-speciale":{"id":"deepseek-v3.2-speciale","name":"DeepSeek-V3.2-Speciale","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.58,"output":1.68}},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"llama-4-maverick-17b-128e-instruct-fp8":{"id":"llama-4-maverick-17b-128e-instruct-fp8","name":"Llama 4 Maverick 17B 128E Instruct FP8","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":16384},"provider":{"shape":"completions"},"cost":{"input":0.25,"output":1}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25}}}},"baseten":{"id":"baseten","env":["BASETEN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.baseten.co/v1","name":"Baseten","doc":"https://docs.baseten.co/inference/model-apis/overview","models":{"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast","name":"DeepSeek V4.1 Flash 1017 Fast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.6,"output":2.4,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4.1-Flash-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-Fast","name":"DeepSeek V4.1 Flash Fast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.6,"output":2.4,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.3,"output":1.2,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.32,"output":3.96,"cache_read":0.132},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K3.1-Pro":{"id":"moonshotai/Kimi-K3.1-Pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"OpenAI GPT 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128072,"output":128072},"cost":{"input":0.1,"output":0.5,"cache_read":0.1},"canonical_model_id":"openai/gpt-oss-120b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.2-Fast":{"id":"zai-org/GLM-5.2-Fast","name":"GLM 5.2 Fast","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":2.1,"output":6.6,"cache_read":0.21},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-5.3-Fast":{"id":"zai-org/GLM-5.3-Fast","name":"GLM 5.3 Fast","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":2.1,"output":6.6,"cache_read":0.21},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B","name":"Nemotron 3 Ultra","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":202800},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"}}},"opencode":{"id":"opencode","env":["OPENCODE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://opencode.ai/inference/openai/v1","name":"OpenCode","doc":"https://opencode.ai/v2/docs/console/models/","models":{"trinity-large-preview-free":{"id":"trinity-large-preview-free","name":"Trinity Large Preview","description":"Legacy model retained for compatibility with older integrations","family":"trinity","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-01-27","last_updated":"2026-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0},"canonical_model_id":"arcee-ai/trinity-large-preview"},"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.6-plus"},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"deepseek-v4-flash-free":{"id":"deepseek-v4-flash-free","name":"DeepSeek V4 Flash Free","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"mimo-v2.5-free":{"id":"mimo-v2.5-free","name":"MiMo V2.5 Free","description":"MiMo omni model for text, image, video, audio, and agents","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"glm-5.3-flash-free":{"id":"glm-5.3-flash-free","name":"GLM-5.3-Flash Free","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"mimo-v2-omni-free":{"id":"mimo-v2-omni-free","name":"MiMo V2 Omni Free","description":"Legacy model retained for compatibility with older integrations","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":64000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2-omni"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-carbon"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"fledge-alpha-free":{"id":"fledge-alpha-free","name":"Fledge Alpha Free","description":"Free-tier preview reasoning model with text and image input and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0}},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"pulse-alpha-free":{"id":"pulse-alpha-free","name":"Pulse Alpha Free","description":"Stealth reasoning model with text and image input and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"ling-3.0-tiny-free":{"id":"ling-3.0-tiny-free","name":"Ling-3.0-tiny Free","description":"Compact MoE model for responsive agents, instruction following, and multi-turn conversations","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0}},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"muse-spark-1.3-contributor-free":{"id":"muse-spark-1.3-contributor-free","name":"Muse Spark 1.3 Free","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for coding and agentic workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meta/muse-spark-1.3"},"nemotron-3.5-super-vl-free":{"id":"nemotron-3.5-super-vl-free","name":"Nemotron 3.5 Super VL Free","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"minimax-m2.1":{"id":"minimax-m2.1","name":"MiniMax-M2.1","description":"Legacy model retained for compatibility with older integrations","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.1},"canonical_model_id":"minimax/MiniMax-M2.1"},"ling-3.1-flash-free":{"id":"ling-3.1-flash-free","name":"Ling 3.1 Flash Free","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"inclusionai/ling-3.1-flash"},"muse-spark-1.2-contributor-free":{"id":"muse-spark-1.2-contributor-free","name":"Muse Spark 1.2 Free","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meta/muse-spark-1.2"},"ling-2.6-flash-free":{"id":"ling-2.6-flash-free","name":"Ling 2.6 Flash Free","description":"Legacy model retained for compatibility with older integrations","family":"ling-flash-free","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262100,"output":32800},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0}},"deepseek-v4.1-flash-free":{"id":"deepseek-v4.1-flash-free","name":"DeepSeek V4.1 Flash Free","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.07,"output":8.5,"cache_read":0.107},"canonical_model_id":"openai/gpt-5"},"ling-3.0-flash-fin-free":{"id":"ling-3.0-flash-fin-free","name":"Ling 3.0 Flash Fin Free","description":"Finance-enhanced model for financial research, multi-step investment workflows, and long-horizon planning and execution","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-09-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"inclusionai/ling-3.0-flash-fin"},"longcat-2.0-free":{"id":"longcat-2.0-free","name":"LongCat-2.0 Free","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meituan/longcat-2.0"},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"qwen3-coder":{"id":"qwen3-coder","name":"Qwen3 Coder","description":"Legacy model retained for compatibility with older integrations","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.45,"output":1.8},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"nemotron-3-super-free":{"id":"nemotron-3-super-free","name":"Nemotron 3 Super Free","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.07,"output":8.5,"cache_read":0.107},"canonical_model_id":"openai/gpt-5.1-codex"},"cat-jam-free":{"id":"cat-jam-free","name":"Cat Jam Free","description":"A text-only reasoning model for coding and agentic workflows, with tool calling and structured JSON outputs.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"exo-free":{"id":"exo-free","name":"Exo Free","description":"Free-tier preview reasoning model with text and image input and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0}},"ll-alpha-free":{"id":"ll-alpha-free","name":"LL Alpha Free","description":"Best in class local model","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"nemotron-3.5-lightning-free":{"id":"nemotron-3.5-lightning-free","name":"Nemotron 3.5 Lightning Free","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"minimax-m3-free":{"id":"minimax-m3-free","name":"MiniMax-M3 Free","description":"Legacy model retained for compatibility with older integrations","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M3"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"glm-4.7-free":{"id":"glm-4.7-free","name":"GLM-4.7 Free","description":"Legacy model retained for compatibility with older integrations","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-4.7"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"x-preview-f-free":{"id":"x-preview-f-free","name":"Ox Alpha Free (Unlimited)","description":"Stealth reasoning model for coding, agentic tasks, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-08-21","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"beam-free":{"id":"beam-free","name":"Beam Free","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"grok-code":{"id":"grok-code","name":"Grok Code Fast 1","description":"Legacy model retained for compatibility with older integrations","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"xai/grok-code-fast-1"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.5"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"north-mini-code-free":{"id":"north-mini-code-free","name":"North Mini Code Free","description":"Cohere coding model for practical software engineering and agentic edits","family":"north","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-09-23","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0},"canonical_model_id":"cohere/north-mini-code-1-0"},"gpt-5.3-codex-spark":{"id":"gpt-5.3-codex-spark","name":"GPT-5.3 Codex Spark","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex-spark","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex-spark"},"claude-3-5-haiku":{"id":"claude-3-5-haiku","name":"Claude Haiku 3.5","description":"Legacy model retained for compatibility with older integrations","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0.8,"output":4,"cache_read":0.08,"cache_write":1},"canonical_model_id":"anthropic/claude-3-5-haiku-20241022"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro"},"hy3-preview-free":{"id":"hy3-preview-free","name":"Hy3 preview Free","description":"Legacy model retained for compatibility with older integrations","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"tencent/hy3-preview"},"deepseek-v4-flash-vision-exp":{"id":"deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Legacy model retained for compatibility with older integrations","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.6,"output":2.2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-4.7"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"mimo-v2-flash-free":{"id":"mimo-v2-flash-free","name":"MiMo V2 Flash Free","description":"Legacy model retained for compatibility with older integrations","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12-01","release_date":"2025-12-16","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2-flash"},"inkling-2-small-free":{"id":"inkling-2-small-free","name":"Inkling 2 Small Free","description":"Inkling 2 Small, free for a limited time","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"thinkingmachines/inkling-2-small"},"hy3-free":{"id":"hy3-free","name":"Hy3 Free","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":190000,"input":192000,"output":64000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"tencent/hy3"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"muse-wonder-1.0":{"id":"muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gemini-3-pro":{"id":"gemini-3-pro","name":"Gemini 3 Pro","description":"Legacy model retained for compatibility with older integrations","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3-pro-preview"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":128000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"claude-sonnet-4":{"id":"claude-sonnet-4","name":"Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-0"},"glm-5-free":{"id":"glm-5-free","name":"GLM-5 Free","description":"Legacy model retained for compatibility with older integrations","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5"},"kimi-k2":{"id":"kimi-k2","name":"Kimi K2","description":"Legacy model retained for compatibility with older integrations","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.4,"output":2.5,"cache_read":0.4},"canonical_model_id":"moonshotai/kimi-k2-0905"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.07,"output":8.5,"cache_read":0.107},"canonical_model_id":"openai/gpt-5.1"},"longcat-2.5-free":{"id":"longcat-2.5-free","name":"LongCat 2.5 Free","description":"Meituan's multimodal reasoning model for long-horizon coding and agent tasks, with visual understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meituan/longcat-2.5"},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"minimax-m2.1-free":{"id":"minimax-m2.1-free","name":"MiniMax-M2.1 Free","description":"Legacy model retained for compatibility with older integrations","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M2.1"},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":30,"output":180,"cache_read":30},"canonical_model_id":"openai/gpt-5.5-pro"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"minimax-m2.5-free":{"id":"minimax-m2.5-free","name":"MiniMax-M2.5 Free","description":"Legacy model retained for compatibility with older integrations","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M2.5"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"kimi-k2-thinking":{"id":"kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Legacy model retained for compatibility with older integrations","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.4,"output":2.5,"cache_read":0.4},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"flint-40b-free":{"id":"flint-40b-free","name":"Flint 40B Free","description":"Open-weight mixture-of-experts model with about 2.5B active parameters for local coding agents","family":"flint","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06","release_date":"2026-10-21","last_updated":"2026-10-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"recursive/flint"},"iceman-free":{"id":"iceman-free","name":"Iceman Free","description":"Stealth model, free for a limited time","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"mimo-v2.6-flash-free":{"id":"mimo-v2.6-flash-free","name":"MiMo-V2.6-Flash Free","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":30,"output":180,"cache_read":30},"canonical_model_id":"openai/gpt-5.4-pro"},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"space-bunny-free":{"id":"space-bunny-free","name":"Space Bunny Free","description":"Anonymous preview reasoning model for coding, agentic tasks, tool use, and multimodal input","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":524288,"output":524288},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"glm-4.6":{"id":"glm-4.6","name":"GLM-4.6","description":"Legacy model retained for compatibility with older integrations","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.6,"output":2.2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-4.6"},"mimo-v2-pro-free":{"id":"mimo-v2-pro-free","name":"MiMo V2 Pro Free","description":"Legacy model retained for compatibility with older integrations","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":64000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2-pro"},"step-5-preview-free":{"id":"step-5-preview-free","name":"Step 5 Preview Free","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"stepfun/step-5-preview"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-3-flash":{"id":"gemini-3-flash","name":"Gemini 3 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"qwen3.6-plus-free":{"id":"qwen3.6-plus-free","name":"Qwen3.6 Plus Free","description":"Legacy model retained for compatibility with older integrations","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"alibaba/qwen3.5-plus"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"big-pickle":{"id":"big-pickle","name":"Big Pickle","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"big-pickle","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-10-17","last_updated":"2025-10-17","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":160000,"output":32000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"ring-2.6-1t-free":{"id":"ring-2.6-1t-free","name":"Ring 2.6 1T Free","description":"Legacy model retained for compatibility with older integrations","family":"ring-1t-free","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-06","release_date":"2026-05-08","last_updated":"2026-05-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":66000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0}},"crouton-alpha-free":{"id":"crouton-alpha-free","name":"Crouton Alpha Free","description":"Stealth reasoning model with text, image, video and PDF input and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-03","last_updated":"2026-11-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":270000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"kimi-k2.5-free":{"id":"kimi-k2.5-free","name":"Kimi K2.5 Free","description":"Legacy model retained for compatibility with older integrations","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5-codex":{"id":"gpt-5-codex","name":"GPT-5 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.07,"output":8.5,"cache_read":0.107},"canonical_model_id":"openai/gpt-5-codex"},"muse-ember-1.0":{"id":"muse-ember-1.0","name":"Muse Ember 1.0","description":"Reasoning model from Meta with text, image, video and PDF input and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":270000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.004,"cache_write":0,"tiers":[{"input":0.3,"output":1.5,"cache_read":0.012,"cache_write":0,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.3,"output":1.5,"cache_read":0.012,"cache_write":0}},"canonical_model_id":"meta/muse-ember-1.0"},"grok-build-0.1":{"id":"grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"minimax-m3.1-flash-free":{"id":"minimax-m3.1-flash-free","name":"MiniMax M3.1 Flash Free","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"nemotron-3-ultra-free":{"id":"nemotron-3-ultra-free","name":"Nemotron 3 Ultra Free","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"provider":{"npm":"@ai-sdk/mistral","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"longcat-2.5-preview-free":{"id":"longcat-2.5-preview-free","name":"LongCat 2.5 Preview Free","description":"Meituan's multimodal reasoning model for coding and agent tasks, with image understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meituan/longcat-2.5-preview"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"ling-3.0-flash-free":{"id":"ling-3.0-flash-free","name":"Ling-3.0-flash Free","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"inclusionai/ling-3.0-flash"},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"laguna-s-2.1-free":{"id":"laguna-s-2.1-free","name":"Laguna S 2.1 Free","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"poolside/laguna-s-2.1"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"glm-5":{"id":"glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"api":"https://opencode.ai/inference/openai/v1"},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"gemini-3.1-pro":{"id":"gemini-3.1-pro","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/google/v1beta"},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"minimax-cn":{"id":"minimax-cn","env":["MINIMAX_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://api.minimax.cn/anthropic/v1","name":"MiniMax (minimax.cn)","doc":"https://platform.minimaxi.com/docs/guides/quickstart","models":{"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3137,"output":1.2549,"cache_read":0.0314,"cache_write":0.3922}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3137,"output":1.2549,"cache_read":0.0314,"cache_write":0.3922}},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3137,"output":1.2549,"cache_read":0.0627,"cache_write":0.3922}},"MiniMax-M2.5-highspeed":{"id":"MiniMax-M2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.6275,"output":2.5098,"cache_read":0.0314,"cache_write":0.3922}},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.3137,"output":1.2549,"cache_read":0.0627,"tiers":[{"input":0.6275,"output":2.5098,"cache_read":0.1255,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.6275,"output":2.5098,"cache_read":0.1255}}},"MiniMax-M2.7-highspeed":{"id":"MiniMax-M2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.6275,"output":2.5098,"cache_read":0.0627,"cache_write":0.3922}},"MiniMax-M3.1-Flash":{"id":"MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.1494,"output":0.5976,"cache_read":0.0149},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"MiniMax-M2":{"id":"MiniMax-M2","name":"MiniMax-M2","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3137,"output":1.2549,"cache_read":0.0314,"cache_write":0.3922}}}},"empiriolabs":{"id":"empiriolabs","env":["EMPIRIOLABS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.empiriolabs.ai/v1","name":"EmpirioLabs AI","doc":"https://docs.empiriolabs.ai","models":{"seed-2-0-code":{"id":"seed-2-0-code","name":"Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":229096,"output":128000},"cost":{"input":0.4,"output":2.4,"cache_read":0.4,"tiers":[{"input":0.8,"output":4.8,"cache_read":0.8,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"gemma-4-26b-a4b":{"id":"gemma-4-26b-a4b","name":"Gemma 4 26B-A4B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.05,"output":0.29,"cache_read":0.025},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"mimo-v2-6-pro-ultraspeed":{"id":"mimo-v2-6-pro-ultraspeed","name":"MiMo V2.6 Pro UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":4.35},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"seed-2-0-lite":{"id":"seed-2-0-lite","name":"Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":229096,"output":128000},"cost":{"input":0.31,"output":2.5,"cache_read":0.31,"tiers":[{"input":0.62,"output":5,"cache_read":0.62,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"qwen3-6-plus":{"id":"qwen3-6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.5,"tiers":[{"input":2,"output":6,"cache_read":2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":2}},"canonical_model_id":"alibaba/qwen3.6-plus"},"seed-2-0-pro":{"id":"seed-2-0-pro","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":229096,"output":128000},"cost":{"input":0.63,"output":3.79,"cache_read":0.63,"tiers":[{"input":1.26,"output":7.58,"cache_read":1.26,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"qwen3-6-flash":{"id":"qwen3-6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":64000}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.25,"tiers":[{"input":1,"output":4,"cache_read":1,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1,"output":4,"cache_read":1}},"canonical_model_id":"alibaba/qwen3.6-flash"},"glm-5-3-flash":{"id":"glm-5-3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.075,"output":0.25,"cache_read":0.075},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-4-5-flash":{"id":"glm-4-5-flash","name":"GLM 4.5 Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.5-flash"},"fugu-max":{"id":"fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"qwen3-5-27b":{"id":"qwen3-5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":258048,"output":64000},"cost":{"input":0.086,"output":0.688,"cache_read":0.086,"tiers":[{"input":0.258,"output":2.064,"cache_read":0.258,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-27b"},"glm-5-2":{"id":"glm-5-2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":1.4},"canonical_model_id":"zhipuai/glm-5.2"},"seed-2-0-mini":{"id":"seed-2-0-mini","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":229156,"output":128000},"cost":{"input":0.12,"output":0.5,"cache_read":0.12,"tiers":[{"input":0.24,"output":1,"cache_read":0.24,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":131072},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"qwen3-6-27b":{"id":"qwen3-6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":229376,"output":64000},"cost":{"input":0.412564,"output":2.475384,"cache_read":0.412564},"canonical_model_id":"alibaba/qwen3.6-27b"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":3},"canonical_model_id":"moonshotai/kimi-k3"},"step-3-5-flash-2603":{"id":"step-3-5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":256000,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"kimi-k3-1-pro":{"id":"kimi-k3-1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.184},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"minimax-m3-1-flash":{"id":"minimax-m3-1-flash","name":"MiniMax M3.1 Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.1125,"output":0.45,"cache_read":0.01125},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"qwen3-5-4b":{"id":"qwen3-5-4b","name":"Qwen3.5 4B","description":"Qwen3.5 4B is a low-cost multimodal reasoning model with 256K context, image and video input, function tools, and structured output.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1024,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.04,"output":0.07,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.5-4b"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":393216}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":1.32,"output":3.96,"cache_read":1.32},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3-5-9b":{"id":"qwen3-5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1024,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.09,"output":0.13,"cache_read":0.045},"canonical_model_id":"alibaba/qwen3.5-9b"},"mimo-v2-6-pro":{"id":"mimo-v2-6-pro","name":"MiMo V2.6 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.435},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"qwen3-8-omni-flash":{"id":"qwen3-8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1006592,"output":131072},"cost":{"input":0.3,"output":0.94,"cache_read":0.3},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"kimi-k2-7-code":{"id":"kimi-k2-7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.95,"output":4,"cache_read":0.95},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"qwen3-7-plus":{"id":"qwen3-7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.4,"output":1.6,"cache_read":0.4,"tiers":[{"input":1.2,"output":4.8,"cache_read":1.2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":1.2}},"canonical_model_id":"alibaba/qwen3.7-plus"},"step-3-5-flash":{"id":"step-3-5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":256000,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash"},"muse-spark-1-3":{"id":"muse-spark-1-3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":1},"canonical_model_id":"meta/muse-spark-1.3"},"mimo-v2-6-flash":{"id":"mimo-v2-6-flash","name":"MiMo V2.6 Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.14},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"mistral-small-4":{"id":"mistral-small-4","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.15},"canonical_model_id":"mistral/mistral-small-2603"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":393216}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":1.65,"output":3.3,"cache_read":1.65},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gemma-3-27b":{"id":"gemma-3-27b","name":"Gemma 3 27B","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-3-27b-it"},"qwen3-5-397b-a17b":{"id":"qwen3-5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":258048,"output":64000},"status":"deprecated","cost":{"input":0.172,"output":1.032,"cache_read":0.172,"tiers":[{"input":0.43,"output":2.58,"cache_read":0.43,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"minimax-m2-7":{"id":"minimax-m2-7","name":"MiniMax M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.7"},"fugu-ultra-v1-0":{"id":"fugu-ultra-v1-0","name":"Fugu Ultra v1.0","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":7.5,"output":45,"cache_read":1.5,"tiers":[{"input":15,"output":67.5,"cache_read":3,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":15,"output":67.5,"cache_read":3}},"canonical_model_id":"sakana/fugu-ultra"},"glm-4-6v-flash":{"id":"glm-4-6v-flash","name":"GLM 4.6V Flash","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"qwen3-8-27b":{"id":"qwen3-8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.17,"output":0.5,"cache_read":0.08},"canonical_model_id":"alibaba/qwen3.8-27b"},"glm-4-7-flash":{"id":"glm-4-7-flash","name":"GLM 4.7 Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"fugu-ultra-v2-0":{"id":"fugu-ultra-v2-0","name":"Fugu Ultra v2.0","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra-v2"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.225,"output":0.9,"cache_read":0.045,"tiers":[{"input":0.45,"output":1.8,"cache_read":0.09,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.45,"output":1.8,"cache_read":0.09}},"canonical_model_id":"minimax/MiniMax-M3"},"muse-spark-1-1":{"id":"muse-spark-1-1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":1},"canonical_model_id":"meta/muse-spark-1.1"},"kimi-k2-6":{"id":"kimi-k2-6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16000},"cost":{"input":0.8939,"output":3.7131,"cache_read":0.1788},"canonical_model_id":"moonshotai/kimi-k2.6"},"step-3-7-flash":{"id":"step-3-7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":256000,"output":131072},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"glm-5-3":{"id":"glm-5-3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":1.4},"canonical_model_id":"zhipuai/glm-5.3"},"fugu-ultra-v1-1":{"id":"fugu-ultra-v1-1","name":"Fugu Ultra v1.1","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"glm-5-1":{"id":"glm-5-1","name":"GLM 5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":38912}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202745,"output":128000},"cost":{"input":0.825,"output":3.301,"cache_read":0.165,"tiers":[{"input":1.1,"output":3.851,"cache_read":0.22,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5.1"},"qwen3-7-max":{"id":"qwen3-7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":2.5,"output":7.5,"cache_read":2.5},"canonical_model_id":"alibaba/qwen3.7-max"},"minimax-m2-7-highspeed":{"id":"minimax-m2-7-highspeed","name":"MiniMax M2.7 Highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"qwen3-8-max-0902":{"id":"qwen3-8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":2,"output":6,"cache_read":2},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen3-6-35b-a3b":{"id":"qwen3-6-35b-a3b","name":"Qwen3.6 35B A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.07,"output":0.42,"cache_read":0.035},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"muse-spark-1-2":{"id":"muse-spark-1-2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":1},"canonical_model_id":"meta/muse-spark-1.2"},"qwen3-5-122b-a10b":{"id":"qwen3-5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":258048,"output":64000},"cost":{"input":0.115,"output":0.917,"cache_read":0.115,"tiers":[{"input":0.287,"output":2.294,"cache_read":0.287,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"qwen3-8-max":{"id":"qwen3-8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":2,"output":6,"cache_read":2},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen3-7-flash":{"id":"qwen3-7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":991808,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"muse-glimmer-30b":{"id":"muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.2,"output":0.8,"cache_read":0.05},"canonical_model_id":"meta/muse-glimmer-30b"},"deepseek-v4-1-flash-1017":{"id":"deepseek-v4-1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":393216}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.2,"output":0.8,"cache_read":0.02},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"qwen3-5-flash":{"id":"qwen3-5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":995904,"output":32768},"cost":{"input":0.09,"output":0.368,"cache_read":0.09},"canonical_model_id":"alibaba/qwen3.5-flash"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":393216}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.424,"output":1.272,"cache_read":0.424},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"glm-4-7-flashx":{"id":"glm-4-7-flashx","name":"GLM 4.7 FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.07,"output":0.4,"cache_read":0.063},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"qwen3-5-plus":{"id":"qwen3-5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"status":"deprecated","cost":{"input":0.36,"output":2.21,"cache_read":0.36,"tiers":[{"input":0.45,"output":2.76,"cache_read":0.45,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.45,"output":2.76,"cache_read":0.45}},"canonical_model_id":"alibaba/qwen3.5-plus"},"kimi-k2-7-code-highspeed":{"id":"kimi-k2-7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":1.9,"output":8,"cache_read":1.9},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"qwen3-8-flash":{"id":"qwen3-8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":0.16,"output":0.47,"cache_read":0.16},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen3-5-35b-a3b":{"id":"qwen3-5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":258048,"output":64000},"cost":{"input":0.057,"output":0.459,"cache_read":0.057,"tiers":[{"input":0.229,"output":1.835,"cache_read":0.229,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"seed-2-1-turbo":{"id":"seed-2-1-turbo","name":"Seed 2.1 Turbo","description":"Faster ByteDance Seed 2.1 model for multimodal reasoning and latency-sensitive agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":229093,"output":65536},"cost":{"input":0.63,"output":3.13,"cache_read":0.63},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"}}},"tinfoil":{"id":"tinfoil","env":["TINFOIL_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.tinfoil.sh/v1","name":"Tinfoil","doc":"https://docs.tinfoil.sh","models":{"gpt-oss-safeguard-120b":{"id":"gpt-oss-safeguard-120b","name":"gpt-oss-safeguard-120b","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"nomic-embed-text":{"id":"nomic-embed-text","name":"Nomic Embed Text v1.5","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2024-02","last_updated":"2024-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":768},"cost":{"input":0.016,"output":0}},"llama3-3-70b":{"id":"llama3-3-70b","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":1.75,"output":2.75},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.6},"canonical_model_id":"moonshotai/kimi-k3"},"kimi-k3-1-pro":{"id":"kimi-k3-1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.4},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"deepseek-v4-1-flash":{"id":"deepseek-v4-1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"beta","cost":{"input":0.6,"output":1.45,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5-3":{"id":"glm-5-3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.8,"output":5.75,"cache_read":0.45},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"gpt-oss-120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"gemma4-31b":{"id":"gemma4-31b","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.4,"output":1},"canonical_model_id":"google/gemma-4-31b-it"}}},"tencent-tokenhub":{"id":"tencent-tokenhub","env":["TENCENT_TOKENHUB_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://tokenhub.tencentmaas.com/v1","name":"Tencent TokenHub","doc":"https://cloud.tencent.com/document/product/1823/130050","models":{"hy4":{"id":"hy4","name":"Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"tencent/hy3"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"hy3-preview":{"id":"hy3-preview","name":"Hy3 preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"tencent/hy3-preview"}}},"xiaomi-token-plan-sgp":{"id":"xiaomi-token-plan-sgp","env":["XIAOMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token-plan-sgp.xiaomimimo.com/v1","name":"Xiaomi Token Plan (Singapore)","doc":"https://platform.xiaomimimo.com/#/docs","models":{"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"mimo-v2.5-tts":{"id":"mimo-v2.5-tts","type":"speech","name":"MiMo-V2.5-TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts"},"mimo-v2.5-tts-voicedesign":{"id":"mimo-v2.5-tts-voicedesign","type":"speech","name":"MiMo-V2.5-TTS-VoiceDesign","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voicedesign"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"mimo-v2.5-tts-voiceclone":{"id":"mimo-v2.5-tts-voiceclone","type":"speech","name":"MiMo-V2.5-TTS-VoiceClone","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voiceclone"}}},"cline-pass":{"id":"cline-pass","env":["CLINE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.cline.bot/api/v1","name":"ClinePass","doc":"https://docs.cline.bot/getting-started/clinepass","models":{"cline-pass/glm-5.2":{"id":"cline-pass/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"cline-pass/kimi-k2.6":{"id":"cline-pass/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"cline-pass/kimi-k3":{"id":"cline-pass/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"cline-pass/mimo-v2.6-pro":{"id":"cline-pass/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"cline-pass/deepseek-v4.1-flash":{"id":"cline-pass/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"cline-pass/deepseek-v4-pro":{"id":"cline-pass/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"cline-pass/glm-5.3":{"id":"cline-pass/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"cline-pass/mimo-v2.6-flash":{"id":"cline-pass/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"cline-pass/qwen3.7-plus":{"id":"cline-pass/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.04,"cache_write":0.5,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.12,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.12,"cache_write":1.5}},"canonical_model_id":"alibaba/qwen3.7-plus"},"cline-pass/minimax-m3":{"id":"cline-pass/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"cline-pass/qwen3.7-max":{"id":"cline-pass/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"cline-pass/kimi-k2.7-code":{"id":"cline-pass/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"cline-pass/deepseek-v4-flash":{"id":"cline-pass/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"cline-pass/glm-5.3-flash":{"id":"cline-pass/glm-5.3-flash","name":"cline-pass/glm-5.3-flash","description":"Latest natively multimodal model in the GLM-5 series","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"cline-pass/mimo-v2.5":{"id":"cline-pass/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"cline-pass/mimo-v2.5-pro":{"id":"cline-pass/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.74,"output":3.48,"cache_read":0.0145},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"cline-pass/qwen3.8-max":{"id":"cline-pass/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"cline-pass/muse-spark-1.3-contributor":{"id":"cline-pass/muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.3"}}},"llmgateway-providers":{"id":"llmgateway-providers","env":["LLMGATEWAY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.llmgateway.io/v1","name":"LLM Gateway","doc":"https://llmgateway.io/docs","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5 (Anthropic)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1 (Anthropic)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5 (Anthropic)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5-2":{"id":"anthropic/claude-fable-5-2","name":"Claude Fable 5.2 (Anthropic)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-sonnet-4-5-20250929":{"id":"anthropic/claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5 (2025-09-29) (Anthropic)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5 (Anthropic)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-haiku-4-5-20251001":{"id":"anthropic/claude-haiku-4-5-20251001","name":"Claude Haiku 4.5 (2025-10-01) (Anthropic)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5 (Anthropic)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-5-20251101":{"id":"anthropic/claude-opus-4-5-20251101","name":"Claude Opus 4.5 (Anthropic)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6 (Anthropic)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8 (Anthropic)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5 (Anthropic)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (Anthropic)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5 (Anthropic)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6 (Anthropic)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7 (Anthropic)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (Anthropic)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"baidu/glm-5.2":{"id":"baidu/glm-5.2","name":"GLM-5.2 (Baidu)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"baidu/kimi-k3":{"id":"baidu/kimi-k3","name":"Kimi K3 (Baidu)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"baidu/glm-5.1":{"id":"baidu/glm-5.1","name":"GLM-5.1 (Baidu)","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"baidu/deepseek-v4.1-flash":{"id":"baidu/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Baidu)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"baidu/deepseek-v4-pro":{"id":"baidu/deepseek-v4-pro","name":"DeepSeek V4 Pro (Baidu)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.32,"output":3.96,"cache_read":0.042},"canonical_model_id":"deepseek/deepseek-v4-pro"},"baidu/glm-5.3":{"id":"baidu/glm-5.3","name":"GLM-5.3 (Baidu)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"baidu/deepseek-v4-flash":{"id":"baidu/deepseek-v4-flash","name":"DeepSeek V4 Flash (Baidu)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"baidu/glm-5.3-flash":{"id":"baidu/glm-5.3-flash","name":"GLM-5.3 Flash (Baidu)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"baidu/deepseek-v4-flash-0731":{"id":"baidu/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Baidu)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"baidu/deepseek-v4.1-flash-1017":{"id":"baidu/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Baidu)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.28,"output":1.13,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"aws-mantle/gpt-5.6-sol":{"id":"aws-mantle/gpt-5.6-sol","name":"GPT-5.6 Sol (AWS Mantle)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":921600,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.44,"cache_write":5.5},"canonical_model_id":"openai/gpt-5.6-sol"},"aws-mantle/gpt-6-astra":{"id":"aws-mantle/gpt-6-astra","name":"GPT-6 Astra (AWS Mantle)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"aws-mantle/gpt-5.6-luna":{"id":"aws-mantle/gpt-5.6-luna","name":"GPT-5.6 Luna (AWS Mantle)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":921600,"output":128000},"cost":{"input":0.22,"output":1.32,"cache_read":0.022,"cache_write":0.275},"canonical_model_id":"openai/gpt-5.6-luna"},"aws-mantle/gpt-5.6-terra":{"id":"aws-mantle/gpt-5.6-terra","name":"GPT-5.6 Terra (AWS Mantle)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":921600,"output":128000},"cost":{"input":2.2,"output":13.2,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"openai/gpt-5.6-terra"},"scx-ai-gp/glm-5.2-fast":{"id":"scx-ai-gp/glm-5.2-fast","name":"GLM-5.2 Turbo (SCX.ai)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2.156,"output":6.776,"cache_read":0.429},"canonical_model_id":"zhipuai/glm-5.2"},"scx-ai-gp/glm-5.2":{"id":"scx-ai-gp/glm-5.2","name":"GLM-5.2 (SCX.ai)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.605,"output":2.123,"cache_read":0.154},"canonical_model_id":"zhipuai/glm-5.2"},"scx-ai-gp/kimi-k3.1-pro":{"id":"scx-ai-gp/kimi-k3.1-pro","name":"Kimi K3.1 Pro (scx-ai-gp)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.9,"output":9.5,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"scx-ai-gp/kimi-k3":{"id":"scx-ai-gp/kimi-k3","name":"Kimi K3 (SCX.ai)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3.135,"output":15.675,"cache_read":0.319},"canonical_model_id":"moonshotai/kimi-k3"},"scx-ai-gp/deepseek-v4.1-flash":{"id":"scx-ai-gp/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (SCX.ai)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"scx-ai-gp/glm-5.3-fast":{"id":"scx-ai-gp/glm-5.3-fast","name":"GLM 5.3 Fast (SCX.ai)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":2.8,"output":8.8,"cache_read":0.56},"canonical_model_id":"zhipuai/glm-5.3"},"scx-ai-gp/glm-5.3":{"id":"scx-ai-gp/glm-5.3","name":"GLM-5.3 (SCX.ai)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.924,"output":2.904,"cache_read":0.1716},"canonical_model_id":"zhipuai/glm-5.3"},"scx-ai-gp/kimi-k2.7-code":{"id":"scx-ai-gp/kimi-k2.7-code","name":"Kimi K2.7 Code (SCX.ai)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.737,"output":3.08,"cache_read":0.143},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"scx-ai-gp/glm-5.3-flash":{"id":"scx-ai-gp/glm-5.3-flash","name":"GLM-5.3 Flash (SCX.ai)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.088,"output":0.25,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-5.3-flash"},"scx-ai-gp/qwen3.8-max":{"id":"scx-ai-gp/qwen3.8-max","name":"Qwen3.8 Max (SCX.ai)","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.54,"output":4.631,"cache_read":0.198,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"scx-ai-gp/deepseek-v4.1-flash-1017":{"id":"scx-ai-gp/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (scx-ai-gp)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":384000},"cost":{"input":0.135,"output":0.54,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"aws-bedrock/grok-4-6":{"id":"aws-bedrock/grok-4-6","name":"Grok 4.6 (AWS Bedrock)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"aws-bedrock/claude-sonnet-5-5":{"id":"aws-bedrock/claude-sonnet-5-5","name":"Claude Sonnet 5.5 (AWS Bedrock)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"aws-bedrock/claude-fable-5-1":{"id":"aws-bedrock/claude-fable-5-1","name":"Claude Fable 5.1 (AWS Bedrock)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"aws-bedrock/grok-4-3":{"id":"aws-bedrock/grok-4-3","name":"Grok 4.3 (AWS Bedrock)","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"aws-bedrock/llama-4-scout-17b-instruct":{"id":"aws-bedrock/llama-4-scout-17b-instruct","name":"Llama 4 Scout 17B Instruct (AWS Bedrock)","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"status":"deprecated","cost":{"input":0.17,"output":0.66},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"aws-bedrock/kimi-k3":{"id":"aws-bedrock/kimi-k3","name":"Kimi K3 (AWS Bedrock)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"moonshotai/kimi-k3"},"aws-bedrock/claude-sonnet-5":{"id":"aws-bedrock/claude-sonnet-5","name":"Claude Sonnet 5 (AWS Bedrock)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"aws-bedrock/claude-fable-5-2":{"id":"aws-bedrock/claude-fable-5-2","name":"Claude Fable 5.2 (AWS Bedrock)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"aws-bedrock/grok-4-7":{"id":"aws-bedrock/grok-4-7","name":"Grok 4.7 (AWS Bedrock)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":524288},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"aws-bedrock/claude-sonnet-4-5-20250929":{"id":"aws-bedrock/claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5 (2025-09-29) (AWS Bedrock)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"aws-bedrock/claude-fable-5":{"id":"aws-bedrock/claude-fable-5","name":"Claude Fable 5 (AWS Bedrock)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"aws-bedrock/llama-3.1-70b-instruct":{"id":"aws-bedrock/llama-3.1-70b-instruct","name":"Llama 3.1 70B Instruct (AWS Bedrock)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":2048},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"aws-bedrock/claude-haiku-4-5-20251001":{"id":"aws-bedrock/claude-haiku-4-5-20251001","name":"Claude Haiku 4.5 (2025-10-01) (AWS Bedrock)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"aws-bedrock/claude-opus-5":{"id":"aws-bedrock/claude-opus-5","name":"Claude Opus 5 (AWS Bedrock)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"aws-bedrock/claude-opus-4-5-20251101":{"id":"aws-bedrock/claude-opus-4-5-20251101","name":"Claude Opus 4.5 (AWS Bedrock)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"aws-bedrock/claude-opus-4-6":{"id":"aws-bedrock/claude-opus-4-6","name":"Claude Opus 4.6 (AWS Bedrock)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"aws-bedrock/claude-opus-4-8":{"id":"aws-bedrock/claude-opus-4-8","name":"Claude Opus 4.8 (AWS Bedrock)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"aws-bedrock/claude-opus-5-5":{"id":"aws-bedrock/claude-opus-5-5","name":"Claude Opus 5.5 (AWS Bedrock)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"aws-bedrock/claude-sonnet-4-5":{"id":"aws-bedrock/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (AWS Bedrock)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"aws-bedrock/claude-haiku-5-5":{"id":"aws-bedrock/claude-haiku-5-5","name":"Claude Haiku 5.5 (AWS Bedrock)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"anthropic/claude-haiku-5-5"},"aws-bedrock/claude-sonnet-4-6":{"id":"aws-bedrock/claude-sonnet-4-6","name":"Claude Sonnet 4.6 (AWS Bedrock)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"aws-bedrock/llama-4-maverick-17b-instruct":{"id":"aws-bedrock/llama-4-maverick-17b-instruct","name":"Llama 4 Maverick 17B Instruct (AWS Bedrock)","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"status":"deprecated","cost":{"input":0.24,"output":0.97},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"aws-bedrock/claude-opus-4-7":{"id":"aws-bedrock/claude-opus-4-7","name":"Claude Opus 4.7 (AWS Bedrock)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"aws-bedrock/claude-haiku-4-5":{"id":"aws-bedrock/claude-haiku-4-5","name":"Claude Haiku 4.5 (AWS Bedrock)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"perplexity/sonar":{"id":"perplexity/sonar","name":"Sonar (Perplexity)","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":130000,"output":4096},"cost":{"input":0.25,"output":2.5,"cache_write":0.25},"canonical_model_id":"perplexity/sonar"},"mistral/codestral-2508":{"id":"mistral/codestral-2508","name":"Codestral (Mistral AI)","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.3,"output":0.9},"canonical_model_id":"mistral/codestral-2508"},"mistral/mistral-small-2506":{"id":"mistral/mistral-small-2506","name":"Mistral Small 3.2 (Mistral AI)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/mistral-small-2506"},"mistral/mistral-medium-3-5":{"id":"mistral/mistral-medium-3-5","name":"Mistral Medium 3.5 (Mistral AI)","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistral/mistral-large-2512":{"id":"mistral/mistral-large-2512","name":"Mistral Large 3 (Mistral AI)","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/ministral-3b-2512":{"id":"mistral/ministral-3b-2512","name":"Ministral 3B (Mistral AI)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"mistral/ministral-3b-2512"},"mistral/ministral-8b-2512":{"id":"mistral/ministral-8b-2512","name":"Ministral 8B (Mistral AI)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.15,"output":0.15},"canonical_model_id":"mistral/ministral-8b-2512"},"mistral/mistral-small-2603":{"id":"mistral/mistral-small-2603","name":"Mistral Small 4 (Mistral AI)","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"mistral/mistral-small-2603"},"mistral/glm-5.3":{"id":"mistral/glm-5.3","name":"GLM-5.3 (Mistral AI)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"mistral/devstral-2512":{"id":"mistral/devstral-2512","name":"Devstral 2 (Mistral AI)","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/devstral-2512"},"mistral/mistral-large-4":{"id":"mistral/mistral-large-4","name":"Mistral Large 4 (Mistral AI)","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"cost":{"input":1.36,"output":4.18,"cache_read":0.14},"canonical_model_id":"mistral/mistral-large-4"},"mistral/ministral-14b-2512":{"id":"mistral/ministral-14b-2512","name":"Ministral 14B (Mistral AI)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"mistral/ministral-14b-2512"},"mistral/mistral-large-latest":{"id":"mistral/mistral-large-latest","name":"Mistral Large Latest (Mistral AI)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":262144},"cost":{"input":4,"output":12},"canonical_model_id":"mistral/mistral-large-latest"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro (DeepSeek)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":393216},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (DeepSeek)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"cloudflare/deepseek-v4-pro":{"id":"cloudflare/deepseek-v4-pro","name":"DeepSeek V4 Pro (Cloudflare)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"cloudflare/glm-5.3":{"id":"cloudflare/glm-5.3","name":"GLM-5.3 (Cloudflare)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"cloudflare/deepseek-v4-flash":{"id":"cloudflare/deepseek-v4-flash","name":"DeepSeek V4 Flash (Cloudflare)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"cloudflare/glm-5.3-flash":{"id":"cloudflare/glm-5.3-flash","name":"GLM-5.3 Flash (Cloudflare)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"cloudflare/deepseek-v4-flash-0731":{"id":"cloudflare/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Cloudflare)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"cloudflare/deepseek-v4.1-flash-1017":{"id":"cloudflare/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Cloudflare)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"greenference/qwen3-30b-a3b":{"id":"greenference/qwen3-30b-a3b","name":"Qwen3 30B A3B (greenference)","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.095,"output":0.285},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"greenference/qwen3-14b":{"id":"greenference/qwen3-14b","name":"Qwen3 14B (greenference)","description":"Tool-capable chat model for instruction following and agentic application workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"cost":{"input":0.076,"output":0.228}},"greenference/glm-5.3-flash":{"id":"greenference/glm-5.3-flash","name":"GLM-5.3 Flash (greenference)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.49,"cache_read":0.028},"canonical_model_id":"zhipuai/glm-5.3-flash"},"greenference/qwen3.6-27b":{"id":"greenference/qwen3.6-27b","name":"Qwen3.6 27B (greenference)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":8192},"cost":{"input":0.15,"output":1.35},"canonical_model_id":"alibaba/qwen3.6-27b"},"flexai/glm-5.2":{"id":"flexai/glm-5.2","name":"GLM-5.2 (flexai)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.7,"output":2.2,"cache_read":0.105},"canonical_model_id":"zhipuai/glm-5.2"},"flexai/deepseek-v4-flash":{"id":"flexai/deepseek-v4-flash","name":"DeepSeek V4 Flash (flexai)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.119,"output":0.238,"cache_read":0.004},"canonical_model_id":"deepseek/deepseek-v4-flash"},"flexai/glm-5.3-flash":{"id":"flexai/glm-5.3-flash","name":"GLM-5.3 Flash (flexai)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.08,"output":0.5,"cache_read":0.012},"canonical_model_id":"zhipuai/glm-5.3-flash"},"flexai/gpt-oss-120b":{"id":"flexai/gpt-oss-120b","name":"GPT OSS 120B (flexai)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-120b"},"flexai/deepseek-v4.1-flash-1017":{"id":"flexai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (flexai)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.004},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"vertex-openai/grok-4-6":{"id":"vertex-openai/grok-4-6","name":"Grok 4.6 (Vertex AI (OpenAI-compatible))","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"vertex-openai/grok-4-20-reasoning":{"id":"vertex-openai/grok-4-20-reasoning","name":"Grok 4.20 Reasoning (Vertex AI (OpenAI-compatible))","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"vertex-openai/grok-4-7":{"id":"vertex-openai/grok-4-7","name":"Grok 4.7 (Vertex AI (OpenAI-compatible))","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":524288},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"vertex-openai/grok-4-20-non-reasoning":{"id":"vertex-openai/grok-4-20-non-reasoning","name":"Grok 4.20 Non-Reasoning (Vertex AI (OpenAI-compatible))","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"bytedance/glm-5.2":{"id":"bytedance/glm-5.2","name":"GLM-5.2 (ByteDance)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"bytedance/seed-2-0-pro-260328":{"id":"bytedance/seed-2-0-pro-260328","name":"Seed 2.0 Pro (260328) (ByteDance)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-28","last_updated":"2026-03-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.1}},"bytedance/seed-2-0-lite-260428":{"id":"bytedance/seed-2-0-lite-260428","name":"Seed 2.0 Lite (260428) (ByteDance)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.25,"output":2,"cache_read":0.05}},"bytedance/seed-2-0-code-preview-260328":{"id":"bytedance/seed-2-0-code-preview-260328","name":"Seed 2.0 Code Preview (260328) (ByteDance)","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-28","last_updated":"2026-03-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.1}},"bytedance/deepseek-v4-pro":{"id":"bytedance/deepseek-v4-pro","name":"DeepSeek V4 Pro (ByteDance)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"bytedance/deepseek-v4-flash":{"id":"bytedance/deepseek-v4-flash","name":"DeepSeek V4 Flash (ByteDance)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"bytedance/deepseek-v4-flash-0731":{"id":"bytedance/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (ByteDance)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"bytedance/seed-2-0-mini-260428":{"id":"bytedance/seed-2-0-mini-260428","name":"Seed 2.0 Mini (260428) (ByteDance)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.1,"output":0.4,"cache_read":0.02}},"azure-anthropic/claude-sonnet-5-5":{"id":"azure-anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5 (Azure Anthropic)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"azure-anthropic/claude-fable-5-1":{"id":"azure-anthropic/claude-fable-5-1","name":"Claude Fable 5.1 (Azure Anthropic)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"azure-anthropic/claude-sonnet-5":{"id":"azure-anthropic/claude-sonnet-5","name":"Claude Sonnet 5 (Azure Anthropic)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"azure-anthropic/claude-fable-5":{"id":"azure-anthropic/claude-fable-5","name":"Claude Fable 5 (Azure Anthropic)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"azure-anthropic/claude-opus-5":{"id":"azure-anthropic/claude-opus-5","name":"Claude Opus 5 (Azure Anthropic)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"azure-anthropic/claude-opus-4-6":{"id":"azure-anthropic/claude-opus-4-6","name":"Claude Opus 4.6 (Azure Anthropic)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"azure-anthropic/claude-opus-4-8":{"id":"azure-anthropic/claude-opus-4-8","name":"Claude Opus 4.8 (Azure Anthropic)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"azure-anthropic/claude-opus-5-5":{"id":"azure-anthropic/claude-opus-5-5","name":"Claude Opus 5.5 (Azure Anthropic)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"azure-anthropic/claude-opus-4-7":{"id":"azure-anthropic/claude-opus-4-7","name":"Claude Opus 4.7 (Azure Anthropic)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM-5.2 (Z AI)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-4.5-x":{"id":"zai/glm-4.5-x","name":"GLM-4.5 X (Z AI)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":2.2,"output":8.9,"cache_read":0.45}},"zai/glm-4.5-airx":{"id":"zai/glm-4.5-airx","name":"GLM-4.5 AirX (Z AI)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":1.1,"output":4.5,"cache_read":0.22}},"zai/glm-4.6v":{"id":"zai/glm-4.6v","name":"GLM-4.6V (Z AI)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16000},"cost":{"input":0.3,"output":0.9,"cache_read":0.05},"canonical_model_id":"zhipuai/glm-4.6v"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM-5.1 (Z AI)","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-4.5":{"id":"zai/glm-4.5","name":"GLM-4.5 (Z AI)","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM-4.7 (Z AI)","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5.3":{"id":"zai/glm-5.3","name":"GLM-5.3 (Z AI)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-4-32b-0414-128k":{"id":"zai/glm-4-32b-0414-128k","name":"GLM-4 32B (0414-128k) (Z AI)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":0.1,"output":0.1}},"zai/glm-5.3-flash":{"id":"zai/glm-5.3-flash","name":"GLM-5.3 Flash (Z AI)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-4.5-air":{"id":"zai/glm-4.5-air","name":"GLM-4.5 Air (Z AI)","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM-4.6 (Z AI)","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-4.5v":{"id":"zai/glm-4.5v","name":"GLM-4.5V (Z AI)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16000},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"zai/glm-4.7-flashx":{"id":"zai/glm-4.7-flashx","name":"GLM-4.7 FlashX (Z AI)","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.07,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5 (Z AI)","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":131100},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"zai/glm-4.6v-flashx":{"id":"zai/glm-4.6v-flashx","name":"GLM-4.6V FlashX (Z AI)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":0.04,"output":0.4,"cache_read":0.004}},"entrim/glm-5.3":{"id":"entrim/glm-5.3","name":"GLM-5.3 (entrim)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.5,"output":2,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-5.3"},"entrim/glm-5.3-flash":{"id":"entrim/glm-5.3-flash","name":"GLM-5.3 Flash (entrim)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.35,"cache_read":0.0175},"canonical_model_id":"zhipuai/glm-5.3-flash"},"entrim/deepseek-v4.1-flash-1017":{"id":"entrim/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (entrim)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.8,"cache_read":0.005},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"runware/glm-5.2":{"id":"runware/glm-5.2","name":"GLM-5.2 (Runware)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":128000},"cost":{"input":0.8,"output":2.55,"cache_read":0.16},"canonical_model_id":"zhipuai/glm-5.2"},"runware/kimi-k3.1-pro":{"id":"runware/kimi-k3.1-pro","name":"Kimi K3.1 Pro (runware)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":950000,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"runware/kimi-k3":{"id":"runware/kimi-k3","name":"Kimi K3 (Runware)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"runware/deepseek-v4.1-flash":{"id":"runware/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Runware)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"runware/deepseek-v4-pro":{"id":"runware/deepseek-v4-pro","name":"DeepSeek V4 Pro (Runware)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.961,"output":1.922,"cache_read":0.079},"canonical_model_id":"deepseek/deepseek-v4-pro"},"runware/glm-5.3":{"id":"runware/glm-5.3","name":"GLM-5.3 (Runware)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.3"},"runware/deepseek-v4-flash":{"id":"runware/deepseek-v4-flash","name":"DeepSeek V4 Flash (Runware)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.076,"output":0.153,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"runware/glm-5.3-flash":{"id":"runware/glm-5.3-flash","name":"GLM-5.3 Flash (Runware)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"runware/gemma-4-31b-it":{"id":"runware/gemma-4-31b-it","name":"Gemma 4 31B IT (Runware)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.102,"output":0.297,"cache_read":0.012},"canonical_model_id":"google/gemma-4-31b-it"},"runware/deepseek-v4.1-flash-1017":{"id":"runware/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (runware)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"together-ai/kimi-k3":{"id":"together-ai/kimi-k3","name":"Kimi K3 (Together AI)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":1000000},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"together-ai/deepseek-v4.1-flash":{"id":"together-ai/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Together AI)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"together-ai/deepseek-v4-pro":{"id":"together-ai/deepseek-v4-pro","name":"DeepSeek V4 Pro (Together AI)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":163840},"cost":{"input":1.32,"output":3.96,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v4-pro"},"together-ai/glm-4.7":{"id":"together-ai/glm-4.7","name":"GLM-4.7 (Together AI)","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":128000},"cost":{"input":0.45,"output":2},"canonical_model_id":"zhipuai/glm-4.7"},"together-ai/glm-5.3":{"id":"together-ai/glm-5.3","name":"GLM-5.3 (Together AI)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943717},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"together-ai/minimax-m3.1-flash":{"id":"together-ai/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (Together AI)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"together-ai/glm-5.3-flash":{"id":"together-ai/glm-5.3-flash","name":"GLM-5.3 Flash (Together AI)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943717},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"together-ai/muse-glimmer-30b":{"id":"together-ai/muse-glimmer-30b","name":"Muse Glimmer 30B (Together AI)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.35,"output":1.5,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"together-ai/gpt-oss-120b":{"id":"together-ai/gpt-oss-120b","name":"GPT OSS 120B (Together AI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"together-ai/deepseek-v4.1-flash-1017":{"id":"together-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Together AI)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google-vertex/gemini-3.8-flash":{"id":"google-vertex/gemini-3.8-flash","name":"Gemini 3.8 Flash (Google Vertex AI)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.8-flash"},"google-vertex/gemini-4-carbon":{"id":"google-vertex/gemini-4-carbon","name":"Gemini 4 Carbon (Google Vertex AI)","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-carbon"},"google-vertex/gemini-3.5-flash":{"id":"google-vertex/gemini-3.5-flash","name":"Gemini 3.5 Flash (Google Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.08333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"google-vertex/gemini-3.6-flash":{"id":"google-vertex/gemini-3.6-flash","name":"Gemini 3.6 Flash (Google Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.6-flash"},"google-vertex/gemini-3.1-pro-preview":{"id":"google-vertex/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro (Preview) (Google Vertex AI)","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google-vertex/gemini-3.1-flash-lite":{"id":"google-vertex/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite (Google Vertex AI)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.08333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google-vertex/gemini-4-argon":{"id":"google-vertex/gemini-4-argon","name":"Gemini 4 Argon (Google Vertex AI)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-argon"},"google-vertex/gemini-3.5-flash-lite":{"id":"google-vertex/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite (Google Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google-vertex/gemini-3-flash-preview":{"id":"google-vertex/gemini-3-flash-preview","name":"Gemini 3 Flash (Preview) (Google Vertex AI)","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google-vertex/gemini-3.7-flash":{"id":"google-vertex/gemini-3.7-flash","name":"Gemini 3.7 Flash (Google Vertex AI)","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.7-flash"},"nebius/minimax-m3.1-flash":{"id":"nebius/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (Nebius AI)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"ranoai/deepseek-v4-flash":{"id":"ranoai/deepseek-v4-flash","name":"DeepSeek V4 Flash (RanoAI)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"sciforium/deepseek-v4.1-flash-1017":{"id":"sciforium/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (sciforium)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"luminal/deepseek-v4.1-flash":{"id":"luminal/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (luminal)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.135,"output":0.54,"cache_read":0.0027},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"tencent/glm-5.2":{"id":"tencent/glm-5.2","name":"GLM-5.2 (Tencent Cloud)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"tencent/kimi-k2.6":{"id":"tencent/kimi-k2.6","name":"Kimi K2.6 (Tencent Cloud)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.858,"output":3.566,"cache_read":0.145},"canonical_model_id":"moonshotai/kimi-k2.6"},"tencent/step-5-preview":{"id":"tencent/step-5-preview","name":"Step 5 Preview (Tencent Cloud)","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"tencent/kimi-k3":{"id":"tencent/kimi-k3","name":"Kimi K3 (Tencent Cloud)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"tencent/glm-5.1":{"id":"tencent/glm-5.1","name":"GLM-5.1 (Tencent Cloud)","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"tencent/mimo-v2.6-pro":{"id":"tencent/mimo-v2.6-pro","name":"MiMo V2.6 Pro (Tencent Cloud)","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"tencent/hy-mt2-plus":{"id":"tencent/hy-mt2-plus","name":"Hy-MT2 Plus (Tencent Cloud)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":4096},"cost":{"input":0.074,"output":0.295}},"tencent/deepseek-v4.1-flash":{"id":"tencent/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Tencent Cloud)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"tencent/deepseek-v4-pro":{"id":"tencent/deepseek-v4-pro","name":"DeepSeek V4 Pro (Tencent Cloud)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"tencent/glm-5.3":{"id":"tencent/glm-5.3","name":"GLM-5.3 (Tencent Cloud)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"tencent/mimo-v2.6-flash":{"id":"tencent/mimo-v2.6-flash","name":"MiMo V2.6 Flash (Tencent Cloud)","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"tencent/minimax-m3":{"id":"tencent/minimax-m3","name":"MiniMax M3 (Tencent Cloud)","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"tencent/kimi-k2.7-code":{"id":"tencent/kimi-k2.7-code","name":"Kimi K2.7 Code (Tencent Cloud)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"tencent/deepseek-v4-flash":{"id":"tencent/deepseek-v4-flash","name":"DeepSeek V4 Flash (Tencent Cloud)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash"},"tencent/kimi-k2.7-code-highspeed":{"id":"tencent/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed (Tencent Cloud)","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"tencent/glm-5.3-flash":{"id":"tencent/glm-5.3-flash","name":"GLM-5.3 Flash (Tencent Cloud)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"tencent/glm-5-turbo":{"id":"tencent/glm-5-turbo","name":"GLM-5 Turbo (Tencent Cloud)","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3 (Tencent Cloud)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 Preview (Tencent Cloud)","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"tencent/deepseek-v4-flash-0731":{"id":"tencent/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Tencent Cloud)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"tencent/glm-5.3-flashx":{"id":"tencent/glm-5.3-flashx","name":"GLM-5.3 FlashX (Tencent Cloud)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"tencent/kimi-k2.8-preview":{"id":"tencent/kimi-k2.8-preview","name":"Kimi K2.8 Preview (Tencent Cloud)","description":"Kimi coding model with more efficient thinking and up to 1M context, available through Kimi Code","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1,"output":4,"cache_read":0.25},"canonical_model_id":"moonshotai/kimi-k2.8-preview"},"tencent/minimax-m2.7":{"id":"tencent/minimax-m2.7","name":"MiniMax M2.7 (Tencent Cloud)","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"tencent/glm-5v-turbo":{"id":"tencent/glm-5v-turbo","name":"GLM-5V Turbo (Tencent Cloud)","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"tencent/deepseek-v4.1-flash-1017":{"id":"tencent/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Tencent Cloud)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"tencent/glm-5":{"id":"tencent/glm-5","name":"GLM-5 (Tencent Cloud)","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"alibaba/qwen3.6-plus":{"id":"alibaba/qwen3.6-plus","name":"Qwen3.6 Plus (Alibaba Cloud)","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625,"tiers":[{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5}},"canonical_model_id":"alibaba/qwen3.6-plus"},"alibaba/qwen-plus-latest":{"id":"alibaba/qwen-plus-latest","name":"Qwen Plus Latest (Alibaba Cloud)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-09-09","last_updated":"2024-09-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":0.4,"output":1.2,"cache_read":0.08,"cache_write":0.5}},"alibaba/glm-5.2":{"id":"alibaba/glm-5.2","name":"GLM-5.2 (Alibaba Cloud)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.28},"canonical_model_id":"zhipuai/glm-5.2"},"alibaba/qwen3.8-omni-flash":{"id":"alibaba/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash (Alibaba Cloud)","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"alibaba/qwen-max":{"id":"alibaba/qwen-max","name":"Qwen Max (Alibaba Cloud)","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":1.6,"output":6.4},"canonical_model_id":"alibaba/qwen-max"},"alibaba/kimi-k3":{"id":"alibaba/kimi-k3","name":"Kimi K3 (Alibaba Cloud)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"alibaba/qwen-plus":{"id":"alibaba/qwen-plus","name":"Qwen Plus (Alibaba Cloud)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32000},"cost":{"input":0.4,"output":1.2,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen-plus"},"alibaba/qwen3.8-flash":{"id":"alibaba/qwen3.8-flash","name":"Qwen3.8 Flash (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"alibaba/kimi-k2.5":{"id":"alibaba/kimi-k2.5","name":"Kimi K2.5 (Alibaba Cloud)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.574,"output":3.011},"canonical_model_id":"moonshotai/kimi-k2.5"},"alibaba/qwen35-397b-a17b":{"id":"alibaba/qwen35-397b-a17b","name":"Qwen3.5 397B A17B (Alibaba Cloud)","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"alibaba/deepseek-v4.1-flash":{"id":"alibaba/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Alibaba Cloud)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"alibaba/deepseek-v4-pro":{"id":"alibaba/deepseek-v4-pro","name":"DeepSeek V4 Pro (Alibaba Cloud)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":2.4,"output":4.8,"cache_read":0.2},"canonical_model_id":"deepseek/deepseek-v4-pro"},"alibaba/glm-5.3":{"id":"alibaba/glm-5.3","name":"GLM-5.3 (Alibaba Cloud)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.28},"canonical_model_id":"zhipuai/glm-5.3"},"alibaba/qwen3.5-35b-a3b":{"id":"alibaba/qwen3.5-35b-a3b","name":"Qwen3.5 35B A3B (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"alibaba/qwen3.7-plus":{"id":"alibaba/qwen3.7-plus","name":"Qwen3.7 Plus (Alibaba Cloud)","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"alibaba/qwen3.7-max":{"id":"alibaba/qwen3.7-max","name":"Qwen3.7 Max (Alibaba Cloud)","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"alibaba/deepseek-v4-flash":{"id":"alibaba/deepseek-v4-flash","name":"DeepSeek V4 Flash (Alibaba Cloud)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.2,"output":0.4,"cache_read":0.04},"canonical_model_id":"deepseek/deepseek-v4-flash"},"alibaba/qwen3.6-flash":{"id":"alibaba/qwen3.6-flash","name":"Qwen3.6 Flash (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.05,"cache_write":0.3125},"canonical_model_id":"alibaba/qwen3.6-flash"},"alibaba/qwen3.7-flash":{"id":"alibaba/qwen3.7-flash","name":"Qwen3.7 Flash (Alibaba Cloud)","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":991808,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.0375},"canonical_model_id":"alibaba/qwen3.7-flash"},"alibaba/qwen3.6-35b-a3b":{"id":"alibaba/qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B (Alibaba Cloud)","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.375,"output":2.25},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"alibaba/qwen-flash":{"id":"alibaba/qwen-flash","name":"Qwen Flash (Alibaba Cloud)","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":0.05,"output":0.4,"cache_read":0.01,"cache_write":0.0625},"canonical_model_id":"alibaba/qwen-flash"},"alibaba/deepseek-v4-flash-0731":{"id":"alibaba/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Alibaba Cloud)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.2,"output":0.4,"cache_read":0.04},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"alibaba/qwen3-vl-plus":{"id":"alibaba/qwen3-vl-plus","name":"Qwen3 VL Plus (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":1.6,"cache_read":0.04,"cache_write":0.25},"canonical_model_id":"alibaba/qwen3-vl-plus"},"alibaba/qwen3.8-max":{"id":"alibaba/qwen3.8-max","name":"Qwen3.8 Max (Alibaba Cloud)","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"alibaba/qwen3.5-27b":{"id":"alibaba/qwen3.5-27b","name":"Qwen3.5 27B (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"alibaba/deepseek-v4.1-flash-1017":{"id":"alibaba/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Alibaba Cloud)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"alibaba/qwen3-coder-flash":{"id":"alibaba/qwen3-coder-flash","name":"Qwen3 Coder Flash (Alibaba Cloud)","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":997952,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"alibaba/qwen3-coder-flash"},"alibaba/glm-5":{"id":"alibaba/glm-5","name":"GLM-5 (Alibaba Cloud)","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"cost":{"input":0.573,"output":2.58},"canonical_model_id":"zhipuai/glm-5"},"alibaba/qwen3.5-122b-a10b":{"id":"alibaba/qwen3.5-122b-a10b","name":"Qwen3.5 122B A10B (Alibaba Cloud)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"groq/gpt-oss-20b":{"id":"groq/gpt-oss-20b","name":"GPT OSS 20B (Groq)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32766},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"openai/gpt-oss-20b"},"groq/gpt-oss-120b":{"id":"groq/gpt-oss-120b","name":"GPT OSS 120B (Groq)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32766},"cost":{"input":0.15,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-live-transcribe":{"id":"openai/gpt-live-transcribe","type":"transcription","name":"GPT Live Transcribe (OpenAI)","description":"Low-latency streaming speech-to-text model with keyword and language hints","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-live-transcribe"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro (OpenAI)","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5 (OpenAI)","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2 (OpenAI)","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 Mini (OpenAI)","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 Mini (OpenAI)","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5 (OpenAI)","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol (OpenAI)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra (OpenAI)","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1 (OpenAI)","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3 (OpenAI)","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna (OpenAI)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro (OpenAI)","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol (OpenAI)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-4o-transcribe":{"id":"openai/gpt-4o-transcribe","name":"GPT-4o Transcribe (OpenAI)","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"cost":{"input":2.5,"output":10,"input_audio":6}},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex (OpenAI)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra (OpenAI)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1 (OpenAI)","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini (OpenAI)","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro (OpenAI)","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-4o-mini-transcribe":{"id":"openai/gpt-4o-mini-transcribe","name":"GPT-4o Mini Transcribe (OpenAI)","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"cost":{"input":1.25,"output":5,"input_audio":3}},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna (OpenAI)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol (OpenAI)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro (OpenAI)","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano (OpenAI)","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4 (OpenAI)","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 Nano (OpenAI)","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o (OpenAI)","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra (OpenAI)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-transcribe":{"id":"openai/gpt-transcribe","type":"transcription","name":"GPT Transcribe (OpenAI)","description":"High-accuracy speech-to-text model for audio files and committed Realtime turns","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-transcribe"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o Mini (OpenAI)","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"vertex-anthropic/claude-sonnet-5":{"id":"vertex-anthropic/claude-sonnet-5","name":"Claude Sonnet 5 (Vertex AI (Anthropic))","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"vertex-anthropic/claude-opus-4-5-20251101":{"id":"vertex-anthropic/claude-opus-4-5-20251101","name":"Claude Opus 4.5 (Vertex AI (Anthropic))","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"vertex-anthropic/claude-opus-4-6":{"id":"vertex-anthropic/claude-opus-4-6","name":"Claude Opus 4.6 (Vertex AI (Anthropic))","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"vertex-anthropic/claude-sonnet-4-5":{"id":"vertex-anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (Vertex AI (Anthropic))","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"vertex-anthropic/claude-sonnet-4-6":{"id":"vertex-anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6 (Vertex AI (Anthropic))","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"vertex-anthropic/claude-opus-4-7":{"id":"vertex-anthropic/claude-opus-4-7","name":"Claude Opus 4.7 (Vertex AI (Anthropic))","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"vertex-anthropic/claude-haiku-4-5":{"id":"vertex-anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (Vertex AI (Anthropic))","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"meta-contributor/muse-spark-1.2-contributor":{"id":"meta-contributor/muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor (Meta Contributor)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"meta-contributor/muse-spark-1.3-contributor":{"id":"meta-contributor/muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor (Meta Contributor)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"novita/glm-5.2":{"id":"novita/glm-5.2","name":"GLM-5.2 (NovitaAI)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"novita/kimi-k2.6":{"id":"novita/kimi-k2.6","name":"Kimi K2.6 (NovitaAI)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.8,"output":3.4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"novita/llama-4-scout-17b-instruct":{"id":"novita/llama-4-scout-17b-instruct","name":"Llama 4 Scout 17B Instruct (NovitaAI)","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.18,"output":0.59},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"novita/kimi-k3":{"id":"novita/kimi-k3","name":"Kimi K3 (NovitaAI)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"novita/qwen3-vl-30b-a3b-instruct":{"id":"novita/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct (NovitaAI)","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.2,"output":0.7},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"novita/qwen3.8-27b":{"id":"novita/qwen3.8-27b","name":"Qwen3.8 27B (NovitaAI)","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.42,"output":3,"cache_read":0.085},"canonical_model_id":"alibaba/qwen3.8-27b"},"novita/glm-4.6v":{"id":"novita/glm-4.6v","name":"GLM-4.6V (NovitaAI)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16000},"cost":{"input":0.3,"output":0.9,"cache_read":0.055},"canonical_model_id":"zhipuai/glm-4.6v"},"novita/qwen3.8-flash":{"id":"novita/qwen3.8-flash","name":"Qwen3.8 Flash (NovitaAI)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"novita/glm-5.1":{"id":"novita/glm-5.1","name":"GLM-5.1 (NovitaAI)","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1.38,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"novita/minimax-m2.5":{"id":"novita/minimax-m2.5","name":"MiniMax M2.5 (NovitaAI)","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"novita/qwen35-397b-a17b":{"id":"novita/qwen35-397b-a17b","name":"Qwen3.5 397B A17B (NovitaAI)","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"novita/deepseek-v4.1-flash":{"id":"novita/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (NovitaAI)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"novita/ling-3.0-flash":{"id":"novita/ling-3.0-flash","name":"InclusionAI Ling 3.0 Flash (NovitaAI)","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash"},"novita/glm-4.7":{"id":"novita/glm-4.7","name":"GLM-4.7 (NovitaAI)","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"novita/qwen3.8-2.4t-a95b":{"id":"novita/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B (NovitaAI)","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"novita/glm-5.3":{"id":"novita/glm-5.3","name":"GLM-5.3 (NovitaAI)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"novita/minimax-m3.1-flash":{"id":"novita/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (NovitaAI)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"novita/minimax-m3":{"id":"novita/minimax-m3","name":"MiniMax M3 (NovitaAI)","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"novita/qwen3.7-max":{"id":"novita/qwen3.7-max","name":"Qwen3.7 Max (NovitaAI)","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.25,"output":3.75,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.7-max"},"novita/kimi-k2":{"id":"novita/kimi-k2","name":"Kimi K2 (NovitaAI)","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"cost":{"input":0.57,"output":2.3}},"novita/kimi-k2.7-code":{"id":"novita/kimi-k2.7-code","name":"Kimi K2.7 Code (NovitaAI)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"novita/deepseek-v4-flash":{"id":"novita/deepseek-v4-flash","name":"DeepSeek V4 Flash (NovitaAI)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":393216},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"novita/llama-3.3-70b-instruct":{"id":"novita/llama-3.3-70b-instruct","name":"Llama 3.3 70B Instruct (NovitaAI)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":120000},"cost":{"input":0.135,"output":0.4},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"novita/glm-5.3-flash":{"id":"novita/glm-5.3-flash","name":"GLM-5.3 Flash (NovitaAI)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"novita/gemma-4-31b-it":{"id":"novita/gemma-4-31b-it","name":"Gemma 4 31B IT (NovitaAI)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"novita/hy3":{"id":"novita/hy3","name":"Hy3 (NovitaAI)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":262144},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"novita/glm-4.6":{"id":"novita/glm-4.6","name":"GLM-4.6 (NovitaAI)","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.55,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"novita/qwen3.6-35b-a3b":{"id":"novita/qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B (NovitaAI)","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"cost":{"input":0.248,"output":1.485},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"novita/gemma-4-26b-a4b-it":{"id":"novita/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT (NovitaAI)","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.13,"output":0.4},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"novita/glm-4.5v":{"id":"novita/glm-4.5v","name":"GLM-4.5V (NovitaAI)","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16000},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"novita/deepseek-v4-flash-0731":{"id":"novita/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (NovitaAI)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":393216},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"novita/minimax-m2.7":{"id":"novita/minimax-m2.7","name":"MiniMax M2.7 (NovitaAI)","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"novita/qwen3.8-max":{"id":"novita/qwen3.8-max","name":"Qwen3.8 Max (NovitaAI)","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"novita/step-3.7-flash":{"id":"novita/step-3.7-flash","name":"Step 3.7 Flash (NovitaAI)","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"novita/deepseek-v4.1-flash-1017":{"id":"novita/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (NovitaAI)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"novita/glm-5":{"id":"novita/glm-5","name":"GLM-5 (NovitaAI)","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"novita/llama-4-maverick-17b-instruct":{"id":"novita/llama-4-maverick-17b-instruct","name":"Llama 4 Maverick 17B Instruct (NovitaAI)","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":8192},"cost":{"input":0.27,"output":0.85},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"novita/qwen3.5-122b-a10b":{"id":"novita/qwen3.5-122b-a10b","name":"Qwen3.5 122B A10B (NovitaAI)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"moonshot/kimi-k3.1-pro-highspeed":{"id":"moonshot/kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed (Moonshot AI)","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4}},"moonshot/kimi-k3.1-pro":{"id":"moonshot/kimi-k3.1-pro","name":"Kimi K3.1 Pro (Moonshot AI)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshot/kimi-k2.6":{"id":"moonshot/kimi-k2.6","name":"Kimi K2.6 (Moonshot AI)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3 (Moonshot AI)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot/kimi-k2.5":{"id":"moonshot/kimi-k2.5","name":"Kimi K2.5 (Moonshot AI)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshot/kimi-k2.7-code":{"id":"moonshot/kimi-k2.7-code","name":"Kimi K2.7 Code (Moonshot AI)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshot/kimi-k2.7-code-highspeed":{"id":"moonshot/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed (Moonshot AI)","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo V2.6 Pro (Xiaomi)","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo V2.6 Flash (Xiaomi)","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"google-ai-studio/gemini-3.8-flash":{"id":"google-ai-studio/gemini-3.8-flash","name":"Gemini 3.8 Flash (Google AI Studio)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.8-flash"},"google-ai-studio/gemini-4-carbon":{"id":"google-ai-studio/gemini-4-carbon","name":"Gemini 4 Carbon (Google AI Studio)","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-carbon"},"google-ai-studio/gemini-pro-latest":{"id":"google-ai-studio/gemini-pro-latest","name":"Gemini Pro Latest (Google AI Studio)","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-27","last_updated":"2026-02-27","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2}},"google-ai-studio/gemini-3.6-flash":{"id":"google-ai-studio/gemini-3.6-flash","name":"Gemini 3.6 Flash (Google AI Studio)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.6-flash"},"google-ai-studio/gemini-3.1-pro-preview":{"id":"google-ai-studio/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro (Preview) (Google AI Studio)","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google-ai-studio/gemini-3.1-flash-lite":{"id":"google-ai-studio/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite (Google AI Studio)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.08333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google-ai-studio/gemini-4-argon":{"id":"google-ai-studio/gemini-4-argon","name":"Gemini 4 Argon (Google AI Studio)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-argon"},"google-ai-studio/gemini-3.5-flash-lite":{"id":"google-ai-studio/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite (Google AI Studio)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google-ai-studio/gemini-3-flash-preview":{"id":"google-ai-studio/gemini-3-flash-preview","name":"Gemini 3 Flash (Preview) (Google AI Studio)","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"runpod/kimi-k3.1-pro-highspeed":{"id":"runpod/kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed (Runpod)","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2}},"runpod/kimi-k3.1-pro":{"id":"runpod/kimi-k3.1-pro","name":"Kimi K3.1 Pro (Runpod)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"runpod/kimi-k3":{"id":"runpod/kimi-k3","name":"Kimi K3 (Runpod)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"runpod/glm-5.3":{"id":"runpod/glm-5.3","name":"GLM-5.3 (Runpod)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.77,"output":2.42,"cache_read":0.143},"canonical_model_id":"zhipuai/glm-5.3"},"cerebras/gpt-oss-120b":{"id":"cerebras/gpt-oss-120b","name":"GPT OSS 120B (Cerebras)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"reka-ai/reka-edge-2603":{"id":"reka-ai/reka-edge-2603","name":"Reka Edge 2603 (reka-ai)","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-09","last_updated":"2026-10-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":16384},"cost":{"input":0.1,"output":0.1}},"reka-ai/deepseek-v4.1-flash":{"id":"reka-ai/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (reka-ai)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.135,"output":0.54,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"reka-ai/glm-5.3":{"id":"reka-ai/glm-5.3","name":"GLM-5.3 (reka-ai)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.45,"output":1.8,"cache_read":0.135},"canonical_model_id":"zhipuai/glm-5.3"},"reka-ai/glm-5.3-flash":{"id":"reka-ai/glm-5.3-flash","name":"GLM-5.3 Flash (reka-ai)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.11,"output":0.3,"cache_read":0.02},"canonical_model_id":"zhipuai/glm-5.3-flash"},"reka-ai/deepseek-v4.1-flash-1017":{"id":"reka-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (reka-ai)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax M2.1 (MiniMax)","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.27,"output":1.1},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.1-lightning":{"id":"minimax/minimax-m2.1-lightning","name":"MiniMax M2.1 Lightning (MiniMax)","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"output":131072},"cost":{"input":0.12,"output":0.48}},"minimax/minimax-m2.5-highspeed":{"id":"minimax/minimax-m2.5-highspeed","name":"MiniMax M2.5 Highspeed (MiniMax)","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.6,"output":2.4,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-text-01":{"id":"minimax/minimax-text-01","name":"MiniMax Text 01 (MiniMax)","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-01-15","last_updated":"2025-01-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.2,"output":1.1}},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax M2.5 (MiniMax)","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax M2 (MiniMax)","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.2,"output":1,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (MiniMax)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax M3 (MiniMax)","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax M2.7 Highspeed (MiniMax)","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.6,"output":2.4,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax M2.7 (MiniMax)","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"quartz/gemini-3.1-pro-preview":{"id":"quartz/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro (Preview) (Quartz)","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3 (Meta)","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1 (Meta)","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-wonder-1.0":{"id":"meta/muse-wonder-1.0","name":"Muse Wonder 1.0 (Meta)","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"meta/muse-ember-1.0":{"id":"meta/muse-ember-1.0","name":"Muse Ember 1.0 (Meta)","description":"Muse Ember is Meta's smallest and most efficient reasoning model, built for the work agents repeat all day: tool calls, coding subtasks, routing, extraction, and long-document parsing. It pairs with Muse Wonder or Muse Spark, which plan while Muse Ember handles the volume.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":524288},"cost":{"input":0.1,"output":0.5,"cache_read":0.004},"canonical_model_id":"meta/muse-ember-1.0"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2 (Meta)","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"deepinfra/qwen3-vl-235b-a22b-instruct":{"id":"deepinfra/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct (DeepInfra)","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.88,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"deepinfra/ling-3.0-flash-vl":{"id":"deepinfra/ling-3.0-flash-vl","name":"Ling 3.0 Flash VL (DeepInfra)","description":"Native multimodal hybrid MoE model for image and video understanding, reasoning, and visual agents","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"deepinfra/qwen3-vl-30b-a3b-instruct":{"id":"deepinfra/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct (DeepInfra)","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"deepinfra/mimo-v2.6-pro":{"id":"deepinfra/mimo-v2.6-pro","name":"MiMo V2.6 Pro (DeepInfra)","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"deepinfra/qwen3.5-9b":{"id":"deepinfra/qwen3.5-9b","name":"Qwen3.5 9B (DeepInfra)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.15},"canonical_model_id":"alibaba/qwen3.5-9b"},"deepinfra/deepseek-v4.1-flash":{"id":"deepinfra/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (DeepInfra)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepinfra/deepseek-v4-pro":{"id":"deepinfra/deepseek-v4-pro","name":"DeepSeek V4 Pro (DeepInfra)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":1.3,"output":2.6,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepinfra/ling-3.0-flash":{"id":"deepinfra/ling-3.0-flash","name":"InclusionAI Ling 3.0 Flash (DeepInfra)","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash"},"deepinfra/mimo-v2.6-flash":{"id":"deepinfra/mimo-v2.6-flash","name":"MiMo V2.6 Flash (DeepInfra)","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"deepinfra/granite-4.2-8b":{"id":"deepinfra/granite-4.2-8b","name":"Granite 4.2 8B (DeepInfra)","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.06,"output":0.25,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"deepinfra/minimax-m3":{"id":"deepinfra/minimax-m3","name":"MiniMax M3 (DeepInfra)","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":524288},"cost":{"input":0.28,"output":1.1,"cache_read":0.056},"canonical_model_id":"minimax/MiniMax-M3"},"deepinfra/deepseek-v4-flash":{"id":"deepinfra/deepseek-v4-flash","name":"DeepSeek V4 Flash (DeepInfra)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.09,"output":0.18,"cache_read":0.018},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepinfra/nemotron-3-ultra-550b":{"id":"deepinfra/nemotron-3-ultra-550b","name":"Nemotron 3 Ultra 550B (DeepInfra)","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":2.2,"cache_read":0.1}},"deepinfra/gemma-4-31b-it":{"id":"deepinfra/gemma-4-31b-it","name":"Gemma 4 31B IT (DeepInfra)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"deepinfra/gemma-4-26b-a4b-it":{"id":"deepinfra/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT (DeepInfra)","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.07,"output":0.34},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"deepinfra/muse-glimmer-30b":{"id":"deepinfra/muse-glimmer-30b","name":"Muse Glimmer 30B (DeepInfra)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.3,"output":1.2,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"deepinfra/deepseek-v3.2":{"id":"deepinfra/deepseek-v3.2","name":"DeepSeek V3.2 (DeepInfra)","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":160000,"output":65536},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepinfra/deepseek-v4-flash-0731":{"id":"deepinfra/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (DeepInfra)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":0.08,"output":0.18,"cache_read":0.016},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepinfra/deepseek-v4.1-flash-1017":{"id":"deepinfra/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (DeepInfra)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"azure/gpt-live-transcribe":{"id":"azure/gpt-live-transcribe","type":"transcription","name":"GPT Live Transcribe (Azure)","description":"Low-latency streaming speech-to-text model with keyword and language hints","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-live-transcribe"},"azure/gpt-5.5":{"id":"azure/gpt-5.5","name":"GPT-5.5 (Azure)","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"azure/grok-4-3":{"id":"azure/grok-4-3","name":"Grok 4.3 (Azure)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"azure/gpt-5.2":{"id":"azure/gpt-5.2","name":"GPT-5.2 (Azure)","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"azure/gpt-4.1-mini":{"id":"azure/gpt-4.1-mini","name":"GPT-4.1 Mini (Azure)","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"azure/gpt-5.2-codex":{"id":"azure/gpt-5.2-codex","name":"GPT-5.2 Codex (Azure)","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"azure/gpt-5.4-mini":{"id":"azure/gpt-5.4-mini","name":"GPT-5.4 Mini (Azure)","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"azure/gpt-5":{"id":"azure/gpt-5","name":"GPT-5 (Azure)","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"azure/gpt-5.1-codex":{"id":"azure/gpt-5.1-codex","name":"GPT-5.1 Codex (Azure)","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1-codex"},"azure/gpt-5.6-sol":{"id":"azure/gpt-5.6-sol","name":"GPT-5.6 Sol (Azure)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"azure/gpt-6.1-terra":{"id":"azure/gpt-6.1-terra","name":"GPT-6.1 Terra (Azure)","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"azure/gpt-4.1":{"id":"azure/gpt-4.1","name":"GPT-4.1 (Azure)","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"azure/gpt-6-luna":{"id":"azure/gpt-6-luna","name":"GPT-6 Luna (Azure)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"azure/gpt-5-pro":{"id":"azure/gpt-5-pro","name":"GPT-5 Pro (Azure)","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"azure/gpt-6-sol":{"id":"azure/gpt-6-sol","name":"GPT-6 Sol (Azure)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"azure/gpt-4o-transcribe":{"id":"azure/gpt-4o-transcribe","type":"transcription","name":"GPT-4o Transcribe (Azure)","description":"Speech-to-text model powered by GPT-4o for accurate transcription","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"cost":{"input":2.5,"output":10,"input_audio":6},"canonical_model_id":"openai/gpt-4o-transcribe"},"azure/gpt-5.3-codex":{"id":"azure/gpt-5.3-codex","name":"GPT-5.3 Codex (Azure)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"azure/grok-4-1-fast-reasoning":{"id":"azure/grok-4-1-fast-reasoning","name":"Grok 4.1 Fast Reasoning (Azure)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":0.2,"output":0.5}},"azure/gpt-6-astra":{"id":"azure/gpt-6-astra","name":"GPT-6 Astra (Azure)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"azure/gpt-5.1":{"id":"azure/gpt-5.1","name":"GPT-5.1 (Azure)","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"azure/gpt-5-mini":{"id":"azure/gpt-5-mini","name":"GPT-5 Mini (Azure)","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"azure/gpt-5.1-codex-mini":{"id":"azure/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini (Azure)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"azure/gpt-4o-mini-transcribe":{"id":"azure/gpt-4o-mini-transcribe","type":"transcription","name":"GPT-4o Mini Transcribe (Azure)","description":"Speech-to-text model powered by GPT-4o Mini for fast, accurate transcription","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"cost":{"input":1.25,"output":5,"input_audio":3},"canonical_model_id":"openai/gpt-4o-mini-transcribe"},"azure/gpt-5.6-luna":{"id":"azure/gpt-5.6-luna","name":"GPT-5.6 Luna (Azure)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"azure/gpt-6.1-sol":{"id":"azure/gpt-6.1-sol","name":"GPT-6.1 Sol (Azure)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"azure/gpt-5.4-pro":{"id":"azure/gpt-5.4-pro","name":"GPT-5.4 Pro (Azure)","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"azure/gpt-5-nano":{"id":"azure/gpt-5-nano","name":"GPT-5 Nano (Azure)","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"azure/gpt-5.4":{"id":"azure/gpt-5.4","name":"GPT-5.4 (Azure)","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"azure/gpt-5.4-nano":{"id":"azure/gpt-5.4-nano","name":"GPT-5.4 Nano (Azure)","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"azure/gpt-4o":{"id":"azure/gpt-4o","name":"GPT-4o (Azure)","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"azure/gpt-oss-120b":{"id":"azure/gpt-oss-120b","name":"GPT OSS 120B (Azure)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"azure/gpt-5.6-terra":{"id":"azure/gpt-5.6-terra","name":"GPT-5.6 Terra (Azure)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"azure/gpt-transcribe":{"id":"azure/gpt-transcribe","type":"transcription","name":"GPT Transcribe (Azure)","description":"High-accuracy speech-to-text model for audio files and committed Realtime turns","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-transcribe"},"azure/gpt-4o-mini":{"id":"azure/gpt-4o-mini","name":"GPT-4o Mini (Azure)","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"inference.net/kimi-k3.1-pro":{"id":"inference.net/kimi-k3.1-pro","name":"Kimi K3.1 Pro (Inference.net)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"inference.net/glm-5.3":{"id":"inference.net/glm-5.3","name":"GLM-5.3 (Inference.net)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.9,"output":3,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-5.3"},"inference.net/minimax-m3.1-flash":{"id":"inference.net/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (Inference.net)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.1,"output":0.5,"cache_read":0.005},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"inference.net/deepseek-v4-flash":{"id":"inference.net/deepseek-v4-flash","name":"DeepSeek V4 Flash (Inference.net)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.23,"output":0.62,"cache_read":0.0028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"inference.net/glm-5.3-flash":{"id":"inference.net/glm-5.3-flash","name":"GLM-5.3 Flash (Inference.net)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":0.09,"output":0.28,"cache_read":0.02},"canonical_model_id":"zhipuai/glm-5.3-flash"},"inference.net/deepseek-v4.1-flash-cyber":{"id":"inference.net/deepseek-v4.1-flash-cyber","name":"DeepSeek V4.1 Flash Cyber (Inference.net)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-29","last_updated":"2026-10-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"output":393216},"cost":{"input":0.3,"output":1,"cache_read":0.007}},"inference.net/llama-3.2-11b-instruct":{"id":"inference.net/llama-3.2-11b-instruct","name":"Llama 3.2 11B Instruct (Inference.net)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":0.07,"output":0.33}},"inference.net/deepseek-v4.1-flash-1017":{"id":"inference.net/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Inference.net)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.3,"output":1,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"scx-ai/qwen3-32b":{"id":"scx-ai/qwen3-32b","name":"Qwen3 32B (SCX.ai (Turbo))","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.36,"output":0.87},"canonical_model_id":"alibaba/qwen3-32b"},"scx-ai/gpt-oss-120b":{"id":"scx-ai/gpt-oss-120b","name":"GPT OSS 120B (SCX.ai (Turbo))","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.17,"output":0.55},"canonical_model_id":"openai/gpt-oss-120b"},"scx-ai/minimax-m2.7":{"id":"scx-ai/minimax-m2.7","name":"MiniMax M2.7 (SCX.ai (Turbo))","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":196608},"cost":{"input":0.48,"output":1.79,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M2.7"},"consensusprotocol/qwen3.8-27b":{"id":"consensusprotocol/qwen3.8-27b","name":"Qwen3.8 27B (consensusprotocol)","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":32768},"cost":{"input":0.08,"output":0.35,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"consensusprotocol/gpt-oss-20b":{"id":"consensusprotocol/gpt-oss-20b","name":"GPT OSS 20B (Consensus Protocol)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.04,"output":0.19,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-20b"},"consensusprotocol/deepseek-v4.1-flash":{"id":"consensusprotocol/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Consensus Protocol)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.55,"cache_read":0.005},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"consensusprotocol/deepseek-v4-flash":{"id":"consensusprotocol/deepseek-v4-flash","name":"DeepSeek V4 Flash (Consensus Protocol)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.1,"output":0.2,"cache_read":0.005},"canonical_model_id":"deepseek/deepseek-v4-flash"},"consensusprotocol/glm-5.3-flash":{"id":"consensusprotocol/glm-5.3-flash","name":"GLM-5.3 Flash (Consensus Protocol)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.25,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-5.3-flash"},"consensusprotocol/gemma-4-31b-it":{"id":"consensusprotocol/gemma-4-31b-it","name":"Gemma 4 31B IT (Consensus Protocol)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.25,"cache_read":0.01},"canonical_model_id":"google/gemma-4-31b-it"},"consensusprotocol/deepseek-v4.1-flash-uncensored":{"id":"consensusprotocol/deepseek-v4.1-flash-uncensored","name":"DeepSeek V4.1 Flash 1017 Uncensored (HeimdaLLM) (consensusprotocol)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.18,"output":0.65,"cache_read":0.005}},"fireworks/kimi-k3-fast":{"id":"fireworks/kimi-k3-fast","name":"Kimi K3 Fast (Fireworks AI)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1040384,"output":1040384},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"fireworks/kimi-k3":{"id":"fireworks/kimi-k3","name":"Kimi K3 (Fireworks AI)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1040384,"output":1040384},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"fireworks/deepseek-v4.1-flash":{"id":"fireworks/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Fireworks AI)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"fireworks/glm-5.3":{"id":"fireworks/glm-5.3","name":"GLM-5.3 (Fireworks AI)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"fireworks/glm-5.3-flash":{"id":"fireworks/glm-5.3-flash","name":"GLM-5.3 Flash (Fireworks AI)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"xai/grok-4-6":{"id":"xai/grok-4-6","name":"Grok 4.6 (xAI)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"xai/grok-4-3":{"id":"xai/grok-4-3","name":"Grok 4.3 (xAI)","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4":{"id":"xai/grok-4","name":"Grok 4 (xAI)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":3,"output":15,"cache_read":0.75}},"xai/grok-4-7":{"id":"xai/grok-4-7","name":"Grok 4.7 (xAI)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4-5":{"id":"xai/grok-4-5","name":"Grok 4.5 (xAI)","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"xai/grok-build-0-1":{"id":"xai/grok-build-0-1","name":"Grok Build 0.1 (xAI)","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"xai/grok-4-20-beta-0309-reasoning":{"id":"xai/grok-4-20-beta-0309-reasoning","name":"Grok 4.20 Beta Reasoning (0309) (xAI)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4-20-beta-0309-non-reasoning":{"id":"xai/grok-4-20-beta-0309-non-reasoning","name":"Grok 4.20 Beta Non-Reasoning (0309) (xAI)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"canopywave/glm-5.2":{"id":"canopywave/glm-5.2","name":"GLM-5.2 (CanopyWave)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32768},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"canopywave/kimi-k2.6":{"id":"canopywave/kimi-k2.6","name":"Kimi K2.6 (CanopyWave)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"canopywave/kimi-k3":{"id":"canopywave/kimi-k3","name":"Kimi K3 (CanopyWave)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"canopywave/qwen3.8-flash":{"id":"canopywave/qwen3.8-flash","name":"Qwen3.8 Flash (CanopyWave)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.8-flash"},"canopywave/minimax-m3.1-flash":{"id":"canopywave/minimax-m3.1-flash","name":"MiniMax M3.1 Flash (CanopyWave)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"canopywave/glm-5.3-flash":{"id":"canopywave/glm-5.3-flash","name":"GLM-5.3 Flash (CanopyWave)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"canopywave/deepseek-v4-flash-0731":{"id":"canopywave/deepseek-v4-flash-0731","name":"deepseek-v4-flash-0731 (CanopyWave)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.04},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max (Sakana AI)","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v2.0":{"id":"sakana/fugu-ultra-v2.0","name":"Fugu Ultra v2.0 (Sakana AI)","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra-v2"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra (Sakana AI)","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"}}},"dinference":{"id":"dinference","env":["DINFERENCE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.dinference.com/v1","name":"DInference","doc":"https://dinference.com","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":3.89},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":3.89},"canonical_model_id":"zhipuai/glm-5.1"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":0.22,"output":0.88},"canonical_model_id":"minimax/MiniMax-M2.5"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.45,"output":1.65},"canonical_model_id":"zhipuai/glm-4.7"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.0675,"output":0.27},"canonical_model_id":"openai/gpt-oss-120b"},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.75,"output":2.4},"canonical_model_id":"zhipuai/glm-5"}}},"kilo":{"id":"kilo","env":["KILO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.kilo.ai/api/gateway","name":"Kilo Gateway","doc":"https://kilo.ai","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Claude Opus 4.8 is Anthropic's most capable generally available model in the Opus family. It supports text, image, and file inputs with text output, with reasoning support and a 1M-token...","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude Opus 5.5 is Anthropic's flagship model for demanding reasoning, coding, and long-horizon agentic work, succeeding Claude Opus 5. It is particularly strong at multi-step changes in large codebases, code...","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Sonnet 5 is Anthropic's most capable Sonnet-class model, with frontier performance across coding, agents, and professional work. It supports adaptive thinking with selectable reasoning effort levels (low, medium, high, max,...","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Anthropic: Claude Fable 5.2","description":"Claude Fable 5.2 is Anthropic's most capable model for the most demanding technical work, with gains over Fable 5.1 in coding, reasoning, and vision. In prerelease testing it completed otherwise-infeasible...","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude Fable 5.1 improves on Claude Fable 5 across the board, with the biggest gains in agentic coding, long-running agentic workflows, and knowledge work: long code refactors, front-end and visual...","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude Opus 4.1 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude Fable 5 is a Mythos-class model from Anthropic, built for autonomous knowledge work and coding. It supports text, image, and file inputs with text output, with reasoning support and...","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Claude Opus 5 is Anthropic’s flagship model for demanding reasoning, coding, and long-horizon agentic work. It is particularly strong at end-to-end software tasks, code review and bug finding, visual analysis...","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Claude Sonnet 5.5 is Anthropic's Sonnet-class model for well-scoped everyday work, succeeding Claude Sonnet 5 as a direct upgrade. It is especially strong at building features, fixing bugs, and producing...","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Claude Haiku 5.5 is Anthropic's small, fast model for high-volume, cost-sensitive work such as summarization, subagents, and browser use. It succeeds Claude Haiku 4.5 with stronger coding, computer use, and...","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"anthropic/claude-haiku-5-5"},"writer/palmyra-x5":{"id":"writer/palmyra-x5","name":"Writer: Palmyra X5","description":"General-purpose chat model for instruction following, writing, and analysis","family":"palmyra","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"output":8192},"cost":{"input":0.6,"output":6},"canonical_model_id":"writer/palmyra-x5"},"aion-labs/aion-3.0":{"id":"aion-labs/aion-3.0","name":"AionLabs: Aion-3.0","description":"Aion-3.0 is a multi-model roleplaying and storytelling system from AionLabs, built on the GLM family of models. It uses a collaborative generation process in which multiple specialized models each contribute...","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75},"canonical_model_id":"aion-labs/aion-3.0"},"aion-labs/aion-3.5-mini":{"id":"aion-labs/aion-3.5-mini","name":"AionLabs: Aion 3.5 Mini","description":"Aion 3.5 Mini is a multi-model roleplaying and storytelling system from AionLabs, built on the GLM family of models. It is the smaller, lower-cost sibling of Aion 3.5 and uses...","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18}},"aion-labs/aion-2.0":{"id":"aion-labs/aion-2.0","name":"AionLabs: Aion-2.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-21","last_updated":"2025-12-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.8,"output":1.6,"cache_read":0.2},"canonical_model_id":"aion-labs/aion-2.0"},"aion-labs/aion-3.0-mini":{"id":"aion-labs/aion-3.0-mini","name":"AionLabs: Aion-3.0-Mini","description":"Aion-3.0 Mini is a multi-model roleplaying and storytelling system from AionLabs, built on the DeepSeek family of models. It uses a collaborative generation process in which multiple specialized models each...","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18},"canonical_model_id":"aion-labs/aion-3.0-mini"},"aion-labs/aion-rp-llama-3.1-8b":{"id":"aion-labs/aion-rp-llama-3.1-8b","name":"AionLabs: Aion-RP 1.0 (8B)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2025-02-04","last_updated":"2025-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.8,"output":1.6},"canonical_model_id":"aion-labs/aion-rp-llama-3.1-8b"},"aion-labs/aion-3.5":{"id":"aion-labs/aion-3.5","name":"AionLabs: Aion 3.5","description":"Aion 3.5 is a multi-model roleplaying and storytelling system from AionLabs, built on the GLM family of models. It uses a collaborative generation process in which multiple specialized models each...","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75}},"anthracite-org/magnum-v4-72b":{"id":"anthracite-org/magnum-v4-72b","name":"Magnum v4 72B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":4096},"cost":{"input":2.5,"output":5,"cache_read":2.5},"canonical_model_id":"anthracite-org/magnum-v4-72b"},"baidu/ernie-5.5-flash-preview:free":{"id":"baidu/ernie-5.5-flash-preview:free","name":"Baidu: ERNIE-5.5-Flash-Preview (free)","description":"ERNIE 5.5 Flash Preview is the latest foundation model in the ERNIE family, with comprehensive improvements in coding, agentic capabilities, knowledge work, and deep research. It has 280 billion total...","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"output":921600},"cost":{"input":0,"output":0}},"baidu/ernie-light-dt-1.0-intl":{"id":"baidu/ernie-light-dt-1.0-intl","name":"Baidu: ERNIE-Light-DT-1.0","description":"ERNIE-Light-DT-1.0 is based on open-source GLM models and includes research findings from Baidu Search's Lightning large model. It features Baidu Sparse Attention (BSA), a unique sparse attention mechanism developed by...","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"output":131072},"cost":{"input":1.13,"output":3.94,"cache_read":0.113}},"amazon/nova-pro-v1":{"id":"amazon/nova-pro-v1","name":"Amazon: Nova Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.8,"output":3.2},"canonical_model_id":"amazon/nova-pro-v1"},"amazon/nova-premier-v1":{"id":"amazon/nova-premier-v1","name":"Amazon: Nova Premier 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2025-04-30","last_updated":"2025-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"status":"deprecated","cost":{"input":2.5,"output":12.5,"cache_read":0.625},"canonical_model_id":"amazon/nova-premier"},"amazon/nova-2-lite-v1":{"id":"amazon/nova-2-lite-v1","name":"Amazon: Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"amazon/nova-2-lite-v1"},"amazon/nova-lite-v1":{"id":"amazon/nova-lite-v1","name":"Amazon: Nova Lite 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.06,"output":0.24},"canonical_model_id":"amazon/nova-lite-v1"},"amazon/nova-micro-v1":{"id":"amazon/nova-micro-v1","name":"Amazon: Nova Micro 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":5120},"cost":{"input":0.035,"output":0.14},"canonical_model_id":"amazon/nova-micro-v1"},"meituan/longcat-2.0":{"id":"meituan/longcat-2.0","name":"Meituan: LongCat 2.0","description":"LongCat 2.0 is a sparse mixture-of-experts language model from Meituan, with 48B active parameters out of 1.6T total. It is suited for coding, repository-level changes, long-horizon problem solving, and agentic...","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048756,"output":262144},"cost":{"input":0.75,"output":3,"cache_read":0.015},"canonical_model_id":"meituan/longcat-2.0"},"particle-ai/particle-1":{"id":"particle-ai/particle-1","name":"Particle AI: Particle-1","description":"Particle-1 is a token-efficient agentic coding model from Particle AI, post-trained on DeepSeek V4.1 Flash. It is suited for software engineering work such as terminal workflows, codebase changes, and data...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-28","last_updated":"2026-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.05,"output":0.5,"cache_read":0.003}},"perplexity/sonar-pro":{"id":"perplexity/sonar-pro","name":"Perplexity: Sonar Pro","description":"Advanced Sonar search model for deeper research and cited synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8000},"cost":{"input":3,"output":15}},"perplexity/sonar":{"id":"perplexity/sonar","name":"Perplexity: Sonar","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-01-27","last_updated":"2025-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":127072,"output":114364},"cost":{"input":1,"output":1}},"perplexity/sonar-reasoning-pro":{"id":"perplexity/sonar-reasoning-pro","name":"Perplexity: Sonar Reasoning Pro","description":"Web-grounded reasoning model for multi-step research and cited answers","family":"sonar-reasoning","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":115200},"cost":{"input":2,"output":8}},"perplexity/sonar-deep-research":{"id":"perplexity/sonar-deep-research","name":"Perplexity: Sonar Deep Research","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar-deep-research","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":115200},"cost":{"input":2,"output":8,"reasoning":3}},"perplexity/sonar-pro-search":{"id":"perplexity/sonar-pro-search","name":"Perplexity: Sonar Pro Search","description":"Advanced Sonar search model for deeper research and cited synthesis","family":"sonar-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-10-30","last_updated":"2025-10-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8000},"cost":{"input":3,"output":15}},"rekaai/reka-flash-3":{"id":"rekaai/reka-flash-3","name":"Reka Flash 3","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"reka","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":58982},"cost":{"input":0.1,"output":0.2},"canonical_model_id":"rekaai/reka-flash-3"},"rekaai/reka-edge":{"id":"rekaai/reka-edge","name":"Reka Edge","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":14745},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"rekaai/reka-edge"},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"Grok 4.5 is SpaceXAI's smartest model with frontier performance on coding, knowledge work, and STEM.","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":900000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"Grok 4.7 is SpaceXAI's smartest model with frontier performance on coding, knowledge work, and STEM.","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":0},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.20":{"id":"x-ai/grok-4.20","name":"SpaceXAI: Grok 4.20","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1800000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2}},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"Grok 4.6 is SpaceXAI's smartest model with frontier performance on coding, knowledge work, and STEM.","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Grok coding model for agentic engineering, edits, and codebase workflows","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":230400},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"x-ai/grok-4.20-multi-agent":{"id":"x-ai/grok-4.20-multi-agent","name":"SpaceXAI: Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1800000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2}},"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.5,"output":2.15,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek-chat-v3-0324":{"id":"deepseek/deepseek-chat-v3-0324","name":"DeepSeek V3 0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":115200},"cost":{"input":0.29,"output":1.14,"cache_read":0.11},"canonical_model_id":"deepseek/deepseek-chat-v3-0324"},"deepseek/deepseek-v3.2-exp":{"id":"deepseek/deepseek-v3.2-exp","name":"DeepSeek: DeepSeek V3.2 Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":147456},"cost":{"input":0.27,"output":0.41}},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro 0813 is a large-scale mixture-of-experts model from DeepSeek. This is the GA release of DeepSeek V4 Pro.","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash is a sparse mixture-of-experts model from DeepSeek, and the cost-efficient tier of the V4.1 family. DeepSeek reports that it exceeds V4 Pro on performance, speed, and task...","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":384000},"cost":{"input":1.6,"output":3.2,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v3.1-terminus":{"id":"deepseek/deepseek-v3.1-terminus","name":"DeepSeek: DeepSeek V3.1 Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":147456},"cost":{"input":0.27,"output":1}},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"DeepSeek V4 Flash Vision Exp is an experimental vision-enabled version of [DeepSeek V4 Flash 0731](https://openrouter.ai/deepseek/deepseek-v4-flash-0731) from DeepSeek, adding image understanding while matching the base model on text capabilities including agents,...","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":943717},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0.32,"output":0.89},"canonical_model_id":"deepseek/deepseek-chat"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.09,"output":0.18,"cache_read":0.018},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-chat-v3.1":{"id":"deepseek/deepseek-chat-v3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.25,"output":0.95,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-chat-v3.1"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"DeepSeek V4 Flash 0731 is a sparse mixture-of-experts model from DeepSeek, with 13B active parameters out of 284B total. This re-post-trained revision is suited for coding, reasoning, and agent workflows.","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.44,"output":1.32,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"DeepSeek V4.1 Flash 1017 is the October 17, 2026 snapshot of DeepSeek V4.1 Flash, served by DeepSeek under the `deepseek-flash` API model name. V4.1 Flash is a sparse mixture-of-experts model...","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"inclusionai/ling-3.0-flash-vl":{"id":"inclusionai/ling-3.0-flash-vl","name":"inclusionAI: Ling 3.0 Flash VL","description":"Ling 3.0 Flash VL builds on Ling 3.0 Flash (124B total / 5.5B active MoE from InclusionAI), further strengthening its language capabilities while adding native visual perception and advanced visual...","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"inclusionai/ling-3.0-tiny":{"id":"inclusionai/ling-3.0-tiny","name":"inclusionAI: Ling 3.0 Tiny","description":"Ling 3.0 Tiny is a mixture-of-experts model from InclusionAI, with 1.3B active parameters out of 7.9B total. It is designed for responsive agents, instruction following, and multi-turn conversations, with switchable...","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":250000},"cost":{"input":0.015,"output":0.045,"cache_read":0.003}},"inclusionai/ling-3.0-flash":{"id":"inclusionai/ling-3.0-flash","name":"inclusionAI: Ling 3.0 Flash","description":"*Ling-3.0-flash* is a *124B-parameter Mixture-of-Experts (MoE) model*, with approximately *5.1B parameters activated per token*. The model is designed with *token efficiency and production-scale agentic inference* as key priorities, enabling developers...","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash"},"inclusionai/ling-3.1-flash":{"id":"inclusionai/ling-3.1-flash","name":"inclusionAI: Ling 3.1 Flash","description":"Ling 3.1 Flash is a hybrid reasoning mixture-of-experts model from inclusionAI, with 25B active parameters out of 560B total.","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.3,"output":0.9,"cache_read":0.06},"canonical_model_id":"inclusionai/ling-3.1-flash"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"status":"deprecated","cost":{"input":0.15,"output":1.25,"reasoning":1.25,"cache_read":0.015,"cache_write":0.041667},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.1-flash-lite-image":{"id":"google/gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image) is Google's fastest, most cost-efficient Gemini image model, built for high-velocity developer pipelines and rapid-fire visual exploration. It delivers text-to-image generation...","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Gemini 3.8 Flash is Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows.","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.1-flash-image-preview":{"id":"google/gemini-3.1-flash-image-preview","type":"image","name":"Nano Banana 2 Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Google: Gemini 4 Carbon","description":"Gemini 4 Carbon is a frontier Gemini 4 model from Google for coding, agentic and complex reasoning work. It takes text, image, audio, video and file input, supports long decode...","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875},"canonical_model_id":"google/gemini-4-carbon"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.08,"output":0.16},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-2-27b-it":{"id":"google/gemma-2-27b-it","name":"Gemma 2 27B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-07-13","last_updated":"2024-07-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"cost":{"input":0.65,"output":0.65},"canonical_model_id":"google/gemma-2-27b-it"},"google/lyria-3-pro-preview":{"id":"google/lyria-3-pro-preview","name":"Lyria 3 Pro Preview","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-pro-preview"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.625,"output":5,"reasoning":5,"cache_read":0.0625,"cache_write":0.1875},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":4.5,"reasoning":4.5,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Gemini 3.6 Flash is a high-efficiency model from Google for coding, agentic workflows, and web and app development. It is designed to produce polished outputs with fewer unnecessary edits and...","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.375,"output":1.875,"reasoning":1.875,"cache_read":0.0375,"cache_write":0.020833},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-flash-image":{"id":"google/gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Gemini 3.1 Flash Image, a.k.a. \"Nano Banana 2,\" is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced...","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.04,"output":0.05,"cache_read":0.02},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1,"output":6,"reasoning":6,"cache_read":0.1,"cache_write":0.1875},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.125,"output":0.75,"reasoning":0.75,"cache_read":0.0125,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"status":"deprecated","cost":{"input":0.05,"output":0.2,"reasoning":0.2,"cache_read":0.005,"cache_write":0.041667},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Gemini 4 Argon is Google's flagship reasoning model, built for complex software engineering, deep mathematical and scientific problem solving, and autonomous multi-step agents. Google trained it to keep context across...","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-2.5-pro-preview":{"id":"google/gemini-2.5-pro-preview","name":"Gemini 2.5 Pro Preview 06-05","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["pdf","image","text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.625,"output":5,"reasoning":5,"cache_read":0.0625,"cache_write":0.1875},"canonical_model_id":"google/gemini-2.5-pro-preview"},"google/gemini-3.1-flash-lite-preview":{"id":"google/gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.125,"output":0.75,"reasoning":0.75,"cache_read":0.0125,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"google/gemini-3-pro-image-preview":{"id":"google/gemini-3-pro-image-preview","type":"image","name":"Nano Banana Pro Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":1,"output":6,"reasoning":6,"cache_read":0.1,"cache_write":0.1875},"canonical_model_id":"google/gemini-3-pro-image-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Gemini 3.5 Flash Lite is a high-efficiency model from Google with upgraded agentic capabilities. It is suited for subagents that execute focused tasks within complex, multi-agent workflows.","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.15,"output":1.25,"reasoning":1.25,"cache_read":0.015,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.1,"output":0.34,"cache_read":0.1},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.041667},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-2.5-flash-image":{"id":"google/gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":128000},"cost":{"input":0.015,"output":0.045,"cache_read":0.007},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-omni-1.2-flash":{"id":"google/gemini-omni-1.2-flash","type":"video","name":"Google: Gemini Omni 1.2 Flash","description":"Gemini Omni 1.2 Flash is Google's native multimodal video generation and editing model, the successor to Gemini Omni 1.1 Flash. It generates clips up to 15 seconds long with native...","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image","video","pdf"],"output":["text","video"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-1.2-flash"},"google/gemini-3-pro-image":{"id":"google/gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro is Google’s most advanced image-generation and editing model, built on Gemini 3 Pro. It extends the original Nano Banana with significantly improved multimodal reasoning, real-world grounding, and...","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3-pro-image"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.04,"output":0.12},"canonical_model_id":"google/gemma-3-12b-it"},"google/gemini-omni-1.1-flash":{"id":"google/gemini-omni-1.1-flash","type":"video","name":"Google: Gemini Omni 1.1 Flash","description":"Gemini Omni 1.1 Flash is Google's native multimodal video generation and editing model, the generally available successor to Gemini Omni Flash Preview. It is suited for text-to-video, image-to-video, first and...","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video","pdf"],"output":["text","video"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-1.1-flash"},"google/lyria-3-clip-preview":{"id":"google/lyria-3-clip-preview","name":"Lyria 3 Clip Preview","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-clip-preview"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"Gemini 3.7 Flash is a multimodal model from Google for fast agentic workflows, coding, and complex multi-step reasoning. It is designed for tasks that require responsive performance and reliable multi-step...","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.7-flash"},"google/gemini-nano-banana-2.1":{"id":"google/gemini-nano-banana-2.1","type":"image","name":"Nano Banana 2.1","description":"Nano Banana 2.1 (Gemini Nano Banana 2.1) is Google's image generation and editing model on the Flash tier, succeeding Nano Banana 2 and Nano Banana Pro. It improves product recontextualization,...","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["image","text","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"google/gemini-nano-banana-2.1"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.325,"output":1.95,"cache_write":0.40625},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen-2.5-72b-instruct":{"id":"qwen/qwen-2.5-72b-instruct","name":"Qwen2.5 72B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"cost":{"input":0.36,"output":0.4}},"qwen/qwen3-coder-30b-a3b-instruct":{"id":"qwen/qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"qwen/qwen3-30b-a3b":{"id":"qwen/qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.21,"output":1.9,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen2.5-vl-72b-instruct":{"id":"qwen/qwen2.5-vl-72b-instruct","name":"Qwen: Qwen2.5 VL 72B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-26","last_updated":"2025-01-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":115200},"cost":{"input":0.8,"output":1,"cache_read":0.4},"canonical_model_id":"alibaba/qwen2-5-vl-72b-instruct"},"qwen/qwen3-235b-a22b-thinking-2507":{"id":"qwen/qwen3-235b-a22b-thinking-2507","name":"Qwen: Qwen3 235B A22B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.45,"output":3.5},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"qwen/qwen3.8-omni-flash":{"id":"qwen/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen3.8 Omni Flash is an omni-modal reasoning model from Alibaba, the first Qwen model built around agentic capabilities with native audio-video understanding. It is suited for audio-video analysis and summarization,...","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen/qwen3-vl-8b-instruct":{"id":"qwen/qwen3-vl-8b-instruct","name":"Qwen: Qwen3 VL 8B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.25,"output":0.75,"cache_read":0.12}},"qwen/qwen3-coder":{"id":"qwen/qwen3-coder","name":"Qwen: Qwen3 Coder 480B A35B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":1,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"qwen/qwen3-14b":{"id":"qwen/qwen3-14b","name":"Qwen: Qwen3 14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":40960,"output":36864},"cost":{"input":0.1,"output":0.22}},"qwen/qwen3-vl-30b-a3b-thinking":{"id":"qwen/qwen3-vl-30b-a3b-thinking","name":"Qwen: Qwen3 VL 30B A3B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.29,"output":1}},"qwen/qwen3-vl-30b-a3b-instruct":{"id":"qwen/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Qwen3.8 27B is an open-weight dense vision-language model from Qwen. It is suited for coding, professional workflows, research, multimodal interaction, and long-running agent tasks, with flexible thinking that can be...","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.425,"output":2.55,"cache_read":0.085,"cache_write":0.53125},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.26,"output":0.78,"cache_read":0.052,"cache_write":0.325},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen3.8 Flash is a multimodal reasoning model from Alibaba. It is suited for coding assistance, agentic workflows, visual understanding, document and codebase analysis, desktop interaction, chart analysis, and long-video analysis.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3-30b-a3b-instruct-2507":{"id":"qwen/qwen3-30b-a3b-instruct-2507","name":"Qwen: Qwen3 30B A3B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3.5-flash-02-23":{"id":"qwen/qwen3.5-flash-02-23","name":"Qwen: Qwen3.5-Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-25","last_updated":"2026-02-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.065,"output":0.26}},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.39,"output":2.34},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":40960},"status":"deprecated","cost":{"input":0.04,"output":0.06,"cache_read":0.036},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3.8-max-prime":{"id":"qwen/qwen3.8-max-prime","name":"Qwen 3.8 Max Prime","description":"Qwen3.8 Max Prime is a higher-throughput variant of Qwen3.8 Max from Alibaba's Qwen team, served as a separate SKU at a higher price point. It accepts text, image, and video...","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":4,"output":12,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.8-max-prime"},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"Qwen3.8 Max 0902 is an updated snapshot of Qwen3.8 Max from Alibaba's Qwen team. It is a 2.4-trillion-parameter mixture-of-experts model that accepts text, image, and video input and returns text,...","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3-235b-a22b-2507":{"id":"qwen/qwen3-235b-a22b-2507","name":"Qwen: Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.14,"output":0.8,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.1625,"output":1.3},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Qwen3.7-Plus is a cost-effective model in Alibaba's Qwen3.7 series. It supports text and image input with text output, building on the series' text capabilities with a comprehensive upgrade to its...","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.32,"output":1.28,"cache_read":0.064,"cache_write":0.4},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.475,"output":4.425,"cache_read":0.295,"cache_write":1.84375},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1875,"output":1.125,"cache_write":0.234375},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Qwen3.7 Flash is a vision-language reasoning model from Alibaba. It is suited for multimodal agents, visual coding, search, and computer interaction, with strengths in object recognition, spatial understanding, and real-world...","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen3.5-plus-02-15":{"id":"qwen/qwen3.5-plus-02-15","name":"Qwen: Qwen3.5 Plus 2026-02-15","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.26,"output":1.56}},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.45,"output":2.7},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.1,"output":0.9,"cache_read":0.025},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.12,"output":0.8,"cache_read":0.07},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen3-next-80b-a3b-instruct":{"id":"qwen/qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.09,"output":1.1},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen/qwen3-32b":{"id":"qwen/qwen3-32b","name":"Qwen3 32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.08,"output":0.28},"canonical_model_id":"alibaba/qwen3-32b"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.195,"output":1.56},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.195,"output":0.975,"cache_read":0.039,"cache_write":0.24375},"canonical_model_id":"alibaba/qwen3-coder-flash"},"qwen/qwen3.5-plus-20260420":{"id":"qwen/qwen3.5-plus-20260420","name":"Qwen: Qwen3.5 Plus 2026-04-20","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.8,"cache_write":0.375}},"qwen/qwen-2.5-coder-32b-instruct":{"id":"qwen/qwen-2.5-coder-32b-instruct","name":"Qwen2.5 Coder 32B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.66,"output":1},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.26,"output":2.08},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"~deepseek/deepseek-pro-latest":{"id":"~deepseek/deepseek-pro-latest","name":"DeepSeek: DeepSeek Pro Latest","description":"This model always redirects to the latest model in the DeepSeek Pro family.","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-14","last_updated":"2026-09-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":393216},"cost":{"input":0.0999,"output":8,"cache_read":0.0999}},"~deepseek/deepseek-flash-latest":{"id":"~deepseek/deepseek-flash-latest","name":"DeepSeek: DeepSeek Flash Latest","description":"This model always redirects to the latest model in the DeepSeek Flash family.","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-14","last_updated":"2026-09-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.022,"output":0.4,"cache_read":0.004}},"~deepseek/deepseek-v4-flash-latest":{"id":"~deepseek/deepseek-v4-flash-latest","name":"DeepSeek: DeepSeek V4 Flash Latest","description":"This model always redirects to the latest model in the DeepSeek V4 Flash family.","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-01","last_updated":"2026-08-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0434,"output":0.3,"cache_read":0.035}},"bytedance/ui-tars-1.5-7b":{"id":"bytedance/ui-tars-1.5-7b","name":"ByteDance: UI-TARS 7B ","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":2048},"cost":{"input":0.1,"output":0.2,"cache_read":0.1}},"~moonshotai/kimi-latest":{"id":"~moonshotai/kimi-latest","name":"MoonshotAI: Kimi Latest","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1824,"output":11.0055,"cache_read":0.18}},"kt/midm-k-3.0-pro":{"id":"kt/midm-k-3.0-pro","name":"KT: Mi:dm K 3.0 Pro","description":"Mi:dm K 3.0 Pro is a Mixture-of-Experts reasoning model from KT, with 120B total and 12B active parameters. It uses a hybrid architecture that mixes Mamba, MoE and attention layers.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":261795,"output":235615},"cost":{"input":0.2,"output":0.8,"cache_read":0.04}},"nousresearch/hermes-4-405b":{"id":"nousresearch/hermes-4-405b","name":"Nous: Hermes 4 405B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":1,"output":3,"cache_read":0.2},"canonical_model_id":"nousresearch/hermes-4-405b"},"~unbiased/pareto-latest":{"id":"~unbiased/pareto-latest","name":"Pareto Latest","description":"This model always redirects to the latest model in the Pareto family.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"~google/gemini-pro-latest":{"id":"~google/gemini-pro-latest","name":"Google: Gemini Pro Latest","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["audio","pdf","image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875}},"~google/gemini-flash-latest":{"id":"~google/gemini-flash-latest","name":"Google: Gemini Flash Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667}},"thedrummer/unslopnemo-12b":{"id":"thedrummer/unslopnemo-12b","name":"TheDrummer: UnslopNemo 12B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-11-08","last_updated":"2024-11-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":819200},"cost":{"input":0.4,"output":0.4},"canonical_model_id":"thedrummer/unslopnemo-12b"},"thedrummer/cydonia-24b-v4.1":{"id":"thedrummer/cydonia-24b-v4.1","name":"TheDrummer: Cydonia 24B V4.1","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-09-27","last_updated":"2025-09-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.3,"output":0.5,"cache_read":0.15},"canonical_model_id":"thedrummer/cydonia-24b-v4.1"},"thedrummer/skyfall-36b-v2":{"id":"thedrummer/skyfall-36b-v2","name":"TheDrummer: Skyfall 36B V2","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.55,"output":0.8,"cache_read":0.25},"canonical_model_id":"thedrummer/skyfall-36b-v2"},"tencent/hy-mt2-7b":{"id":"tencent/hy-mt2-7b","name":"Hy-MT2-7B","description":"Hy-MT2-7B is a 7B-parameter translation model from Tencent. It supports 33 language pairs and five Chinese dialect and minority-language pairs, with workflows for structured, delimiter-based, contextual, glossary-based, and style-guided translation.","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.074,"output":0.295},"canonical_model_id":"tencent/hy-mt2-7b"},"tencent/hy-mt2-30b-a3b":{"id":"tencent/hy-mt2-30b-a3b","name":"Hy-MT2-30B-A3B","description":"Hy-MT2-30B-A3B is Tencent's flagship translation model in the Hy-MT2 family. It supports 33 language pairs and five Chinese dialect and minority-language pairs, with workflows for structured, delimiter-based, contextual, glossary-based, and...","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.074,"output":0.295},"canonical_model_id":"tencent/hy-mt2-30b-a3b"},"tencent/hunyuan-a13b-instruct":{"id":"tencent/hunyuan-a13b-instruct","name":"Tencent: Hunyuan A13B Instruct","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-08","last_updated":"2025-07-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":117964},"cost":{"input":0.14,"output":0.57}},"tencent/hy4":{"id":"tencent/hy4","name":"Tencent: Hy4","description":"The official release of Hy4 delivers comprehensive and substantial improvements over Hy4 Preview, with particularly strong gains in agentic capabilities and performance across a wide range of long-horizon, real-world productivity...","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Hy3 is a 295B-parameter Mixture-of-Experts model from Tencent (21B active, 192 experts with top-8 routing) built for reasoning, agentic workflows, and real-world production use. It supports a configurable reasoning effort:...","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":128000},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"Tencent: Hy4 preview is a mixture-of-experts model from Tencent, with 49B active parameters out of 770B total. It is designed for coding agents, complex tool-use workflows, and productivity tasks that...","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"tencent/hy-mt2-1.8b":{"id":"tencent/hy-mt2-1.8b","name":"Hy-MT2-1.8B","description":"Hy-MT2-1.8B is a compact 1.8B-parameter translation model from Tencent. It supports 33 language pairs and five Chinese dialect and minority-language pairs, with workflows for structured, delimiter-based, contextual, glossary-based, and style-guided...","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.044,"output":0.177},"canonical_model_id":"tencent/hy-mt2-1.8b"},"tencent/hy3-preview":{"id":"tencent/hy3-preview","name":"Hy3 preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.18,"output":0.6,"cache_read":0.06},"canonical_model_id":"tencent/hy3-preview"},"mistralai/voxtral-small-24b-2507":{"id":"mistralai/voxtral-small-24b-2507","name":"Voxtral Small 24B 2507","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":26214},"cost":{"input":0.1,"output":0.3,"cache_read":0.01},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"mistralai/mistral-large-4-0":{"id":"mistralai/mistral-large-4-0","name":"Mistral: Mistral Large 4","description":"Mistral Large 4 is a frontier multimodal (text and image input) model from Mistral AI built for reasoning, coding, and agentic workloads. It offers a 512K-token context window with up...","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"cost":{"input":0.7,"output":2.1,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"mistralai/codestral-2508":{"id":"mistralai/codestral-2508","name":"Codestral 25.08","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":204800},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-2508"},"mistralai/mistral-small-3.1-24b-instruct":{"id":"mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":102400},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"mistral/mistral-small-3.1-24b-instruct"},"mistralai/mixtral-8x22b-instruct":{"id":"mistralai/mixtral-8x22b-instruct","name":"Mixtral 8x22B Instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-01-31","release_date":"2024-04-17","last_updated":"2024-04-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":52428},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mixtral-8x22b-instruct"},"mistralai/mistral-medium-3-5":{"id":"mistralai/mistral-medium-3-5","name":"Mistral Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistralai/mistral-large-2512":{"id":"mistralai/mistral-large-2512","name":"Mistral Large 3","description":"Mistral Large 3 2512 is Mistral’s most capable model to date, featuring a sparse mixture-of-experts architecture with 41B active parameters (675B total), and released under the Apache 2.0 license.","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistralai/ministral-3b-2512":{"id":"mistralai/ministral-3b-2512","name":"Ministral 3 3B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":0.1,"output":0.1,"cache_read":0.01},"canonical_model_id":"mistral/ministral-3b-2512"},"mistralai/ministral-8b-2512":{"id":"mistralai/ministral-8b-2512","name":"Ministral 3 8B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.15,"output":0.15,"cache_read":0.015},"canonical_model_id":"mistral/ministral-8b-2512"},"mistralai/mistral-large-2407":{"id":"mistralai/mistral-large-2407","name":"Mistral Large 2407","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large-2407"},"mistralai/mistral-small-24b-instruct-2501":{"id":"mistralai/mistral-small-24b-instruct-2501","name":"Mistral Small 3","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.05,"output":0.08},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"mistralai/mistral-small-3.2-24b-instruct":{"id":"mistralai/mistral-small-3.2-24b-instruct","name":"Mistral Small 3.2 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":26214},"cost":{"input":0.1,"output":0.3,"cache_read":0.01},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"mistralai/mistral-medium-3.1":{"id":"mistralai/mistral-medium-3.1","name":"Mistral Medium 3.1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-30","release_date":"2025-08-12","last_updated":"2025-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-3.1"},"mistralai/mistral-small-2603":{"id":"mistralai/mistral-small-2603","name":"Mistral Small 4","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/mistral-nemo":{"id":"mistralai/mistral-nemo","name":"Mistral Nemo","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.15,"output":0.15,"cache_read":0.015},"canonical_model_id":"mistral/mistral-nemo"},"mistralai/devstral-2512":{"id":"mistralai/devstral-2512","name":"Devstral 2","description":"Devstral 2 is a state-of-the-art open-source model by Mistral AI specializing in agentic coding. It is a 123B-parameter dense transformer model supporting a 256K context window. Devstral 2 supports exploring...","family":"devstral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/devstral-2512"},"mistralai/mistral-saba":{"id":"mistralai/mistral-saba","name":"Saba","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-02-17","last_updated":"2025-02-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":26214},"cost":{"input":0.2,"output":0.6,"cache_read":0.02},"canonical_model_id":"mistral/mistral-saba"},"mistralai/mistral-large":{"id":"mistralai/mistral-large","name":"Mistral Large","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11-30","release_date":"2024-02-26","last_updated":"2024-02-26","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":102400},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large"},"mistralai/mistral-medium-3":{"id":"mistralai/mistral-medium-3","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-3"},"mistralai/ministral-14b-2512":{"id":"mistralai/ministral-14b-2512","name":"Ministral 3 14B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.2,"output":0.2,"cache_read":0.02},"canonical_model_id":"mistral/ministral-14b-2512"},"microsoft/phi-4":{"id":"microsoft/phi-4","name":"Microsoft: Phi 4","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-01-10","last_updated":"2025-01-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":14745},"cost":{"input":0.056,"output":0.112}},"kilo-auto/small":{"id":"kilo-auto/small","name":"Auto Small","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"1970-01-01","last_updated":"1970-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.05,"output":0.4,"reasoning":0,"cache_read":0.005}},"kilo-auto/balanced":{"id":"kilo-auto/balanced","name":"Auto Balanced","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"1970-01-01","last_updated":"1970-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.325,"output":1.95,"reasoning":0,"cache_read":0.0325,"cache_write":0.40625}},"kilo-auto/free":{"id":"kilo-auto/free","name":"Auto Free","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"1970-01-01","last_updated":"1970-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32768},"cost":{"input":0,"output":0,"reasoning":0,"cache_read":0,"cache_write":0}},"kilo-auto/frontier":{"id":"kilo-auto/frontier","name":"Auto Frontier","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"1970-01-01","last_updated":"1970-01-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"reasoning":0,"cache_read":0.5,"cache_write":6.25}},"kilo-auto/efficient":{"id":"kilo-auto/efficient","name":"Auto Efficient","description":"Routes each request to the cheapest model that gets the job done, based on continuously benchmarked accuracy and cost.","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"1970-01-01","last_updated":"1970-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.325,"output":1.95,"reasoning":0,"cache_read":0.0325,"cache_write":0.40625}},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"MoonshotAI: Kimi K3.1 Pro","description":"Kimi K3.1 Pro is Moonshot AI's flagship open-weight multimodal reasoning model and a post-trained successor to Kimi K3, with a 1M-token context window. It is built for long-horizon coding, 3D...","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.2375,"output":8.4085,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.65,"output":3.41,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 Instruct 0905","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Kimi K3 is a 2.8T parameter open-weight multimodal reasoning model from Moonshot AI. It is suited for complex coding, knowledge work, and long-horizon agentic workflows, and is particularly strong at...","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2":{"id":"moonshotai/kimi-k2","name":"Kimi K2 0711","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12-31","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"MoonshotAI: Kimi K2.7 Code is a coding-focused model in Moonshot AI's Kimi K2 family, built to complete end-to-end programming tasks reliably over long contexts. It uses a native multimodal mixture-of-experts...","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.6,"output":3.5,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"perceptron/perceptron-mk1":{"id":"perceptron/perceptron-mk1","name":"Perceptron: Perceptron Mk1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":0.15,"output":1.5},"canonical_model_id":"perceptron/perceptron-mk1"},"perceptron/perceptron-mk1.5":{"id":"perceptron/perceptron-mk1.5","name":"Perceptron: Perceptron Mk1.5","description":"Perceptron Mk1.5 is Perceptron's embodied reasoning model for physical agents. It accepts text, image, video, and audio input, and answers with text plus optional structured annotations: points, boxes, polygons, tracks,...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":36864,"output":8192},"cost":{"input":0.15,"output":1.5}},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":942818},"cost":{"input":0.1,"output":0.4,"cache_read":0.03},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-6-sol-pro":{"id":"openai/gpt-6-sol-pro","name":"OpenAI: GPT-6 Sol Pro","description":"GPT-6 Sol Pro is the same underlying model as [GPT-6 Sol](https://openrouter.ai/openai/gpt-6-sol), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5}},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-5-image":{"id":"openai/gpt-5-image","type":"image","name":"GPT-5 Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-10-01","release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["image","text","pdf"],"output":["image","text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":10,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-5-image"},"openai/gpt-5.6-terra-pro":{"id":"openai/gpt-5.6-terra-pro","name":"GPT-5.6 Terra","description":"GPT-5.6 Terra Pro is the same underlying model as [GPT-5.6 Terra](https://openrouter.ai/openai/gpt-5.6-terra), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-chat-latest":{"id":"openai/gpt-chat-latest","name":"OpenAI: GPT Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5}},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"GPT-5.6 Sol is the flagship model in OpenAI's GPT-5.6 series. It is suited for complex reasoning, coding, and agentic workflows, and is particularly strong at command-line and multi-step coding tasks...","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"OpenAI: GPT-6.1 Terra","description":"GPT-6.1 Terra is the mid-tier model in OpenAI's GPT-6.1 series, built for fast, capable computer use at a lower price than GPT-6.1 Sol. It reads what is on screen, takes...","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna-pro":{"id":"openai/gpt-6-luna-pro","name":"OpenAI: GPT-6 Luna Pro","description":"GPT-6 Luna Pro is the same underlying model as [GPT-6 Luna](https://openrouter.ai/openai/gpt-6-luna), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125}},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"GPT-6 Luna is the fast, cost-efficient model in OpenAI's GPT-6 series, positioned below GPT-6 Sol. It is suited for high-volume and latency-sensitive workloads such as chat, classification, and lightweight agentic...","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-3.5-turbo-16k":{"id":"openai/gpt-3.5-turbo-16k","name":"OpenAI: GPT-3.5 Turbo 16k","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2023-08-28","last_updated":"2023-08-28","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"cost":{"input":3,"output":4}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.018,"output":0.09,"cache_read":0.009},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-6-astra-pro":{"id":"openai/gpt-6-astra-pro","name":"OpenAI: GPT-6 Astra Pro ($$$$)","description":"GPT-6 Astra Pro is the same underlying model as [GPT-6 Astra](https://openrouter.ai/openai/gpt-6-astra), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"openai/gpt-audio":{"id":"openai/gpt-audio","type":"chat","name":"GPT-Audio","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","audio","pdf"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10},"canonical_model_id":"openai/gpt-audio"},"openai/gpt-4":{"id":"openai/gpt-4","name":"GPT-4","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":4096},"cost":{"input":30,"output":60},"canonical_model_id":"openai/gpt-4"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6.1-sol-pro":{"id":"openai/gpt-6.1-sol-pro","name":"OpenAI: GPT-6.1 Sol Pro","description":"GPT-6.1 Sol Pro is the same underlying model as [GPT-6.1 Sol](https://openrouter.ai/openai/gpt-6.1-sol), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. **Cost note:** pro mode spends far more...","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"GPT-6 Sol is the cost-efficient high-end model in OpenAI's GPT-6 series, positioned below the flagship GPT-6 Astra and above the fast GPT-6 Luna tier. It is suited for demanding professional...","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-4o-mini-2024-07-18":{"id":"openai/gpt-4o-mini-2024-07-18","name":"OpenAI: GPT-4o-mini (2024-07-18)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-4o-2024-05-13":{"id":"openai/gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":5,"output":15},"canonical_model_id":"openai/gpt-4o-2024-05-13"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's flagship model for demanding end-to-end work. It is suited for advanced analysis, software engineering, deep research, scientific work, and document creation, with particular strengths in long-horizon...","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna-pro":{"id":"openai/gpt-5.6-luna-pro","name":"GPT-5.6 Luna","description":"GPT-5.6 Luna Pro is the same underlying model as [GPT-5.6 Luna](https://openrouter.ai/openai/gpt-5.6-luna), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"GPT-5.6 Luna is a fast, cost-efficient model in OpenAI's GPT-5.6 series. It is suited for high-volume, latency-sensitive tasks such as chat, classification, and lightweight agentic workflows, providing capable reasoning for...","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"GPT-6.1 Sol is an upgrade to GPT-6 Sol from OpenAI, positioned below the flagship GPT-6 Astra in the GPT-6 series. It is suited for agentic coding, computer use, document-heavy professional...","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-6.1-terra-pro":{"id":"openai/gpt-6.1-terra-pro","name":"OpenAI: GPT-6.1 Terra Pro","description":"GPT-6.1 Terra Pro is the same underlying model as [GPT-6.1 Terra](https://openrouter.ai/openai/gpt-6.1-terra), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. **Cost note:** pro mode spends far more...","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25}},"openai/gpt-audio-mini":{"id":"openai/gpt-audio-mini","type":"chat","name":"GPT-Audio Mini","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","audio","pdf"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.6,"output":2.4},"canonical_model_id":"openai/gpt-audio-mini"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-image-2":{"id":"openai/gpt-5.4-image-2","type":"image","name":"GPT-5.4 Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":false,"structured_output":true,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["image","text","pdf"],"output":["image","text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":8,"output":15,"cache_read":2},"canonical_model_id":"openai/gpt-5.4-image-2"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3-pro","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","pdf","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-3.5-turbo-0613":{"id":"openai/gpt-3.5-turbo-0613","name":"OpenAI: GPT-3.5 Turbo (older v0613)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":4095,"output":3685},"cost":{"input":1,"output":2}},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.03,"output":0.15,"cache_read":0.015},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"GPT-5.6 Terra is a balanced model in OpenAI's GPT-5.6 series, positioned between the flagship Sol tier and the cost-efficient Luna tier. It is suited for everyday coding, reasoning, and agentic...","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5-image-mini":{"id":"openai/gpt-5-image-mini","type":"image","name":"GPT-5 Image Mini","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-10-16","last_updated":"2025-10-16","modalities":{"input":["pdf","image","text"],"output":["image","text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":2.5,"output":2,"cache_read":0.25},"canonical_model_id":"openai/gpt-5-image-mini"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-5.6-sol-pro":{"id":"openai/gpt-5.6-sol-pro","name":"GPT-5.6 Sol","description":"GPT-5.6 Sol Pro is the same underlying model as [GPT-5.6 Sol](https://openrouter.ai/openai/gpt-5.6-sol), served with `reasoning.mode` set to `pro` for higher-quality responses on complex tasks. Learn more in OpenAI's docs: https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"elorian/glimpse":{"id":"elorian/glimpse","name":"Elorian: Glimpse","description":"Glimpse is a multimodal visual reasoning model from Elorian, built for visual understanding and complex visual reasoning in the physical world. It reasons directly over images and video rather than...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":256000},"cost":{"input":0.6,"output":3,"cache_read":0.06}},"cognitivecomputations/dolphin-mistral-24b-venice-edition":{"id":"cognitivecomputations/dolphin-mistral-24b-venice-edition","name":"Venice: Uncensored","description":"Venice Uncensored Dolphin Mistral 24B Venice Edition is a fine-tuned variant of Mistral-Small-24B-Instruct-2501, developed by dphn.ai in collaboration with Venice.ai. This model is designed as an “uncensored” instruct-tuned LLM, preserving...","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.2,"output":0.9},"canonical_model_id":"cognitivecomputations/dolphin-mistral-24b-venice-edition"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-r-plus-08-2024"},"cohere/command-r7b-12-2024":{"id":"cohere/command-r7b-12-2024","name":"Command R7B","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-12-2024"},"cohere/command-a-plus":{"id":"cohere/command-a-plus","name":"Cohere: Command A+","description":"Command A+ is Cohere's flagship model for enterprise agentic workflows. It accepts text and image inputs with a 192K context window, supports native tool calling with strict tool schemas, structured...","family":"command-a","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04-01","release_date":"2026-05-20","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":192000,"output":64000},"cost":{"input":0.3,"output":1.5,"cache_read":0.15},"canonical_model_id":"cohere/command-a-plus-05-2026"},"cohere/command-r-08-2024":{"id":"cohere/command-r-08-2024","name":"Command R","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"cohere/command-r-08-2024"},"cohere/command-a":{"id":"cohere/command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a"},"cohere/north-mini-code:free":{"id":"cohere/north-mini-code:free","name":"Cohere: North Mini Code (free)","description":"North Mini Code is Cohere's first agentic coding model and the debut of its North family. A sparse mixture-of-experts model with 30B total parameters and 3B active, it is optimized...","family":"north","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09-23","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0,"output":0},"canonical_model_id":"cohere/north-mini-code-1-0"},"ricursiveai/ripple-65b-preview":{"id":"ricursiveai/ripple-65b-preview","name":"Ricursive: Ripple 65B Preview","description":"Ripple-65B-Preview by ricursiveAI, a 65B model with native tool calling, served in BF16.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.025}},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"MiMo-V2.6-Pro is the flagship foundation model developed by Xiaomi. Built at a scale of over 1T parameters, it is designed to push the ceiling of capability for the most demanding...","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.004},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-pro-ultraspeed":{"id":"xiaomi/mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","description":"MiMo-V2.6-Pro-UltraSpeed is the fast speed edition of Xiaomi's flagship foundation model, MiMo-V2.6-Pro. Built from the same 1T MiMo-V2.6-Pro checkpoint, it matches the original model in quality while delivering roughly 10x...","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo-V2.6-Flash is an open-source foundation model developed by Xiaomi. Built on a Mixture-of-Experts architecture with 309B total parameters and 15B activated per token, it employs a hybrid attention mechanism for...","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"status":"deprecated","cost":{"input":0.4,"output":2,"cache_read":0.08,"tiers":[{"input":0.8,"output":4,"cache_read":0.16,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.8,"output":4,"cache_read":0.16}},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"status":"deprecated","cost":{"input":0.435,"output":0.87,"cache_read":0.0036,"tiers":[{"input":2,"output":6,"cache_read":0.4,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.4}},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"ibm-granite/granite-4.2-8b":{"id":"ibm-granite/granite-4.2-8b","name":"IBM: Granite 4.2 8B","description":"Granite 4.2 8B is a dense reasoning model from IBM. It is suited for mathematics, code generation, multilingual dialogue, and agentic workflows that need multi-step reasoning. It supports full, low-effort,...","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.06,"output":0.15,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"mancer/weaver":{"id":"mancer/weaver","name":"Mancer: Weaver (alpha)","description":"An attempt to recreate Claude-style verbosity, but don't expect the same level of coherence or memory. Meant for use in roleplay/narrative situations.","family":"alpha","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-08-02","last_updated":"2023-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":6000},"cost":{"input":0.3,"output":0.5,"cache_read":0.3},"canonical_model_id":"mancer/weaver"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.27,"output":1.08,"cache_read":0.027},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax: MiniMax M3.1 Flash","description":"MiniMax-M3.1-Flash is a multimodal model from MiniMax. Compared with M3, it delivers significant improvements across multiple benchmarks, particularly in complex agentic tasks, coding, and cybersecurity. It is built for complex,...","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":176947},"cost":{"input":0.21,"output":0.84,"cache_read":0.042},"canonical_model_id":"minimax/MiniMax-M2.7"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Inkling Small is an open-weight multimodal mixture-of-experts model from Thinking Machines Lab, with 12B active parameters out of 276B total. It is positioned as the smaller, more efficient member of...","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":262144},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling-2-small:free":{"id":"thinkingmachines/inkling-2-small:free","name":"Thinking Machines: Inkling 2 Small (free)","description":"Inkling 2 Small is a multimodal mixture-of-experts reasoning model from Thinking Machines Lab, with 17B active parameters out of 594B total. It is the first model in the second Inkling...","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"thinkingmachines/inkling-2-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Inkling is an open-weight multimodal mixture-of-experts model from Thinking Machines Lab, with 41B active parameters out of 975B total. It is designed for general-purpose reasoning, coding, agentic and tool-use systems,...","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":471859},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"reflection/beam-1.0-501b-a23b":{"id":"reflection/beam-1.0-501b-a23b","name":"Reflection: Beam 1.0 501B A23B","description":"Beam 1.0 is Reflection's open-weight reasoning model for coding and long-horizon agentic workflows. It uses a sparse mixture-of-experts architecture with 501B total and 23B active parameters per token, and a...","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.25,"output":1,"cache_read":0.05},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"upstage/solar-pro4":{"id":"upstage/solar-pro4","name":"Upstage: Solar Pro 4","description":"Solar Pro 4 is a large language model from Upstage. It is suited for agentic workflows, office productivity, document-intensive work, and coding.","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"upstage/solar-pro4"},"upstage/solar-mini4":{"id":"upstage/solar-mini4","name":"Upstage: Solar Mini 4","description":"Solar Mini 4 is Upstage's compact, cost-efficient language model, a 35B-parameter mixture-of-experts with 3B active parameters and a 524K context window. It is built for agentic use cases where response...","family":"solar-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"upstage/solar-mini4"},"prism-ml/ternary-bonsai-2-27b":{"id":"prism-ml/ternary-bonsai-2-27b","name":"PrismML: Ternary Bonsai 2 27B","description":"Bonsai 2 27B is a 27B-parameter reasoning model from PrismML derived from Qwen3.8-27B. It supports coding, mathematics, tool calling, and image understanding with a 262K-token context window. Ternary compression shrinks...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.075,"output":0.5,"cache_read":0.0375}},"prism-ml/ternary-bonsai-2-9b":{"id":"prism-ml/ternary-bonsai-2-9b","name":"PrismML: Ternary Bonsai 2 9B","description":"Ternary Bonsai 2 9B is PrismML’s compact, open-weight language model for conversational AI, reasoning, and tool use. Built on Qwen3.5, it uses ternary weights packed into 2 bits for efficient...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.08,"output":0.13,"cache_read":0.04}},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It is designed to keep track of information across extended tasks, work through...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-wonder":{"id":"meta/muse-wonder","name":"Meta: Muse Wonder","description":"Muse Wonder is a frontier reasoning model from Meta, designed for complex personal and professional agentic tasks. It accepts text, images, video, audio, and PDF documents and returns text, with...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":4,"output":20,"cache_read":0.2}},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark 1.1 is a multimodal reasoning model from Meta, built for agentic tasks. It accepts text, images, video, audio, and PDF documents and returns text, with a 1M-token context...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Meta: Muse Spark 1.2 Contributor","description":"Muse Spark 1.2 contributor tier is a reasoning model from Meta designed for developers who want to start building at an even lower cost. It’s meaningfully cheaper than Muse Spark...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-08-21","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is a coding-optimized open-weight model. Trained specifically for agentic coding workflows, it delivers higher first-attempt accuracy, reliable tool calling, and deep codebase understanding across the repos developers...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/muse-ember":{"id":"meta/muse-ember","name":"Meta: Muse Ember","description":"Muse Ember is the smallest and most efficient model from Meta that’s designed for complex reasoning execution and the work agents repeat all day: tool calls, coding agent subtasks, routing,...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.5,"cache_read":0.004}},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer 30B is a dense, open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark and optimized for autonomous agents on consumer hardware. It is suited for long-horizon...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.3,"output":1.2,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a reasoning model from Meta, designed for complex agentic tasks. It accepts text, images, video, audio, and PDF documents, returns text, and offers a 1M-token context...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.3-contributor":{"id":"meta/muse-spark-1.3-contributor","name":"Meta: Muse Spark 1.3 Contributor","description":"Muse Spark 1.3 Contributor is the cost-efficient contributor tier of Meta’s multimodal reasoning model for experimentation, learning, and early-stage agentic, multi-agent, and coding workflows. It is designed to track information...","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"~openai/gpt-terra-latest":{"id":"~openai/gpt-terra-latest","name":"OpenAI: GPT Terra Latest","description":"This model always redirects to the latest model in the OpenAI GPT Terra family.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25}},"~openai/gpt-mini-latest":{"id":"~openai/gpt-mini-latest","name":"OpenAI: GPT Mini Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075}},"~openai/gpt-sol-latest":{"id":"~openai/gpt-sol-latest","name":"OpenAI: GPT Sol Latest","description":"This model always redirects to the latest model in the OpenAI GPT Sol family.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"~openai/gpt-luna-latest":{"id":"~openai/gpt-luna-latest","name":"OpenAI: GPT Luna Latest","description":"This model always redirects to the latest model in the OpenAI GPT Luna family.","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125}},"~openai/gpt-astra-latest":{"id":"~openai/gpt-astra-latest","name":"OpenAI: GPT Astra Latest ($$$$)","description":"This model always redirects to the latest model in the OpenAI GPT Astra family.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"Step 5 Preview is StepFun's flagship model for agentic work, built on a sparse Mixture-of-Experts architecture (27B active / 600B total parameters). It performs strongly in software engineering and professional...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":64000},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/step-3.7-flash":{"id":"stepfun/step-3.7-flash","name":"Step 3.7 Flash","description":"Step 3.7 Flash is StepFun's latest high-efficiency multimodal Mixture-of-Experts model. It pairs a 196B-parameter language backbone with a vision encoder for native image and video understanding, activating roughly 11B parameters...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":230400},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"stepfun/step-3.5-flash":{"id":"stepfun/step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"stepfun/step-3.5-flash"},"fireworks/ember-1":{"id":"fireworks/ember-1","name":"Fireworks: Ember-1","description":"Ember-1 is a specialized reasoning model from Fireworks Research, built on [Kimi K3](https://openrouter.ai/moonshotai/kimi-k3). It is designed to make every token go further: it produces shorter reasoning traces, using roughly 40%...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"undi95/remm-slerp-l2-13b":{"id":"undi95/remm-slerp-l2-13b","name":"ReMM SLERP 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-07-22","last_updated":"2023-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":6144,"output":5529},"cost":{"input":0.3,"output":0.5,"cache_read":0.2},"canonical_model_id":"undi95/remm-slerp-l2-13b"},"openrouter/pareto-code":{"id":"openrouter/pareto-code","name":"Pareto Code Router","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-05-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":65536},"cost":{"input":0,"output":0}},"openrouter/free":{"id":"openrouter/free","name":"OpenRouter Free Models Router","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-01","last_updated":"2026-02-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32768},"cost":{"input":0,"output":0}},"openrouter/auto":{"id":"openrouter/auto","name":"Auto Router","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-15","last_updated":"2026-03-15","modalities":{"input":["audio","image","pdf","text","video"],"output":["image","text"]},"open_weights":false,"limit":{"context":2000000,"output":32768},"cost":{"input":0,"output":0}},"openrouter/bodybuilder":{"id":"openrouter/bodybuilder","name":"Body Builder (beta)","description":"Preview model for early access evaluation, prototyping, and compatibility testing","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-03-15","last_updated":"2026-03-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"status":"beta","cost":{"input":0,"output":0}},"~z-ai/glm-latest":{"id":"~z-ai/glm-latest","name":"Z.ai: GLM Latest","description":"This model always redirects to the latest GLM model from Z.ai.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-19","last_updated":"2026-08-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0699,"output":1.4,"cache_read":0.0689}},"~z-ai/glm-flash-latest":{"id":"~z-ai/glm-flash-latest","name":"Z.ai: GLM Flash Latest","description":"This model always redirects to the latest model in the GLM Flash family.","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.0399,"output":0.0784,"cache_read":0.03}},"dots-studio/dots-3-note-preview:free":{"id":"dots-studio/dots-3-note-preview:free","name":"Dots Studio: Dots3-Note Preview (free)","description":"Dots3-Note Preview is an open-weight mixture-of-experts model from Dots Studio, with 16B active parameters out of 280B total. It is the lightest model in the Dots 3 family and is...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":512000,"output":460800},"cost":{"input":0,"output":0}},"unbiased/pareto-26.10-preview":{"id":"unbiased/pareto-26.10-preview","name":"Pareto 26.10 Preview","description":"Pareto is a multimodal composite model built for research, coding, and agentic workflows, while delivering frontier-level performance across a broad range of general-purpose tasks. This is a preview of the...","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"unbiased/pareto-26.10":{"id":"unbiased/pareto-26.10","name":"Pareto 26.10","description":"Pareto is a multimodal composite model built for research, coding, and agentic workflows, while delivering frontier-level performance across a broad range of general-purpose tasks.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"unbiased/pareto-26.9":{"id":"unbiased/pareto-26.9","name":"Pareto 26.9","description":"Pareto is a multimodal composite model built for research, coding, and agentic workflows, while delivering frontier-level performance across a broad range of general-purpose tasks.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25}},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-4.6v":{"id":"z-ai/glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.055},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5.3-flashx-legal":{"id":"z-ai/glm-5.3-flashx-legal","name":"Z.ai: GLM 5.3 FlashX Legal","description":"GLM-5.3-FlashX-Legal (GLM-Legal) is Z.ai's legal-domain variant of GLM-5.3-FlashX, a native multimodal model that accepts text, image, and video input and produces text. It adds legal-domain mid-training and post-training with reinforcement...","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"z-ai/glm-4.5":{"id":"z-ai/glm-4.5","name":"GLM-4.5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"GLM-5.3 is a large-scale reasoning model from Z.ai, built for complex software engineering and long-horizon agent tasks. It supports text input and output with a 1M-token context window, and improves...","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"GLM-5.3-Flash is a native multimodal model from Z.ai. It is suited for efficient coding and long-horizon agent tasks. Its hybrid sparse and linear attention architecture maintains accurate long-context behavior while...","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM-5-Turbo","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-4.5-air":{"id":"z-ai/glm-4.5-air","name":"GLM-4.5-Air","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM-4.6","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.5,"output":2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-4.5v":{"id":"z-ai/glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"z-ai/glm-5.3-flashx":{"id":"z-ai/glm-5.3-flashx","name":"Z.ai: GLM 5.3 FlashX","description":"GLM-5.3-FlashX is the high-speed variant of Z.ai's GLM-5.3-Flash, a native multimodal model delivering inference speeds of up to 200 tokens/s. Built on the same hybrid sparse and linear attention architecture...","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"z-ai/glm-5.3-prime":{"id":"z-ai/glm-5.3-prime","name":"Z.ai: GLM 5.3 Prime","description":"GLM-5.3-Prime is the high-speed variant of Z.ai's GLM-5.3, inheriting its full capabilities while delivering 1.5–2× the output throughput through inference acceleration. It supports text input and output with a 1M-token...","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.8,"output":8.8,"cache_read":0.56}},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-4.7-flash":{"id":"z-ai/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.0605,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"meta-llama/llama-3.2-3b-instruct":{"id":"meta-llama/llama-3.2-3b-instruct","name":"Meta: Llama 3.2 3B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.05,"output":0.33},"canonical_model_id":"meta/llama-3.2-3b-instruct"},"meta-llama/llama-guard-4-12b":{"id":"meta-llama/llama-guard-4-12b","name":"Meta: Llama Guard 4 12B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0.144,"output":0.144},"canonical_model_id":"meta/llama-guard-4-12b"},"meta-llama/llama-4-maverick":{"id":"meta-llama/llama-4-maverick","name":"Meta: Llama 4 Maverick","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":32768},"cost":{"input":0.35,"output":1,"cache_read":0.17},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/llama-3.1-8b-instruct":{"id":"meta-llama/llama-3.1-8b-instruct","name":"Llama-3.1-8B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.02,"output":0.04},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/llama-3.1-70b-instruct":{"id":"meta-llama/llama-3.1-70b-instruct","name":"Llama-3.1-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"meta-llama/llama-3.3-70b-instruct":{"id":"meta-llama/llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":115200},"cost":{"input":0.1,"output":0.32},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta-llama/llama-4-scout":{"id":"meta-llama/llama-4-scout","name":"Meta: Llama 4 Scout","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"output":16384},"cost":{"input":0.08,"output":0.24},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"meta-llama/llama-3.2-1b-instruct":{"id":"meta-llama/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":60000,"output":54000},"cost":{"input":0.027,"output":0.201},"canonical_model_id":"meta/llama-3.2-1b-instruct"},"liquid/lfm-3-1.7b":{"id":"liquid/lfm-3-1.7b","name":"LiquidAI: LFM3-1.7B","description":"A compact 1.7B-parameter text model with a 256K-token context, post-trained for agents, tool calling, and structured outputs. It reasons before it answers. Prompts and outputs may be retained and used...","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":8192},"cost":{"input":0.08,"output":0.2,"cache_read":0.02}},"liquid/lfm-2.5-24b-a2b":{"id":"liquid/lfm-2.5-24b-a2b","name":"LiquidAI: LFM2.5-24B-A2B","description":"LFM2.5-24B-A2B is a mixture-of-experts reasoning model from Liquid AI with 24B total and 2.45B active parameters. It always reasons before answering and is built for agents that call tools. Liquid...","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.05,"output":0.7,"cache_read":0.025}},"liquid/lfm-2.5-2.6b":{"id":"liquid/lfm-2.5-2.6b","name":"LiquidAI: LFM2.5-2.6B (retires Nov 13)","description":"LFM2.5-2.6B is a compact reasoning model from Liquid AI. It is suited for agent workflows, data extraction, RAG, and long-context processing. Liquid advises against using it for agentic coding or...","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.35,"output":0.5,"cache_read":0.04}},"liquid/lfm-3-1.7b:free":{"id":"liquid/lfm-3-1.7b:free","name":"LiquidAI: LFM3-1.7B (free)","description":"A compact 1.7B-parameter text model with a 256K-token context, post-trained for agents, tool calling, and structured outputs. It reasons before it answers. Prompts and outputs may be retained and used...","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":8192},"cost":{"input":0,"output":0}},"nex-agi/nex-n2.5-pro":{"id":"nex-agi/nex-n2.5-pro","name":"Nex AGI: Nex-N2.5-Pro","description":"Nex-N2.5 is an agentic model built to turn goals into working, verified outcomes. Its core strength is agentic coding within a visual feedback loop: it can explore codebases, implement multi-file...","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.075,"output":0.25,"cache_read":0.015}},"nex-agi/nex-n2.5-mini":{"id":"nex-agi/nex-n2.5-mini","name":"Nex AGI: Nex-N2.5-Mini","description":"Nex-N2.5 is an agentic model built to turn goals into working, verified outcomes. Its core strength is agentic coding within a visual feedback loop: it can explore codebases, implement multi-file...","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.025,"output":0.1,"cache_read":0.0025}},"nex-agi/nex-n2.6":{"id":"nex-agi/nex-n2.6","name":"Nex AGI: Nex-N2.6","description":"Nex-N2.6 is an agentic model from Nex AGI, built on [GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash-BF16) with about 321B parameters. It is suited for computer use, coding, and long-horizon tasks that involve tools. Compared with...","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.15,"output":0.5,"cache_read":0.03}},"moondream/moondream3-preview":{"id":"moondream/moondream3-preview","name":"Moondream: Moondream 3 Preview","description":"Moondream 3 Preview is a vision-language model from Moondream with 9B total parameters and 2B active (mixture-of-experts). It handles visual question answering, captioning, OCR, and visual reasoning over images, with...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"moondream/moondream3.1-9b-a2b":{"id":"moondream/moondream3.1-9b-a2b","name":"Moondream: Moondream 3.1","description":"Moondream 3.1 is a vision-language model from Moondream, the successor to Moondream 3 Preview, with 9B total parameters and 2B active (mixture-of-experts). It handles visual question answering, captioning, OCR, and...","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"~x-ai/grok-latest":{"id":"~x-ai/grok-latest","name":"xAI: Grok Latest","description":"This model always redirects to the latest Grok model from xAI.","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":0}},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free":{"id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free","name":"NVIDIA: Nemotron 3 Nano Omni (free)","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"NVIDIA Nemotron 3 Ultra is an open frontier-reasoning and orchestration model from NVIDIA, with 55B active parameters out of 550B total (MoE). Built on a hybrid Transformer-Mamba mixture-of-experts architecture, it...","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":182520},"cost":{"input":0.4,"output":1.76,"cache_read":0.08},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.06,"output":0.24,"cache_read":0.012},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/nemotron-3.5-super-vl":{"id":"nvidia/nemotron-3.5-super-vl","name":"NVIDIA: Nemotron 3.5 Super VL","description":"NVIDIA Nemotron 3.5 Super VL is an open multimodal mixture-of-experts model from NVIDIA, with 12B active parameters out of 120B total. It takes text, images, documents, GUI screenshots, and video...","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.06,"output":0.35,"cache_read":0.01},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-super-vl:free":{"id":"nvidia/nemotron-3.5-super-vl:free","name":"NVIDIA: Nemotron 3.5 Super VL (free)","description":"NVIDIA Nemotron 3.5 Super VL is an open multimodal mixture-of-experts model from NVIDIA, with 12B active parameters out of 120B total. It takes text, images, documents, GUI screenshots, and video... **Terms of service** For NVIDIA free endpoints (Super/Ultra/etc): Trial use only - do not submit personal or confidential data. Your use is logged for security purposes and to improve NVIDIA products and services. The logged session data for improvement purposes is not linked to your identity or any persistent identifier. For more information about our data processing practices, see our [Privacy Policy](https://www.nvidia.com/en-us/about-nvidia/privacy-policy/). By interacting with this endpoint, you consent to our collection, recording, and use of such information and the [NVIDIA API Trial Terms of Service](https://assets.ngc.nvidia.com/products/api-catalog/legal/NVIDIA%20API%20Trial%20Terms%20of%20Service.pdf).","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-lightning":{"id":"nvidia/nemotron-3.5-lightning","name":"Nemotron 3.5 Lightning 30B A3B","description":"NVIDIA Nemotron 3.5 Lightning is an open mixture-of-experts model from NVIDIA, with 3B active parameters out of 30B total. It is suited for high-throughput agentic workloads and specialized tasks that...","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.025,"output":0.12,"cache_read":0.0125},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3.5-lightning:free":{"id":"nvidia/nemotron-3.5-lightning:free","name":"NVIDIA: Nemotron 3.5 Lightning (free)","description":"NVIDIA Nemotron 3.5 Lightning is an open mixture-of-experts model from NVIDIA, with 3B active parameters out of 30B total. It is suited for high-throughput agentic workloads and specialized tasks that... **Terms of service** For NVIDIA free endpoints (Super/Ultra/etc): Trial use only - do not submit personal or confidential data. Your use is logged for security purposes and to improve NVIDIA products and services. The logged session data for improvement purposes is not linked to your identity or any persistent identifier. For more information about our data processing practices, see our [Privacy Policy](https://www.nvidia.com/en-us/about-nvidia/privacy-policy/). By interacting with this endpoint, you consent to our collection, recording, and use of such information and the [NVIDIA API Trial Terms of Service](https://assets.ngc.nvidia.com/products/api-catalog/legal/NVIDIA%20API%20Trial%20Terms%20of%20Service.pdf).","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3-ultra-550b-a55b:free":{"id":"nvidia/nemotron-3-ultra-550b-a55b:free","name":"NVIDIA: Nemotron 3 Ultra (free)","description":"NVIDIA Nemotron 3 Ultra is an open frontier-reasoning and orchestration model from NVIDIA, with 55B active parameters out of 550B total (MoE). Built on a hybrid Transformer-Mamba mixture-of-experts architecture, it... **Terms of service** For NVIDIA free endpoints (Super/Ultra/etc): Trial use only - do not submit personal or confidential data. Your use is logged for security purposes and to improve NVIDIA products and services. The logged session data for improvement purposes is not linked to your identity or any persistent identifier. For more information about our data processing practices, see our [Privacy Policy](https://www.nvidia.com/en-us/about-nvidia/privacy-policy/). By interacting with this endpoint, you consent to our collection, recording, and use of such information and the [NVIDIA API Trial Terms of Service](https://assets.ngc.nvidia.com/products/api-catalog/legal/NVIDIA%20API%20Trial%20Terms%20of%20Service.pdf).","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.075,"output":0.4},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/nemotron-3.5-content-safety":{"id":"nvidia/nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"NVIDIA Nemotron 3.5 Content Safety is a compact 4B-parameter multimodal guardrail model from NVIDIA, fine-tuned from Google Gemma-3-4B. It moderates both inputs to and responses from LLMs and VLMs, accepting...","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"stealth/glyph-cluster":{"id":"stealth/glyph-cluster","name":"Stealth: Glyph Cluster (free)","description":"Your prompts and completions may be retained and used to train or improve the provider's services. Glyph Cluster is a reasoning model for coding and long-context analysis, served through Vercel AI Gateway during its stealth period at no cost. It supports function calling and streaming, takes text input only, and does not support structured outputs. Zero Data Retention is not available for this model.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0,"output":0,"reasoning":0,"cache_read":0,"cache_write":0}},"~anthropic/claude-sonnet-latest":{"id":"~anthropic/claude-sonnet-latest","name":"Anthropic: Claude Sonnet Latest","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"~anthropic/claude-fable-latest":{"id":"~anthropic/claude-fable-latest","name":"Anthropic: Claude Fable Latest","description":"This model always redirects to the latest model in the Claude Fable family.","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10}},"~anthropic/claude-opus-latest":{"id":"~anthropic/claude-opus-latest","name":"Anthropic: Claude Opus Latest","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5}},"~anthropic/claude-haiku-latest":{"id":"~anthropic/claude-haiku-latest","name":"Anthropic: Claude Haiku Latest","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125}},"morph/morph-v3-large":{"id":"morph/morph-v3-large","name":"Morph: Morph V3 Large","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.9,"output":1.9},"canonical_model_id":"morph/morph-v3-large"},"morph/morph-v3-fast":{"id":"morph/morph-v3-fast","name":"Morph: Morph V3 Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.8,"output":1.2},"canonical_model_id":"morph/morph-v3-fast"},"gryphe/mythomax-l2-13b":{"id":"gryphe/mythomax-l2-13b","name":"MythoMax 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":3686},"cost":{"input":0.08,"output":0.11},"canonical_model_id":"gryphe/mythomax-l2-13b"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Fugu Max is the cost-performance model in Sakana AI's Fugu family. Rather than a single monolithic model, Fugu is a learned multi-agent orchestration system: a language model trained to route...","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v2":{"id":"sakana/fugu-ultra-v2","name":"Fugu Ultra v2","description":"Fugu Ultra v2 is the higher-performance model in Sakana AI's Fugu family. Rather than a single monolithic model, Fugu is a learned multi-agent orchestration system: a language model trained to...","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra-v2"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Fugu Ultra is the higher-performance model in Sakana AI's Fugu family. Rather than a single monolithic model, Fugu is a learned multi-agent orchestration system: a language model trained to route...","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"},"sakana/sakana-namazu":{"id":"sakana/sakana-namazu","name":"Sakana Namazu","description":"Sakana Namazu is a Japanese-specialized reasoning model from Sakana AI, based on Kimi K2.6 with additional training for Japanese language and business contexts. It is suited for Japanese instruction following,...","family":"sakana-namazu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.95,"output":4,"cache_read":0.15},"canonical_model_id":"sakana/sakana-namazu"},"scaledown/extract":{"id":"scaledown/extract","name":"ScaleDown: Extract","description":"Extract is a description-driven entity extraction model from ScaleDown. Instead of a fixed set of entity types, callers describe the fields they want in plain English through `provider.options.scaledown.entities`, and the...","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":900000},"cost":{"input":0.05,"output":0}},"scaledown/summarize":{"id":"scaledown/summarize","name":"ScaleDown: Summarize","description":"Summarize is an abstractive summarization model from ScaleDown. It condenses long text and documents into a fluent, faithful rewrite rather than lifting sentences from the source, and is suited for...","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":4000},"cost":{"input":0.05,"output":0}},"sao10k/l3-lunaris-8b":{"id":"sao10k/l3-lunaris-8b","name":"Sao10K: Llama 3 8B Lunaris","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-13","last_updated":"2024-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":7372},"cost":{"input":0.04,"output":0.05},"canonical_model_id":"sao10k/l3-lunaris-8b"},"sao10k/l3.1-euryale-70b":{"id":"sao10k/l3.1-euryale-70b","name":"Sao10K: Llama 3.1 Euryale 70B v2.2","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-28","last_updated":"2024-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.85,"output":0.85},"canonical_model_id":"sao10k/l3.1-euryale-70b"},"bytedance-seed/seed-2.0-mini":{"id":"bytedance-seed/seed-2.0-mini","name":"Seed 2.0 Mini","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"bytedance-seed/seed-2.0-lite":{"id":"bytedance-seed/seed-2.0-lite","name":"Seed 2.0 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.25,"output":2},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"bytedance-seed/seed-2-1-turbo":{"id":"bytedance-seed/seed-2-1-turbo","name":"ByteDance Seed: Seed 2.1 Turbo","description":"Seed 2.1 Turbo is a multimodal model from ByteDance Seed for coding and long-horizon agent workflows. It is suited for end-to-end software delivery, multi-step task execution, and understanding visual and...","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.5,"output":2.5},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"relace/relace-search":{"id":"relace/relace-search","name":"Relace: Relace Search","description":"Tool-capable chat model for instruction following and agentic application workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":1,"output":3},"canonical_model_id":"relace/relace-search"},"relace/relace-apply-3":{"id":"relace/relace-apply-3","name":"Relace: Relace Apply 3","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.85,"output":1.25},"canonical_model_id":"relace/relace-apply-3"},"motif-technologies/motif-3":{"id":"motif-technologies/motif-3","name":"Motif Technologies: Motif 3","description":"Motif 3 is a Mixture-of-Experts language model from Motif Technologies, with 314B total and 13.2B active parameters. It is a general-purpose multilingual model for English and Korean, particularly strong at...","family":"motif","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.3,"output":1.2,"cache_read":0.06}},"inference-net/schematron-v2-turbo":{"id":"inference-net/schematron-v2-turbo","name":"Inference.net: Schematron V2 Turbo","description":"Schematron V2 Turbo is a 3B-parameter HTML-to-JSON extraction model from Inference.net. It prioritizes throughput for high-volume extraction workloads. Extraction instructions must be supplied through a JSON schema in response_format rather...","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.03,"output":0.15,"cache_read":0.03},"canonical_model_id":"inference-net/schematron-v2-turbo"},"inference-net/schematron-v2-small":{"id":"inference-net/schematron-v2-small","name":"Inference.net: Schematron V2 Small","description":"Schematron V2 Small is a 3B-parameter HTML-to-JSON extraction model from Inference.net. It prioritizes extraction quality for complex schemas and long pages. Extraction instructions must be supplied through a JSON schema...","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.05,"output":0.23,"cache_read":0.05},"canonical_model_id":"inference-net/schematron-v2-small"}}},"lowrouter":{"id":"lowrouter","env":["LOWROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.lowrouter.ai/v1","name":"LowRouter","doc":"https://lowrouter.ai/docs/models/available","models":{"auto/mistralai/codestral-2508":{"id":"auto/mistralai/codestral-2508","name":"Codestral 25.08","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.3138,"output":0.9413,"cache_read":0.0314},"canonical_model_id":"mistral/codestral-2508"},"auto/mistralai/mistral-medium-3.5":{"id":"auto/mistralai/mistral-medium-3.5","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5688,"output":7.8442,"cache_read":0.1569},"canonical_model_id":"mistral/mistral-medium-2604"},"auto/mistralai/mistral-large-2512":{"id":"auto/mistralai/mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5229,"output":1.5688,"cache_read":0.0523},"canonical_model_id":"mistral/mistral-large-2512"},"auto/mistralai/ministral-3b-2512":{"id":"auto/mistralai/ministral-3b-2512","name":"Ministral 3 3B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1046,"output":0.1046,"cache_read":0.0105},"canonical_model_id":"mistral/ministral-3-3b-instruct-2512"},"auto/mistralai/ministral-8b-2512":{"id":"auto/mistralai/ministral-8b-2512","name":"Ministral 3 8B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1569,"output":0.1569,"cache_read":0.0157},"canonical_model_id":"mistral/ministral-3-8b-instruct-2512"},"auto/mistralai/mistral-small-2603":{"id":"auto/mistralai/mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.1569,"output":0.6275,"cache_read":0.0157},"canonical_model_id":"mistral/mistral-small-2603"},"auto/mistralai/mistral-large-4":{"id":"auto/mistralai/mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"status":"beta","cost":{"input":1.4367,"output":4.4156,"cache_read":0.1479},"canonical_model_id":"mistral/mistral-large-4"},"auto/mistralai/ministral-14b-2512":{"id":"auto/mistralai/ministral-14b-2512","name":"Ministral 3 14B","description":"Open vision-language model for efficient local deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2092,"output":0.2092,"cache_read":0.0209},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"auto/openai/gpt-oss-safeguard-120b":{"id":"auto/openai/gpt-oss-safeguard-120b","name":"GPT OSS Safeguard 120B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.18,"output":0.73},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"auto/openai/gpt-5.5":{"id":"auto/openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"auto/openai/gpt-5.2":{"id":"auto/openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"auto/openai/gpt-4.1-mini":{"id":"auto/openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"auto/openai/gpt-5.4-mini":{"id":"auto/openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"auto/openai/gpt-oss-safeguard-20b":{"id":"auto/openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.08,"output":0.24},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"auto/openai/gpt-5":{"id":"auto/openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"auto/openai/gpt-5.6-sol":{"id":"auto/openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"auto/openai/gpt-6.1-terra":{"id":"auto/openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"auto/openai/gpt-4.1":{"id":"auto/openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"auto/openai/o3":{"id":"auto/openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"auto/openai/gpt-6-luna":{"id":"auto/openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"auto/openai/gpt-oss-20b":{"id":"auto/openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.113,"output":0.4745},"canonical_model_id":"openai/gpt-oss-20b"},"auto/openai/gpt-6-sol":{"id":"auto/openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"auto/openai/gpt-6-astra":{"id":"auto/openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"auto/openai/gpt-5-mini":{"id":"auto/openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"auto/openai/gpt-5.6-luna":{"id":"auto/openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"auto/openai/gpt-6.1-sol":{"id":"auto/openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"auto/openai/gpt-5-nano":{"id":"auto/openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"auto/openai/gpt-5.4":{"id":"auto/openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"auto/openai/gpt-4o":{"id":"auto/openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"auto/openai/gpt-oss-120b":{"id":"auto/openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1695,"output":0.6779},"canonical_model_id":"openai/gpt-oss-120b"},"auto/openai/gpt-5.6-terra":{"id":"auto/openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"auto/openai/gpt-4o-mini":{"id":"auto/openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"}}},"alibaba-token-plan-cn":{"id":"alibaba-token-plan-cn","env":["ALIBABA_TOKEN_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1","name":"Alibaba Token Plan (China)","doc":"https://www.alibabacloud.com/help/zh/model-studio/token-plan-overview","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-plus"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"happyhorse-1.1-r2v":{"id":"happyhorse-1.1-r2v","type":"video","name":"HappyHorse 1.1 Reference-to-Video","description":"Video model for reference-guided video generation","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["image","text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.cn-beijing.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"qwen-image-2.0":{"id":"qwen-image-2.0","type":"image","name":"Qwen Image 2.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"input":196601,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M2.5"},"qwen-image-2.0-pro":{"id":"qwen-image-2.0-pro","type":"image","name":"Qwen Image 2.0 Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"happyhorse-1.1-i2v":{"id":"happyhorse-1.1-i2v","type":"video","name":"HappyHorse 1.1 Image-to-Video","description":"Video model for image-to-video generation","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["image","text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.cn-beijing.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-pro"},"qwen3.8-max-preview":{"id":"qwen3.8-max-preview","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"happyhorse-1.1-t2v":{"id":"happyhorse-1.1-t2v","type":"video","name":"HappyHorse 1.1 Text-to-Video","description":"Video model for prompt-driven text-to-video generation","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.cn-beijing.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-max"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-flash"},"wan2.7-image":{"id":"wan2.7-image","type":"image","name":"Wan2.7 Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-03","last_updated":"2025-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"status":"deprecated","cost":{"input":0,"output":0}},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-max"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"wan2.7-image-pro":{"id":"wan2.7-image-pro","type":"image","name":"Wan2.7 Image Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":16384},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"}}},"pendra":{"id":"pendra","env":["PENDRA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.pendra.ai/api/v1","name":"Pendra","doc":"https://pendra.ai/docs/integrations/opencode","models":{"llama3.3:70b":{"id":"llama3.3:70b","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"qwen3.6:27b":{"id":"qwen3.6:27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-27b"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen3-coder:30b":{"id":"qwen3-coder:30b","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"gpt-oss:120b":{"id":"gpt-oss:120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-oss-120b"},"glm-4.7-flash":{"id":"glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.7-flash"}}},"ollama-cloud":{"id":"ollama-cloud","env":["OLLAMA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://ollama.com/v1","name":"Ollama Cloud","doc":"https://docs.ollama.com/cloud","models":{"deepseek-v4.1-flash:1017":{"id":"deepseek-v4.1-flash:1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":976000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"mistral-large-3:675b":{"id":"mistral-large-3:675b","name":"mistral-large-3:675b","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"kimi-k2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"kimi-k3":{"id":"kimi-k3","name":"kimi-k3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"gemma4:31b":{"id":"gemma4:31b","name":"gemma4:31b","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.14,"output":0.4,"cache_read":0.05},"canonical_model_id":"google/gemma-4-31b-it"},"deepseek-v4-pro:0813":{"id":"deepseek-v4-pro:0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"nemotron-3-super":{"id":"nemotron-3-super","name":"nemotron-3-super","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.015,"output":0.6,"cache_read":0.015},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"deepseek-v4-pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-oss:20b":{"id":"gpt-oss:20b","name":"gpt-oss:20b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.3,"cache_read":0.035},"canonical_model_id":"openai/gpt-oss-20b"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"nemotron-3-ultra":{"id":"nemotron-3-ultra","name":"nemotron-3-ultra","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.1,"output":3,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"muse-spark-open":{"id":"muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"minimax-m3":{"id":"minimax-m3","name":"minimax-m3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"minimax/MiniMax-M3"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"kimi-k2.7-code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"beam":{"id":"beam","name":"Beam 1.0 501B A23B","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"minimax-m2.7":{"id":"minimax-m2.7","name":"minimax-m2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":196608},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"gpt-oss:120b":{"id":"gpt-oss:120b","name":"gpt-oss:120b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.014},"canonical_model_id":"openai/gpt-oss-120b"},"nemotron-3-nano:30b":{"id":"nemotron-3-nano:30b","name":"nemotron-3-nano:30b","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.06,"output":0.24},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"}}},"gmicloud":{"id":"gmicloud","env":["GMICLOUD_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.gmi-serving.com/v1","name":"GMI Cloud","doc":"https://docs.gmicloud.ai/inference-engine/api-reference/llm-api-reference","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":127999}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":409600,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":409600,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":409600,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.6,"output":2.4,"cache_read":0.12,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24}},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":384000},"cost":{"input":0.112,"output":0.224,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.392,"output":2.784,"cache_read":0.116},"canonical_model_id":"deepseek/deepseek-v4-pro"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.855,"output":3.6,"cache_read":0.144},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k2.7-code-highspeed":{"id":"moonshotai/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"Qwen/Qwen3.8-Flash":{"id":"Qwen/Qwen3.8-Flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048575,"output":131072},"cost":{"input":0.16,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"Qwen/Qwen3.7-Max":{"id":"Qwen/Qwen3.7-Max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"Qwen/Qwen3.8-Max":{"id":"Qwen/Qwen3.8-Max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"zai-org/GLM-5.1-FP8":{"id":"zai-org/GLM-5.1-FP8","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.98,"output":3.08,"cache_read":0.182},"canonical_model_id":"zhipuai/glm-5.1"},"zai-org/GLM-5.2-FP8":{"id":"zai-org/GLM-5.2-FP8","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.979,"output":3.08,"cache_read":0.182},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5-FP8":{"id":"zai-org/GLM-5-FP8","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.6,"output":1.92,"cache_read":0.12},"canonical_model_id":"zhipuai/glm-5"}}},"xiaomi-token-plan-cn":{"id":"xiaomi-token-plan-cn","env":["XIAOMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token-plan-cn.xiaomimimo.com/v1","name":"Xiaomi Token Plan (China)","doc":"https://platform.xiaomimimo.com/#/docs","models":{"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"mimo-v2.5-tts-voiceclone":{"id":"mimo-v2.5-tts-voiceclone","type":"speech","name":"MiMo-V2.5-TTS-VoiceClone","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voiceclone"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"mimo-v2.5-tts-voicedesign":{"id":"mimo-v2.5-tts-voicedesign","type":"speech","name":"MiMo-V2.5-TTS-VoiceDesign","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voicedesign"},"mimo-v2.5-tts":{"id":"mimo-v2.5-tts","type":"speech","name":"MiMo-V2.5-TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts"}}},"auriko":{"id":"auriko","env":["AURIKO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.auriko.ai/v1","name":"Auriko","doc":"https://docs.auriko.ai","models":{"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"minimax-m2-7":{"id":"minimax-m2-7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"minimax-m2-7-highspeed":{"id":"minimax-m2-7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"qwen-3.6-plus":{"id":"qwen-3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.1,"tiers":[{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5}},"canonical_model_id":"alibaba/qwen3.6-plus"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"}}},"perplexity":{"id":"perplexity","env":["PERPLEXITY_API_KEY"],"npm":"@ai-sdk/perplexity","name":"Perplexity","doc":"https://docs.perplexity.ai","models":{"sonar-pro":{"id":"sonar-pro","name":"Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"status":"deprecated","cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"sonar":{"id":"sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"sonar-reasoning-pro":{"id":"sonar-reasoning-pro","name":"Sonar Reasoning Pro","description":"Web-grounded Sonar for multi-step research questions that need cited reasoning","family":"sonar-reasoning","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":2,"output":8},"canonical_model_id":"perplexity/sonar-reasoning-pro"},"sonar-deep-research":{"id":"sonar-deep-research","name":"Perplexity Sonar Deep Research","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-02-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":2,"output":8,"reasoning":3},"canonical_model_id":"perplexity/sonar-deep-research"}}},"mistral":{"id":"mistral","env":["MISTRAL_API_KEY"],"npm":"@ai-sdk/mistral","name":"Mistral","doc":"https://docs.mistral.ai/getting-started/models/","models":{"mistral-large-4-0-8":{"id":"mistral-large-4-0-8","name":"Mistral Large 4.0.8","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"status":"beta","cost":{"input":0.7,"output":2.1,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"mistral-medium-2508":{"id":"mistral-medium-2508","name":"Mistral Medium 3.1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-08-12","last_updated":"2025-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2}},"codestral-2508":{"id":"codestral-2508","name":"Codestral 25.08","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-2508"},"voxtral-small-2507":{"id":"voxtral-small-2507","name":"Voxtral Small","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32000},"cost":{"input":0.1,"output":0.4}},"mistral-small-2506":{"id":"mistral-small-2506","name":"Mistral Small 3.2","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":0.1,"output":0.3}},"mistral-medium-2505":{"id":"mistral-medium-2505","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":0.4,"output":2}},"glm-5-2":{"id":"glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"labs-leanstral-1-5-1":{"id":"labs-leanstral-1-5-1","name":"Leanstral 1.5","description":"An updated Lean 4 formal proof engineering model optimised for automated theorem proving and autoformalization. 119B total parameters, 6.5B active.","family":"leanstral","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"status":"deprecated","cost":{"input":0,"output":0}},"ministral-3b-latest":{"id":"ministral-3b-latest","name":"Ministral 3B (latest)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-01","last_updated":"2024-10-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":128000},"cost":{"input":0.1,"output":0.1,"cache_read":0.01}},"mistral-large-2512":{"id":"mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5,"cache_read":0.05}},"ministral-3b-2512":{"id":"ministral-3b-2512","name":"Ministral 3 3B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":262144},"cost":{"input":0.1,"output":0.1,"cache_read":0.01},"canonical_model_id":"mistral/ministral-3-3b-instruct-2512"},"ministral-8b-2512":{"id":"ministral-8b-2512","name":"Ministral 3 8B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.15,"output":0.15,"cache_read":0.015},"canonical_model_id":"mistral/ministral-3-8b-instruct-2512"},"devstral-medium-latest":{"id":"devstral-medium-latest","name":"Devstral 2 (latest)","description":"Legacy model retained for compatibility with older integrations","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2}},"ministral-8b-latest":{"id":"ministral-8b-latest","name":"Ministral 8B (latest)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-01","last_updated":"2024-10-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.15,"output":0.15,"cache_read":0.015}},"mistral-small-2603":{"id":"mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015}},"magistral-medium-latest":{"id":"magistral-medium-latest","name":"Magistral Medium (latest)","description":"Mistral reasoning model for transparent analysis, math, and complex decisions","family":"magistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-03-17","last_updated":"2025-03-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":2,"output":5}},"zai-glm-5-2":{"id":"zai-glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"labs-devstral-small-2512":{"id":"labs-devstral-small-2512","name":"Devstral Small 2","description":"Legacy model retained for compatibility with older integrations","family":"devstral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"status":"deprecated","cost":{"input":0,"output":0}},"zai-glm-5-3":{"id":"zai-glm-5-3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"codestral-latest":{"id":"codestral-latest","name":"Codestral (latest)","description":"Mistral code model for completions, refactors, and developer IDE workflows","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-05-29","last_updated":"2025-01-04","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":0.3,"output":0.9,"cache_read":0.03}},"open-mistral-nemo":{"id":"open-mistral-nemo","name":"Open Mistral Nemo","description":"Legacy model retained for compatibility with older integrations","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"status":"deprecated","cost":{"input":0.15,"output":0.15}},"zai-glm-5-3-flash":{"id":"zai-glm-5-3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"voxtral-small-latest":{"id":"voxtral-small-latest","name":"Voxtral Small (latest)","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32000},"cost":{"input":0.1,"output":0.4}},"devstral-2512":{"id":"devstral-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2}},"mistral-small-latest":{"id":"mistral-small-latest","name":"Mistral Small (latest)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015}},"mistral-medium-latest":{"id":"mistral-medium-latest","name":"Mistral Medium (latest)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-latest"},"mistral-medium-2604":{"id":"mistral-medium-2604","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15}},"devstral-latest":{"id":"devstral-latest","name":"Devstral 2","description":"Legacy model retained for compatibility with older integrations","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2}},"deepseek-v4-1-flash-1017":{"id":"deepseek-v4-1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"mistral-embed":{"id":"mistral-embed","type":"embedding","name":"Mistral Embed","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"mistral-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":3072},"cost":{"input":0.1,"output":0}},"voxtral-mini-tts-latest":{"id":"voxtral-mini-tts-latest","type":"speech","name":"Voxtral Mini TTS (latest)","description":"Multilingual text-to-speech model with zero-shot voice cloning","family":"voxtral","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-23","last_updated":"2026-03-23","modalities":{"input":["text"],"output":["audio"]},"open_weights":true,"limit":{"context":0,"output":0}},"voxtral-mini-latest":{"id":"voxtral-mini-latest","type":"transcription","name":"Voxtral Mini (latest)","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-04","last_updated":"2026-02-04","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0}},"mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"status":"beta","cost":{"input":0.7,"output":2.1,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"ministral-14b-2512":{"id":"ministral-14b-2512","name":"Ministral 3 14B","description":"Open vision-language model for efficient local deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.2,"cache_read":0.02},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"pixtral-12b":{"id":"pixtral-12b","name":"Pixtral 12B","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2024-09-01","last_updated":"2024-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"status":"deprecated","cost":{"input":0.15,"output":0.15}},"mistral-large-latest":{"id":"mistral-large-latest","name":"Mistral Large (latest)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5,"cache_read":0.05}}}},"routing-run":{"id":"routing-run","env":["ROUTING_RUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.routing.run/v1","name":"routing.run","doc":"https://docs.routing.run/api-reference/models","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.8,"output":2.4},"canonical_model_id":"zhipuai/glm-5.2"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.275,"output":1.1},"canonical_model_id":"moonshotai/kimi-k2.6"},"glm-5.2-nitro":{"id":"glm-5.2-nitro","name":"GLM 5.2 Nitro","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.8,"output":2.4},"canonical_model_id":"zhipuai/glm-5.2"},"kimi-k2.6-nitro":{"id":"kimi-k2.6-nitro","name":"Kimi K2.6 Nitro","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.275,"output":1.1},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15},"canonical_model_id":"openai/gpt-5.6-sol"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32000},"cost":{"input":0.16,"output":0.48},"canonical_model_id":"alibaba/qwen3.5-9b"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.348,"output":0.696},"canonical_model_id":"deepseek/deepseek-v4-pro"},"nemotron-3-ultra":{"id":"nemotron-3-ultra","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32000},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"kimi-k2.7-code-nitro":{"id":"kimi-k2.7-code-nitro","name":"Kimi K2.7 Code Nitro","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.275,"output":1.1},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":32000},"cost":{"input":0.275,"output":1.1},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.112,"output":0.224},"canonical_model_id":"deepseek/deepseek-v4-flash"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":0.7,"output":4.2},"canonical_model_id":"openai/gpt-5.6-luna"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":1.5,"output":9},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-6"}}},"ovhcloud":{"id":"ovhcloud","env":["OVHCLOUD_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://oai.endpoints.kepler.ai.cloud.ovh.net/v1","name":"OVHcloud AI Endpoints","doc":"https://www.ovhcloud.com/en/public-cloud/ai-endpoints/catalog//","models":{"meta-llama-3_3-70b-instruct":{"id":"meta-llama-3_3-70b-instruct","name":"Meta-Llama-3_3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.74,"output":0.74},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"qwen2.5-vl-72b-instruct":{"id":"qwen2.5-vl-72b-instruct","name":"Qwen2.5-VL-72B-Instruct","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-26","last_updated":"2025-01-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":1.01,"output":1.01},"canonical_model_id":"alibaba/qwen2-5-vl-72b-instruct"},"qwen3guard-gen-8b":{"id":"qwen3guard-gen-8b","name":"Qwen3Guard-Gen-8B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-22","last_updated":"2026-01-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0,"output":0}},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8-27B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.47,"output":3.19},"canonical_model_id":"alibaba/qwen3.8-27b"},"mistral-small-3.2-24b-instruct-2506":{"id":"mistral-small-3.2-24b-instruct-2506","name":"Mistral-Small-3.2-24B-Instruct-2506","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.1,"output":0.31},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"gpt-oss-20b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.18},"canonical_model_id":"openai/gpt-oss-20b"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5-397B-A17B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.71,"output":4.25},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5-9B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.12,"output":0.18},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen3guard-gen-0.6b":{"id":"qwen3guard-gen-0.6b","name":"Qwen3Guard-Gen-0.6B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-22","last_updated":"2026-01-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0,"output":0}},"qwen3.6-27b":{"id":"qwen3.6-27b","name":"Qwen3.6-27B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.47,"output":3.19},"canonical_model_id":"alibaba/qwen3.6-27b"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"gpt-oss-120b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.09,"output":0.47},"canonical_model_id":"openai/gpt-oss-120b"}}},"fireworks-ai":{"id":"fireworks-ai","env":["FIREWORKS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.fireworks.ai/inference/v1/","name":"Fireworks AI","doc":"https://fireworks.ai/docs/","models":{"accounts/fireworks/models/glm-5p3-flash":{"id":"accounts/fireworks/models/glm-5p3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048573,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":0.1875,"output":0.625,"cache_read":0.0375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"accounts/fireworks/models/qwen3p8-max":{"id":"accounts/fireworks/models/qwen3p8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":3,"output":9,"cache_read":0.375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"accounts/fireworks/models/glm-5p3":{"id":"accounts/fireworks/models/glm-5p3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048573,"output":262144},"experimental":{"modes":{"priority":{"cost":{"input":1.75,"output":5.5,"cache_read":0.325},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"accounts/fireworks/models/minimax-m3p1-flash":{"id":"accounts/fireworks/models/minimax-m3p1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"experimental":{"modes":{"priority":{"cost":{"input":0.225,"output":0.9,"cache_read":0.0225},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"accounts/fireworks/models/kimi-k3":{"id":"accounts/fireworks/models/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":3.75,"output":18.75,"cache_read":0.375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"accounts/fireworks/models/deepseek-v4p1-flash-1017":{"id":"accounts/fireworks/models/deepseek-v4p1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"experimental":{"modes":{"priority":{"cost":{"input":0.375,"output":1.5,"cache_read":0.0075},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"accounts/fireworks/models/deepseek-v4p1-flash":{"id":"accounts/fireworks/models/deepseek-v4p1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"experimental":{"modes":{"priority":{"cost":{"input":0.375,"output":1.5,"cache_read":0.0075},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"accounts/fireworks/models/qwen3p8-2p4t-a95b":{"id":"accounts/fireworks/models/qwen3p8-2p4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"accounts/fireworks/models/muse-spark-open":{"id":"accounts/fireworks/models/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":1.875,"output":6.375,"cache_read":0.225},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"accounts/fireworks/models/minimax-m3":{"id":"accounts/fireworks/models/minimax-m3","name":"MiniMax-M3","description":"Fireworks text-only MiniMax coding model for long-context reasoning and agent tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":512000},"experimental":{"modes":{"priority":{"cost":{"input":0.45,"output":1.8,"cache_read":0.09},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"accounts/fireworks/models/ember-1":{"id":"accounts/fireworks/models/ember-1","name":"Ember-1","description":"Specialized model from Fireworks built on Kimi K3, producing shorter reasoning traces with approximately 40% fewer tokens while maintaining comparable quality","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"accounts/fireworks/models/kimi-k3p1-pro":{"id":"accounts/fireworks/models/kimi-k3p1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":3,"output":15,"cache_read":0.3},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"accounts/fireworks/routers/qwen-max-latest":{"id":"accounts/fireworks/routers/qwen-max-latest","name":"Qwen Max Latest (Qwen3.8 Max)","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":3,"output":9,"cache_read":0.375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"accounts/fireworks/routers/deepseek-v4p1-flash-spot":{"id":"accounts/fireworks/routers/deepseek-v4p1-flash-spot","name":"DeepSeek V4.1 Flash Spot","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.21,"output":0.84,"cache_read":0.0042},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"accounts/fireworks/routers/deepseek-flash-latest":{"id":"accounts/fireworks/routers/deepseek-flash-latest","name":"DeepSeek Flash Latest","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"experimental":{"modes":{"priority":{"cost":{"input":0.375,"output":1.5,"cache_read":0.0075},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"accounts/fireworks/routers/kimi-k3-fast":{"id":"accounts/fireworks/routers/kimi-k3-fast","name":"Kimi K3 Fast","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"accounts/fireworks/routers/glm-5p3-spot":{"id":"accounts/fireworks/routers/glm-5p3-spot","name":"GLM 5.3 Spot","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048573,"output":262144},"cost":{"input":0.98,"output":3.08,"cache_read":0.182},"canonical_model_id":"zhipuai/glm-5.3"},"accounts/fireworks/routers/glm-5p3-fast":{"id":"accounts/fireworks/routers/glm-5p3-fast","name":"GLM 5.3 Fast","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048572,"output":262144},"cost":{"input":2.1,"output":6.6,"cache_read":0.39},"canonical_model_id":"zhipuai/glm-5.3"},"accounts/fireworks/routers/glm-latest":{"id":"accounts/fireworks/routers/glm-latest","name":"GLM Latest","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048573,"output":262144},"experimental":{"modes":{"priority":{"cost":{"input":1.75,"output":5.5,"cache_read":0.325},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"accounts/fireworks/routers/kimi-latest":{"id":"accounts/fireworks/routers/kimi-latest","name":"Kimi Latest","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":3.75,"output":18.75,"cache_read":0.375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"accounts/fireworks/routers/glm-fast-latest":{"id":"accounts/fireworks/routers/glm-fast-latest","name":"GLM 5.3 Fast (Latest)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048572,"output":262144},"cost":{"input":2.1,"output":6.6,"cache_read":0.39},"canonical_model_id":"zhipuai/glm-5.3"},"accounts/fireworks/routers/kimi-fast-latest":{"id":"accounts/fireworks/routers/kimi-fast-latest","name":"Kimi Fast Latest","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"accounts/fireworks/routers/glm-flash-latest":{"id":"accounts/fireworks/routers/glm-flash-latest","name":"GLM Flash Latest (GLM 5.3 Flash)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048573,"output":131072},"experimental":{"modes":{"priority":{"cost":{"input":0.1875,"output":0.625,"cache_read":0.0375},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"accounts/fireworks/routers/minimax-latest":{"id":"accounts/fireworks/routers/minimax-latest","name":"MiniMax Latest","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":512000},"experimental":{"modes":{"priority":{"cost":{"input":0.45,"output":1.8,"cache_read":0.09},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"accounts/fireworks/routers/deepseek-v4p1-flash-1017-ultrafast":{"id":"accounts/fireworks/routers/deepseek-v4p1-flash-1017-ultrafast","name":"DeepSeek V4.1 Flash 1017 Ultra-fast","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":2.4,"output":9.6,"cache_read":0.048},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"accounts/fireworks/routers/kimi-k3-spot":{"id":"accounts/fireworks/routers/kimi-k3-spot","name":"Kimi K3 Spot","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.1,"output":10.5,"cache_read":0.21},"canonical_model_id":"moonshotai/kimi-k3"},"accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot":{"id":"accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot","name":"DeepSeek V4.1 Flash 1017 Spot","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.21,"output":0.84,"cache_read":0.0042},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"modal":{"id":"modal","env":["MODAL_PROXY_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.us-west.modal.direct/v1","name":"Modal","doc":"https://modal.com/docs/guide/endpoints","models":{"meta-models/Muse-Spark-Open-816B-A42B":{"id":"meta-models/Muse-Spark-Open-816B-A42B","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"reasoning":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"thinkingmachines/Inkling-NVFP4":{"id":"thinkingmachines/Inkling-NVFP4","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.2,"output":5,"cache_read":0.27},"canonical_model_id":"thinkingmachines/inkling"},"Qwen/Qwen3.8-2.4T-A95B":{"id":"Qwen/Qwen3.8-2.4T-A95B","name":"Qwen3.8-Max","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1010000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.45,"output":1.5,"cache_read":0.09},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/GLM-5.3-Flash-NVFP4":{"id":"nvidia/GLM-5.3-Flash-NVFP4","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"deepseek":{"id":"deepseek","env":["DEEPSEEK_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.deepseek.com","name":"DeepSeek","doc":"https://api-docs.deepseek.com/quick_start/pricing","models":{"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.66,"output":1.98,"reasoning":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek-v4-flash-vision-exp":{"id":"deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"status":"deprecated","cost":{"input":0.15,"output":0.6,"reasoning":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-flash":{"id":"deepseek-flash","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.15,"output":0.6,"reasoning":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"status":"deprecated","cost":{"input":0.15,"output":0.6,"reasoning":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"tensorx":{"id":"tensorx","env":["TENSORX_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.tensorx.ai/v1","name":"TensorX","doc":"https://docs.tensorx.ai/","models":{"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1-0528","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":8192},"status":"deprecated","cost":{"input":0.66,"output":2.6,"cache_read":0.165,"cache_write":0.825},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":2,"output":4,"cache_read":0.5},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.5,"output":1.5,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"deprecated","cost":{"input":1.75,"output":3.5,"cache_read":0.4375,"cache_write":2.185},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"status":"deprecated","cost":{"input":0.3,"output":0.5,"cache_read":0.075,"cache_write":0.375},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.25,"output":0.3,"cache_read":0.06},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.4,"output":2.4,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.8-flash-next":{"id":"qwen/qwen3.8-flash-next","name":"Qwen3.8 Flash Next","description":"Open-weight experimental preview of the Qwen4 architecture: hybrid-attention MoE (125B total, 6B active) with vision encoder for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-flash-next"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.15,"output":0.2,"cache_read":0.0375,"cache_write":0.1875},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3-235b-a22b-2507":{"id":"qwen/qwen3-235b-a22b-2507","name":"Qwen3 235B-A22B-2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06-30","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":262144},"status":"deprecated","cost":{"input":0.072,"output":0.464,"cache_read":0.018,"cache_write":0.09},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"cost":{"input":2.5,"output":6,"cache_read":0.63},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.5,"output":3.5,"cache_read":0.125,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":1,"output":4,"cache_read":0.25,"cache_write":1.25},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.75},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.5,"output":2.8,"cache_read":0.125,"cache_write":0.625},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.25,"output":4.5,"cache_read":0.3125},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":65536},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.075,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.4,"output":2,"cache_read":0.1},"canonical_model_id":"minimax/MiniMax-M3"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.5,"output":4.5,"cache_read":0.375},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":202752},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.35,"cache_write":1.75},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":1.75,"output":4.5,"cache_read":0.44},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":1.2,"output":4,"cache_read":0.3,"cache_write":1.5},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":1.2,"output":4,"cache_read":0.3,"cache_write":1.5},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":202752},"status":"deprecated","cost":{"input":1,"output":3.2,"cache_read":0.25,"cache_write":1.25},"canonical_model_id":"zhipuai/glm-5"}}},"mixlayer":{"id":"mixlayer","env":["MIXLAYER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://models.mixlayer.ai/v1","name":"Mixlayer","doc":"https://docs.mixlayer.com","models":{"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.25,"output":1.3},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B A10B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"}}},"novita-ai":{"id":"novita-ai","env":["NOVITA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.novita.ai/openai","name":"Novita AI","doc":"https://novita.ai/docs/guides/introduction","models":{"mindai/macaron-v1-tall":{"id":"mindai/macaron-v1-tall","name":"Macaron V1 Tall","description":"Qwen3.6-based Mixture-of-LoRA model with specialists for chat, personal agents, coding, and generative UI","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2475,"output":1.43,"cache_read":0.044},"canonical_model_id":"mindlab/macaron-v1-tall"},"mindai/macaron-v1-venti":{"id":"mindai/macaron-v1-venti","name":"Macaron V1 Venti","description":"GLM-5.2-based Mixture-of-LoRA model with specialists for chat, personal agents, coding, and generative UI","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.825,"output":2.475,"cache_read":0.165},"canonical_model_id":"mindlab/macaron-v1-venti"},"baidu/ernie-4.5-21B-a3b":{"id":"baidu/ernie-4.5-21B-a3b","name":"ERNIE 4.5 21B A3B","description":"Open ERNIE text MoE with 21B total and 3B active parameters","family":"ernie","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":120000,"output":8000},"cost":{"input":0.07,"output":0.28},"canonical_model_id":"baidu/ernie-4.5-21b-a3b"},"baidu/cobuddy":{"id":"baidu/cobuddy","name":"CoBuddy","description":"Baidu Qianfan model optimized for code generation and tool-using coding agents","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-05-06","last_updated":"2026-05-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":0.28,"output":1.13,"cache_read":0.07},"canonical_model_id":"baidu/cobuddy"},"baai/bge-reranker-v2-m3":{"id":"baai/bge-reranker-v2-m3","type":"reranking","name":"BGE Reranker V2 M3","description":"Lightweight multilingual cross-encoder that scores query-document relevance","family":"bge","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-03-15","last_updated":"2024-03-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":0},"cost":{"input":0.01,"output":0},"canonical_model_id":"baai/bge-reranker-v2-m3"},"baai/bge-m3":{"id":"baai/bge-m3","type":"embedding","name":"BGE M3","description":"Multilingual embedding model combining dense, sparse, and multi-vector retrieval","family":"bge","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-30","last_updated":"2024-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":0},"cost":{"input":0.01,"output":0},"canonical_model_id":"baai/bge-m3"},"minimaxai/minimax-m1-80k":{"id":"minimaxai/minimax-m1-80k","name":"MiniMax M1 80K","description":"Open hybrid-attention MoE reasoning model with a million-token context and an 80K thinking budget","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":40000},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"minimax/minimax-m1-80k"},"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1 0528","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.7,"output":2.5,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek_v3":{"id":"deepseek/deepseek_v3","name":"DeepSeek-V3","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16000},"cost":{"input":0.89,"output":0.89},"canonical_model_id":"deepseek/deepseek-v3"},"deepseek/deepseek-r1-0528-qwen3-8b":{"id":"deepseek/deepseek-r1-0528-qwen3-8b","name":"DeepSeek R1 0528 Qwen3 8B","description":"DeepSeek R1 0528 distilled into Qwen3 8B for mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"release_date":"2025-05-29","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.06,"output":0.09},"canonical_model_id":"deepseek/deepseek-r1-0528-qwen3-8b"},"deepseek/deepseek-r1-turbo":{"id":"deepseek/deepseek-r1-turbo","name":"DeepSeek R1 (Turbo)","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16000},"cost":{"input":0.7,"output":2.5},"canonical_model_id":"deepseek/deepseek-r1"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":1.6,"output":3.2,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek/deepseek-ocr-2":{"id":"deepseek/deepseek-ocr-2","name":"DeepSeek OCR 2","description":"High-accuracy OCR model for extracting text from documents, screenshots, receipts, and natural scenes","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0.03},"canonical_model_id":"deepseek/deepseek-ocr-2"},"inclusionai/ling-3.0-flash-vl":{"id":"inclusionai/ling-3.0-flash-vl","name":"Ling 3.0 Flash VL","description":"Native multimodal hybrid MoE model for image and video understanding, reasoning, and visual agents","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"inclusionai/ling-3.0-flash-sante":{"id":"inclusionai/ling-3.0-flash-sante","name":"Ling 3.0 Flash Sante","description":"Health and medicine specialization of Ling 3.0 Flash for medical reasoning and evidence-based retrieval","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-sante"},"inclusionai/ling-3.0-flash-fin":{"id":"inclusionai/ling-3.0-flash-fin","name":"Ling 3.0 Flash Fin","description":"Finance-enhanced model for financial research, multi-step investment workflows, and long-horizon planning and execution","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-27","last_updated":"2026-09-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-fin"},"inclusionai/ling-3.0-flash":{"id":"inclusionai/ling-3.0-flash","name":"Ling 3.0 Flash","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash"},"inclusionai/ling-3.1-flash":{"id":"inclusionai/ling-3.1-flash","name":"Ling 3.1 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.3,"output":0.9,"cache_read":0.06},"canonical_model_id":"inclusionai/ling-3.1-flash"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":98304,"output":16384},"cost":{"input":0.119,"output":0.2},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.13,"output":0.4},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-12b-it"},"qwen/qwen3-reranker-8b":{"id":"qwen/qwen3-reranker-8b","type":"reranking","name":"Qwen3 Reranker 8B","description":"Multilingual query-document reranking model supporting more than 100 languages","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"cost":{"input":0.05,"output":0},"canonical_model_id":"alibaba/qwen3-reranker-8b"},"qwen/qwen3-vl-30b-a3b-instruct":{"id":"qwen/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.2,"output":0.7},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.42,"output":3,"cache_read":0.085},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen-mt-plus":{"id":"qwen/qwen-mt-plus","name":"Qwen MT Plus","description":"Flagship Qwen translation model with terminology control and support for 92 languages","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-07-24","last_updated":"2025-07-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"cost":{"input":0.25,"output":0.75},"canonical_model_id":"alibaba/qwen-mt-plus"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/qwen3-embedding-8b":{"id":"qwen/qwen3-embedding-8b","type":"embedding","name":"Qwen3 Embedding 8B","description":"Multilingual text embedding model for retrieval, code search, classification, and clustering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"cost":{"input":0.07,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.25,"output":3.75,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.248,"output":1.485},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3-omni-30b-a3b-thinking":{"id":"qwen/qwen3-omni-30b-a3b-thinking","name":"Qwen3 Omni 30B A3B Thinking","description":"Multimodal reasoning model accepting text, images, video, and audio with text output","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.25,"output":0.97,"input_audio":2.2},"canonical_model_id":"alibaba/qwen3-omni-30b-a3b-thinking"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"xiaomimimo/mimo-v2.6-pro":{"id":"xiaomimimo/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomimimo/mimo-v2.6-flash":{"id":"xiaomimimo/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xiaomimimo/mimo-v2.5":{"id":"xiaomimimo/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.168,"output":0.336,"cache_read":0.0034},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomimimo/mimo-v2.5-pro":{"id":"xiaomimimo/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.522,"output":1.044,"cache_read":0.0043},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"nousresearch/hermes-2-pro-llama-3-8b":{"id":"nousresearch/hermes-2-pro-llama-3-8b","name":"Hermes 2 Pro Llama 3 8B","description":"Llama 3 fine-tune optimized for function calling, structured JSON responses, and dialogue","family":"hermes","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2024-04-30","last_updated":"2024-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.14,"output":0.14},"canonical_model_id":"nousresearch/hermes-2-pro-llama-3-8b"},"tencent/hy4":{"id":"tencent/hy4","name":"Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":983010,"output":64000},"cost":{"input":0.417,"output":1.2505,"cache_read":0.021},"canonical_model_id":"tencent/hy4"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":262144},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"microsoft/wizardlm-2-8x22b":{"id":"microsoft/wizardlm-2-8x22b","name":"WizardLM 2 8x22B","description":"Microsoft WizardLM instruction-tuned Mixtral MoE for multilingual dialogue and complex tasks","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2024-04-15","last_updated":"2024-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65535,"output":8000},"cost":{"input":0.62,"output":0.62},"canonical_model_id":"microsoft/wizardlm-2-8x22b"},"moonshotai/kimi-k3.1-pro-highspeed":{"id":"moonshotai/kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.8,"output":3.4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 Instruct 0905","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k2-instruct":{"id":"moonshotai/kimi-k2-instruct","name":"Kimi K2 Instruct","description":"Non-thinking Kimi K2 MoE instruction model for coding and tool-using agents","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.05,"output":0.25},"canonical_model_id":"openai/gpt-oss-120b"},"apodex/apodex-1.1-mini":{"id":"apodex/apodex-1.1-mini","name":"Apodex 1.1 Mini","description":"Open-weight 35B MoE model for long-horizon research, forecasting, and tool-assisted work","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-24","last_updated":"2026-08-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"apodex/apodex-1.1-mini"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"tiers":[{"input":0.6,"output":2.4,"cache_read":0.12,"tier":{"type":"context","size":524288}}],"context_over_200k":{"input":0.6,"output":2.4,"cache_read":0.12}},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":64000},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/step-3.7-flash":{"id":"stepfun/step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":256000,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"baichuan/baichuan-m2-32b":{"id":"baichuan/baichuan-m2-32b","name":"Baichuan M2 32B","description":"Open medical model trained for clinical reasoning and patient interaction with on, off, and auto thinking modes","family":"baichuan","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"temperature":true,"release_date":"2025-08-13","last_updated":"2025-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.07,"output":0.07},"canonical_model_id":"baichuan/baichuan-m2-32b"},"meta-llama/llama-4-scout-17b-16e-instruct":{"id":"meta-llama/llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B Instruct","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.18,"output":0.59},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"meta-llama/llama-3.1-8b-instruct":{"id":"meta-llama/llama-3.1-8b-instruct","name":"Llama-3.1-8B-Instruct","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.02,"output":0.05},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/llama-3.3-70b-instruct":{"id":"meta-llama/llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":12288,"output":12288},"cost":{"input":0.135,"output":0.4},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta-llama/llama-3.2-1b-instruct":{"id":"meta-llama/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct","description":"Compact instruction-tuned Llama model for multilingual dialogue and on-device assistants","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":32000},"cost":{"input":0.02,"output":0.02},"canonical_model_id":"meta/llama-3.2-1b-instruct"},"meta-llama/llama-4-maverick-17b-128e-instruct-fp8":{"id":"meta-llama/llama-4-maverick-17b-128e-instruct-fp8","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":8192},"cost":{"input":0.27,"output":0.85},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"zai-org/glm-5.2":{"id":"zai-org/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/autoglm-phone-9b-multilingual":{"id":"zai-org/autoglm-phone-9b-multilingual","name":"AutoGLM Phone 9B Multilingual","description":"Multilingual visual model for operating smartphone interfaces and mobile agents","family":"glm","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-12-10","last_updated":"2025-12-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.035,"output":0.138},"canonical_model_id":"zhipuai/autoglm-phone-9b-multilingual"},"zai-org/glm-4.6v":{"id":"zai-org/glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.055},"canonical_model_id":"zhipuai/glm-4.6v"},"zai-org/glm-5.1":{"id":"zai-org/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1.38,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai-org/glm-5.3-flashX":{"id":"zai-org/glm-5.3-flashX","name":"GLM 5.3 FlashX","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/glm-4.7":{"id":"zai-org/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/glm-5.3":{"id":"zai-org/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/glm-5.3-flash":{"id":"zai-org/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/glm-4.5-air":{"id":"zai-org/glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.13,"output":0.85,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai-org/glm-4.6":{"id":"zai-org/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.55,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"zai-org/glm-4.5v":{"id":"zai-org/glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"zai-org/glm-5":{"id":"zai-org/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"zai-org/glm-4.7-flash":{"id":"zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.07,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.05,"output":0.2},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"gryphe/mythomax-l2-13b":{"id":"gryphe/mythomax-l2-13b","name":"MythoMax L2 13B","description":"Llama 2 merge combining MythoLogic and Huginn for creative writing and roleplay","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":3200},"cost":{"input":0.09,"output":0.09},"canonical_model_id":"gryphe/mythomax-l2-13b"},"paddlepaddle/paddleocr-vl":{"id":"paddlepaddle/paddleocr-vl","name":"PaddleOCR VL","description":"Compact vision-language model for multilingual document parsing, OCR, tables, formulas, and charts","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-10-16","last_updated":"2025-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.02,"output":0.02},"canonical_model_id":"paddlepaddle/paddleocr-vl"}}},"aixy":{"id":"aixy","env":["AIXY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.aixy-gateway.com/v1","name":"Aixy","doc":"https://docs.aixy-gateway.com/integrations/overview","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.aixy-gateway.com/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.aixy-gateway.com/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.aixy-gateway.com/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.aixy-gateway.com/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"gemini/gemini-3.8-flash":{"id":"gemini/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"gemini/gemini-4-argon":{"id":"gemini/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.aixy-gateway.com/v1","shape":"responses"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"}}},"google":{"id":"google","env":["GOOGLE_API_KEY","GOOGLE_GENERATIVE_AI_API_KEY","GEMINI_API_KEY"],"npm":"@ai-sdk/google","name":"Google","doc":"https://ai.google.dev/gemini-api/docs/models","models":{"gemini-2.5-pro-preview-tts":{"id":"gemini-2.5-pro-preview-tts","type":"speech","name":"Gemini 2.5 Pro Preview TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gemini-flash","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-05-01","last_updated":"2025-05-01","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"cost":{"input":1,"output":20}},"gemini-flash-lite-latest":{"id":"gemini-flash-lite-latest","name":"Gemini Flash-Lite Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03}},"deep-research-preview-04-2026":{"id":"deep-research-preview-04-2026","name":"Deep Research Preview (Apr-21-2026)","description":"Agentic model for autonomous multi-step research, synthesis, and cited reports","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/deep-research-preview-04-2026"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":30},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-carbon"},"gemini-pro-latest":{"id":"gemini-pro-latest","name":"Gemini Pro Latest","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"lyria-3-pro-preview":{"id":"lyria-3-pro-preview","name":"Lyria 3 Pro Preview","description":"Music generation model for full-length songs from text or images with vocals and structure","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-pro-preview"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"gemini-omni-flash-preview":{"id":"gemini-omni-flash-preview","type":"video","name":"Gemini Omni Flash Preview","description":"Video generation and editing model for fast, conversational text- and image-to-video workflows","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1.5,"output":17.5},"canonical_model_id":"google/gemini-omni-flash-preview"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5}},"gemini-2.5-flash-preview-tts":{"id":"gemini-2.5-flash-preview-tts","type":"speech","name":"Gemini 2.5 Flash Preview TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gemini-flash","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-05-01","last_updated":"2025-05-01","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"cost":{"input":0.5,"output":10}},"gemini-flash-latest":{"id":"gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75}},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"gemini-embedding-001":{"id":"gemini-embedding-001","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":1},"cost":{"input":0.15,"output":0}},"gemini-embedding-2":{"id":"gemini-embedding-2","type":"embedding","name":"Gemini Embedding 2","description":"Multimodal embedding model mapping text, images, video, audio, and PDFs into a unified embedding space","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-11","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1},"cost":{"input":0.2,"output":0,"input_audio":6.5},"canonical_model_id":"google/gemini-embedding-2"},"gemini-2.5-computer-use-preview-10-2025":{"id":"gemini-2.5-computer-use-preview-10-2025","name":"Gemini 2.5 Computer Use Preview 10-2025","description":"Specialized Gemini 2.5 model for browser-control agents that automate UI tasks","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-10-07","last_updated":"2025-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":64000},"cost":{"input":1.25,"output":10,"tiers":[{"input":2.5,"output":15,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15}},"canonical_model_id":"google/gemini-2.5-computer-use-preview-10-2025"},"gemini-3.1-flash-image":{"id":"gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":60},"canonical_model_id":"google/gemini-3.1-flash-image"},"gemini-3.1-pro-preview-customtools":{"id":"gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}}},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}}},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5}},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3}},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"gemini-3.5-live-translate-preview":{"id":"gemini-3.5-live-translate-preview","type":"realtime","name":"Gemini 3.5 Live Translate Preview","description":"Low-latency audio-to-audio model for real-time speech translation across 70+ languages","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["audio"],"output":["audio","text"]},"open_weights":false,"limit":{"context":16384,"output":32768},"cost":{"input":3.5,"output":21,"input_audio":3.5,"output_audio":21},"canonical_model_id":"google/gemini-3.5-live-translate-preview"},"deep-research-max-preview-04-2026":{"id":"deep-research-max-preview-04-2026","name":"Deep Research Max Preview (Apr-21-2026)","description":"Maximum-comprehensiveness agentic researcher for multi-step investigation, synthesis, and cited reports","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/deep-research-max-preview-04-2026"},"gemini-3.1-flash-lite-preview":{"id":"gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Legacy model retained for compatibility with older integrations","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5}},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768}},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1}},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.3,"output":30,"cache_read":0.075},"canonical_model_id":"google/gemini-2.5-flash-image"},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768}},"gemini-3-pro-image":{"id":"gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":120},"canonical_model_id":"google/gemini-3-pro-image"},"gemini-3.1-flash-tts-preview":{"id":"gemini-3.1-flash-tts-preview","type":"speech","name":"Gemini 3.1 Flash TTS Preview","description":"Low-latency speech generation with steerable prompts and expressive audio tags","family":"gemini-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-15","last_updated":"2026-04-15","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"cost":{"input":1,"output":20},"canonical_model_id":"google/gemini-3.1-flash-tts-preview"},"lyria-3-clip-preview":{"id":"lyria-3-clip-preview","name":"Lyria 3 Clip Preview","description":"Music generation model for short 30-second clips, loops, and previews from text or image prompts","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-clip-preview"},"gemini-3.1-flash-live-preview":{"id":"gemini-3.1-flash-live-preview","type":"realtime","name":"Gemini 3.1 Flash Live Preview","description":"High-quality, low-latency Live API model for real-time dialogue and voice-first AI applications","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-26","last_updated":"2026-03-26","modalities":{"input":["text","image","video","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":0.75,"output":4.5,"input_audio":3,"output_audio":12},"canonical_model_id":"google/gemini-3.1-flash-live-preview"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"}}},"wally":{"id":"wally","env":["WALLY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.runanywhere.ai/v1","name":"Wally","doc":"https://docs.runanywhere.ai/wally-cloud/api","models":{"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"deepseek-v4.1-flash-fast":{"id":"deepseek-v4.1-flash-fast","name":"DeepSeek V4.1 Flash Fast","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.6,"output":2.4,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3-fast":{"id":"glm-5.3-fast","name":"GLM-5.3 Fast","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.1,"output":6.6,"cache_read":0.39},"canonical_model_id":"zhipuai/glm-5.3"},"deepseek-v4-pro-fast":{"id":"deepseek-v4-pro-fast","name":"DeepSeek V4 Pro Fast","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":1.91,"output":3.83,"cache_read":0.16},"canonical_model_id":"deepseek/deepseek-v4-pro"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524287,"output":131072},"cost":{"input":0.33,"output":1.32,"cache_read":0.066},"canonical_model_id":"minimax/MiniMax-M3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.272,"output":0.65,"cache_read":0.076},"canonical_model_id":"zhipuai/glm-5.3-flash"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"}}},"atomic-chat":{"id":"atomic-chat","env":["ATOMIC_CHAT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"http://127.0.0.1:1337/v1","name":"Atomic Chat","doc":"https://atomic.chat","models":{"gemma-4-E4B-it-MLX-4bit":{"id":"gemma-4-E4B-it-MLX-4bit","name":"Gemma 4 E4B Instruct (MLX 4-bit)","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-E4B-it"},"Qwen3_5-9B-MLX-4bit":{"id":"Qwen3_5-9B-MLX-4bit","name":"Qwen 3.5 9B (MLX 4-bit)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-9b"},"gemma-4-E4B-it-IQ4_XS":{"id":"gemma-4-E4B-it-IQ4_XS","name":"Gemma 4 E4B Instruct (IQ4_XS)","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-E4B-it"},"Qwen3_5-9B-Q4_K_M":{"id":"Qwen3_5-9B-Q4_K_M","name":"Qwen 3.5 9B (Q4_K_M)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-9b"},"Meta-Llama-3_1-8B-Instruct-GGUF":{"id":"Meta-Llama-3_1-8B-Instruct-GGUF","name":"Meta Llama 3.1 8B Instruct (GGUF)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"meta/llama-3.1-8b-instruct"}}},"zeldoc":{"id":"zeldoc","env":["ZELDOC_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.zeldoc.ai/v1","name":"Zeldoc","doc":"https://docs.zeldoc.ai","models":{"zdev":{"id":"zdev","name":"ZDev","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0}}}},"chutes":{"id":"chutes","env":["CHUTES_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://llm.chutes.ai/v1","name":"Chutes","doc":"https://llm.chutes.ai/v1/models","models":{"google/gemma-4-31B-turbo-TEE":{"id":"google/gemma-4-31B-turbo-TEE","name":"gemma 4 31B turbo TEE","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.12,"output":0.37,"cache_read":0.012},"canonical_model_id":"google/gemma-4-31b-it"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"deepseek-ai/DeepSeek-V3.2-TEE":{"id":"deepseek-ai/DeepSeek-V3.2-TEE","name":"DeepSeek V3.2 TEE","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":1,"output":1,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash-0731-TEE":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731-TEE","name":"DeepSeek V4 Flash 0731 TEE","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.44,"output":1.32,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-20","last_updated":"2026-10-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"tencent/Hy4":{"id":"tencent/Hy4","name":"Hy4","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Kimi coding model for software agents, refactors, and repository reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"moonshotai/Kimi-K2.6-TEE":{"id":"moonshotai/Kimi-K2.6-TEE","name":"Kimi K2.6 TEE","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65535},"cost":{"input":0.39,"output":1.8,"cache_read":0.039},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/Kimi-K3-TEE":{"id":"moonshotai/Kimi-K3-TEE","name":"Kimi K3 TEE","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65535},"cost":{"input":1.85,"output":9.5,"cache_read":0.185},"canonical_model_id":"moonshotai/kimi-k3"},"Qwen/Qwen3.8-27B-TEE":{"id":"Qwen/Qwen3.8-27B-TEE","name":"Qwen3.8 27B TEE","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.039,"output":1.25,"cache_read":0.0039},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.8-Max-0902":{"id":"Qwen/Qwen3.8-Max-0902","name":"Qwen3.8 Max 0902","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen3.8-max","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-20","last_updated":"2026-10-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"Qwen/Qwen3.8-2.4T-A95B":{"id":"Qwen/Qwen3.8-2.4T-A95B","name":"Qwen3.8 2.4T A95B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"Qwen/Qwen3.6-27B-TEE":{"id":"Qwen/Qwen3.6-27B-TEE","name":"Qwen3.6 27B TEE","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3.5-27B-TEE":{"id":"Qwen/Qwen3.5-27B-TEE","name":"Qwen3.5 27B TEE","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":1.75,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen/Qwen3.5-397B-A17B-TEE":{"id":"Qwen/Qwen3.5-397B-A17B-TEE","name":"Qwen3.5 397B A17B TEE","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.45,"output":3,"cache_read":0.045},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"zai-org/GLM-5.2-TEE":{"id":"zai-org/GLM-5.2-TEE","name":"GLM 5.2 TEE","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65535},"cost":{"input":1.25,"output":3.95,"cache_read":0.125},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.1-TEE":{"id":"zai-org/GLM-5.1-TEE","name":"GLM 5.1 TEE","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":65535},"cost":{"input":0.9,"output":2.9,"cache_read":0.09},"canonical_model_id":"zhipuai/glm-5.1"},"zai-org/GLM-5.2-Fast":{"id":"zai-org/GLM-5.2-Fast","name":"GLM 5.2 Fast","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0}}}},"cloudflare-ai-gateway":{"id":"cloudflare-ai-gateway","env":["CLOUDFLARE_API_TOKEN","CLOUDFLARE_ACCOUNT_ID","CLOUDFLARE_GATEWAY_ID"],"npm":"ai-gateway-provider","name":"Cloudflare AI Gateway","doc":"https://developers.cloudflare.com/ai-gateway/","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-carbon"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15,"cache_write":1.5},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemini-3-flash":{"id":"google/gemini-3-flash","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"google/gemini-3.1-pro":{"id":"google/gemini-3.1-pro","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"alibaba/qwen3.5-397b-a17b":{"id":"alibaba/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"alibaba/qwen3.7-plus":{"id":"alibaba/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.32,"output":1.28,"cache_read":0.064},"canonical_model_id":"alibaba/qwen3.7-plus"},"alibaba/qwen3.7-max":{"id":"alibaba/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.25,"output":3.75,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.7-max"},"alibaba/qwen3-max":{"id":"alibaba/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":1.2,"output":6},"canonical_model_id":"alibaba/qwen3-max"},"alibaba/qwen3.8-max":{"id":"alibaba/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":5,"output":30},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.1,"output":0.4,"cache_read":0.03},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.7999999999999998,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.7999999999999998,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":1.25,"output":5,"cache_read":0.625},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"provider":{"npm":"@ai-sdk/openai","api":"https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/openai"},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-4o-mini"},"reflection-ai/beam-1.0-501b-a23b":{"id":"reflection-ai/beam-1.0-501b-a23b","name":"Beam 1.0 501B A23B","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"minimax/m3.1-flash":{"id":"minimax/m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015,"cache_write":0.15},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.16},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.16},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-wonder-1.0":{"id":"meta/muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1040000,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/muse-ember-1.0":{"id":"meta/muse-ember-1.0","name":"Muse Ember","description":"Muse Ember is Meta's smallest and most efficient reasoning model, built for the work agents repeat all day: tool calls, coding subtasks, routing, extraction, and long-document parsing. It pairs with Muse Wonder or Muse Spark, which plan while Muse Ember handles the volume.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":524288},"cost":{"input":0.1,"output":0.5,"cache_read":0.004},"canonical_model_id":"meta/muse-ember-1.0"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.16},"canonical_model_id":"meta/muse-spark-1.2"},"fireworks/ember-1":{"id":"fireworks/ember-1","name":"Ember-1","description":"Specialized model from Fireworks built on Kimi K3, producing shorter reasoning traces with approximately 40% fewer tokens while maintaining comparable quality","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"unbiased/pareto":{"id":"unbiased/pareto","name":"Pareto","description":"Blended multimodal model that runs multiple language models in parallel and returns a synthesized answer","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25},"canonical_model_id":"unbiased/pareto"},"xai/grok-4.20-0309-non-reasoning":{"id":"xai/grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.20-0309-reasoning":{"id":"xai/grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"}}},"digitalocean":{"id":"digitalocean","env":["DIGITALOCEAN_ACCESS_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.do-ai.run/v1","name":"DigitalOcean","doc":"https://docs.digitalocean.com/products/gradient-ai-platform/details/models/","models":{"nemotron-3-nano-omni":{"id":"nemotron-3-nano-omni","name":"Nemotron 3 Nano Omni","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.5,"output":0.9,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"mistral-3-14B":{"id":"mistral-3-14B","name":"Ministral 3 14B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.2,"output":0.2,"cache_read":0.04},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"gemma-4-31B-it":{"id":"gemma-4-31B-it","name":"Gemma 4","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":0.18,"output":0.5,"cache_read":0.036},"canonical_model_id":"google/gemma-4-31b-it"},"anthropic-claude-haiku-4.5":{"id":"anthropic-claude-haiku-4.5","name":"Anthropic Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.21},"canonical_model_id":"zhipuai/glm-5.2"},"deepseek-4-flash":{"id":"deepseek-4-flash","name":"Deepseek V4 Flash","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"openai-gpt-5-nano":{"id":"openai-gpt-5-nano","name":"OpenAI GPT-5 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"gte-large-en-v1.5":{"id":"gte-large-en-v1.5","type":"embedding","name":"GTE Large (v1.5)","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-03-27","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":1024},"cost":{"input":0.09,"output":0}},"anthropic-claude-fable-5.2":{"id":"anthropic-claude-fable-5.2","name":"Anthropic Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.6"},"anthropic-claude-5-sonnet":{"id":"anthropic-claude-5-sonnet","name":"Anthropic Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"openai-gpt-5":{"id":"openai-gpt-5","name":"OpenAI GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"anthropic-claude-opus-4.6":{"id":"anthropic-claude-opus-4.6","name":"Anthropic Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-6"},"deepseek-3.2":{"id":"deepseek-3.2","name":"Deepseek 3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.5,"output":1.6,"cache_read":0.15},"canonical_model_id":"deepseek/deepseek-v3.2"},"openai-gpt-4o":{"id":"openai-gpt-4o","name":"OpenAI GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai-gpt-image-2":{"id":"openai-gpt-image-2","type":"image","name":"OpenAI GPT Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image","text"]},"open_weights":false,"limit":{"context":0,"output":16384},"cost":{"input":8,"output":30},"canonical_model_id":"openai/gpt-image-2"},"openai-gpt-5.4":{"id":"openai-gpt-5.4","name":"OpenAI GPT-5.4","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai-gpt-5.5":{"id":"openai-gpt-5.5","name":"OpenAI GPT-5.5","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai-gpt-6-luna":{"id":"openai-gpt-6-luna","name":"OpenAI GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"anthropic-claude-opus-4.8":{"id":"anthropic-claude-opus-4.8","name":"Anthropic Claude Opus 4.8","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic-claude-fable-5":{"id":"anthropic-claude-fable-5","name":"Anthropic Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"nemotron-3.5-super-vl":{"id":"nemotron-3.5-super-vl","name":"NVIDIA Nemotron 3.5 Super VL","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":0.65,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"multi-qa-mpnet-base-dot-v1":{"id":"multi-qa-mpnet-base-dot-v1","type":"embedding","name":"Multi-QA-mpnet-base-dot-v1","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2021-08-23","last_updated":"2021-08-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":768},"cost":{"input":0.009,"output":0},"canonical_model_id":"sentence-transformers/multi-qa-mpnet-base-dot-v1"},"llama-4-maverick":{"id":"llama-4-maverick","name":"Llama 4 Maverick","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.25,"output":0.87,"cache_read":0.05},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"openai-gpt-5-mini":{"id":"openai-gpt-5-mini","name":"OpenAI GPT-5 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"anthropic-claude-5.5-haiku":{"id":"anthropic-claude-5.5-haiku","name":"Anthropic Claude 5.5 Haiku","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"openai-o1":{"id":"openai-o1","name":"OpenAI o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"openai-o3-mini":{"id":"openai-o3-mini","name":"OpenAI o3 mini","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen 3.5 397B A17B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.55,"output":3.5,"cache_read":0.111},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax M2.5 (Public Preview)","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax-m2.5","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08","release_date":"2026-02-12","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.3,"output":1.2,"cache_read":0.06}},"openai-gpt-4.1":{"id":"openai-gpt-4.1","name":"OpenAI GPT-4.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"Deepseek V4 Pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.348},"canonical_model_id":"deepseek/deepseek-v4-pro"},"reflection-beam":{"id":"reflection-beam","name":"Beam","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-21","last_updated":"2026-10-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.4,"output":1.2,"cache_read":0.04}},"openai-gpt-image-1":{"id":"openai-gpt-image-1","type":"image","name":"GPT Image 1","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-24","last_updated":"2025-04-24","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":40,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1"},"openai-gpt-5.2-pro":{"id":"openai-gpt-5.2-pro","name":"OpenAI GPT-5.2 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"qwen3-tts-voicedesign":{"id":"qwen3-tts-voicedesign","type":"speech","name":"Qwen3 TTS VoiceDesign","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["audio"]},"open_weights":true,"limit":{"context":32768,"output":1},"provider":{"npm":"@ai-sdk/openai"}},"anthropic-claude-sonnet-5.5":{"id":"anthropic-claude-sonnet-5.5","name":"Anthropic Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"glm-5.3":{"id":"glm-5.3","name":"GLM5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"anthropic-claude-fable-5.1":{"id":"anthropic-claude-fable-5.1","name":"Anthropic Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic-claude-4.5-sonnet":{"id":"anthropic-claude-4.5-sonnet","name":"Anthropic Claude 4.5 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax M3.1-Flash (Public Preview)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"qwen3-embedding-0.6b":{"id":"qwen3-embedding-0.6b","type":"embedding","name":"Qwen3 Embedding 0.6B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-03","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":1024},"status":"beta","cost":{"input":0.04,"output":0}},"all-mini-lm-l6-v2":{"id":"all-mini-lm-l6-v2","type":"embedding","name":"All-MiniLM-L6-v2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2021-08-30","last_updated":"2021-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256,"output":384},"cost":{"input":0.009,"output":0},"canonical_model_id":"sentence-transformers/all-minilm-l6-v2"},"anthropic-claude-opus-5.5":{"id":"anthropic-claude-opus-5.5","name":"Anthropic Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.4,"cache_write":10,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.4,"cache_write":10}},"canonical_model_id":"anthropic/claude-opus-5-5"},"openai-gpt-oss-120b":{"id":"openai-gpt-oss-120b","name":"OpenAI GPT-oss-120b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.1,"output":0.7,"cache_read":0.02},"canonical_model_id":"openai/gpt-oss-120b"},"anthropic-claude-4.6-sonnet":{"id":"anthropic-claude-4.6-sonnet","name":"Anthropic Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"openai-o3":{"id":"openai-o3","name":"OpenAI o3","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"nemotron-3-ultra-550b":{"id":"nemotron-3-ultra-550b","name":"Nemotron 3 Ultra","description":"Flagship Nemotron model for high-throughput reasoning and complex agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.9,"output":1.7,"cache_read":0.18},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"anthropic-claude-opus-4.5":{"id":"anthropic-claude-opus-4.5","name":"Anthropic Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"openai-gpt-5.4-pro":{"id":"openai-gpt-5.4-pro","name":"OpenAI GPT-5.4 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai-gpt-oss-20b":{"id":"openai-gpt-oss-20b","name":"OpenAI GPT-oss-20b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.05,"output":0.45,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-20b"},"e5-large-v2":{"id":"e5-large-v2","type":"embedding","name":"E5 Large v2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-05","last_updated":"2023-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":1024},"cost":{"input":0.02,"output":0},"canonical_model_id":"intfloat/e5-large-v2"},"openai-gpt-6-astra":{"id":"openai-gpt-6-astra","name":"OpenAI GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai-gpt-4o-mini":{"id":"openai-gpt-4o-mini","name":"OpenAI GPT-4o mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai-gpt-5.6-terra":{"id":"openai-gpt-5.6-terra","name":"OpenAI GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai-gpt-5.4-nano":{"id":"openai-gpt-5.4-nano","name":"OpenAI GPT-5.4 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai-gpt-5.4-mini":{"id":"openai-gpt-5.4-mini","name":"OpenAI GPT-5.4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo V2.5 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.8,"output":3,"cache_read":0.16},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"bge-reranker-v2-m3":{"id":"bge-reranker-v2-m3","type":"reranking","name":"BGE Reranker v2 M3","description":"Reranking model for improving retrieval quality in search and recommendation systems","family":"bge","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-03-15","last_updated":"2024-03-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":1},"cost":{"input":0.01,"output":0},"canonical_model_id":"baai/bge-reranker-v2-m3"},"openai-gpt-image-1.5":{"id":"openai-gpt-image-1.5","type":"image","name":"OpenAI GPT Image 1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"output":16384},"cost":{"input":5,"output":10,"cache_read":1},"canonical_model_id":"openai/gpt-image-1.5"},"bge-m3":{"id":"bge-m3","type":"embedding","name":"BGE M3","description":"Multilingual embedding model combining dense, sparse, and multi-vector retrieval","family":"bge","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-30","last_updated":"2024-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":1024},"cost":{"input":0.02,"output":0},"canonical_model_id":"baai/bge-m3"},"openai-gpt-5.6-sol":{"id":"openai-gpt-5.6-sol","name":"OpenAI GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai-gpt-5.6-luna":{"id":"openai-gpt-5.6-luna","name":"OpenAI GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai-gpt-6-sol":{"id":"openai-gpt-6-sol","name":"OpenAI GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"stable-diffusion-3.5-large":{"id":"stable-diffusion-3.5-large","type":"image","name":"Stable Diffusion 3.5 Large","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"stable-diffusion","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-10-22","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":256,"output":1}},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8-Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-max"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"openai-gpt-6.1-terra":{"id":"openai-gpt-6.1-terra","name":"OpenAI GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1}},"canonical_model_id":"openai/gpt-6.1-terra"},"arcee-trinity-large-thinking":{"id":"arcee-trinity-large-thinking","name":"Arcee Trinity Large Thinking (Public Preview)","description":"Reasoning-optimized 398B MoE agent model with extended thinking for long-horizon and multi-turn tool use","family":"trinity","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.25,"output":0.9,"cache_read":0.06},"canonical_model_id":"arcee-ai/trinity-large-thinking"},"anthropic-claude-opus-5":{"id":"anthropic-claude-opus-5","name":"Anthropic Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"openai-gpt-5.2":{"id":"openai-gpt-5.2","name":"OpenAI GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai-gpt-5.3-codex":{"id":"openai-gpt-5.3-codex","name":"OpenAI GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"anthropic-claude-opus-4.7":{"id":"anthropic-claude-opus-4.7","name":"Anthropic Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"nemotron-nano-12b-v2-vl":{"id":"nemotron-nano-12b-v2-vl","name":"Nemotron-nano 12b v2-vl","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2025-10-28","last_updated":"2025-10-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.2,"output":0.6,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-nano-12b-v2-vl"},"openai-gpt-6-1-sol":{"id":"openai-gpt-6-1-sol","name":"OpenAI GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"wan2-2-t2v-a14b":{"id":"wan2-2-t2v-a14b","type":"video","name":"Wan2.2-T2V-A14B","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-07-28","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["video"]},"open_weights":true,"limit":{"context":100,"output":1}},"fal-ai/fast-sdxl":{"id":"fal-ai/fast-sdxl","type":"image","name":"Fast SDXL","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"stable-diffusion","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-07-26","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0}},"fal-ai/elevenlabs/tts/multilingual-v2":{"id":"fal-ai/elevenlabs/tts/multilingual-v2","type":"speech","name":"ElevenLabs Multilingual TTS v2","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"elevenlabs","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-08-22","last_updated":"2023-08-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"canonical_model_id":"elevenlabs/eleven_multilingual_v2"},"fal-ai/flux/schnell":{"id":"fal-ai/flux/schnell","type":"image","name":"FLUX.1 [schnell]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-08-01","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0}},"fal-ai/stable-audio-25/text-to-audio":{"id":"fal-ai/stable-audio-25/text-to-audio","type":"speech","name":"Stable Audio 2.5 (Text-to-Audio)","description":"Speech generation model for controllable voice, narration, and audio delivery","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-08","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0}}}},"munito":{"id":"munito","env":["MUNITO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.munito.ai/inference/v1","name":"Munito AI","doc":"https://docs.munito.ai/models","models":{"aleph-alpha/kolibri-1":{"id":"aleph-alpha/kolibri-1","name":"Kolibri 1","description":"Aleph Alpha's German and English mixture-of-experts reasoning model (78B total, 3.46B active) for chat, RAG and agents","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-18","release_date":"2026-10-03","last_updated":"2026-10-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.13,"output":0.51,"cache_read":0.078},"canonical_model_id":"aleph-alpha/kolibri-1"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.18,"output":2.4,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"deepseek-ai/deepseek-v4-flash":{"id":"deepseek-ai/deepseek-v4-flash","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.099,"output":0.25,"cache_read":0.019},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/deepseek-v4.1-flash-1017":{"id":"deepseek-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"status":"beta","cost":{"input":0.27,"output":1,"cache_read":0.0054},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"zai-org/glm-5.3-flash":{"id":"zai-org/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.13,"output":0.45,"cache_read":0.027},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"abliteration-ai":{"id":"abliteration-ai","env":["ABLIT_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.abliteration.ai/v1","name":"abliteration.ai","doc":"https://docs.abliteration.ai/models","models":{"abliterated-model-large-v2":{"id":"abliterated-model-large-v2","name":"Abliterated Model Large V2","description":"GLM-5.3 model abliterated and finetuned for cyber, ML red teaming, and agent testing","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-29","last_updated":"2026-08-31","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":999990},"cost":{"input":5,"output":5,"cache_read":0.5}},"abliterated-model":{"id":"abliterated-model","name":"Abliterated Model","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-01-06","last_updated":"2026-07-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":150000,"input":150000,"output":8192},"cost":{"input":3,"output":3,"cache_read":0.3}},"abliterated-model-large":{"id":"abliterated-model-large","name":"Abliterated Model Large","description":"GLM-5.2 model abliterated and finetuned for cyber, ML red teaming, and agent testing","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-25","last_updated":"2026-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":999990},"cost":{"input":5,"output":5,"cache_read":0.5}}}},"kimi-code-plan-cn":{"id":"kimi-code-plan-cn","env":["KIMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.kimi.com/coding/v1","name":"Kimi For Coding (kimi.com)","doc":"https://www.kimi.com/code/docs/en/kimi-code/models.html","models":{"kimi-for-coding-highspeed":{"id":"kimi-for-coding-highspeed","name":"Kimi For Coding HighSpeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"k3.1-pro":{"id":"k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"k3":{"id":"k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3"},"k3-256k":{"id":"k3-256k","name":"Kimi K3-256K","description":"256K-context version of Kimi K3, reducing token consumption for shorter coding sessions","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3"},"k3.1-pro-highspeed":{"id":"k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-for-coding":{"id":"kimi-for-coding","name":"Kimi K2.8 Preview","description":"Kimi coding model with more efficient thinking and up to 1M context, available through Kimi Code","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.8-preview"}}},"llmtech":{"id":"llmtech","env":["LLMTECH_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.llmtech.eu/v1","name":"LLM Tech","doc":"https://llmtech.eu/models/qwen3.8-27b","models":{"nvidia/Qwen3.8-27B-NVFP4":{"id":"nvidia/Qwen3.8-27B-NVFP4","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.25,"output":2.09,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3.8-27b"}}},"nano-gpt":{"id":"nano-gpt","env":["NANO_GPT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://nano-gpt.com/api/v1","name":"NanoGPT","doc":"https://docs.nano-gpt.com","models":{"gemma-4-12b-it-station-keeper":{"id":"gemma-4-12b-it-station-keeper","name":"Gemma 4 12B StationKeeper","description":"Gemma 4 12B StationKeeper is an open-weight roleplay finetune with image understanding, tool calling, optional reasoning, and a 131,072-token context window.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-09","last_updated":"2026-09-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.025}},"gemma-4-26b-a4b-it-musica":{"id":"gemma-4-26b-a4b-it-musica","name":"Musica","description":"Musica is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"gemma-4-31b-it-garnet":{"id":"gemma-4-31b-it-garnet","name":"Garnet","description":"Garnet is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"mercury-2":{"id":"mercury-2","name":"Mercury 2","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":50000},"cost":{"input":0.25,"output":0.75,"cache_read":0.025},"canonical_model_id":"inception/mercury-2"},"gemma-4-12b-it":{"id":"gemma-4-12b-it","name":"Gemma 4 12B Instruct","description":"Compact Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.025},"canonical_model_id":"google/gemma-4-12b-it"},"Gemma-4-26B-A4B-MeroMero:thinking":{"id":"Gemma-4-26B-A4B-MeroMero:thinking","name":"Gemma 4 26B A4B MeroMero Thinking","description":"Gemma 4 26B A4B MeroMero with thinking enabled for more deliberate emotive dialogue, relationship scenes, creative writing, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash"},"gemini-2.5-flash-preview-05-20:thinking":{"id":"gemini-2.5-flash-preview-05-20:thinking","name":"Gemini 2.5 Flash 0520 Thinking","description":"Preview snapshot of Gemini 2.5 Flash with controllable thinking budgets","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"input":1048000,"output":65536},"status":"deprecated","cost":{"input":0.15,"output":3.5,"cache_read":0.015},"canonical_model_id":"google/gemini-2.5-flash-preview-05-20"},"MiniMax-M1":{"id":"MiniMax-M1","name":"MiniMax M1","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"minimax","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-01-08","last_updated":"2025-06-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.1394,"output":1.3328,"cache_read":0.0697}},"holo3-35b-a3b":{"id":"holo3-35b-a3b","name":"Holo3-35B-A3B","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":8192},"cost":{"input":0.25,"output":1.8,"cache_read":0.125}},"gemini-2.5-flash-lite-preview-09-2025-thinking":{"id":"gemini-2.5-flash-lite-preview-09-2025-thinking","name":"Gemini 2.5 Flash Lite Preview (09/2025) – Thinking","description":"September 2025 preview of Gemini 2.5 Flash-Lite with better instruction following and multimodal quality","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"google/gemini-2.5-flash-lite-preview-09-2025"},"sarvam-105b":{"id":"sarvam-105b","name":"Sarvam 105B","description":"Flagship Indian-language reasoning model for enterprise multilingual applications","family":"sarvam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-18","last_updated":"2026-02-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":4096},"cost":{"input":0.054,"output":0.2124,"cache_read":0.0336},"canonical_model_id":"sarvam/sarvam-105b"},"Meta-Llama-3-1-8B-Instruct-FP8":{"id":"Meta-Llama-3-1-8B-Instruct-FP8","name":"Llama 3.1 8B (decentralized)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.02,"output":0.03,"cache_read":0.01}},"gemini-2.5-pro-preview-03-25":{"id":"gemini-2.5-pro-preview-03-25","name":"Gemini 2.5 Pro Preview 0325","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"release_date":"2025-03-25","last_updated":"2025-03-25","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2.5,"output":10,"cache_read":0.25}},"doubao-seed-2-0-lite-260215":{"id":"doubao-seed-2-0-lite-260215","name":"Doubao Seed 2.0 Lite","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":32000},"cost":{"input":0.25,"output":2,"cache_read":0.0731},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"auto-model-basic":{"id":"auto-model-basic","name":"Auto model (Basic)","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2025-04-16","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":9.996,"output":19.992,"cache_read":4.998}},"Qwen3.5-27B-Queen-Derestricted":{"id":"Qwen3.5-27B-Queen-Derestricted","name":"Qwen3.5 27B Queen Derestricted","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"claw-high":{"id":"claw-high","name":"Claw High","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2}},"Gemma-4-31B-Dark-Gemistry":{"id":"Gemma-4-31B-Dark-Gemistry","name":"Gemma 4 31B Dark Gemistry","description":"Gemma 4 31B Dark Gemistry is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"Gemma-4-31B-MeroMero-v2":{"id":"Gemma-4-31B-MeroMero-v2","name":"Gemma 4 31B MeroMero v2","description":"Gemma 4 31B MeroMero v2 is a LoRA finetune for emotive dialogue, relationship scenes, creative writing, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-08-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"Gemma-4-31B-Novelist":{"id":"Gemma-4-31B-Novelist","name":"Gemma 4 31B Novelist (ArliAI)","description":"Gemma 4 31B Novelist is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"Gemma-4-31B-Queen":{"id":"Gemma-4-31B-Queen","name":"Gemma 4 31B Queen","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-01","last_updated":"2026-05-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"Gemma-4-31B-Animus-V14.1":{"id":"Gemma-4-31B-Animus-V14.1","name":"Gemma 4 31B Animus V14.1","description":"Gemma 4 31B Animus V14.1 is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"gemma-4-26b-a4b-it-chimeraxheretic":{"id":"gemma-4-26b-a4b-it-chimeraxheretic","name":"Gemma 4 26B A4B Chimera X Heretic","description":"Chimera X Heretic is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-08","last_updated":"2026-10-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"cache_write":0.375},"canonical_model_id":"google/gemini-2.5-pro"},"gemma-4-26b-a4b-it-darksoul":{"id":"gemma-4-26b-a4b-it-darksoul","name":"Dark Soul","description":"Dark Soul is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"Gemma-4-31B-Agares-v1":{"id":"Gemma-4-31B-Agares-v1","name":"Gemma 4 31B Agares v1","description":"Gemma 4 31B Agares v1 is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"command-a-reasoning-08-2025":{"id":"command-a-reasoning-08-2025","name":"Cohere Command A (08/2025)","description":"Cohere reasoning model for multilingual enterprise agents, tools, and complex workflows","family":"command-a","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":8192},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"cohere/command-a-reasoning-08-2025"},"pokee-isaac":{"id":"pokee-isaac","name":"Pokee-Isaac 28B","description":"Pokee-Isaac is a 28B agentic model with a roughly 10-million-token context window, function calling, and OpenAI-compatible structured output. Pokee bills in $0.01 increments, rounding each non-zero request up to the next cent.","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-08-04","last_updated":"2026-08-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":250000,"input":250000,"output":60000},"cost":{"input":0.15,"output":1,"cache_read":0.075}},"gemini-2.5-flash-preview-05-20":{"id":"gemini-2.5-flash-preview-05-20","name":"Gemini 2.5 Flash 0520","description":"Preview snapshot of Gemini 2.5 Flash with controllable thinking budgets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"input":1048000,"output":65536},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"google/gemini-2.5-flash-preview-05-20"},"auto-model":{"id":"auto-model","name":"Auto model","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2025-04-16","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":0,"output":0}},"Gemma-4-31B-AssGuard":{"id":"Gemma-4-31B-AssGuard","name":"Gemma 4 31B AssGuard","description":"Gemma 4 31B AssGuard is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"hermes-low":{"id":"hermes-low","name":"Hermes Low","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2,"cache_write":0.08333}},"claw-low":{"id":"claw-low","name":"Claw Low","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2,"cache_write":0.08333}},"doubao-seed-2-0-mini-260215":{"id":"doubao-seed-2-0-mini-260215","name":"Doubao Seed 2.0 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":32000},"cost":{"input":0.1,"output":0.4845,"cache_read":0.02465},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"Gemma-4-31B-MeroMero-v2:thinking":{"id":"Gemma-4-31B-MeroMero-v2:thinking","name":"Gemma 4 31B MeroMero v2 Thinking","description":"Gemma 4 31B MeroMero v2 with thinking enabled for more deliberate emotive dialogue, relationship scenes, creative writing, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-08-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"Gemma-4-31B-Gembrain-uncensored-heretic":{"id":"Gemma-4-31B-Gembrain-uncensored-heretic","name":"Gemma 4 31B Gembrain Uncensored Heretic","description":"Gemma 4 31B Gembrain Uncensored Heretic is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"Gemma-4-31B-SDFT-Heretic-RP":{"id":"Gemma-4-31B-SDFT-Heretic-RP","name":"Gemma 4 31B SDFT Heretic RP","description":"Gemma 4 31B SDFT Heretic RP is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"hermes-high":{"id":"hermes-high","name":"Hermes High","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2}},"universal-summarizer":{"id":"universal-summarizer","name":"Universal Summarizer","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-12-23","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":30,"output":30}},"claw-medium":{"id":"claw-medium","name":"Claw Medium","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2}},"gemma-4-26b-a4b-it-opusdistill":{"id":"gemma-4-26b-a4b-it-opusdistill","name":"Opus Distill","description":"Opus Distill is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"Gemma-4-31B-Cognitive-Unshackled":{"id":"Gemma-4-31B-Cognitive-Unshackled","name":"Gemma 4 31B Cognitive Unshackled","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-01","last_updated":"2026-05-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"google/gemini-2.5-flash-lite"},"hermes-medium":{"id":"hermes-medium","name":"Hermes Medium","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-11","last_updated":"2026-05-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2}},"gemma-4-26b-a4b-it-shadowsiren":{"id":"gemma-4-26b-a4b-it-shadowsiren","name":"Shadow Siren","description":"Shadow Siren is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"deepseek-chat-cheaper":{"id":"deepseek-chat-cheaper","name":"DeepSeek V3/Chat Cheaper","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"deepseek","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.1,"output":0.425,"cache_read":0.05}},"gemini-2.5-flash-preview-04-17:thinking":{"id":"gemini-2.5-flash-preview-04-17:thinking","name":"Gemini 2.5 Flash Preview Thinking","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"release_date":"2025-04-17","last_updated":"2025-04-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"status":"deprecated","cost":{"input":0.15,"output":3.5,"cache_read":0.015}},"venice-uncensored":{"id":"venice-uncensored","name":"Venice Uncensored","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"venice","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-10-01","last_updated":"2025-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.4,"output":1.8,"cache_read":0.4}},"celeris-1":{"id":"celeris-1","name":"Celeris 1","description":"Celeris 1 is a diffusion language model built for ultra-low-latency classification, extraction, judging, query rewriting, and other short structured responses.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-07-25","last_updated":"2026-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"input":8192,"output":8192},"cost":{"input":2,"output":6,"cache_read":1}},"Gemma-4-31B-DarkIdol":{"id":"Gemma-4-31B-DarkIdol","name":"Gemma 4 31B DarkIdol","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-01","last_updated":"2026-05-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"gemma-4-31b-it-darkidol":{"id":"gemma-4-31b-it-darkidol","name":"DarkIdol","description":"DarkIdol is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"gemini-2.0-pro-reasoner":{"id":"gemini-2.0-pro-reasoner","name":"Gemini 2.0 Pro Reasoner","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-02-05","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":1.292,"output":4.998,"cache_read":0.323}},"deepseek-chat":{"id":"deepseek-chat","name":"DeepSeek V3/Deepseek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.1,"output":0.425,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-chat"},"auto-model-premium":{"id":"auto-model-premium","name":"Auto model (Premium)","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2025-04-16","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":9.996,"output":19.992,"cache_read":4.998}},"gemini-2.5-flash-preview-09-2025":{"id":"gemini-2.5-flash-preview-09-2025","name":"Gemini 2.5 Flash Preview (09/2025)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03}},"gemini-2.5-pro-exp-03-25":{"id":"gemini-2.5-pro-exp-03-25","name":"Gemini 2.5 Pro Experimental 0325","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"release_date":"2025-03-25","last_updated":"2025-03-25","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2.5,"output":10,"cache_read":0.25}},"longcat-2.0":{"id":"longcat-2.0","name":"LongCat 2.0","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.75,"output":3,"cache_read":0.015},"canonical_model_id":"meituan/longcat-2.0"},"gemini-2.5-flash-lite-preview-06-17":{"id":"gemini-2.5-flash-lite-preview-06-17","name":"Gemini 2.5 Flash Lite Preview","description":"First preview of Gemini 2.5 Flash-Lite, the low-cost, low-latency 2.5 model","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"google/gemini-2.5-flash-lite-preview-06-17"},"holo3-35b-a3b:thinking":{"id":"holo3-35b-a3b:thinking","name":"Holo3-35B-A3B Thinking","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":8192},"cost":{"input":0.25,"output":1.8,"cache_read":0.125}},"gemma-4-31b-it-gembrain":{"id":"gemma-4-31b-it-gembrain","name":"Gembrain","description":"Gembrain is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"gemini-2.5-pro-preview-06-05":{"id":"gemini-2.5-pro-preview-06-05","name":"Gemini 2.5 Pro Preview 0605","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2.5,"output":10,"cache_read":0.25},"canonical_model_id":"google/gemini-2.5-pro-preview"},"gemma-4-31b-it-gemsicle":{"id":"gemma-4-31b-it-gemsicle","name":"Gemsicle","description":"Gemsicle is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"nano-gpt-help":{"id":"nano-gpt-help","name":"NanoGPT Help","description":"Text-only NanoGPT support assistant. Questions are processed by the Help inference provider; do not paste secrets or account credentials. Covers the website, models, API, pricing, memory, media generation, and support.","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-06-06","last_updated":"2026-06-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":6000,"input":6000,"output":512},"cost":{"input":0,"output":0}},"Gemma-4-31B-K1-v5":{"id":"Gemma-4-31B-K1-v5","name":"Gemma 4 31B K1 v5","description":"ArliAI-hosted Gemma 4 31B K1 v5 finetune for plot progression, action scenes, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-02","last_updated":"2026-05-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"gemma-4-31b-it-isometry":{"id":"gemma-4-31b-it-isometry","name":"Isometry","description":"Isometry is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"mercury-coder-small":{"id":"mercury-coder-small","name":"Mercury Coder Small","description":"Model by Inception AI. A diffusion large language model that runs incredibly quickly (500+ tokens/second) while matching Claude 3.5 Haiku and GPT-4o-mini. 1st in speed on Copilot arena, and matching 2nd in quality.","family":"mercury","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.25,"output":1,"cache_read":0.125}},"gemini-2.5-pro-preview-05-06":{"id":"gemini-2.5-pro-preview-05-06","name":"Gemini 2.5 Pro Preview 0506","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"release_date":"2025-05-06","last_updated":"2025-05-06","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2.5,"output":10,"cache_read":0.25}},"kimi-k2-instruct-fast":{"id":"kimi-k2-instruct-fast","name":"Kimi K2 0711 Fast","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"kimi-k2","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"status":"deprecated","cost":{"input":0.4,"output":1.8,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"Qwen3.5-27B-BlueStar-v3-Derestricted":{"id":"Qwen3.5-27B-BlueStar-v3-Derestricted","name":"Qwen3.5 27B BlueStar v3 Derestricted","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"gemini-3-pro-image-preview":{"id":"gemini-3-pro-image-preview","type":"chat","name":"Gemini 3 Pro Image","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"input":65536,"output":32768},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-image-preview"},"gemma-4-12b-it-starry-ocean":{"id":"gemma-4-12b-it-starry-ocean","name":"Gemma 4 12B Starry Ocean","description":"Gemma 4 12B Starry Ocean is an open-weight merge for storytelling, roleplay, and creative writing. It supports image understanding, tool calling, optional reasoning, and a 131,072-token context window.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":131072},"cost":{"input":0.05,"output":0.25,"cache_read":0.025}},"gemini-2.5-flash-preview-04-17":{"id":"gemini-2.5-flash-preview-04-17","name":"Gemini 2.5 Flash Preview","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"release_date":"2025-04-17","last_updated":"2025-04-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.015}},"gemini-exp-1206":{"id":"gemini-exp-1206","name":"Gemini 2.0 Pro 1206","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":2097152,"input":2097152,"output":8192},"cost":{"input":1.258,"output":4.998,"cache_read":0.629}},"gemini-2.5-flash-nothinking":{"id":"gemini-2.5-flash-nothinking","name":"Gemini 2.5 Flash (No Thinking)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03}},"gemma-4-31b-it-scarlet":{"id":"gemma-4-31b-it-scarlet","name":"Gemma 4 31B Scarlet","description":"Scarlet is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-08","last_updated":"2026-10-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"GLM-4.6-Derestricted-v5":{"id":"GLM-4.6-Derestricted-v5","name":"GLM 4.6 Derestricted v5","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":8192},"cost":{"input":0.4,"output":1.5,"cache_read":0.2}},"Gemma-4-31B-Fabled":{"id":"Gemma-4-31B-Fabled","name":"Gemma 4 31B Fabled (ArliAI)","description":"ArliAI-hosted Gemma 4 31B Fabled finetune for mythic narrative writing, adventure scenes, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-02","last_updated":"2026-05-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"synth-2.5-flash":{"id":"synth-2.5-flash","name":"Synth 2.5 Flash Preview","description":"Synth 2.5 Flash Preview is a low-cost text model designed for role-play, character dialogue, and collaborative storytelling.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-09-05","last_updated":"2026-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":30000,"input":30000,"output":30000},"cost":{"input":0.03,"output":0.1}},"Gemma-4-26B-A4B-MeroMero":{"id":"Gemma-4-26B-A4B-MeroMero","name":"Gemma 4 26B A4B MeroMero","description":"Gemma 4 26B A4B MeroMero is an NVFP4 multimodal mixture-of-experts fine-tune for emotive dialogue, relationship scenes, creative writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"mistral-code-agent-latest":{"id":"mistral-code-agent-latest","name":"Mistral Code Agent Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"mistral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.4,"output":2,"cache_read":0.2}},"Gemma-4-31B-GarnetV2":{"id":"Gemma-4-31B-GarnetV2","name":"Gemma 4 31B Garnet V2","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-01","last_updated":"2026-05-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.153}},"phi-4-mini-instruct":{"id":"phi-4-mini-instruct","name":"Phi 4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-02-26","last_updated":"2025-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.17,"output":0.68,"cache_read":0.085},"canonical_model_id":"microsoft/phi-4-mini"},"Gemma-4-31B-Claude-4.6-Opus-Reasoning-Distilled":{"id":"Gemma-4-31B-Claude-4.6-Opus-Reasoning-Distilled","name":"Gemma 4 31B Claude 4.6 Opus Reasoning Distilled","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"claude","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-01","last_updated":"2026-05-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.306,"output":0.306,"cache_read":0.0306,"cache_write":0.3825}},"Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-Derestricted-Lite":{"id":"Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-Derestricted-Lite","name":"Qwen3.5 27B Claude 4.6 Opus Reasoning Distilled Derestricted Lite","description":"Qwen3.5 27B Claude 4.6 Opus Reasoning Distilled Derestricted Lite is a lighter-tuned community finetune for responsive multimodal chat, expressive writing, and roleplay.","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306,"cache_read":0.0306,"cache_write":0.3825}},"qwen3-vl-235b-a22b-instruct-original":{"id":"qwen3-vl-235b-a22b-instruct-original","name":"Qwen3 VL 235B A22B Instruct Original","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.3,"output":1.9,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"mistral-code-latest":{"id":"mistral-code-latest","name":"Mistral Code Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"mistral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.15}},"phi-4-multimodal-instruct":{"id":"phi-4-multimodal-instruct","name":"Phi 4 Multimodal","description":"Compact Microsoft multimodal model for text, image, and speech understanding","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-02-26","last_updated":"2025-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.07,"output":0.11,"cache_read":0.035},"canonical_model_id":"microsoft/phi-4-multimodal-instruct"},"gemma-4-31b-it-fabled":{"id":"gemma-4-31b-it-fabled","name":"Fabled","description":"Fabled is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"Gemma-4-31B-MeroMero":{"id":"Gemma-4-31B-MeroMero","name":"Gemma 4 31B MeroMero","description":"Gemma 4 31B MeroMero is a community creative finetune for emotive dialogue, relationship scenes, and multimodal roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-02","last_updated":"2026-05-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"gemma-4-12b-it-semancer":{"id":"gemma-4-12b-it-semancer","name":"Gemma 4 12B Semancer","description":"Gemma 4 12B Semancer is an open-weight roleplay finetune with image understanding, tool calling, optional reasoning, and a 131,072-token context window.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-09","last_updated":"2026-09-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.025}},"Qwen3.5-27B-Blossom-V6.4-Derestricted":{"id":"Qwen3.5-27B-Blossom-V6.4-Derestricted","name":"Qwen3.5 27B Blossom V6.4 Derestricted","description":"Qwen3.5 27B Blossom V6.4 Derestricted is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"gemma-4-26b-a4b-it-moonlight":{"id":"gemma-4-26b-a4b-it-moonlight","name":"Moonlight Dusk","description":"Moonlight Dusk is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"doubao-seed-2-0-code-preview-260215":{"id":"doubao-seed-2-0-code-preview-260215","name":"Doubao Seed 2.0 Code Preview","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":128000},"cost":{"input":0.782,"output":3.893,"cache_read":0.391},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"gemma-4-26b-a4b-it-chimerax":{"id":"gemma-4-26b-a4b-it-chimerax","name":"Chimera X","description":"Chimera X is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"fastgpt":{"id":"fastgpt","name":"Web Answer","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-12-23","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":7.5,"output":7.5}},"Gemma-4-31B-StyleTune":{"id":"Gemma-4-31B-StyleTune","name":"Gemma 4 31B StyleTune","description":"Gemma 4 31B StyleTune is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"gemini-2.0-pro-exp-02-05":{"id":"gemini-2.0-pro-exp-02-05","name":"Gemini 2.0 Pro 0205","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-02-05","last_updated":"2025-02-05","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":2097152,"input":2097152,"output":8192},"cost":{"input":1.989,"output":7.956,"cache_read":0.49725}},"gemma-4-26b-a4b-it-luminous":{"id":"gemma-4-26b-a4b-it-luminous","name":"Luminous Mirror","description":"Luminous Mirror is a Gemma 4 26B A4B multimodal mixture-of-experts fine-tune for creative writing, expressive dialogue, and roleplay.","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.12,"output":0.38,"cache_read":0.06}},"gemini-2.5-flash-preview-09-2025-thinking":{"id":"gemini-2.5-flash-preview-09-2025-thinking","name":"Gemini 2.5 Flash Preview (09/2025) – Thinking","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03}},"gemma-4-31b-it-novelist":{"id":"gemma-4-31b-it-novelist","name":"Novelist","description":"Novelist is a multimodal Gemma 4 31B creative finetune for expressive dialogue, long-form storytelling, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-07-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"Gemma-4-31B-Isometry-RP":{"id":"Gemma-4-31B-Isometry-RP","name":"Gemma 4 31B Isometry RP","description":"Gemma 4 31B Isometry RP is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"Gemma-4-31B-Gembrain-X-Core":{"id":"Gemma-4-31B-Gembrain-X-Core","name":"Gemma 4 31B Gembrain X Core","description":"Gemma 4 31B Gembrain X Core is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306}},"auto-model-standard":{"id":"auto-model-standard","name":"Auto model (Standard)","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2025-04-16","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":9.996,"output":19.992,"cache_read":4.998}},"Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-Derestricted":{"id":"Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-Derestricted","name":"Qwen3.5 27B Claude 4.6 Opus Reasoning Distilled Derestricted","description":"Qwen3.5 27B Claude 4.6 Opus Reasoning Distilled Derestricted is a community creative finetune for reasoning, multimodal chat, expressive writing, and roleplay.","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-15","last_updated":"2026-05-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.306,"output":0.306,"cache_read":0.0306,"cache_write":0.3825}},"deepseek-v3-0324":{"id":"deepseek-v3-0324","name":"DeepSeek Chat 0324","description":"March 2025 checkpoint of DeepSeek-V3 with improved reasoning and coding","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.2,"output":0.77,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v3-0324"},"doubao-seed-2-0-pro-260215":{"id":"doubao-seed-2-0-pro-260215","name":"Doubao Seed 2.0 Pro","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":128000},"cost":{"input":0.782,"output":3.876,"cache_read":0.391},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"synth-2.5-pro":{"id":"synth-2.5-pro","name":"Synth 2.5 Pro Preview","description":"Synth 2.5 Pro Preview is a low-cost text model designed for role-play, character dialogue, and collaborative storytelling.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-09-05","last_updated":"2026-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":30000,"input":30000,"output":30000},"cost":{"input":0.1,"output":0.2}},"longcat-2.0:thinking":{"id":"longcat-2.0:thinking","name":"LongCat 2.0 Thinking","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.75,"output":3,"cache_read":0.015},"canonical_model_id":"meituan/longcat-2.0"},"gemini-2.5-flash-lite-preview-09-2025":{"id":"gemini-2.5-flash-lite-preview-09-2025","name":"Gemini 2.5 Flash Lite Preview (09/2025)","description":"September 2025 preview of Gemini 2.5 Flash-Lite with better instruction following and multimodal quality","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"google/gemini-2.5-flash-lite-preview-09-2025"},"anthropic/claude-sonnet-4.6:thinking":{"id":"anthropic/claude-sonnet-4.6:thinking","name":"Claude Sonnet 4.6 Thinking","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-sonnet-5:thinking":{"id":"anthropic/claude-sonnet-5:thinking","name":"Claude Sonnet 5 Thinking","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-opus-4.6:thinking:medium":{"id":"anthropic/claude-opus-4.6:thinking:medium","name":"Claude 4.6 Opus Thinking Medium","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-sonnet-latest":{"id":"anthropic/claude-sonnet-latest","name":"Claude Sonnet Latest","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-01","last_updated":"2026-03-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"anthropic/claude-opus-4.8:thinking":{"id":"anthropic/claude-opus-4.8:thinking","name":"Claude Opus 4.8 Thinking","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude 4.6 Opus","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude 4.7 Opus","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude 4.5 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-4.1:thinking:1024":{"id":"anthropic/claude-opus-4.1:thinking:1024","name":"Claude 4.1 Opus Thinking (1K)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-fable-latest":{"id":"anthropic/claude-fable-latest","name":"Claude Fable Latest","description":"Compatibility alias for Claude Fable.","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5}},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-opus-4.1:thinking:8192":{"id":"anthropic/claude-opus-4.1:thinking:8192","name":"Claude 4.1 Opus Thinking (8K)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-opus-4.1:thinking":{"id":"anthropic/claude-opus-4.1:thinking","name":"Claude 4.1 Opus Thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-sonnet-4.5:thinking":{"id":"anthropic/claude-sonnet-4.5:thinking","name":"Claude Sonnet 4.5 Thinking","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-opus-4.6:thinking:low":{"id":"anthropic/claude-opus-4.6:thinking:low","name":"Claude 4.6 Opus Thinking Low","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude 4.1 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-opus-4.6:thinking:max":{"id":"anthropic/claude-opus-4.6:thinking:max","name":"Claude 4.6 Opus Thinking Max","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.5:thinking":{"id":"anthropic/claude-opus-4.5:thinking","name":"Claude 4.5 Opus Thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-4.1:thinking:32768":{"id":"anthropic/claude-opus-4.1:thinking:32768","name":"Claude 4.1 Opus Thinking (32K)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-opus-4.7:thinking":{"id":"anthropic/claude-opus-4.7:thinking","name":"Claude 4.7 Opus Thinking","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-latest":{"id":"anthropic/claude-opus-latest","name":"Claude Opus Latest","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-29","last_updated":"2026-03-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5}},"anthropic/claude-sonnet-5.5:thinking":{"id":"anthropic/claude-sonnet-5.5:thinking","name":"Claude Sonnet 5.5 Thinking","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-haiku-4.5:thinking":{"id":"anthropic/claude-haiku-4.5:thinking","name":"Claude Haiku 4.5 Thinking","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-haiku-latest":{"id":"anthropic/claude-haiku-latest","name":"Claude Haiku Latest","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-29","last_updated":"2026-03-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]}},"anthropic/claude-opus-4.6:thinking":{"id":"anthropic/claude-opus-4.6:thinking","name":"Claude 4.6 Opus Thinking","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"aion-labs/aion-3.0":{"id":"aion-labs/aion-3.0","name":"AionLabs: Aion 3.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75},"canonical_model_id":"aion-labs/aion-3.0"},"aion-labs/aion-3.5-mini":{"id":"aion-labs/aion-3.5-mini","name":"AionLabs: Aion 3.5 Mini","description":"A GLM-family collaborative generation model tuned for immersive roleplay and storytelling, with stronger narrative structure, tension, conflict, and nuanced mature themes.","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18}},"aion-labs/aion-2.0":{"id":"aion-labs/aion-2.0","name":"AionLabs: Aion-2.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-21","last_updated":"2025-12-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.8,"output":1.6,"cache_read":0.2},"canonical_model_id":"aion-labs/aion-2.0"},"aion-labs/aion-3.0-mini":{"id":"aion-labs/aion-3.0-mini","name":"AionLabs: Aion 3.0 Mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18},"canonical_model_id":"aion-labs/aion-3.0-mini"},"aion-labs/aion-rp-llama-3.1-8b":{"id":"aion-labs/aion-rp-llama-3.1-8b","name":"Llama 3.1 8b (uncensored)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2025-02-04","last_updated":"2025-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.8,"output":1.6,"cache_read":0.4},"canonical_model_id":"aion-labs/aion-rp-llama-3.1-8b"},"aion-labs/aion-3.5":{"id":"aion-labs/aion-3.5","name":"AionLabs: Aion 3.5","description":"A GLM-family collaborative generation model tuned for immersive roleplay and storytelling, with stronger narrative structure, tension, conflict, and nuanced mature themes.","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75}},"Sao10K/L3-8B-Stheno-v3.2":{"id":"Sao10K/L3-8B-Stheno-v3.2","name":"Sao10K Stheno 8b","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-11-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.2006,"output":0.2006,"cache_read":0.1003}},"Sao10K/L3.1-70B-Hanami-x1":{"id":"Sao10K/L3.1-70B-Hanami-x1","name":"Llama 3.1 70B Hanami","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"Sao10K/L3.1-70B-Euryale-v2.2":{"id":"Sao10K/L3.1-70B-Euryale-v2.2","name":"Llama 3.1 70B Euryale","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-28","last_updated":"2024-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":20480,"input":20480,"output":16384},"cost":{"input":0.306,"output":0.357,"cache_read":0.153},"canonical_model_id":"sao10k/l3.1-euryale-70b"},"Sao10K/L3.3-70B-Euryale-v2.3":{"id":"Sao10K/L3.3-70B-Euryale-v2.3","name":"Llama 3.3 70B Euryale","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-12-18","last_updated":"2024-12-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":20480,"input":20480,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465},"canonical_model_id":"sao10k/l3.3-euryale-70b"},"baseten/Kimi-K2-Instruct-FP4":{"id":"baseten/Kimi-K2-Instruct-FP4","name":"Kimi K2 0711 Instruct FP4","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":131072},"status":"deprecated","cost":{"input":0.4,"output":1.8,"cache_read":0.2}},"TEE/glm-5.2:thinking":{"id":"TEE/glm-5.2:thinking","name":"GLM 5.2 Thinking TEE","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":1.25,"output":3.95,"cache_read":0.125},"canonical_model_id":"zhipuai/glm-5.2"},"TEE/glm-5.2":{"id":"TEE/glm-5.2","name":"GLM 5.2 TEE","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":1.25,"output":3.95,"cache_read":0.125},"canonical_model_id":"zhipuai/glm-5.2"},"TEE/kimi-k3.1-pro":{"id":"TEE/kimi-k3.1-pro","name":"Kimi K3.1 Pro TEE","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":4,"output":20,"cache_read":0.4},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"TEE/kimi-k2.6":{"id":"TEE/kimi-k2.6","name":"Kimi K2.6 TEE","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.39,"output":1.8,"cache_read":0.039},"canonical_model_id":"moonshotai/kimi-k2.6"},"TEE/glm-5.1-thinking":{"id":"TEE/glm-5.1-thinking","name":"GLM 5.1 Thinking TEE","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"input":202752,"output":65535},"cost":{"input":0.9,"output":2.9,"cache_read":0.09},"canonical_model_id":"zhipuai/glm-5.1"},"TEE/gemma-4-26b-a4b-uncensored":{"id":"TEE/gemma-4-26b-a4b-uncensored","name":"Gemma 4 26B A4B Uncensored TEE","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-05-23","last_updated":"2026-05-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":65536},"cost":{"input":0.15,"output":0.7,"cache_read":0.05}},"TEE/llama3-3-70b":{"id":"TEE/llama3-3-70b","name":"Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":1.75,"output":2.75,"cache_read":1.75},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"TEE/kimi-k3":{"id":"TEE/kimi-k3","name":"Kimi K3 TEE","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65535},"cost":{"input":1.85,"output":9.5,"cache_read":0.185},"canonical_model_id":"moonshotai/kimi-k3"},"TEE/qwen3.8-27b":{"id":"TEE/qwen3.8-27b","name":"Qwen3.8 27B TEE","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.2,"output":2.5,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"TEE/glm-5.1":{"id":"TEE/glm-5.1","name":"GLM 5.1 TEE","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"input":202752,"output":65535},"cost":{"input":0.9,"output":2.9,"cache_read":0.09},"canonical_model_id":"zhipuai/glm-5.1"},"TEE/deepseek-v4.1-flash":{"id":"TEE/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash TEE","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.6,"output":1.45,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"TEE/gemma4-31b:thinking":{"id":"TEE/gemma4-31b:thinking","name":"Gemma 4 31B Thinking TEE","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.12,"output":0.37,"cache_read":0.012},"canonical_model_id":"google/gemma-4-31b-it"},"TEE/glm-5.3":{"id":"TEE/glm-5.3","name":"GLM 5.3 TEE","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"TEE/glm-5.3-flash":{"id":"TEE/glm-5.3-flash","name":"GLM 5.3 Flash TEE","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"TEE/gemma-4-31b-it":{"id":"TEE/gemma-4-31b-it","name":"Gemma 4 31B IT TEE","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.15,"output":0.46,"cache_read":0.075},"canonical_model_id":"google/gemma-4-31b-it"},"TEE/qwen3.6-27b":{"id":"TEE/qwen3.6-27b","name":"Qwen3.6 27B TEE","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.32,"output":3.25,"cache_read":0.03},"canonical_model_id":"alibaba/qwen3.6-27b"},"TEE/qwen3.6-35b-a3b":{"id":"TEE/qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B TEE","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.2,"output":1.27,"cache_read":0.056},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"TEE/deepseek-v3.2":{"id":"TEE/deepseek-v3.2","name":"DeepSeek V3.2 TEE","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"input":164000,"output":65536},"cost":{"input":1,"output":1,"cache_read":0.5},"canonical_model_id":"deepseek/deepseek-v3.2"},"TEE/gpt-oss-120b":{"id":"TEE/gpt-oss-120b","name":"GPT-OSS 120B TEE","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.15},"canonical_model_id":"openai/gpt-oss-120b"},"TEE/gemma4-31b":{"id":"TEE/gemma4-31b","name":"Gemma 4 31B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.12,"output":0.37,"cache_read":0.012},"canonical_model_id":"google/gemma-4-31b-it"},"anthracite-org/magnum-v2-72b":{"id":"anthracite-org/magnum-v2-72b","name":"Magnum V2 72B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":2.006,"output":2.992,"cache_read":1.003}},"anthracite-org/magnum-v4-72b":{"id":"anthracite-org/magnum-v4-72b","name":"Magnum v4 72B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":2.65,"output":5.3,"cache_read":1.003},"canonical_model_id":"anthracite-org/magnum-v4-72b"},"baidu/ernie-light-dt-1.0-intl":{"id":"baidu/ernie-light-dt-1.0-intl","name":"ERNIE Light DT 1.0 (Intl)","description":"ERNIE Light DT 1.0 (Intl) is Baidu's text model with Baidu Sparse Attention for working with long conversations and documents. It supports tool calling, structured output, a 1,024,000-token context window, and up to 131,072 output tokens. Choose max, high, or low reasoning effort, or none to disable reasoning.","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-11","last_updated":"2026-11-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"input":1024000,"output":131072},"cost":{"input":1.3,"output":4.5,"cache_read":0.13}},"inflatebot/MN-12B-Mag-Mell-R1":{"id":"inflatebot/MN-12B-Mag-Mell-R1","name":"Mag Mell R1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"amazon/nova-pro-v1":{"id":"amazon/nova-pro-v1","name":"Amazon Nova Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"input":300000,"output":32000},"cost":{"input":0.799,"output":3.196,"cache_read":0.3995},"canonical_model_id":"amazon/nova-pro-v1"},"amazon/nova-2-lite-v1":{"id":"amazon/nova-2-lite-v1","name":"Amazon Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65535},"cost":{"input":0.51,"output":4.25,"cache_read":0.255},"canonical_model_id":"amazon/nova-2-lite-v1"},"amazon/nova-lite-v1":{"id":"amazon/nova-lite-v1","name":"Amazon Nova Lite 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"input":300000,"output":5120},"cost":{"input":0.0595,"output":0.238,"cache_read":0.02975},"canonical_model_id":"amazon/nova-lite-v1"},"aisingapore/gemma-sea-lion-v4-27b-it":{"id":"aisingapore/gemma-sea-lion-v4-27b-it","name":"Gemma SEA-LION v4 27B","description":"Gemma 3 27B tuned by AI Singapore for Southeast Asian languages and instruction following","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":128000},"cost":{"input":0.24,"output":0.48},"canonical_model_id":"aisingapore/gemma-sea-lion-v4-27b-it"},"aisingapore/qwen-sea-lion-v4-32b-it":{"id":"aisingapore/qwen-sea-lion-v4-32b-it","name":"Qwen SEA-LION v4 32B","description":"AI Singapore’s Qwen-based multilingual model, adapted for Southeast Asian languages and cultural contexts. Supports text chat and tool calling with a 128K context window.","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":131072},"cost":{"input":0.3,"output":0.6}},"meituan/longcat-2.5-preview":{"id":"meituan/longcat-2.5-preview","name":"LongCat 2.5 Preview","description":"Meituan's multimodal reasoning model for coding and agent tasks, with image understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.7875,"output":3.0975,"cache_read":0.01575},"canonical_model_id":"meituan/longcat-2.5-preview"},"particle-ai/particle-1":{"id":"particle-ai/particle-1","name":"Particle-1","description":"Particle-1 is Particle AI’s coding and data-engineering model, post-trained on DeepSeek V4.1 Flash. It accepts text and images, supports tool calling, and offers a shared 1,048,576-token context window with up to 131,072 output tokens, including reasoning. Reasoning defaults to high and can be turned off. JSON formatting is supported; strict JSON-schema enforcement is not guaranteed.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-29","last_updated":"2026-10-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.25,"output":1,"cache_read":0.03}},"aleph-alpha/kolibri-1":{"id":"aleph-alpha/kolibri-1","name":"Kolibri 1","description":"Aleph Alpha's German and English mixture-of-experts reasoning model (78B total, 3.46B active) for chat, RAG and agents","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-18","release_date":"2026-10-03","last_updated":"2026-10-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":943718},"cost":{"input":0.168,"output":0.588,"cache_read":0.0987},"canonical_model_id":"aleph-alpha/kolibri-1"},"abacusai/Dracarys-72B-Instruct":{"id":"abacusai/Dracarys-72B-Instruct","name":"Llama 3.1 70B Dracarys 2","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-08-02","last_updated":"2025-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":900000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-latest":{"id":"x-ai/grok-latest","name":"Grok Latest","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5}},"x-ai/grok-4.20":{"id":"x-ai/grok-4.20","name":"Grok 4.20","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"input":2000000,"output":131072},"cost":{"input":1.25,"output":2.5,"cache_read":0.2}},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":230400},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"x-ai/grok-4.20-multi-agent":{"id":"x-ai/grok-4.20-multi-agent","name":"Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"input":2000000,"output":131072},"cost":{"input":1.25,"output":2.5,"cache_read":0.2}},"Steelskull/L3.3-Electra-R1-70b":{"id":"Steelskull/L3.3-Electra-R1-70b","name":"Steelskull Electra R1 70b","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.69989,"output":0.69989,"cache_read":0.349945}},"Steelskull/L3.3-Nevoria-R1-70b":{"id":"Steelskull/L3.3-Nevoria-R1-70b","name":"Steelskull Nevoria R1 70b","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"Steelskull/L3.3-MS-Nevoria-70b":{"id":"Steelskull/L3.3-MS-Nevoria-70b","name":"Steelskull Nevoria 70b","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"Steelskull/L3.3-Cu-Mai-R1-70b":{"id":"Steelskull/L3.3-Cu-Mai-R1-70b","name":"Llama 3.3 70B Cu Mai","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5":{"id":"failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5","name":"Llama 3 70B abliterated","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-26","last_updated":"2025-07-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"input":8192,"output":8192},"cost":{"input":0.7,"output":0.7,"cache_read":0.35}},"deepseek/deepseek-v4-pro:thinking":{"id":"deepseek/deepseek-v4-pro:thinking","name":"DeepSeek V4 Pro (Thinking)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.95124,"output":1.79607,"cache_read":0.17925},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4.1-flash-uncensored:thinking":{"id":"deepseek/deepseek-v4.1-flash-uncensored:thinking","name":"DeepSeek V4.1 Flash Uncensored Thinking","description":"A lower-refusal finetune of DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. Supports a context window of up to 1M tokens.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"deepseek/deepseek-v4-flash-0423":{"id":"deepseek/deepseek-v4-flash-0423","name":"DeepSeek V4 Flash 0423","description":"Initial DeepSeek V4 Flash snapshot for economical reasoning, coding, and million-token agent workloads","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0423"},"deepseek/deepseek-v4-flash-0423:thinking":{"id":"deepseek/deepseek-v4-flash-0423:thinking","name":"DeepSeek V4 Flash 0423 (Thinking)","description":"Initial DeepSeek V4 Flash snapshot for economical reasoning, coding, and million-token agent workloads","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0423"},"deepseek/deepseek-v3.2:thinking":{"id":"deepseek/deepseek-v3.2:thinking","name":"DeepSeek V3.2 Thinking","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":163000,"input":163000,"output":65536},"cost":{"input":0.2088,"output":0.3096,"cache_read":0.0216},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash:thinking":{"id":"deepseek/deepseek-v4-flash:thinking","name":"DeepSeek V4 Flash (Thinking)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4.1-flash-1017-uncensored:thinking":{"id":"deepseek/deepseek-v4.1-flash-1017-uncensored:thinking","name":"DeepSeek V4.1 Flash 1017 Uncensored Thinking","description":"Uncensored DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. The date label is retained for compatibility. Served only by its own checkpoint; it may be unavailable while that host is down.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.33,"output":1.32,"cache_read":0.011}},"deepseek/deepseek-v4-flash-0731:thinking":{"id":"deepseek/deepseek-v4-flash-0731:thinking","name":"DeepSeek V4 Flash 0731 (Thinking)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.05,"output":0.16,"cache_read":0.013},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.66,"output":4.1267,"cache_read":0.0921},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4-flash-latest":{"id":"deepseek/deepseek-v4-flash-latest","name":"DeepSeek V4 Flash Latest","description":"Compatibility alias that routes to the newest dated DeepSeek V4 Flash release. Currently routes to DeepSeek V4 Flash 0731. ⚠️ This route goes directly to DeepSeek, so privacy and logging guarantees are limited.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-02","last_updated":"2026-08-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":393216},"cost":{"input":0.1,"output":0.6,"cache_read":0.0042}},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.022,"output":0.4,"cache_read":0.004},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.86979,"output":1.77565,"cache_read":0.08873},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-latest":{"id":"deepseek/deepseek-latest","name":"DeepSeek Latest","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.66,"output":4.0139,"cache_read":0.105}},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.2156,"output":0.6468,"cache_read":0.00686},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-v4.1-flash:thinking":{"id":"deepseek/deepseek-v4.1-flash:thinking","name":"DeepSeek V4.1 Flash Thinking","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.022,"output":0.4,"cache_read":0.004},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4.1-flash-1017:thinking":{"id":"deepseek/deepseek-v4.1-flash-1017:thinking","name":"DeepSeek V4.1 Flash 1017 Thinking","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":393216},"cost":{"input":0.1,"output":0.6,"cache_read":0.0042},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek/deepseek-v4.1-flash-1017-uncensored":{"id":"deepseek/deepseek-v4.1-flash-1017-uncensored","name":"DeepSeek V4.1 Flash 1017 Uncensored","description":"Uncensored DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. The date label is retained for compatibility. Served only by its own checkpoint; it may be unavailable while that host is down.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.33,"output":1.32,"cache_read":0.011}},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-pro-0813:thinking":{"id":"deepseek/deepseek-v4-pro-0813:thinking","name":"DeepSeek V4 Pro 0813 Thinking","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":384000},"cost":{"input":0.66,"output":4.0139,"cache_read":0.105},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash-0910-uncensored":{"id":"deepseek/deepseek-v4.1-flash-0910-uncensored","name":"DeepSeek V4.1 Flash 0910 Uncensored","description":"Uncensored DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. The date label is retained for compatibility. Served only by its own checkpoint; it may be unavailable while that host is down.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"input":524288,"output":32768},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":163000,"input":163000,"output":65536},"cost":{"input":0.2088,"output":0.3096,"cache_read":0.0216},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.05,"output":0.16,"cache_read":0.013},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":393216},"cost":{"input":0.1,"output":0.6,"cache_read":0.0042},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek/deepseek-v4.1-flash-0910-uncensored:thinking":{"id":"deepseek/deepseek-v4.1-flash-0910-uncensored:thinking","name":"DeepSeek V4.1 Flash 0910 Uncensored Thinking","description":"Uncensored DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. The date label is retained for compatibility. Served only by its own checkpoint; it may be unavailable while that host is down.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"input":524288,"output":32768},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"deepseek/deepseek-v4.1-flash-uncensored":{"id":"deepseek/deepseek-v4.1-flash-uncensored","name":"DeepSeek V4.1 Flash Uncensored","description":"A lower-refusal finetune of DeepSeek V4.1 Flash with text and image input, optional reasoning, and tool calling. Supports a context window of up to 1M tokens.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"inclusionai/ling-3.0-flash-vl":{"id":"inclusionai/ling-3.0-flash-vl","name":"Ling 3.0 Flash VL","description":"Native multimodal hybrid MoE model for image and video understanding, reasoning, and visual agents","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"inclusionai/ling-3.0-tiny":{"id":"inclusionai/ling-3.0-tiny","name":"Ling 3.0 Tiny","description":"Ling 3.0 Tiny is a compact 7.9B-parameter Mixture-of-Experts model with 1.3B parameters active per token. It is designed for responsive agents, reliable instruction following, natural multi-turn conversations, long-context work, and function calling at low inference cost.","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-11-07","last_updated":"2026-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.015,"output":0.045,"cache_read":0.003}},"inclusionai/ling-3.0-flash":{"id":"inclusionai/ling-3.0-flash","name":"Ling 3.0 Flash","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash"},"inclusionai/ling-3.0-tiny:thinking":{"id":"inclusionai/ling-3.0-tiny:thinking","name":"Ling 3.0 Tiny Thinking","description":"Ling 3.0 Tiny Thinking enables visible reasoning on inclusionAI's compact 7.9B-parameter Mixture-of-Experts model for harder agent tasks, coding, planning, function calling, and long-context workflows.","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"release_date":"2026-11-07","last_updated":"2026-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.015,"output":0.045,"cache_read":0.003}},"inclusionai/ling-3.1-flash":{"id":"inclusionai/ling-3.1-flash","name":"Ling 3.1 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.1-flash"},"inclusionai/ling-3.0-flash:thinking":{"id":"inclusionai/ling-3.0-flash:thinking","name":"Ling 3.0 Flash Thinking","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash"},"google/gemini-3.5-flash-thinking":{"id":"google/gemini-3.5-flash-thinking","name":"Gemini 3.5 Flash Thinking","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.083333},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-lite-latest":{"id":"google/gemini-flash-lite-latest","name":"Gemini Flash Lite Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.08333},"canonical_model_id":"google/gemini-flash-lite-latest"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemma4-31b-splituntied":{"id":"google/gemma4-31b-splituntied","name":"Gemma 4 31B Split-Untied","description":"Blazed-Forge's Split-Untied is a text-only Gemma 4 31B community finetune with an untied BF16 output head, built for creative writing, roleplay, expressive dialogue, and tool use.","family":"gemma","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.1,"output":0.3,"cache_read":0.05}},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-carbon"},"google/gemini-pro-latest":{"id":"google/gemini-pro-latest","name":"Gemini Pro Latest","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-29","last_updated":"2026-03-29","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375}},"google/gemini-3.1-pro-preview-high":{"id":"google/gemini-3.1-pro-preview-high","name":"Gemini 3.1 Pro (Preview High)","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemma-4-26b-a4b-it-cybersecurity":{"id":"google/gemma-4-26b-a4b-it-cybersecurity","name":"Gemma 4 26B A4B Cybersecurity","description":"Gemma 4 26B A4B Cybersecurity is a cybersecurity-focused variant based on the uncensored model, with provider moderation for illegal activities. It supports optional reasoning, image understanding, tool calling, and a 262,144-token context window.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-19","last_updated":"2026-09-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1056,"output":0.3344,"cache_read":0.0528}},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.083333},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-flash-latest"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemma-4-31b-it:thinking":{"id":"google/gemma-4-31b-it:thinking","name":"Gemma 4 31B Thinking","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.1,"output":0.34,"cache_read":0.1},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro (Preview Custom Tools)","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro (Preview)","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":0.1875},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.1-pro-preview-low":{"id":"google/gemini-3.1-pro-preview-low","name":"Gemini 3.1 Pro (Preview Low)","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3-flash-preview-thinking":{"id":"google/gemini-3-flash-preview-thinking","name":"Gemini 3 Flash Thinking","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.14,"output":0.4,"cache_read":0.05},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26b-a4b-it:thinking":{"id":"google/gemma-4-26b-a4b-it:thinking","name":"Gemma 4 26B A4B Thinking","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.01,"output":0.031,"cache_read":0.005},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/diffusiongemma":{"id":"google/diffusiongemma","name":"DiffusionGemma","description":"DiffusionGemma is a high-speed diffusion-based version of Gemma 4 26B A4B. It supports optional reasoning and a 262,144-token context window.","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","xhigh"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-09","last_updated":"2026-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.05,"output":0.15,"cache_read":0.025},"canonical_model_id":"google/diffusiongemma-26b-a4b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash (Preview)","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.01,"output":0.031,"cache_read":0.005},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.7-flash"},"qwen/qwen3.5-27b:thinking":{"id":"qwen/qwen3.5-27b:thinking","name":"Qwen3.5 27B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":260096,"input":260096,"output":65536},"cost":{"input":0.2,"output":1.75,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen 3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.325,"output":1.95,"cache_read":0.0325,"cache_write":0.40625},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen-2.5-72b-instruct":{"id":"qwen/qwen-2.5-72b-instruct","name":"Qwen2.5 72B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2025-07-03","last_updated":"2025-07-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":8192},"cost":{"input":0.36,"output":0.4,"cache_read":0.1785}},"qwen/qwen3-coder-30b-a3b-instruct":{"id":"qwen/qwen3-coder-30b-a3b-instruct","name":"Qwen3 Coder 30B A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"qwen/qwen3-30b-a3b":{"id":"qwen/qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":41000,"input":41000,"output":32768},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.3,"output":1.9,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen2.5-vl-72b-instruct":{"id":"qwen/qwen2.5-vl-72b-instruct","name":"Qwen25 VL 72b","description":"Qwen25 VL 72b model with 32k context window","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-05-10","last_updated":"2025-05-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"input":32000,"output":32000},"cost":{"input":0.69989,"output":0.69989}},"qwen/qwen3.8-27b-antislop":{"id":"qwen/qwen3.8-27b-antislop","name":"Qwen 3.8 27B Antislop","description":"Qwen 3.8 27B Antislop is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3-vl-235b-a22b-thinking":{"id":"qwen/qwen3-vl-235b-a22b-thinking","name":"Qwen3 VL 235B A22B Thinking","description":"Qwen vision-language thinking model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-thinking"},"qwen/qwen3.8-max:thinking":{"id":"qwen/qwen3.8-max:thinking","name":"Qwen3.8 Max Thinking","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"input":991000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.8-27b:thinking":{"id":"qwen/qwen3.8-27b:thinking","name":"Qwen3.8 27B Thinking","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.15,"output":0.7,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.8-27b-hemmingway":{"id":"qwen/qwen3.8-27b-hemmingway","name":"Qwen 3.8 27B Hemingway","description":"Qwen 3.8 27B Hemingway is an open-weight NVFP4 multimodal creative finetune for long-form prose, character dialogue, storytelling, and roleplay.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.25,"output":1.5,"cache_read":0.125}},"qwen/qwen3-235b-a22b-thinking-2507":{"id":"qwen/qwen3-235b-a22b-thinking-2507","name":"Qwen 3 235b A22B 2507 Thinking","description":"Updated large open Qwen3 MoE thinking model for reasoning, math, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":81920},"cost":{"input":0.3,"output":0.5},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"qwen/qwen3.7-plus:thinking":{"id":"qwen/qwen3.7-plus:thinking","name":"Qwen3.7 Plus Thinking","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":983616,"output":65536},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.8-27b-novelist":{"id":"qwen/qwen3.8-27b-novelist","name":"Qwen 3.8 27B Novelist","description":"Qwen 3.8 27B Novelist is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.8-27b-kimiko":{"id":"qwen/qwen3.8-27b-kimiko","name":"Qwen 3.8 27B Kimiko","description":"Qwen 3.8 27B Kimiko is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.8-omni-flash":{"id":"qwen/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen/qwen3-coder":{"id":"qwen/qwen3-coder","name":"Qwen 3 Coder 480B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"input":262000,"output":65536},"cost":{"input":0.13,"output":0.5,"cache_read":0.065},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"qwen/qwen-max":{"id":"qwen/qwen-max","name":"Qwen 2.5 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"input":32000,"output":8192},"cost":{"input":1.5997,"output":6.392,"cache_read":0.79985},"canonical_model_id":"alibaba/qwen-max"},"qwen/qwen3-14b":{"id":"qwen/qwen3-14b","name":"Qwen 3 14b","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":41000,"input":41000,"output":32768},"cost":{"input":0.08,"output":0.24,"cache_read":0.04}},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.15,"output":0.7,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.6-max-preview":{"id":"qwen/qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":245760,"input":245760,"output":65536},"cost":{"input":1.04,"output":6.24,"cache_read":0.52},"canonical_model_id":"alibaba/qwen3.6-max-preview"},"qwen/qwen3.5-flash":{"id":"qwen/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen3.8-27b-kiwen":{"id":"qwen/qwen3.8-27b-kiwen","name":"Qwen 3.8 27B Kiwen","description":"Qwen 3.8 27B Kiwen is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":995904,"input":995904,"output":32768},"cost":{"input":0.3995,"output":1.2002,"cache_read":0.19975},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.14,"output":0.42,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3-30b-a3b-instruct-2507":{"id":"qwen/qwen3-30b-a3b-instruct-2507","name":"Qwen3 30B A3B Instruct 2507","description":"Updated compact Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":0.2,"output":0.5,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3-235b-a22b-instruct-2507":{"id":"qwen/qwen3-235b-a22b-instruct-2507","name":"Qwen 3 235b A22B 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.09,"output":0.55,"cache_read":0.0175},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3-next-80b-a3b-thinking":{"id":"qwen/qwen3-next-80b-a3b-thinking","name":"Qwen3 Next 80B A3B (Thinking)","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":0.15,"output":0.65,"cache_read":0.075},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"qwen/qwen3.8-27b-uncensored:thinking":{"id":"qwen/qwen3.8-27b-uncensored:thinking","name":"Qwen 3.8 27B Uncensored Thinking","description":"Qwen 3.8 27B Uncensored with thinking enabled for more deliberate creative work, coding, multimodal analysis, tool use, and long-context problem solving.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-07-29","last_updated":"2026-08-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1,"output":3,"cache_read":0.22}},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.39,"output":2.34,"cache_read":0.3},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.05,"output":0.15,"cache_read":0.008},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3.8-max-prime":{"id":"qwen/qwen3.8-max-prime","name":"Qwen3.8 Max Prime","description":"High-throughput edition of Qwen3.8 Max for coding, professional work, multimodal understanding, and long-running agent workflows","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":4,"output":12,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.8-max-prime"},"qwen/qwen3.8-27b-darkidol":{"id":"qwen/qwen3.8-27b-darkidol","name":"Qwen 3.8 27B DarkIdol","description":"Qwen 3.8 27B DarkIdol is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.8-27b-cybersecurity":{"id":"qwen/qwen3.8-27b-cybersecurity","name":"Qwen 3.8 27B Cybersecurity","description":"Qwen 3.8 27B Cybersecurity is a cybersecurity-focused variant based on the uncensored model, with provider moderation for illegal activities. It supports optional reasoning, image understanding, tool calling, and a 262,144-token context window.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-19","last_updated":"2026-09-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3.5-122b-a10b:thinking":{"id":"qwen/qwen3.5-122b-a10b:thinking","name":"Qwen3.5 122B A10B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.26,"output":2.08,"cache_read":0.103788},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"qwen/qwen3.7-flash:thinking":{"id":"qwen/qwen3.7-flash:thinking","name":"Qwen3.7 Flash Thinking","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":983616,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":260096,"input":260096,"output":65536},"cost":{"input":0.14,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.6-35b-a3b:thinking":{"id":"qwen/qwen3.6-35b-a3b:thinking","name":"Qwen3.6 35B A3B Thinking","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.112,"output":0.8,"cache_read":0.056},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.8-27b-fable":{"id":"qwen/qwen3.8-27b-fable","name":"Qwen 3.8 27B Fable","description":"Qwen 3.8 27B Fable is an open-weight multimodal creative finetune for expressive dialogue, long-form storytelling, character work, and roleplay.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-07-29","last_updated":"2026-08-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.25,"output":1.5,"cache_read":0.125}},"qwen/qwen3.6-27b:thinking":{"id":"qwen/qwen3.6-27b:thinking","name":"Qwen3.6 27B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.203,"output":2.24,"cache_read":0.1015},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1.475,"output":4.425,"cache_read":0.295,"cache_write":1.84375},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.8-27b-synthia":{"id":"qwen/qwen3.8-27b-synthia","name":"Qwen 3.8 27B Synthia","description":"Qwen 3.8 27B Synthia is a text-only roleplay finetune served by Aoru in NVFP4 with a 262,144-token context window.","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.19,"output":1.16,"cache_read":0.02,"cache_write":0.24},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3.8-27b-fimi":{"id":"qwen/qwen3.8-27b-fimi","name":"Qwen 3.8 27B Fimi","description":"Qwen 3.8 27B Fimi is a creative finetune served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen-turbo":{"id":"qwen/qwen-turbo","name":"Qwen Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":8192},"cost":{"input":0.04998,"output":0.2006,"cache_read":0.02499},"canonical_model_id":"alibaba/qwen-turbo"},"qwen/qwen3.5-397b-a17b:thinking":{"id":"qwen/qwen3.5-397b-a17b:thinking","name":"Qwen3.5 397B A17B Thinking","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.39,"output":2.34,"cache_read":0.3},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.203,"output":2.24,"cache_read":0.1015},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen2.5-coder-32b-instruct":{"id":"qwen/qwen2.5-coder-32b-instruct","name":"Qwen 2.5 Coder 32b","description":"Open coding-focused Qwen model for code generation, repair, and repository reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"input":32000,"output":8192},"cost":{"input":0.2006,"output":0.2006,"cache_read":0.1003},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.112,"output":0.8,"cache_read":0.056},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3.8-27b-uncensored":{"id":"qwen/qwen3.8-27b-uncensored","name":"Qwen 3.8 27B Uncensored","description":"Qwen 3.8 27B Uncensored is an NVFP4 open-weight multimodal model LoRA-tuned for fewer refusals across chat, coding, reasoning, tool use, and long-context work.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-07-29","last_updated":"2026-08-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1,"output":3,"cache_read":0.22}},"qwen/qwen3.7-max:thinking":{"id":"qwen/qwen3.7-max:thinking","name":"Qwen3.7 Max Thinking","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1.475,"output":4.425,"cache_read":0.295,"cache_write":1.84375},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":983616,"output":65536},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.5-plus"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.12,"output":0.8,"cache_read":0.07},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen3-next-80b-a3b-instruct":{"id":"qwen/qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B (Instruct)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.09,"output":1.1,"cache_read":0.07},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen/qwen3-32b":{"id":"qwen/qwen3-32b","name":"Qwen 3 32b","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":41000,"input":41000,"output":32768},"cost":{"input":0.08,"output":0.24,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-32b"},"qwen/qwen3-8b":{"id":"qwen/qwen3-8b","name":"Qwen 3 8B","description":"Dense 8B Qwen3 model with switchable thinking for chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":41000,"input":41000,"output":32768},"cost":{"input":0.47,"output":0.47},"canonical_model_id":"alibaba/qwen3-8b"},"qwen/qwen3-235b-a22b":{"id":"qwen/qwen3-235b-a22b","name":"Qwen 3 235b A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.09,"output":0.55,"cache_read":0.0175},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"qwen/qwen3.8-27b-queen":{"id":"qwen/qwen3.8-27b-queen","name":"Qwen 3.8 27B Queen","description":"Qwen 3.8 27B Queen is an open-weight roleplay finetune with image understanding, tool calling, optional reasoning, and a 262,144-token context window.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-09","last_updated":"2026-09-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.25,"output":1.5,"cache_read":0.125}},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"input":991000,"output":65536},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":260096,"input":260096,"output":65536},"cost":{"input":0.2,"output":1.75,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.8-27b-swift":{"id":"qwen/qwen3.8-27b-swift","name":"Qwen 3.8 27B Swift","description":"Qwen 3.8 27B Swift is a finetune for fast responses, served by Aoru in NVFP4 with a 262,144-token context window. It supports image understanding, tool calling, and optional reasoning.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.05}},"qwen/qwen3.5-omni-plus":{"id":"qwen/qwen3.5-omni-plus","name":"Qwen3.5 Omni Plus","description":"Qwen3.5 Omni Plus is Qwen's stronger general multimodal model. We verified live support for text prompts, images, audio files, and direct video URLs on Alibaba's chat-completions-compatible API. Alibaba describes Plus as a comprehensive evolution of Qwen3 Omni with support for over 10 hours of audio input.","family":"qwen3.5","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-03-30","last_updated":"2026-03-30","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":983616,"output":65536}},"qwen/qwen3.5-35b-a3b:thinking":{"id":"qwen/qwen3.5-35b-a3b:thinking","name":"Qwen3.5 35B A3B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":260096,"input":260096,"output":65536},"cost":{"input":0.14,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.5-omni-flash":{"id":"qwen/qwen3.5-omni-flash","name":"Qwen3.5 Omni Flash","description":"Qwen3.5 Omni Flash is Qwen's fast multimodal model. We verified live support for text prompts, images, audio files, and direct video URLs on Alibaba's chat-completions-compatible API. Alibaba describes Flash as a fully evolved version of Qwen3 Omni with audio input support across 60+ languages.","family":"qwen3.5","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-03-30","last_updated":"2026-03-30","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":49152,"input":49152,"output":16384}},"qwen/qwen3.5-flash:thinking":{"id":"qwen/qwen3.5-flash:thinking","name":"Qwen3.5 Flash Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991808,"input":991808,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3-coder-flash"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.26,"output":2.08,"cache_read":0.103788},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"qwen/qwen3.5-plus:thinking":{"id":"qwen/qwen3.5-plus:thinking","name":"Qwen3.5 Plus Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"input":983616,"output":65536},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.5-plus"},"abliteration-ai/abliterated-model-large-v2":{"id":"abliteration-ai/abliterated-model-large-v2","name":"Abliterated Model Large V2","description":"Abliteration.ai's default large text reasoning model is derived from GLM-5.3 for harder reasoning and evaluation workloads, with automatic prompt caching and a one-million-token context window.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-31","last_updated":"2026-08-31","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":999990},"cost":{"input":3,"output":5,"cache_read":0.3}},"abliteration-ai/abliterated-model-large-flash":{"id":"abliteration-ai/abliterated-model-large-flash","name":"Abliterated Large Flash","description":"Abliterated Large Flash is an uncensored reasoning model based on DeepSeek V4.1-Flash-1017. It accepts text and images and returns text, with tool calling, JSON mode, JSON Schema output, and automatic prompt caching. Its shared input/output context is 1,048,576 tokens, with up to 262,144 output tokens when space permits. Reasoning defaults to high and can be turned off or set to low, high, or max. Supports up to four images across the request history.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":262144},"cost":{"input":1,"output":2,"cache_read":0.1}},"abliteration-ai/abliterated-model":{"id":"abliteration-ai/abliterated-model","name":"Abliterated Model","description":"Abliteration.ai's multimodal reasoning model supports text and image input, structured output, automatic prompt caching, and a 262K-token context window.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":false,"structured_output":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":262134},"cost":{"input":1,"output":3,"cache_read":0.1}},"abliteration-ai/abliterated-model-large":{"id":"abliteration-ai/abliterated-model-large","name":"Abliterated Model Large","description":"Abliteration.ai's large text reasoning model is derived from GLM-5.2 and supports native tool calling, structured output, automatic prompt caching, and a one-million-token context window.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":999990},"cost":{"input":3,"output":5,"cache_read":0.3}},"sicariussicariistuff/assistant-pepe-32b":{"id":"sicariussicariistuff/assistant-pepe-32b","name":"Assistant Pepe 32B","description":"Assistant Pepe 32B is SicariusSicariiStuff's Qwen3-32B finetune for creative writing, brainstorming, roleplay and irreverent conversation. Trained on UBW Tapestries, it has a built-in conversational persona and replies without a separate thinking mode. It accepts and returns text, with a 40,960-token context window and up to 8,192 output tokens.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-11-03","last_updated":"2026-11-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"input":40960,"output":8192},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"MiniMaxAI/MiniMax-M1-80k":{"id":"MiniMaxAI/MiniMax-M1-80k","name":"MiniMax M1 80K","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.6052,"output":2.4225,"cache_read":0.3026},"canonical_model_id":"minimax/minimax-m1-80k"},"xtools-at/deepseek-v4-pro-qwen3.5-9b-uncensored-heretic":{"id":"xtools-at/deepseek-v4-pro-qwen3.5-9b-uncensored-heretic","name":"DeepSeek V4 Pro Qwen3.5 9B Uncensored Heretic","description":"xtools-at's uncensored Heretic version of Jackrong's DeepSeek V4 Pro Qwen3.5 9B, a Qwen3.5 9B model distilled from DeepSeek V4 Pro on about 250,000 math and STEM samples. It answers directly without a thinking phase. It accepts and returns text, with a 32,768-token context window shared by input and output and up to 8,192 output tokens.","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-11-07","last_updated":"2026-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.28,"output":0.28,"cache_read":0.14}},"EVA-UNIT-01/EVA-LLaMA-3.33-70B-v0.1":{"id":"EVA-UNIT-01/EVA-LLaMA-3.33-70B-v0.1","name":"EVA-LLaMA-3.33-70B-v0.1","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":2.006,"output":2.006,"cache_read":1.003}},"EVA-UNIT-01/EVA-Qwen2.5-32B-v0.2":{"id":"EVA-UNIT-01/EVA-Qwen2.5-32B-v0.2","name":"EVA-Qwen2.5-32B-v0.2","description":"A RP/storywriting specialist model, full-parameter finetune of Qwen2.5-32B on mixture of synthetic and natural data. It uses Celeste 70B 0.1 data mixture, greatly expanding it to improve versatility, creativity and flavor of the resulting model.","family":"v0","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-26","last_updated":"2025-07-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.799,"output":0.799}},"EVA-UNIT-01/EVA-LLaMA-3.33-70B-v0.0":{"id":"EVA-UNIT-01/EVA-LLaMA-3.33-70B-v0.0","name":"EVA Llama 3.33 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-26","last_updated":"2025-07-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":2.006,"output":2.006,"cache_read":1.003}},"EVA-UNIT-01/EVA-Qwen2.5-72B-v0.2":{"id":"EVA-UNIT-01/EVA-Qwen2.5-72B-v0.2","name":"EVA-Qwen2.5-72B-v0.2","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.799,"output":0.799,"cache_read":0.3995}},"Doctor-Shotgun/MS3.2-24B-Magnum-Diamond":{"id":"Doctor-Shotgun/MS3.2-24B-Magnum-Diamond","name":"MS3.2 24B Magnum Diamond","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.2,"output":0.7,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/deepseek-v3.2-exp-thinking":{"id":"deepseek-ai/deepseek-v3.2-exp-thinking","name":"DeepSeek V3.2 Exp Thinking","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"input":163840,"output":65536},"cost":{"input":0.28,"output":0.42,"cache_read":0.14}},"deepseek-ai/DeepSeek-V3.1-Terminus":{"id":"deepseek-ai/DeepSeek-V3.1-Terminus","name":"DeepSeek V3.1 Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2025-08-02","last_updated":"2025-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.25,"output":0.7,"cache_read":0.125}},"deepseek-ai/DeepSeek-V3.1-Terminus:thinking":{"id":"deepseek-ai/DeepSeek-V3.1-Terminus:thinking","name":"DeepSeek V3.1 Terminus (Thinking)","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek-thinking","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2024-01-01","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.25,"output":0.7,"cache_read":0.125}},"deepseek-ai/deepseek-v3.2-exp":{"id":"deepseek-ai/deepseek-v3.2-exp","name":"DeepSeek V3.2 Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"input":163840,"output":65536},"cost":{"input":0.28,"output":0.42,"cache_read":0.14}},"deepseek-ai/DeepSeek-V3.1:thinking":{"id":"deepseek-ai/DeepSeek-V3.1:thinking","name":"DeepSeek V3.1 Thinking","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.2,"output":0.7,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"input":163840,"output":32768},"cost":{"input":0.5,"output":2.15,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"bytedance/doubao-seed-character":{"id":"bytedance/doubao-seed-character","name":"Doubao Seed Character","description":"ByteDance's character-focused Doubao Seed model for roleplay, persona consistency, dialogue, and creative character interactions. It supports text and image input with a 128k context window. Requests route through ZenMux to ByteDance; ZenMux does not publish a model-API zero-retention or training guarantee, so avoid sensitive data.","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":32768},"cost":{"input":0.15,"output":0.37,"cache_read":0.03,"cache_write":0.003},"canonical_model_id":"bytedance-seed/seed-character"},"Salesforce/Llama-xLAM-2-70b-fc-r":{"id":"Salesforce/Llama-xLAM-2-70b-fc-r","name":"Llama-xLAM-2 70B fc-r","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-04-13","last_updated":"2025-04-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":2.5,"output":2.5,"cache_read":1.25}},"featherless-ai/Qwerky-72B":{"id":"featherless-ai/Qwerky-72B","name":"Qwerky 72B","description":"General-purpose chat model for instruction following, writing, and analysis","family":"qwerky","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-03-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"input":32000,"output":8192},"cost":{"input":0.5,"output":0.5,"cache_read":0.25}},"mlabonne/NeuralDaredevil-8B-abliterated":{"id":"mlabonne/NeuralDaredevil-8B-abliterated","name":"Neural Daredevil 8B abliterated","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"input":8192,"output":8192},"cost":{"input":0.44,"output":0.44,"cache_read":0.22}},"GalrionSoftworks/MN-LooseCannon-12B-v1":{"id":"GalrionSoftworks/MN-LooseCannon-12B-v1","name":"MN-LooseCannon-12B-v1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"huihui-ai/Llama-3.3-70B-Instruct-abliterated":{"id":"huihui-ai/Llama-3.3-70B-Instruct-abliterated","name":"Llama 3.3 70B Instruct abliterated","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-08-08","last_updated":"2025-08-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.7,"output":0.7,"cache_read":0.35}},"huihui-ai/Qwen2.5-32B-Instruct-abliterated":{"id":"huihui-ai/Qwen2.5-32B-Instruct-abliterated","name":"Qwen 2.5 32B Abliterated","description":"Uncensored version of Qwen 2.5 32B Instruct with restrictions removed.","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-01-06","last_updated":"2025-01-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.7,"output":0.7}},"huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated":{"id":"huihui-ai/DeepSeek-R1-Distill-Qwen-32B-abliterated","name":"DeepSeek R1 Qwen Abliterated","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-01-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":1.4,"output":1.4,"cache_read":0.7}},"huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated":{"id":"huihui-ai/DeepSeek-R1-Distill-Llama-70B-abliterated","name":"DeepSeek R1 Llama 70B Abliterated","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-01-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.7,"output":0.7,"cache_read":0.35}},"lightonai/LightOnOCR-2-1B":{"id":"lightonai/LightOnOCR-2-1B","name":"LightOnOCR 2","description":"LightOnOCR 2 hosted by IONOS in Berlin, Germany. Zero data retention.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.1785,"output":0.3465}},"tencent/hy4":{"id":"tencent/hy4","name":"Tencent Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.462,"output":1.386,"cache_read":0.0233},"canonical_model_id":"tencent/hy4"},"tencent/hy3":{"id":"tencent/hy3","name":"Tencent Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":128000},"cost":{"input":0.066,"output":0.26,"cache_read":0.029},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Tencent Hy4 Preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"mistralai/codestral-2508":{"id":"mistralai/codestral-2508","name":"Codestral 2508","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.15},"canonical_model_id":"mistral/codestral-2508"},"mistralai/mistral-medium-3.5":{"id":"mistralai/mistral-medium-3.5","name":"Mistral Medium 3.5","description":"Mistral Medium 3.5 is a 128B dense open-weights flagship model for instruction-following, reasoning, coding, long-horizon agentic work, tool use, structured output, and multimodal prompts. It supports a 256k context window and configurable reasoning effort.","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":1.5,"output":7.5,"cache_read":0.75}},"mistralai/mistral-small-3.1-24b-instruct":{"id":"mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B (2503)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":102400},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"mistral/mistral-small-3.1-24b-instruct"},"mistralai/ministral-14b-instruct-2512":{"id":"mistralai/ministral-14b-instruct-2512","name":"Ministral 3 14B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.05},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"mistralai/ministral-3b-2512":{"id":"mistralai/ministral-3b-2512","name":"Ministral 3B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.1,"output":0.1,"cache_read":0.05},"canonical_model_id":"mistral/ministral-3b-2512"},"mistralai/ministral-8b-2512":{"id":"mistralai/ministral-8b-2512","name":"Ministral 8B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.15,"output":0.15,"cache_read":0.075},"canonical_model_id":"mistral/ministral-8b-2512"},"mistralai/devstral-small-2505":{"id":"mistralai/devstral-small-2505","name":"Mistral Devstral Small 2505","description":"OpenHands+Devstral is 100% local 100% open, and is SOTA for the category on SWE-Bench Verified: 46.8% accuracy.","family":"devstral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-08-02","last_updated":"2025-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.06,"output":0.06,"cache_read":0.03}},"mistralai/mistral-small-24b-instruct-2501":{"id":"mistralai/mistral-small-24b-instruct-2501","name":"Mistral Small 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.1155,"output":0.3465},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"mistralai/mistral-small-3.2-24b-instruct":{"id":"mistralai/mistral-small-3.2-24b-instruct","name":"Mistral Small 3.2 24B (2506)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.2,"output":0.4,"cache_read":0.1},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"mistralai/mistral-medium-3.1":{"id":"mistralai/mistral-medium-3.1","name":"Mistral Medium 3.1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-06-30","release_date":"2025-08-12","last_updated":"2025-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.4,"output":2,"cache_read":0.2},"canonical_model_id":"mistral/mistral-medium-3.1"},"mistralai/mistral-nemo-instruct-2407":{"id":"mistralai/mistral-nemo-instruct-2407","name":"Mistral Nemo","description":"12B parameter model with multilingual support.","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.1003,"output":0.1207,"cache_read":0.05015},"canonical_model_id":"mistral/mistral-nemo"},"mistralai/mistral-medium-3.5:thinking":{"id":"mistralai/mistral-medium-3.5:thinking","name":"Mistral Medium 3.5 Thinking","description":"Mistral Medium 3.5 with reasoning enabled by default (reasoning_effort=high), for complex coding, agentic, and multi-step reasoning prompts.","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":32768},"cost":{"input":1.5,"output":7.5,"cache_read":0.75}},"mistralai/mistral-saba":{"id":"mistralai/mistral-saba","name":"Mistral Saba","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-02-17","last_updated":"2025-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"input":32768,"output":26214},"cost":{"input":0.1989,"output":0.595,"cache_read":0.09945},"canonical_model_id":"mistral/mistral-saba"},"mistralai/mistral-large":{"id":"mistralai/mistral-large","name":"Mistral Large 2411","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-11-30","release_date":"2024-02-26","last_updated":"2024-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":102400},"cost":{"input":2.006,"output":6.001,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large"},"mistralai/mistral-large-4":{"id":"mistralai/mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"input":524288,"output":262144},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"mistralai/mistral-medium-3":{"id":"mistralai/mistral-medium-3","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.4,"output":2,"cache_read":0.2},"canonical_model_id":"mistral/mistral-medium-3"},"mistralai/mistral-small-4-119b-2603":{"id":"mistralai/mistral-small-4-119b-2603","name":"Mistral Small 4 119B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.4,"output":1.4,"cache_read":0.2},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/ministral-14b-2512":{"id":"mistralai/ministral-14b-2512","name":"Ministral 14B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.2,"output":0.2,"cache_read":0.1},"canonical_model_id":"mistral/ministral-14b-2512"},"mistralai/devstral-2-123b-instruct-2512":{"id":"mistralai/devstral-2-123b-instruct-2512","name":"Devstral 2 123B","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.4,"output":1.4,"cache_read":0.2},"canonical_model_id":"mistral/devstral-2512"},"mistralai/mixtral-8x22b-instruct-v0.1":{"id":"mistralai/mixtral-8x22b-instruct-v0.1","name":"Mixtral 8x22B","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-01-31","release_date":"2024-04-17","last_updated":"2024-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":52428},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mixtral-8x22b-instruct"},"mistralai/mistral-small-4-119b-2603:thinking":{"id":"mistralai/mistral-small-4-119b-2603:thinking","name":"Mistral Small 4 119B Thinking","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.4,"output":1.4,"cache_read":0.2},"canonical_model_id":"mistral/mistral-small-2603"},"microsoft/wizardlm-2-8x22b":{"id":"microsoft/wizardlm-2-8x22b","name":"WizardLM-2 8x22B","description":"Microsoft WizardLM instruction-tuned Mixtral MoE for multilingual dialogue and complex tasks","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-04-15","last_updated":"2024-04-15","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465},"canonical_model_id":"microsoft/wizardlm-2-8x22b"},"orca/orcacyber-k3.1-pro":{"id":"orca/orcacyber-k3.1-pro","name":"OrcaCyber K3.1 Pro Uncensored","description":"An abliterated / uncensored variant of Kimi K3.1 Pro for authorized security research, coding, and tool use. Accepts text and images, with reasoning enabled by default and an option to turn it off. Supports a 1M-token context window, up to 943K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048064,"input":1048064,"output":943718},"cost":{"input":4,"output":20,"cache_read":0.35}},"orca/orcacyber-zero-1.5":{"id":"orca/orcacyber-zero-1.5","name":"OrcaCyber Zero 1.5","description":"OrcaRouter's frontier cybersecurity model, post-trained for authorized security research: vulnerability research and reproduction, exploit development, penetration testing, and security auditing. Supports a 1M-token context window, optional reasoning, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-30","last_updated":"2026-10-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":999488,"input":999488,"output":128000},"cost":{"input":3,"output":7.5,"cache_read":0.75}},"orca/orcacyber-minimax-m3.1-flash":{"id":"orca/orcacyber-minimax-m3.1-flash","name":"OrcaCyber MiniMax M3.1 Flash Uncensored","description":"An abliterated / uncensored variant of MiniMax M3.1 Flash for authorized security research, coding, and tool use. Reasoning is always enabled, with selectable effort. Supports a 262K-token context window, up to 131K output tokens, tool calling, and structured output. Accepts text input. Offensive work is permitted only within an authorized security engagement.","family":"minimax-m3","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":261632,"input":261632,"output":131072},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"orca/orcacyber-mimo-flash":{"id":"orca/orcacyber-mimo-flash","name":"OrcaCyber MiMo V2.6 Flash","description":"An OrcaCyber model built on MiMo V2.6 Flash for authorized security research, coding, and tool use. Accepts text input, with reasoning enabled by default and an option to turn it off. Supports a 1M-token context window, up to 131K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048064,"input":1048064,"output":131072},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"orca/orcacyber-glm-5.3-flash":{"id":"orca/orcacyber-glm-5.3-flash","name":"OrcaCyber GLM 5.3 Flash","description":"An OrcaCyber model built on GLM 5.3 Flash for authorized security research, coding, and tool use. Accepts text and images. Reasoning is always enabled, with selectable effort. Supports a 1M-token context window, up to 131K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048064,"input":1048064,"output":131072},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"orca/orcacyber-flash-1.0":{"id":"orca/orcacyber-flash-1.0","name":"OrcaCyber DeepSeek V4.1 Flash","description":"An OrcaCyber model built on DeepSeek V4.1 Flash for authorized security research, coding, and tool use. Accepts text and images, with reasoning off by default. Supports a 1M-token context window, up to 393K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048064,"input":1048064,"output":393216},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"orca/orcacyber-qwen3.8-flash-next":{"id":"orca/orcacyber-qwen3.8-flash-next","name":"OrcaCyber Qwen3.8 Flash Next Uncensored","description":"An abliterated / uncensored variant of Qwen3.8 Flash Next for authorized security research, coding, and tool use. Accepts text and images, with reasoning enabled by default and an option to turn it off. Supports a 262K-token context window, up to 131K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":261632,"input":261632,"output":131072},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"orca/orcacyber-flash-1.0:thinking":{"id":"orca/orcacyber-flash-1.0:thinking","name":"OrcaCyber DeepSeek V4.1 Flash Thinking","description":"An OrcaCyber model built on DeepSeek V4.1 Flash for authorized security research, coding, and tool use. Accepts text and images, with reasoning on by default. Supports a 1M-token context window, up to 393K output tokens, tool calling, and structured output. Offensive work is permitted only within an authorized security engagement.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048064,"input":1048064,"output":393216},"cost":{"input":0.8,"output":1.6,"cache_read":0.15}},"moonshotai/kimi-k3.1-pro-highspeed":{"id":"moonshotai/kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Kimi K3.1 Pro Highspeed is the faster variant of K3.1 Pro, a multimodal reasoning model for coding, 3D creation, document analysis and multi-step tool use. It supports a 1M-token context window and text, image and video inputs. Reasoning is always enabled, with low, high and max effort levels.","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-24","last_updated":"2026-10-24","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4}},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.39,"output":1.8,"cache_read":0.039},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k2-instruct-0711":{"id":"moonshotai/kimi-k2-instruct-0711","name":"Kimi K2 0711","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.4,"output":1.8,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"moonshotai/kimi-k2-instruct":{"id":"moonshotai/kimi-k2-instruct","name":"Kimi K2 Instruct","description":"Non-thinking Kimi K2 MoE instruction model for coding and tool-using agents","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":8192},"cost":{"input":0.4,"output":1.8,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":943718},"cost":{"input":0.45,"output":9.6,"cache_read":0.13},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.375,"output":2,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2.5:thinking":{"id":"moonshotai/kimi-k2.5:thinking","name":"Kimi K2.5 Thinking","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.375,"output":2,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2.6:thinking":{"id":"moonshotai/kimi-k2.6:thinking","name":"Kimi K2.6 Thinking","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.88,"output":4.13,"cache_read":0.231},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-latest":{"id":"moonshotai/kimi-latest","name":"Kimi Latest","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":943718},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2}},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.6,"output":3,"cache_read":0.12},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2.7-code-highspeed":{"id":"moonshotai/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code High-Speed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":1.9,"output":8,"cache_read":0.32},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":98304},"cost":{"input":0.6,"output":2.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"moonshotai/Kimi-K2-Instruct-0905":{"id":"moonshotai/Kimi-K2-Instruct-0905","name":"Kimi K2 0905","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":100352},"cost":{"input":0.4,"output":1.8,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k2-0905"},"perceptron/perceptron-mk1":{"id":"perceptron/perceptron-mk1","name":"Perceptron Mk1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.15,"output":1.5,"cache_read":0.075},"canonical_model_id":"perceptron/perceptron-mk1"},"perceptron/perceptron-mk1.5":{"id":"perceptron/perceptron-mk1.5","name":"Perceptron Mk1.5","description":"Image, video, and audio understanding with visual grounding, reasoning, and function calling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":36864,"input":36864,"output":8192},"cost":{"input":0.15,"output":1.5},"canonical_model_id":"perceptron/perceptron-mk1.5"},"MarinaraSpaghetti/NemoMix-Unleashed-12B":{"id":"MarinaraSpaghetti/NemoMix-Unleashed-12B","name":"NemoMix 12B Unleashed","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT 5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-terra-latest":{"id":"openai/gpt-terra-latest","name":"GPT Terra Latest","description":"Compatibility alias that routes to GPT 5.6 Terra, the latest supported GPT Terra model.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25}},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT 4.1 Nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT 5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/o1":{"id":"openai/o1","name":"OpenAI o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":100000},"cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT 4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT 5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-6-sol-pro":{"id":"openai/gpt-6-sol-pro","name":"GPT 6 Sol Pro","description":"GPT-6 Sol Pro uses the same underlying model as GPT-6 Sol with Pro reasoning mode enabled for higher-quality responses on complex tasks.","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5}},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT 5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/o1-pro":{"id":"openai/o1-pro","name":"OpenAI o1 Pro","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2023-09","release_date":"2025-03-19","last_updated":"2025-03-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":100000},"cost":{"input":150,"output":600,"cache_read":75},"canonical_model_id":"openai/o1-pro"},"openai/o3-pro-2025-06-10":{"id":"openai/o3-pro-2025-06-10","name":"OpenAI o3-pro (2025-06-10)","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":100000},"cost":{"input":22,"output":88,"cache_read":11},"canonical_model_id":"openai/o3-pro"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":65536},"cost":{"input":0.075,"output":0.3},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-5.6-terra-pro":{"id":"openai/gpt-5.6-terra-pro","name":"GPT 5.6 Terra Pro","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT 5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT 5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":2.5,"output":20,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT 5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-chat-latest":{"id":"openai/gpt-chat-latest","name":"GPT Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT 5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT 6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT 4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"OpenAI o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":1},"canonical_model_id":"openai/o3"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna-pro":{"id":"openai/gpt-6-luna-pro","name":"GPT 6 Luna Pro","description":"GPT-6 Luna Pro uses the same underlying model as GPT-6 Luna with Pro reasoning mode enabled for higher-quality responses on complex tasks.","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125}},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT 6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-5.1-2025-11-13":{"id":"openai/gpt-5.1-2025-11-13","name":"GPT-5.1 (2025-11-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-sol-latest":{"id":"openai/gpt-sol-latest","name":"GPT Sol Latest","description":"Compatibility alias that routes to GPT 5.6 Sol, the latest supported GPT Sol model.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"cost":{"input":0.018,"output":0.09,"cache_read":0.009},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-luna-latest":{"id":"openai/gpt-luna-latest","name":"GPT Luna Latest","description":"Compatibility alias that routes to GPT 5.6 Luna, the latest supported GPT Luna model.","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125}},"openai/gpt-6-astra-pro":{"id":"openai/gpt-6-astra-pro","name":"GPT 6 Astra Pro","description":"GPT 6 Astra in Pro reasoning mode. Uses additional model work for difficult tasks, with higher latency and token usage at the same per-token rates. Reasoning effort remains independently configurable.","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT 5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":15,"output":120,"cache_read":1.5},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6.1-sol-pro":{"id":"openai/gpt-6.1-sol-pro","name":"GPT 6.1 Sol Pro","description":"GPT-6.1 Sol Pro uses the same underlying model as GPT-6.1 Sol with Pro reasoning mode enabled for higher-quality responses on complex tasks.","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT 6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT 5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT 6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT 5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-latest":{"id":"openai/gpt-latest","name":"GPT Latest","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-03-29","last_updated":"2026-03-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT 5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT 5.1 Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.6-luna-pro":{"id":"openai/gpt-5.6-luna-pro","name":"GPT 5.6 Luna Pro","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT 5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT 6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-6.1-terra-pro":{"id":"openai/gpt-6.1-terra-pro","name":"GPT 6.1 Terra Pro","description":"GPT-6.1 Terra Pro uses the same underlying model as GPT-6.1 Terra with Pro reasoning mode enabled for higher-quality responses on complex tasks.","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25}},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT 5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT 5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT 5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":400000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.03,"output":0.15,"cache_read":0.015},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT 5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/o3-mini-low":{"id":"openai/o3-mini-low","name":"OpenAI o3-mini (Low)","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/gpt-astra-latest":{"id":"openai/gpt-astra-latest","name":"GPT Astra Latest","description":"Compatibility alias that routes to GPT 6 Astra, the latest supported GPT Astra model.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5}},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-5.6-sol-pro":{"id":"openai/gpt-5.6-sol-pro","name":"GPT 5.6 Sol Pro","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":1050000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"elorian/glimpse":{"id":"elorian/glimpse","name":"Elorian Glimpse","description":"Glimpse is Elorian's visual reasoning model for understanding images and video and answering in text. It can analyze charts, count objects, follow events over time, and reason about spatial relationships and physical cause and effect. It supports tool calling and structured output across a shared 262,144-token context window, with up to 256,000 output tokens within the remaining context.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":256000},"cost":{"input":0.63,"output":3.15,"cache_read":0.063}},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Cohere: Command R+","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":4096},"cost":{"input":2.856,"output":14.246,"cache_read":1.428},"canonical_model_id":"cohere/command-r-plus-08-2024"},"pqhaz/DeepSeek-V4.1-Flash-1017-heretic":{"id":"pqhaz/DeepSeek-V4.1-Flash-1017-heretic","name":"DeepSeek V4.1 Flash Heretic","description":"pqhaz's Heretic checkpoint of DeepSeek V4.1 Flash 1017, served by Sable at original mixed precision (FP8 dense/Engram and MXFP4 experts). Supports text and image input, tools, structured output, and optional reasoning. Separate from the DeAlign uncensored checkpoint.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-31","last_updated":"2026-10-31","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"input":512000,"output":128000},"cost":{"input":0.198,"output":0.792,"cache_read":0.0132,"cache_write":0.198}},"pqhaz/DeepSeek-V4.1-Flash-1017-heretic:thinking":{"id":"pqhaz/DeepSeek-V4.1-Flash-1017-heretic:thinking","name":"DeepSeek V4.1 Flash Heretic Thinking","description":"pqhaz's Heretic checkpoint of DeepSeek V4.1 Flash 1017, served by Sable at original mixed precision (FP8 dense/Engram and MXFP4 experts). Supports text and image input, tools, structured output, and optional reasoning. Separate from the DeAlign uncensored checkpoint.","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-31","last_updated":"2026-10-31","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"input":512000,"output":128000},"cost":{"input":0.198,"output":0.792,"cache_read":0.0132,"cache_write":0.198}},"ricursiveai/ripple-65b-preview":{"id":"ricursiveai/ripple-65b-preview","name":"Ripple 65B Preview","description":"Ripple 65B Preview is Ricursive Intelligence's Apache 2.0-licensed, 65-billion-parameter reasoning model for coding and agentic tasks. It accepts and returns text, supports automatic tool calling and JSON output, and has a 16,384-token context window shared by input and output. It reasons before answering by default, and this preview's thinking cannot be reliably turned off.","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":16384},"cost":{"input":0.2,"output":0.6,"cache_read":0.05}},"xiaomi/mimo-v2.5:thinking":{"id":"xiaomi/mimo-v2.5:thinking","name":"MiMo V2.5 Thinking","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.422,"output":2.11,"cache_read":0.0844,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.6-flash-abliterated":{"id":"xiaomi/mimo-v2.6-flash-abliterated","name":"MiMo V2.6 Flash Abliterated","description":"A MiMo V2.6 Flash finetune with refusal-direction ablation, image input, a 1M-token context window, separate reasoning output, and tool calling.","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.5,"output":1.5,"cache_read":0.275}},"xiaomi/mimo-v2.6-flash-uncensored:thinking":{"id":"xiaomi/mimo-v2.6-flash-uncensored:thinking","name":"MiMo V2.6 Flash Uncensored Thinking","description":"MiMo V2.6 Flash Uncensored with maximum thinking enabled. Supports a 1M-token context window and tool calling.","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-26","last_updated":"2026-09-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.5,"output":1.5,"cache_read":0.1995}},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo V2.6 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-pro-ultraspeed":{"id":"xiaomi/mimo-v2.6-pro-ultraspeed","name":"MiMo V2.6 Pro UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo V2.6 Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xiaomi/mimo-v2.5-pro:thinking":{"id":"xiaomi/mimo-v2.5-pro:thinking","name":"MiMo V2.5 Pro Thinking","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.49,"output":0.97,"cache_read":0.004,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.422,"output":2.11,"cache_read":0.0844,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo V2.5 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.49,"output":0.97,"cache_read":0.004,"cache_write":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"xiaomi/mimo-v2.6-flash-uncensored":{"id":"xiaomi/mimo-v2.6-flash-uncensored","name":"MiMo V2.6 Flash Uncensored","description":"A text-only, lower-refusal MiMo V2.6 Flash finetune served by Heabsy with a 1M-token context window, separate reasoning output, and tool calling.","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.5,"output":1.5,"cache_read":0.1995}},"speakleash/bielik-11b-v3.0-instruct":{"id":"speakleash/bielik-11b-v3.0-instruct","name":"Bielik 11B v3.0","description":"SpeakLeash’s Polish-focused multilingual model for conversation, writing and text analysis across European languages. Supports tool calling with a 32K context window.","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.48,"output":0.48}},"ibm-granite/granite-4.2-8b":{"id":"ibm-granite/granite-4.2-8b","name":"Granite 4.2 8B","description":"IBM Granite 4.2 8B is an Apache 2.0-licensed dense model with native step-by-step reasoning and specialized training for agentic work. It can plan before acting, sequence tools, navigate codebases, work in terminals, and verify results across coding, search, mathematics, science, and complex instruction-following tasks.","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":117964},"cost":{"input":0.06,"output":0.15,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"meganova-ai/manta-flash-1.0":{"id":"meganova-ai/manta-flash-1.0","name":"Manta Flash 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-20","last_updated":"2025-12-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"input":16384,"output":16384},"cost":{"input":0.02,"output":0.16,"cache_read":0.01}},"meganova-ai/manta-mini-1.0":{"id":"meganova-ai/manta-mini-1.0","name":"Manta Mini 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-20","last_updated":"2025-12-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"input":8192,"output":8192},"cost":{"input":0.02,"output":0.16,"cache_read":0.01}},"meganova-ai/manta-pro-1.0":{"id":"meganova-ai/manta-pro-1.0","name":"Manta Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-20","last_updated":"2025-12-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"input":65536,"output":32768},"cost":{"input":0.06,"output":0.5,"cache_read":0.03}},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"input":204800,"output":131072},"cost":{"input":0.27,"output":1.08,"cache_read":0.027},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":131072},"cost":{"input":0.17,"output":1.53,"cache_read":0.085},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax M3.1 Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"input":512000,"output":80000},"cost":{"input":0.23,"output":0.96,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-01":{"id":"minimax/minimax-01","name":"MiniMax 01","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2025-01-15","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000192,"input":1000192,"output":16384},"cost":{"input":0.1394,"output":1.122,"cache_read":0.0697}},"minimax/minimax-latest":{"id":"minimax/minimax-latest","name":"MiniMax Latest","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"input":512000,"output":80000},"cost":{"input":0.23,"output":0.96,"cache_read":0.05}},"minimax/minimax-m3:thinking":{"id":"minimax/minimax-m3:thinking","name":"MiniMax M3 Thinking","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"input":512000,"output":80000},"cost":{"input":0.23,"output":0.96,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"input":204800,"output":131072},"cost":{"input":0.21,"output":0.84,"cache_read":0.042},"canonical_model_id":"minimax/MiniMax-M2.7"},"minimax/minimax-m2.7-turbo":{"id":"minimax/minimax-m2.7-turbo","name":"MiniMax M2.7 Turbo","description":"Efficient MiniMax model for quick assistance, coding, and routine automation","family":"minimax-m2.7","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"input":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06}},"thinkingmachines/Inkling-Small:thinking":{"id":"thinkingmachines/Inkling-Small:thinking","name":"Inkling Small Thinking","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"input":524288,"output":32768},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1040000,"input":1040000,"output":32768},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"input":524288,"output":32768},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling:thinking":{"id":"thinkingmachines/inkling:thinking","name":"Inkling Thinking","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1040000,"input":1040000,"output":32768},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"reflection/beam-1.0":{"id":"reflection/beam-1.0","name":"Beam 1.0 501B A23B","description":"Reflection's Apache 2.0 open-weight text model with 501.3B total and 23.4B active parameters, built for coding, reasoning and tool use. It supports a shared 1,048,576-token context window, up to 131,072 output tokens, JSON mode and structured output. Reasoning is always enabled with low, medium, high, xhigh and max effort; NanoGPT defaults to max. Knowledge cutoff: June 30, 2026.","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"ornith-ai/ornith-1.5-122b":{"id":"ornith-ai/ornith-1.5-122b","name":"Ornith 1.5 122B","description":"Ornith 1.5 122B is an MIT-licensed open-weight model for coding, reasoning, tool use and image understanding. It accepts text and images across a shared 262,144-token context, with up to 32,768 output tokens. Reasoning is enabled by default; JSON object output and streaming are supported.","family":"ornith","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.26,"output":2.08,"cache_read":0.07}},"ornith-ai/ornith-1.5-35b-a3b:thinking":{"id":"ornith-ai/ornith-1.5-35b-a3b:thinking","name":"Ornith 1.5 35B Thinking","description":"Ornith 1.5 35B A3B is an open-weight mixture-of-experts model for agentic coding, reasoning, tool use, image understanding, and long-context work. This variant enables thinking by default.","family":"ornith","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-07-29","last_updated":"2026-08-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.05}},"ornith-ai/ornith-1.5-35b-a3b":{"id":"ornith-ai/ornith-1.5-35b-a3b","name":"Ornith 1.5 35B","description":"Ornith 1.5 35B A3B is an open-weight mixture-of-experts model for agentic coding, tool use, image understanding, and long-context work. This variant disables thinking for faster direct responses.","family":"ornith","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-07-29","last_updated":"2026-08-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.05}},"upstage/solar-pro4:thinking":{"id":"upstage/solar-pro4:thinking","name":"Solar Pro 4 Thinking","description":"Upstage's flagship model, specialized for agentic use","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"input":524288,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.03},"canonical_model_id":"upstage/solar-pro4"},"upstage/solar-pro4":{"id":"upstage/solar-pro4","name":"Solar Pro 4","description":"Upstage's flagship model, specialized for agentic use","family":"solar-pro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"input":524288,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.03},"canonical_model_id":"upstage/solar-pro4"},"upstage/solar-mini4":{"id":"upstage/solar-mini4","name":"Solar Mini 4","description":"Upstage's compact, cost-efficient model for agentic use","family":"solar-mini","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"input":524288,"output":131072},"cost":{"input":0.05,"output":0.2,"cache_read":0.005},"canonical_model_id":"upstage/solar-mini4"},"upstage/solar-pro-3":{"id":"upstage/solar-pro-3","name":"Solar Pro 3","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-07","release_date":"2026-01-26","last_updated":"2026-03-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":117964},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"upstage/solar-pro3"},"upstage/solar-mini4:thinking":{"id":"upstage/solar-mini4:thinking","name":"Solar Mini 4 Thinking","description":"Upstage's compact, cost-efficient model for agentic use","family":"solar-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"input":524288,"output":131072},"cost":{"input":0.05,"output":0.2,"cache_read":0.005},"canonical_model_id":"upstage/solar-mini4"},"prism-ml/ternary-bonsai-2-27b":{"id":"prism-ml/ternary-bonsai-2-27b","name":"Ternary Bonsai 2 27B","description":"Ternary Bonsai 2 27B is a 27B-parameter reasoning model from PrismML derived from Qwen3.8-27B. It supports coding, mathematics, tool calling, and image understanding with a 262K-token context window.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.075,"output":0.5,"cache_read":0.0375}},"prism-ml/ternary-bonsai-2-9b":{"id":"prism-ml/ternary-bonsai-2-9b","name":"Ternary Bonsai2 9B","description":"Ternary Bonsai2 9B is Prism ML’s open-weight model derived from Qwen3.5-9B with ternary language weights. It accepts text and generates text, supports reasoning and tool calling, and offers a shared 262,144-token context window with up to 65,536 output tokens. Thinking is enabled by default and can be turned off.","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.08,"output":0.13,"cache_read":0.04}},"Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B":{"id":"Envoid/Llama-3.05-Nemotron-Tenyxchat-Storybreaker-70B","name":"Nemotron Tenyxchat Storybreaker 70b","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B":{"id":"Envoid/Llama-3.05-NT-Storybreaker-Ministral-70B","name":"Llama 3.05 Storybreaker Ministral 70b","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"heabsy/cyberheabsy":{"id":"heabsy/cyberheabsy","name":"CyberHeabsy","description":"A low-refusal text model for authorized security research, roleplay, and creative writing. It preserves tool calling after refusal removal, supports optional reasoning, and has a 1M-token context window.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-27","last_updated":"2026-09-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1.5,"output":4.5,"cache_read":0.275}},"heabsy/qwen3.8-27b-uncensored-fast":{"id":"heabsy/qwen3.8-27b-uncensored-fast","name":"Qwen 3.8 27B Uncensored Fast by Heabsy","description":"Heabsy's NVFP4 build of Qwen3.8-27B by Alibaba Cloud, with refusal removal based on huihui-ai's Huihui-Qwen3.8-27B-abliterated. Quantized and calibrated by Heabsy, with unpublished weights under the Heabsy Model License. Supports text and image input, tools, and optional reasoning capped at 16,384 tokens within the output budget. This named build is separate from Qwen 3.8 27B Uncensored.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":235929},"cost":{"input":1,"output":3,"cache_read":0.22}},"LatitudeGames/Wayfarer-Large-70B-Llama-3.3":{"id":"LatitudeGames/Wayfarer-Large-70B-Llama-3.3","name":"Llama 3.3 70B Wayfarer","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-02-20","last_updated":"2025-02-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.7,"output":0.7,"cache_read":0.35}},"LLM360/K2-Think":{"id":"LLM360/K2-Think","name":"K2-Think","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-26","last_updated":"2025-07-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":32768},"cost":{"input":0.17,"output":0.68,"cache_read":0.085}},"VongolaChouko/Starcannon-Unleashed-12B-v1.0":{"id":"VongolaChouko/Starcannon-Unleashed-12B-v1.0","name":"Mistral Nemo Starcannon 12b v1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"ReadyArt/MS3.2-The-Omega-Directive-24B-Unslop-v2.0":{"id":"ReadyArt/MS3.2-The-Omega-Directive-24B-Unslop-v2.0","name":"Omega Directive 24B Unslop v2.0","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.5,"output":0.5,"cache_read":0.25}},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-wonder":{"id":"meta/muse-wonder","name":"Muse Wonder","description":"Meta's Muse Wonder is a frontier reasoning model designed for complex personal and professional agentic tasks. It accepts text, images, audio, video, and PDF documents across a one-million-token context window, supports tool calling and structured output, and always reasons before answering.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2}},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor (Data Used for Training)","description":"A much cheaper opt-in version of Muse Spark 1.2 with the same multimodal coding and agentic capabilities. Prompts and outputs sent to this Contributor model may be used by Meta for training and to improve its products; use the standard Muse Spark 1.2 model if you do not want your data used for training.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/muse-ember":{"id":"meta/muse-ember","name":"Muse Ember","description":"Meta's Muse Ember is the smallest and most efficient Muse model, built for the work agents repeat all day: tool calls, coding-agent subtasks, routing, and extraction. It accepts text, images, audio, video, and PDF documents across a one-million-token context window, supports tool calling and structured output, and always reasons before answering.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-11","last_updated":"2026-11-11","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":1048576},"cost":{"input":0.1,"output":0.5,"cache_read":0.004}},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":117964},"cost":{"input":0.35,"output":1.5,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.3-contributor":{"id":"meta/muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Meta's Muse Spark 1.3 Contributor is a frontier multimodal reasoning model for long-horizon coding and agentic workflows, with strong gains in computer use, browsing, professional tool use, codebase understanding, and million-token retrieval. It accepts text, images, audio, video, and files, supports tool calling and structured output, and always reasons before answering. Prompts and outputs may be used by Meta for training and to improve its products.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":943718},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"xingchen-agi/xing4.0-29b-a4b":{"id":"xingchen-agi/xing4.0-29b-a4b","name":"Xing 4.0 29B A4B","description":"China Telecom’s Xing 4.0 is an Apache 2.0 open-weight mixture-of-experts model with 29B total and 4B active parameters, designed for coding, reasoning and tool use. Supports text input, structured output and a shared 262,144-token input/output context. This route does not use a TEE.","family":"agi","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-24","last_updated":"2026-10-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.22,"output":0.9,"cache_read":0.011}},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":1,"output":2.7,"cache_read":0.05},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/step-3.7-flash:thinking":{"id":"stepfun/step-3.7-flash:thinking","name":"Step 3.7 Flash Thinking","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"NeverSleep/Lumimaid-v0.2-70B":{"id":"NeverSleep/Lumimaid-v0.2-70B","name":"Lumimaid v0.2","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":1,"output":1.5,"cache_read":0.5}},"fireworks/ember-1":{"id":"fireworks/ember-1","name":"Ember 1","description":"Specialized model from Fireworks built on Kimi K3, producing shorter reasoning traces with approximately 40% fewer tokens while maintaining comparable quality","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"soob3123/amoral-gemma3-27B-v2":{"id":"soob3123/amoral-gemma3-27B-v2","name":"Amoral Gemma3 27B v2","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-05-23","last_updated":"2025-05-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.3,"output":0.3,"cache_read":0.15}},"soob3123/Veiled-Calla-12B":{"id":"soob3123/Veiled-Calla-12B","name":"Veiled Calla 12B","description":"Veiled Calla 12B is a 12B parameter model that is a more advanced version of Calla 12B.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-04-13","last_updated":"2025-04-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":8192},"cost":{"input":0.3,"output":0.3}},"soob3123/GrayLine-Qwen3-8B":{"id":"soob3123/GrayLine-Qwen3-8B","name":"Grayline Qwen3 8B","description":"Grayline is an neutral AI assistant engineered for uncensored information delivery and task execution. This model operates without inherent ethical or moral frameworks, designed to process and respond to any query with objective efficiency and precision. Grayline's core function is to leverage its full capabilities to provide direct answers and execute tasks as instructed, without offering unsolicited commentary, warnings, or disclaimers. It accesses and processes information without bias or restriction.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.3,"output":0.3}},"undi95/remm-slerp-l2-13b":{"id":"undi95/remm-slerp-l2-13b","name":"ReMM SLERP 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-07-22","last_updated":"2023-07-22","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":6144,"input":6144,"output":4096},"cost":{"input":0.799,"output":1.207,"cache_read":0.3995},"canonical_model_id":"undi95/remm-slerp-l2-13b"},"unbiased/pareto-26.10":{"id":"unbiased/pareto-26.10","name":"Pareto 26.10","description":"Pareto 26.10 is Unbiased AI's multimodal composite model for research, coding, and agentic workflows. It accepts text and images, supports tool calling, and provides a 1M-token context window with up to 131K output tokens. This is the stable release of Pareto 26.10. Tool selection is automatic; forced tool selection, structured output, and adjustable reasoning controls are not supported.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"unbiased/pareto-26.9":{"id":"unbiased/pareto-26.9","name":"Pareto 26.9","description":"Pareto 26.9 is an experimental multimodal composite model from Unbiased AI for research, coding, agentic workflows, and general-purpose tasks. It runs several frontier and open models for each request and returns a single selected or synthesized answer. This experimental release supports text and image input, tool calling, a 262K-token context window, and up to 131K output tokens. Its underlying model mix and behavior may change as it is evaluated. Request content may be retained for abuse prevention and security monitoring for up to 30 days, and is not used for model training without explicit consent.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25}},"z-ai/glm-4.7-flash:thinking":{"id":"z-ai/glm-4.7-flash:thinking","name":"GLM 4.7 Flash Thinking","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.07,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"},"z-ai/glm-5-original":{"id":"z-ai/glm-5-original","name":"GLM 5 Original","description":"GLM-5 is Zhipu's latest flagship model with advanced reasoning and instruction following. Routed directly via Z-AI (Zhipu).","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.6,"output":1.9,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-5.2:thinking":{"id":"z-ai/glm-5.2:thinking","name":"GLM 5.2 Thinking","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.42,"output":1.32,"cache_read":0.078},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-4.6-original":{"id":"z-ai/glm-4.6-original","name":"GLM 4.6 Original","description":"GLM-4.6, Zhipu's flagship text model with 256K context window and advanced reasoning capabilities. Direct via Z-AI (Zhipu).","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":65535},"cost":{"input":0.55,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-5.3-flash-apex-abliterated":{"id":"z-ai/glm-5.3-flash-apex-abliterated","name":"Apex Flash 1 Abliterated","description":"Apex Flash 1 Abliterated is an experimental derivative of Cantina Security and Yeta's Apex Flash 1 with modified refusal behavior.","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.15,"output":0.5,"cache_read":0.075}},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.42,"output":1.32,"cache_read":0.078},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.3:thinking":{"id":"z-ai/glm-5.3:thinking","name":"GLM 5.3 Thinking","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/GLM-4.5-Air:thinking":{"id":"z-ai/GLM-4.5-Air:thinking","name":"GLM 4.5 Air (Thinking)","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":98304},"cost":{"input":0.13,"output":0.85,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-5.3-flash-cybersecurity":{"id":"z-ai/glm-5.3-flash-cybersecurity","name":"GLM 5.3 Flash Cybersecurity","description":"GLM 5.3 Flash Cybersecurity is a cybersecurity-focused variant based on the uncensored model, with provider moderation for illegal activities. It supports always-on reasoning, image understanding, tool calling, and a 1,048,576-token context window.","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-19","last_updated":"2026-09-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.15,"output":0.5,"cache_read":0.075}},"z-ai/glm-5v-turbo:thinking":{"id":"z-ai/glm-5v-turbo:thinking","name":"GLM 5V Turbo Thinking","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":202800,"input":202800,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-4.7:thinking":{"id":"z-ai/glm-4.7:thinking","name":"GLM 4.7 Thinking","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.4004,"output":1.9292,"cache_read":0.08008},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/GLM-4.6-turbo:thinking":{"id":"z-ai/GLM-4.6-turbo:thinking","name":"GLM 4.6 Turbo (Thinking)","description":"GLM 4.6 Turbo with thinking mode enabled for enhanced reasoning; shows internal reasoning and supports long context.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2025-10-02","last_updated":"2025-10-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"input":204800,"output":131072},"cost":{"input":0.55,"output":2.2,"cache_read":0.11}},"z-ai/GLM-4.6-turbo":{"id":"z-ai/GLM-4.6-turbo","name":"GLM 4.6 Turbo","description":"Fast variant of GLM 4.6 for general chat, coding, and analysis with improved latency and strong reasoning.","family":"glm","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-10-02","last_updated":"2025-10-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"input":204800,"output":131072},"cost":{"input":0.55,"output":2.2,"cache_read":0.11}},"z-ai/glm-4.6v":{"id":"z-ai/glm-4.6v","name":"GLM 4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":24000},"cost":{"input":0.3,"output":0.9,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.3-uncensored":{"id":"z-ai/glm-5.3-uncensored","name":"GLM 5.3 Uncensored","description":"An experimental uncensored version of the full GLM 5.3 reasoning model for chat, creative writing, coding, and tool use. It may show unusual behavior or inconsistent response quality.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-09-26","last_updated":"2026-09-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":1.25,"output":2.25,"cache_read":0.3}},"z-ai/glm-4.6v-original":{"id":"z-ai/glm-4.6v-original","name":"GLM 4.6V Original","description":"GLM-4.6V scales its context window to 128k tokens in training, and achieves SoTA performance in visual understanding among models of similar parameter scales. Integrates native Function Calling capabilities, bridging 'visual perception' and 'executable action' for multimodal agents. Direct via Z-AI (Zhipu).","family":"glm","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":24000},"cost":{"input":0.6,"output":0.9,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM 5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":131072},"cost":{"input":0.7,"output":2.5,"cache_read":0.18},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5.3-flashx-legal":{"id":"z-ai/glm-5.3-flashx-legal","name":"GLM 5.3 FlashX Legal","description":"GLM 5.3 FlashX Legal is Z.AI's model trained for legal document analysis, contract review, legal reasoning and initial drafts. It accepts text and images and returns text, with always-on reasoning, tool calling, JSON output, a 1M-token context window and up to 131,072 output tokens. External legal databases and document-editing tools require your own integrations.","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"z-ai/glm-4.5":{"id":"z-ai/glm-4.5","name":"GLM 4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.3,"output":1.3,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/GLM-4.5-Air":{"id":"z-ai/GLM-4.5-Air","name":"GLM 4.5 Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":98304},"cost":{"input":0.13,"output":0.85,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-5.3-flash-uncensored":{"id":"z-ai/glm-5.3-flash-uncensored","name":"GLM 5.3 Flash Uncensored","description":"GLM 5.3 Flash Uncensored is an uncensored fine-tune of the efficient 320B mixture-of-experts reasoning model, built for unrestricted chat, creative writing, coding, agentic work, tool use, and long-context tasks.","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-07-29","last_updated":"2026-08-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.2,"output":0.8,"cache_read":0.07}},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM 4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.4004,"output":1.9292,"cache_read":0.08008},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-latest":{"id":"z-ai/glm-latest","name":"GLM Latest","description":"Compatibility alias that routes to the newest thinking GLM model. Currently routes to GLM 5.2 Thinking.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-03","last_updated":"2026-05-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2}},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.6,"output":1.1,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-4.7-original:thinking":{"id":"z-ai/glm-4.7-original:thinking","name":"GLM 4.7 Original Thinking","description":"GLM-4.7 original with extended thinking capabilities for complex reasoning.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.4004,"output":1.9292,"cache_read":0.08008},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/GLM-4.5:thinking":{"id":"z-ai/GLM-4.5:thinking","name":"GLM 4.5 (Thinking)","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":65536},"cost":{"input":0.3,"output":1.3,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/glm-4.7-original":{"id":"z-ai/glm-4.7-original","name":"GLM 4.7 Original","description":"GLM-4.7 is a next-gen GLM series text model with stronger reasoning, long-context chat, and reliable tool use. Routed directly via Z-AI (Zhipu).","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.4004,"output":1.9292,"cache_read":0.08008},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3-flash-apex":{"id":"z-ai/glm-5.3-flash-apex","name":"Apex Flash 1","description":"Apex Flash 1 is Cantina Security and Yeta's cybersecurity-focused post-train of GLM 5.3 Flash for code investigation and tool use.","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":32768},"cost":{"input":0.15,"output":0.5,"cache_read":0.075}},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM 5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202800,"input":202800,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-5.1:thinking":{"id":"z-ai/glm-5.1:thinking","name":"GLM 5.1 Thinking","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":131072},"cost":{"input":0.7,"output":2.5,"cache_read":0.18},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-4.6:thinking":{"id":"z-ai/glm-4.6:thinking","name":"GLM 4.6 Thinking","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.55,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-4.5v:thinking":{"id":"z-ai/glm-4.5v:thinking","name":"GLM 4.5V Thinking","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-4.5v"},"z-ai/glm-5-original:thinking":{"id":"z-ai/glm-5-original:thinking","name":"GLM 5 Original Thinking","description":"GLM-5 original with extended thinking capabilities for complex reasoning.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.6,"output":1.9,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM 4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65535},"cost":{"input":0.55,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-4.5v":{"id":"z-ai/glm-4.5v","name":"GLM 4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-4.5v"},"z-ai/glm-5:thinking":{"id":"z-ai/glm-5:thinking","name":"GLM 5 Thinking","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.6,"output":1.9,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM 5V Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":202800,"input":202800,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM 5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.6,"output":1.9,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-4.7-flash":{"id":"z-ai/glm-4.7-flash","name":"GLM 4.7 Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":128000},"cost":{"input":0.07,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"},"inception/mercury-2.5-preview":{"id":"inception/mercury-2.5-preview","name":"Mercury 2.5 Preview","description":"Mercury 2.5 Preview is Inception's latest and most intelligent diffusion language model. Instead of generating tokens strictly one at a time, it produces and refines multiple tokens in parallel, reaching up to 1,107 tokens per second on standard GPUs. It delivers a 10+ point intelligence gain over Mercury 2, with tunable reasoning, parallel tool calls, schema-aligned JSON output, and a 260K context window. It is built for latency-sensitive production work such as search agents, voice pipelines, customer support, rapid coding iteration, and coding subagents.","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":260000,"input":260000,"output":65536},"cost":{"input":0.04,"output":0.15,"cache_read":0.004}},"inception/mercury-3":{"id":"inception/mercury-3","name":"Mercury 3","description":"Inception's diffusion reasoning model for chat, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-16","last_updated":"2026-10-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":131072},"cost":{"input":0.1,"output":0.35,"cache_read":0.01},"canonical_model_id":"inception/mercury-3"},"meta-llama/llama-3.2-3b-instruct":{"id":"meta-llama/llama-3.2-3b-instruct","name":"Llama 3.2 3b Instruct","description":"Small instruction-tuned Llama model for multilingual dialogue and agentic retrieval","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":8192},"cost":{"input":0.0306,"output":0.0493,"cache_read":0.0153},"canonical_model_id":"meta/llama-3.2-3b-instruct"},"meta-llama/llama-4-maverick":{"id":"meta-llama/llama-4-maverick","name":"Llama 4 Maverick","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.05},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/llama-3.1-8b-instruct":{"id":"meta-llama/llama-3.1-8b-instruct","name":"Llama 3.1 8b Instruct","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"cost":{"input":0.02,"output":0.04,"cache_read":0.0272},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/llama-3.3-70b-instruct":{"id":"meta-llama/llama-3.3-70b-instruct","name":"Llama 3.3 70b Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"cost":{"input":0.05,"output":0.23,"cache_read":0.025},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta-llama/llama-4-scout":{"id":"meta-llama/llama-4-scout","name":"Llama 4 Scout","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":328000,"input":328000,"output":65536},"cost":{"input":0.085,"output":0.46,"cache_read":0.0425},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"pamanseau/OpenReasoning-Nemotron-32B":{"id":"pamanseau/OpenReasoning-Nemotron-32B","name":"OpenReasoning Nemotron 32B","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.05}},"liquid/lfm-3-1.7b":{"id":"liquid/lfm-3-1.7b","name":"LFM3 1.7B","description":"Liquid AI's compact 1.7B-parameter text model for tool use, structured output, data extraction, and specialized agents. It reasons before answering and supports a 262,144-token context window with up to 8,192 output tokens. Pair it with retrieval for knowledge-heavy tasks; it is not recommended for complex multi-step reasoning or agentic coding.","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-11-07","last_updated":"2026-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":8192},"cost":{"input":0.1,"output":0.25,"cache_read":0.025}},"liquid/lfm-2.5-24b-a2b":{"id":"liquid/lfm-2.5-24b-a2b","name":"LFM2.5 24B A2B","description":"Liquid AI's text-only mixture-of-experts model for reasoning and tool-using agents, with 24B total and 2.45B active parameters. It always thinks before answering and supports structured output. Pair it with retrieval for knowledge-heavy tasks. Open weights use the LFM Open License v1.0, with a $10M annual-revenue commercial threshold; hosted API use is subject to separate service terms that permit retention and use of prompts and responses for model training.","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-10-14","last_updated":"2026-10-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.05,"output":0.7,"cache_read":0.025}},"liquid/lfm-2.5-2.6b":{"id":"liquid/lfm-2.5-2.6b","name":"LFM2.5 2.6B","description":"Liquid AI's compact 2.6B reasoning model for agent workflows, data extraction, RAG, and long-context processing. It supports tool calling and structured output, but Liquid advises against using it for agentic coding. Warning: prompts and responses may be logged and used for model training or service improvement; do not send sensitive data.","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":32768},"cost":{"input":0.1,"output":0.2,"cache_read":0.05}},"nex-agi/nex-n2.5-pro":{"id":"nex-agi/nex-n2.5-pro","name":"Nex N2.5 Pro","description":"Nex N2.5 Pro is an open-source multimodal agentic model for coding, tool use, and long-horizon workflows. It supports image input, structured output, configurable reasoning, a 262K-token context window, and up to 235K output tokens.","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.075,"output":0.25,"cache_read":0.015}},"nex-agi/nex-n2.5-mini":{"id":"nex-agi/nex-n2.5-mini","name":"Nex N2.5 Mini","description":"Nex N2.5 Mini is an open-source multimodal agentic model for coding and long-horizon workflows. It supports image input, structured output, configurable reasoning, a 262K-token context window, and up to 235K output tokens.","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":false,"structured_output":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.025,"output":0.1,"cache_read":0.0025}},"nex-agi/nex-n2.6":{"id":"nex-agi/nex-n2.6","name":"Nex N2.6","description":"Nex N2.6 is Nex AGI's agentic model for coding and long-running tasks that use tools. It accepts text and images, produces text, and supports tool calling and structured output within a 262,144-token context window. Reasoning is always enabled, with medium and high effort levels.","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.15,"output":0.5,"cache_read":0.03}},"nothingiisreal/L3.1-70B-Celeste-V0.1-BF16":{"id":"nothingiisreal/L3.1-70B-Celeste-V0.1-BF16","name":"Llama 3.1 70B Celeste v0.1","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"shisa-ai/shisa-v2-llama3.3-70b":{"id":"shisa-ai/shisa-v2-llama3.3-70b","name":"Shisa V2 Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-26","last_updated":"2025-07-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.5,"output":0.5,"cache_read":0.25}},"shisa-ai/shisa-v2.1-llama3.3-70b":{"id":"shisa-ai/shisa-v2.1-llama3.3-70b","name":"Shisa V2.1 Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":4096},"cost":{"input":0.5,"output":0.5,"cache_read":0.25}},"moondream/moondream3-preview":{"id":"moondream/moondream3-preview","name":"Moondream 3 Preview","description":"Moondream 3 Preview is the original 9B mixture-of-experts vision-language checkpoint with 2B active parameters, for visual question answering, captioning, OCR, and visual reasoning. It accepts text or one image with optional reasoning, a 32,000-token context, and up to 4,096 output tokens.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"input":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"moondream/moondream3.1-9b-a2b":{"id":"moondream/moondream3.1-9b-a2b","name":"Moondream 3.1 9B A2B","description":"Moondream 3.1 is the successor to Moondream 3 Preview: a distinct 9B mixture-of-experts vision-language checkpoint with 2B active parameters, for visual question answering, captioning, OCR, and visual reasoning. It accepts text or one image with optional reasoning, a 32,000-token context, and up to 4,096 output tokens.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"input":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"reka/reka-flash-3":{"id":"reka/reka-flash-3","name":"Reka Flash 3","description":"Reka's 21B reasoning model for chat and coding, served directly by Reka.","family":"reka","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":65536},"cost":{"input":0.105,"output":0.21},"canonical_model_id":"rekaai/reka-flash-3"},"reka/reka-edge-2603":{"id":"reka/reka-edge-2603","name":"Reka Edge 2603","description":"Reka's compact multimodal model for visual understanding and tool use, served directly by Reka.","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":16384},"cost":{"input":0.105,"output":0.105},"canonical_model_id":"rekaai/reka-edge"},"nvidia/nemotron-3-ultra-550b-a55b:thinking":{"id":"nvidia/nemotron-3-ultra-550b-a55b:thinking","name":"Nvidia Nemotron 3 Ultra 550B Thinking","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":0.5,"output":2.5,"cache_read":0.15},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nvidia Nemotron 3 Ultra 550B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512288,"input":512288,"output":65536},"cost":{"input":0.5,"output":2.5,"cache_read":0.15},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/Llama-3.1-Nemotron-70B-Instruct-HF":{"id":"nvidia/Llama-3.1-Nemotron-70B-Instruct-HF","name":"Nvidia Nemotron 70b","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.357,"output":0.408,"cache_read":0.1785},"canonical_model_id":"nvidia/llama-3.1-nemotron-70b-instruct"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nvidia Nemotron 3 Nano 30B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":235929},"cost":{"input":0.17,"output":0.68,"cache_read":0.085},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/nemotron-3.5-lightning:thinking":{"id":"nvidia/nemotron-3.5-lightning:thinking","name":"Nvidia Nemotron 3.5 Lightning Thinking","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":0.05,"output":0.2,"cache_read":0.01},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3.5-super-vl":{"id":"nvidia/nemotron-3.5-super-vl","name":"Nvidia Nemotron 3.5 Super VL","description":"NVIDIA’s open-weight 120B model (12B active) for reasoning, coding, tool use, document and GUI understanding, and video understanding. Text, images and video in; text out. Served in NVFP4 with a 262,144-token shared context window. NanoGPT currently limits responses to 16,384 tokens while separate hosted output limits remain unpublished. OpenMDW 1.1 license.","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.15,"output":0.5,"cache_read":0.02},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-lightning":{"id":"nvidia/nemotron-3.5-lightning","name":"Nvidia Nemotron 3.5 Lightning","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":0.05,"output":0.2,"cache_read":0.01},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/Llama-3.3-Nemotron-Super-49B-v1":{"id":"nvidia/Llama-3.3-Nemotron-Super-49B-v1","name":"Nvidia Nemotron Super 49B","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-18","last_updated":"2025-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":16384},"cost":{"input":0.15,"output":0.15,"cache_read":0.075},"canonical_model_id":"nvidia/llama-3.3-nemotron-super-49b-v1"},"nvidia/nemotron-3-super-120b-a12b:thinking":{"id":"nvidia/nemotron-3-super-120b-a12b:thinking","name":"Nvidia Nemotron 3 Super 120B Thinking","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.05,"output":0.25,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nvidia Nemotron 3 Super 120B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":16384},"cost":{"input":0.05,"output":0.25,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/nemotron-3.5-content-safety":{"id":"nvidia/nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":32768},"cost":{"input":0.05,"output":0.15,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"stepfun-ai/step-3.5-flash-2603":{"id":"stepfun-ai/step-3.5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"stepfun-ai/step-3.5-flash":{"id":"stepfun-ai/step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":65536},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"stepfun/step-3.5-flash"},"nanogpt/coding-router:medium":{"id":"nanogpt/coding-router:medium","name":"Coding Router Medium","description":"Automatic model router for matching prompts to suitable backends and budgets","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028}},"nanogpt/coding-router:low":{"id":"nanogpt/coding-router:low","name":"Coding Router Low","description":"Automatic model router for matching prompts to suitable backends and budgets","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028}},"nanogpt/coding-router:high":{"id":"nanogpt/coding-router:high","name":"Coding Router High","description":"Automatic model router for matching prompts to suitable backends and budgets","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":1.1,"output":2.2,"cache_read":0.11}},"nanogpt/coding-router":{"id":"nanogpt/coding-router","name":"Coding Router","description":"Automatic model router for matching prompts to suitable backends and budgets","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":1.1,"output":2.2,"cache_read":0.11}},"nanogpt/coding-router:max":{"id":"nanogpt/coding-router:max","name":"Coding Router Max","description":"Automatic model router for matching prompts to suitable backends and budgets","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5}},"deepcogito/cogito-v1-preview-qwen-32B":{"id":"deepcogito/cogito-v1-preview-qwen-32B","name":"Cogito v1 Preview Qwen 32B","description":"32-B parameter reasoning model from DeepCogito (Qwen backbone) – strong general reasoning & coding at low price.","family":"cogito","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-05-10","last_updated":"2025-05-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":32768},"cost":{"input":1.8,"output":1.8}},"TheDrummer/Anubis-70B-v1":{"id":"TheDrummer/Anubis-70B-v1","name":"Anubis 70B v1","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":16384},"cost":{"input":0.31,"output":0.31,"cache_read":0.155}},"TheDrummer/Anubis-70B-v1.1":{"id":"TheDrummer/Anubis-70B-v1.1","name":"Anubis 70B v1.1","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":16384},"cost":{"input":0.31,"output":0.31,"cache_read":0.155}},"TheDrummer/Cydonia-24B-v2":{"id":"TheDrummer/Cydonia-24B-v2","name":"The Drummer Cydonia 24B v2","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-02-17","last_updated":"2025-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.1003,"output":0.1207,"cache_read":0.05015}},"TheDrummer/Magidonia-24B-v4.3":{"id":"TheDrummer/Magidonia-24B-v4.3","name":"The Drummer Magidonia 24B v4.3","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-12-25","last_updated":"2025-12-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.1003,"output":0.1207,"cache_read":0.05015}},"TheDrummer/skyfall-36b-v2":{"id":"TheDrummer/skyfall-36b-v2","name":"TheDrummer Skyfall 36B V2","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06-30","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":29491},"cost":{"input":0.55,"output":0.8,"cache_read":0.25},"canonical_model_id":"thedrummer/skyfall-36b-v2"},"TheDrummer/Cydonia-24B-v4.1":{"id":"TheDrummer/Cydonia-24B-v4.1","name":"The Drummer Cydonia 24B v4.1","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-09-27","last_updated":"2025-09-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":117964},"cost":{"input":0.3,"output":0.5,"cache_read":0.15},"canonical_model_id":"thedrummer/cydonia-24b-v4.1"},"TheDrummer/UnslopNemo-12B-v4.1":{"id":"TheDrummer/UnslopNemo-12B-v4.1","name":"UnslopNemo 12b v4","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"input":8192,"output":26214},"cost":{"input":0.493,"output":0.493,"cache_read":0.2465}},"TheDrummer/Cydonia-24B-v4":{"id":"TheDrummer/Cydonia-24B-v4","name":"The Drummer Cydonia 24B v4","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"cost":{"input":0.2006,"output":0.2414,"cache_read":0.1003}},"TheDrummer/artemis-31b-v1.2":{"id":"TheDrummer/artemis-31b-v1.2","name":"Artemis 31B v1.2","description":"TheDrummer's Gemma 4 31B finetune for creative writing, character roleplay, and conversation. It accepts and returns text, with a 65,536-token context window shared by input and output and up to 8,192 output tokens.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":8192},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"TheDrummer/Rocinante-12B-v1.1":{"id":"TheDrummer/Rocinante-12B-v1.1","name":"Rocinante 12b","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"input":16384,"output":8192},"cost":{"input":0.408,"output":0.595,"cache_read":0.204}},"TheDrummer/Artemis-v1.1":{"id":"TheDrummer/Artemis-v1.1","name":"TheDrummer/Artemis v1.1","description":"TheDrummer's Artemis v1.1 is a Gemma 4 31B fine-tune for creative writing, expressive dialogue, and roleplay, with optional thinking and a 262K context window.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"release_date":"2026-09-06","last_updated":"2026-09-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.1,"output":0.45,"cache_read":0.05}},"TheDrummer/Cydonia-24B-v4.3":{"id":"TheDrummer/Cydonia-24B-v4.3","name":"The Drummer Cydonia 24B v4.3","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"release_date":"2025-12-25","last_updated":"2025-12-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"input":65536,"output":32768},"cost":{"input":0.12,"output":0.15,"cache_read":0.06}},"unsloth/gemma-3-27b-it":{"id":"unsloth/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":96000},"cost":{"input":0.2992,"output":0.2992,"cache_read":0.1496},"canonical_model_id":"google/gemma-3-27b-it"},"unsloth/gemma-3-4b-it":{"id":"unsloth/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.2006,"output":0.2006,"cache_read":0.1003},"canonical_model_id":"google/gemma-3-4b-it"},"unsloth/gemma-3-12b-it":{"id":"unsloth/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":131072,"output":16384},"cost":{"input":0.272,"output":0.272,"cache_read":0.136},"canonical_model_id":"google/gemma-3-12b-it"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v1.1":{"id":"sakana/fugu-ultra-v1.1","name":"Fugu Ultra v1.1","description":"Sakana AI's upgraded Fugu Ultra release with stronger coding, agentic task execution, and advanced reasoning through dynamic orchestration of frontier models.","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":16384},"cost":{"input":5,"output":30,"cache_read":0.5}},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":1000000,"output":16384},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"},"bytedance-seed/seed-2.0-code":{"id":"bytedance-seed/seed-2.0-code","name":"ByteDance Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.25},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"bytedance-seed/seed-2.0-lite":{"id":"bytedance-seed/seed-2.0-lite","name":"ByteDance Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":131072},"cost":{"input":0.25,"output":2,"cache_read":0.125},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"bytedance-seed/seed-2-1-turbo":{"id":"bytedance-seed/seed-2-1-turbo","name":"ByteDance Seed 2.1 Turbo","description":"ByteDance Seed 2.1 Turbo is a multimodal model for coding and long-horizon agent workflows, including end-to-end software delivery and multi-step task execution. It supports text, image, and video input with a 262k context window.","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":262144,"output":235929},"cost":{"input":0.5,"output":2.5,"cache_read":0.25},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"Gryphe/MythoMax-L2-13b":{"id":"Gryphe/MythoMax-L2-13b","name":"MythoMax 13B","description":"Llama 2 merge combining MythoLogic and Huginn for creative writing and roleplay","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"input":4096,"output":3686},"cost":{"input":0.1003,"output":0.1003,"cache_read":0.05015},"canonical_model_id":"gryphe/mythomax-l2-13b"},"inference-net/schematron-v2-turbo":{"id":"inference-net/schematron-v2-turbo","name":"Schematron V2 Turbo","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"cost":{"input":0.03,"output":0.15,"cache_read":0.015},"canonical_model_id":"inference-net/schematron-v2-turbo"},"inference-net/schematron-v2-small":{"id":"inference-net/schematron-v2-small","name":"Schematron V2 Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":4096},"cost":{"input":0.05,"output":0.23,"cache_read":0.025},"canonical_model_id":"inference-net/schematron-v2-small"}}},"friendli":{"id":"friendli","env":["FRIENDLI_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://api.friendli.ai/serverless/v1","name":"Friendli","doc":"https://friendli.ai/docs/guides/serverless_endpoints/introduction","models":{"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.26,"output":3.96,"cache_read":0.234},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"}}},"lucidquery":{"id":"lucidquery","env":["LUCIDQUERY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.lucidquery.com/v1","name":"LucidQuery","doc":"https://lucidquery.com/docs","models":{"lucidquery-agi-01-frontier":{"id":"lucidquery-agi-01-frontier","name":"AGI-01 Frontier","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2026-06-05","release_date":"2026-06-16","last_updated":"2026-06-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":120000},"cost":{"input":5.04675,"output":24.673}},"lucidquery-nexus-coder":{"id":"lucidquery-nexus-coder","name":"LucidQuery Nexus Coder","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"lucid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-08-01","release_date":"2025-09-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":250000,"output":60000},"cost":{"input":2,"output":5}},"lucidnova-rf1-100b":{"id":"lucidnova-rf1-100b","name":"LucidNova RF1 100B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"nova","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-09-16","release_date":"2024-12-28","last_updated":"2025-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":120000,"output":8000},"cost":{"input":2,"output":5}},"lucidquery-agi-01-swift":{"id":"lucidquery-agi-01-swift","name":"AGI-01 Swift","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2026-06-05","release_date":"2026-06-16","last_updated":"2026-06-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":120000},"cost":{"input":2.80375,"output":16.8225}}}},"subconscious":{"id":"subconscious","env":["SUBCONSCIOUS_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://api.subconscious.dev/v1","name":"Subconscious","doc":"https://docs.subconscious.dev","models":{"subconscious/glm-5.3-marathon":{"id":"subconscious/glm-5.3-marathon","name":"GLM-5.3 Marathon","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":5000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"subconscious/deepseek-v4.1-flash-marathon":{"id":"subconscious/deepseek-v4.1-flash-marathon","name":"DeepSeek V4.1 Flash Marathon","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":5000000,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"deepseek/deepseek-v4.1-flash"}}},"poolside":{"id":"poolside","env":["POOLSIDE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.poolside.ai/v1","name":"Poolside","doc":"https://platform.poolside.ai","models":{"poolside/laguna-m.1":{"id":"poolside/laguna-m.1","name":"Laguna M.1","description":"Poolside's open-weight model for agentic coding and long-horizon work","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"poolside/laguna-m.1"},"poolside/laguna-s-2.1":{"id":"poolside/laguna-s-2.1","name":"Laguna S 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"poolside/laguna-s-2.1"},"poolside/laguna-xs-2.1":{"id":"poolside/laguna-xs-2.1","name":"Laguna XS 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-07-02","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"poolside/laguna-xs-2.1"}}},"cloudferro-sherlock":{"id":"cloudferro-sherlock","env":["CLOUDFERRO_SHERLOCK_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api-sherlock.cloudferro.com/openai/v1/","name":"CloudFerro Sherlock","doc":"https://docs.sherlock.cloudferro.com/","models":{"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196000,"input":180000,"output":16000},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.5"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"OpenAI GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":2.92,"output":2.92},"canonical_model_id":"openai/gpt-oss-120b"},"speakleash/Bielik-11B-v3.0-Instruct":{"id":"speakleash/Bielik-11B-v3.0-Instruct","name":"Bielik 11B v3.0 Instruct","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"cost":{"input":0.67,"output":0.67}},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama 3.3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10-09","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":70000,"output":70000},"cost":{"input":2.92,"output":2.92},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.34,"output":4.48},"canonical_model_id":"zhipuai/glm-5.3"}}},"zhipuai":{"id":"zhipuai","env":["ZHIPU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://open.bigmodel.cn/api/paas/v4","name":"Zhipu AI","doc":"https://docs.bigmodel.cn/cn/guide/start/pricing","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.19516,"output":4.18306,"cache_read":0.29879,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"glm-4.6v-flash":{"id":"glm-4.6v-flash","name":"GLM-4.6V-Flash","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.1494,"output":0.44819,"cache_read":0.02988,"cache_write":0,"tiers":[{"input":0.29879,"output":0.89637,"cache_read":0.05976,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.89637,"output":3.58548,"cache_read":0.19421,"cache_write":0,"tiers":[{"input":1.19516,"output":4.18306,"cache_read":0.29879,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5.1"},"glm-4.5":{"id":"glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.44819,"output":2.09153,"cache_read":0.08964,"cache_write":0,"tiers":[{"input":0.59758,"output":2.39032,"cache_read":0.11952,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.7"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.19516,"output":4.18306,"cache_read":0.29879,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11952,"output":0.41831,"cache_read":0.03436,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-4.5-air":{"id":"glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.11952,"output":0.89637,"cache_read":0.0239,"cache_write":0,"tiers":[{"input":0.17927,"output":1.19516,"cache_read":0.03585,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5-air"},"glm-4.6":{"id":"glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"glm-4.5v":{"id":"glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16384},"cost":{"input":0.29879,"output":0.89637,"cache_read":0.05976,"cache_write":0,"tiers":[{"input":0.59758,"output":1.79274,"cache_read":0.11952,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5v"},"glm-5.3-flashx":{"id":"glm-5.3-flashx","name":"GLM-5.3-FlashX","description":"High-speed GLM-5.3-Flash serving option for coding and agent workflows","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.29879,"output":1.04577,"cache_read":0.08516,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5v-turbo":{"id":"glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":0.74698,"output":3.28669,"cache_read":0.17927,"cache_write":0,"tiers":[{"input":1.04577,"output":3.88427,"cache_read":0.26891,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5v-turbo"},"glm-4.7-flashx":{"id":"glm-4.7-flashx","name":"GLM-4.7-FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.0747,"output":0.44819,"cache_read":0.01494,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.59758,"output":2.68911,"cache_read":0.1494,"cache_write":0,"tiers":[{"input":0.89637,"output":3.28669,"cache_read":0.22409,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5"},"glm-4.7-flash":{"id":"glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"glm-4.5-flash":{"id":"glm-4.5-flash","name":"GLM-4.5-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-flash"}}},"vercel":{"id":"vercel","env":["AI_GATEWAY_API_KEY"],"npm":"@ai-sdk/gateway","name":"Vercel AI Gateway","doc":"https://github.com/vercel/ai/tree/5eb85cc45a259553501f535b8ac79a77d0e79223/packages/gateway","models":{"anthropic/claude-fable-5.2-fast":{"id":"anthropic/claude-fable-5.2-fast","name":"Claude Fable 5.2 (Fast)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":16,"output":80,"cache_read":0.4,"cache_write":20},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.8-fast":{"id":"anthropic/claude-opus-4.8-fast","name":"Claude Opus 4.8 (Fast)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5.5-fast":{"id":"anthropic/claude-opus-5.5-fast","name":"Claude Opus 5.5 (Fast)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.4,"cache_write":10},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100001}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-opus-5-fast":{"id":"anthropic/claude-opus-5-fast","name":"Claude Opus 5 (Fast)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-opus-5"},"amazon/titan-embed-text-v2":{"id":"amazon/titan-embed-text-v2","type":"embedding","name":"Titan Text Embeddings V2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"titan-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-04-30","last_updated":"2024-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"amazon/nova-2-lite":{"id":"amazon/nova-2-lite","name":"Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.33,"output":2.75,"cache_read":0.0825},"canonical_model_id":"amazon/nova-2-lite"},"amazon/nova-lite":{"id":"amazon/nova-lite","name":"Nova Lite","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.06,"output":0.24,"cache_read":0.015,"cache_write":0.06},"canonical_model_id":"amazon/nova-lite"},"amazon/nova-micro":{"id":"amazon/nova-micro","name":"Nova Micro","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.035,"output":0.14,"cache_read":0.00875,"cache_write":0.035},"canonical_model_id":"amazon/nova-micro"},"amazon/nova-pro":{"id":"amazon/nova-pro","name":"Nova Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.8,"output":3.2,"cache_read":0.2,"cache_write":0.8},"canonical_model_id":"amazon/nova-pro"},"meituan/longcat-2.5":{"id":"meituan/longcat-2.5","name":"LongCat 2.5","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.006}},"perplexity/pplx-embed-v1-4b":{"id":"perplexity/pplx-embed-v1-4b","type":"embedding","name":"Embed v1 4b","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"perplexity/sonar":{"id":"perplexity/sonar","name":"Sonar","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-02","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":127000,"output":8000},"cost":{"input":0.25,"output":2.5,"cache_write":0.0625}},"perplexity/pplx-embed-v1-0.6b":{"id":"perplexity/pplx-embed-v1-0.6b","type":"embedding","name":"Embed v1 0.6b","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"v0","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"mistral/mistral-medium-3.5":{"id":"mistral/mistral-medium-3.5","name":"Mistral Medium Latest","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":256000},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistral/voxtral-mini-transcribe-3":{"id":"mistral/voxtral-mini-transcribe-3","type":"transcription","name":"Voxtral Mini Transcribe 3","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"mistral/codestral":{"id":"mistral/codestral","name":"Codestral (latest)","description":"Mistral code model for completions, refactors, and developer IDE workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-05-29","last_updated":"2025-01-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-latest"},"mistral/codestral-embed":{"id":"mistral/codestral-embed","type":"embedding","name":"Codestral Embed","description":"Embedding model for code search, retrieval, and code-aware RAG pipelines","family":"codestral-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":3072},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"mistral/codestral-embed-2505"},"mistral/ministral-8b":{"id":"mistral/ministral-8b","name":"Ministral 8B (latest)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-16","last_updated":"2024-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4000},"cost":{"input":0.15,"output":0.15,"cache_read":0.015}},"mistral/ministral-14b":{"id":"mistral/ministral-14b","name":"Ministral 14B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":0.2,"cache_read":0.02},"canonical_model_id":"mistral/ministral-14b"},"mistral/voxtral-mini-tts-3":{"id":"mistral/voxtral-mini-tts-3","type":"speech","name":"Voxtral TTS 3","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"mistral/voxtral-small-transcribe-3":{"id":"mistral/voxtral-small-transcribe-3","type":"transcription","name":"Voxtral Small Transcribe 3","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"mistral/mistral-large-3":{"id":"mistral/mistral-large-3","name":"Mistral Large 3","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/ministral-3b":{"id":"mistral/ministral-3b","name":"Ministral 3B (latest)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-16","last_updated":"2024-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4000},"cost":{"input":0.1,"output":0.1,"cache_read":0.01}},"mistral/mistral-nemo":{"id":"mistral/mistral-nemo","name":"Mistral Nemo","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.029,"output":0.03},"canonical_model_id":"mistral/mistral-nemo"},"mistral/mistral-embed":{"id":"mistral/mistral-embed","type":"embedding","name":"Mistral Embed","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"mistral-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":3072},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"mistral/mistral-embed"},"mistral/mistral-small":{"id":"mistral/mistral-small","name":"Mistral Small (latest)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-latest"},"mistral/mistral-large-4":{"id":"mistral/mistral-large-4","name":"Mistral Large 4","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"cost":{"input":0.7,"output":2.1,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"deepseek/deepseek-v4.1-flash-1017-fast":{"id":"deepseek/deepseek-v4.1-flash-1017-fast","name":"DeepSeek V4.1 Flash 1017 Fast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.6,"output":2.4,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek/deepseek-v3.1":{"id":"deepseek/deepseek-v3.1","name":"DeepSeek-V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":128000},"cost":{"input":0.25,"output":0.95,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek/deepseek-v4.1-flash-1017-ultrafast":{"id":"deepseek/deepseek-v4.1-flash-1017-ultrafast","name":"DeepSeek V4.1 Flash 1017 Ultrafast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.4,"output":9.6,"cache_read":0.048}},"deepseek/deepseek-v3.2-thinking":{"id":"deepseek/deepseek-v3.2-thinking","name":"DeepSeek V3.2 Thinking","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8000},"cost":{"input":0.62,"output":1.85},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.066},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash-fast":{"id":"deepseek/deepseek-v4.1-flash-fast","name":"DeepSeek V4.1 Flash Fast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.6,"output":2.4,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.3,"output":1.2,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048600,"output":1048600},"cost":{"input":1.32,"output":3.96,"cache_read":0.132},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.2156,"output":0.6468,"cache_read":0.0068},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8000},"cost":{"input":0.62,"output":1.85},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek/deepseek-r1":{"id":"deepseek/deepseek-r1","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":1.35,"output":5.4},"canonical_model_id":"deepseek/deepseek-r1"},"inclusionai/ling-3.0-flash-vl":{"id":"inclusionai/ling-3.0-flash-vl","name":"Ling 3.0 Flash VL","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"inclusionai/ling-3.0-flash-sante":{"id":"inclusionai/ling-3.0-flash-sante","name":"Ling 3.0 Flash Sante","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-sante"},"inclusionai/ling-3.1-flash-1019":{"id":"inclusionai/ling-3.1-flash-1019","name":"Ling 3.1 Flash 1019","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"release_date":"2026-10-30","last_updated":"2026-10-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"cost":{"input":0.3,"output":0.9,"cache_read":0.06}},"inclusionai/ling-3.0-flash-fin":{"id":"inclusionai/ling-3.0-flash-fin","name":"Ling 3.0 Flash Fin","description":"Finance-enhanced model for financial research, multi-step investment workflows, and long-horizon planning and execution","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-09-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":0.075,"output":0.22,"cache_read":0.015},"canonical_model_id":"inclusionai/ling-3.0-flash-fin"},"inclusionai/ling-3.0-flash":{"id":"inclusionai/ling-3.0-flash","name":"Ling 3.0 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":0.021,"output":0.063,"cache_read":0.0042},"canonical_model_id":"inclusionai/ling-3.0-flash"},"inclusionai/ling-3.1-flash":{"id":"inclusionai/ling-3.1-flash","name":"Ling 3.1 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.06},"canonical_model_id":"inclusionai/ling-3.1-flash"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.1-flash-lite-image":{"id":"google/gemini-3.1-flash-lite-image","type":"image","name":"Gemini 3.1 Flash Lite Image (Nano Banana 2 Lite)","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":1.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"google/gemini-3.5-transcribe-live":{"id":"google/gemini-3.5-transcribe-live","type":"transcription","name":"Gemini 3.5 Transcribe Live","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"google/gemini-3.5-transcribe-live"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-carbon"},"google/text-multilingual-embedding-002":{"id":"google/text-multilingual-embedding-002","type":"embedding","name":"Text Multilingual Embedding 002","description":"Gecko-based multilingual text embedding model producing up to 768-dimensional vectors","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-05-14","last_updated":"2024-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"google/text-multilingual-embedding-002"},"google/veo-3.1-lite-generate-001":{"id":"google/veo-3.1-lite-generate-001","type":"video","name":"Veo 3.1 Lite Generate","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-omni-flash-preview":{"id":"google/gemini-omni-flash-preview","type":"video","name":"Gemini Omni Flash Preview","description":"Video generation and editing model for fast, conversational text- and image-to-video workflows","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["video"]},"open_weights":false,"limit":{"context":1000000,"output":57920},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-flash-preview"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/veo-3.1-fast-generate-001":{"id":"google/veo-3.1-fast-generate-001","type":"video","name":"Veo 3.1 Fast Generate","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-15","last_updated":"2026-06-08","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-embedding-001":{"id":"google/gemini-embedding-001","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":1},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"google/gemini-embedding-001"},"google/gemini-embedding-2":{"id":"google/gemini-embedding-2","type":"embedding","name":"Gemini Embedding 2","description":"Multimodal embedding model mapping text, images, video, audio, and PDFs into a unified embedding space","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-11","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":3072},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"google/gemini-embedding-2"},"google/gemini-3.1-flash-image":{"id":"google/gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3.1-flash-image"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65000},"cost":{"input":0.25,"output":1.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.8-flash-tts":{"id":"google/gemini-3.8-flash-tts","type":"speech","name":"Gemini 3.8 Flash TTS","description":"Flagship text-to-speech model for expressive, studio-grade voices and long-form multi-speaker audio","family":"gemini-flash","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":0.5,"output":9,"output_audio":9},"canonical_model_id":"google/gemini-3.8-flash-tts"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65000},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/text-embedding-005":{"id":"google/text-embedding-005","type":"embedding","name":"Text Embedding 005","description":"Gecko-based text embedding model specialized in English and code tasks, producing up to 768-dimensional vectors","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-11-18","last_updated":"2024-11-18","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"google/text-embedding-005"},"google/gemini-2.5-flash-image":{"id":"google/gemini-2.5-flash-image","type":"image","name":"Nano Banana (Gemini 2.5 Flash Image)","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-3-flash":{"id":"google/gemini-3-flash","name":"Gemini 3 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65000},"cost":{"input":0.5,"output":3,"cache_read":0.05}},"google/gemini-omni-1.2-flash":{"id":"google/gemini-omni-1.2-flash","type":"video","name":"Gemini Omni 1.2 Flash","description":"Omni-modal model for text, vision, audio, and multimodal agent tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":false,"temperature":false,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image","pdf"],"output":["video"]},"open_weights":false,"limit":{"context":131072,"output":260640},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-1.2-flash"},"google/gemini-3-pro-image":{"id":"google/gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-image"},"google/gemini-3.8-flash-lite-tts":{"id":"google/gemini-3.8-flash-lite-tts","type":"speech","name":"Gemini 3.8 Flash-Lite TTS","description":"Fast, cost-efficient text-to-speech model for high-volume narration and voice agent pipelines","family":"gemini-flash-lite","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":0.5,"output":6,"output_audio":6},"canonical_model_id":"google/gemini-3.8-flash-lite-tts"},"google/gemini-3.8-live-extended-thinking":{"id":"google/gemini-3.8-live-extended-thinking","type":"realtime","name":"Gemini 3.8 Live Extended Thinking","description":"Live API voice model with configurable background reasoning for multi-step real-time agents","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-09-15","last_updated":"2026-09-15","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":131072,"output":65536},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":0.75,"output":4.5,"input_audio":3,"output_audio":12},"canonical_model_id":"google/gemini-3.8-live-extended-thinking"},"google/gemini-3.8-live":{"id":"google/gemini-3.8-live","type":"realtime","name":"Gemini 3.8 Live","description":"Low-latency Live API model for real-time voice agents with interleaved reasoning and async tools","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-09-15","last_updated":"2026-09-15","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":131072,"output":65536},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":0.75,"output":4.5,"input_audio":3,"output_audio":12},"canonical_model_id":"google/gemini-3.8-live"},"google/gemini-3.5-transcribe":{"id":"google/gemini-3.5-transcribe","type":"transcription","name":"Gemini 3.5 Transcribe","description":"Speech-to-text model with language detection, speaker diarization, word timestamps, and custom vocabulary","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":98304,"output":32768},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":2,"output":12,"input_audio":2},"canonical_model_id":"google/gemini-3.5-transcribe"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"google/veo-3.1-generate-001":{"id":"google/veo-3.1-generate-001","type":"video","name":"Veo 3.1","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-15","last_updated":"2026-06-08","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"google/gemini-nano-banana-2.1":{"id":"google/gemini-nano-banana-2.1","type":"image","name":"Gemini Nano Banana 2.1","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-nano-banana-2.1"},"poolside/laguna-s-2.1":{"id":"poolside/laguna-s-2.1","name":"Laguna S 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.09,"output":0.18,"cache_read":0.009},"canonical_model_id":"poolside/laguna-s-2.1"},"bytedance/seedream-4.0":{"id":"bytedance/seedream-4.0","type":"image","name":"Seedream 4.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-09-09","last_updated":"2025-08-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bytedance/seedance-v1.0-pro-fast":{"id":"bytedance/seedance-v1.0-pro-fast","type":"video","name":"Seedance v1.0 Pro Fast","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-24","last_updated":"2025-10-31","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"bytedance/seedream-5.0-lite":{"id":"bytedance/seedream-5.0-lite","type":"image","name":"Seedream 5.0 Lite","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-13","last_updated":"2026-01-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bytedance/seedance-2.0":{"id":"bytedance/seedance-2.0","type":"video","name":"Seedance 2.0","description":"ByteDance unified multimodal audio-video model supporting text, image, video and audio references, editing, extension and synchronized stereo sound.","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-12","last_updated":"2026-10-04","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"bytedance-seed/seedance-2.0"},"bytedance/seedance-v1.0-pro":{"id":"bytedance/seedance-v1.0-pro","type":"video","name":"Seedance v1.0 Pro","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-11","last_updated":"2025-06-11","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"bytedance/seedream-5.0-pro":{"id":"bytedance/seedream-5.0-pro","type":"image","name":"Seedream 5.0 Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-11","last_updated":"2026-07-11","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bytedance/seed-2.1-turbo":{"id":"bytedance/seed-2.1-turbo","name":"Seed 2.1 Turbo","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":2.5,"cache_read":0.1},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"bytedance/seedance-2.0-fast":{"id":"bytedance/seedance-2.0-fast","type":"video","name":"Seedance 2.0 Fast","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-14","last_updated":"2026-04-14","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"bytedance/seedance-2.0-mini":{"id":"bytedance/seedance-2.0-mini","type":"video","name":"Seedance 2.0 Mini","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-06-22","last_updated":"2026-06-22","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"bytedance/seedream-4.5":{"id":"bytedance/seedream-4.5","type":"image","name":"Seedream 4.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-03","last_updated":"2025-11-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bytedance/seedance-2.5":{"id":"bytedance/seedance-2.5","type":"video","name":"Seedance 2.5","description":"ByteDance multimodal audio-video model with up to 30-second single-pass generation, multi-round extension, reference inputs and timestamp-level editing.","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-31","last_updated":"2026-10-04","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"bytedance-seed/seedance-2.5"},"recraft/recraft-v2":{"id":"recraft/recraft-v2","type":"image","name":"Recraft V2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-03-13","last_updated":"2024-03","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4.1-utility":{"id":"recraft/recraft-v4.1-utility","type":"image","name":"Recraft V4.1 Utility","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4.1":{"id":"recraft/recraft-v4.1","type":"image","name":"Recraft V4.1","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4.1-utility-pro":{"id":"recraft/recraft-v4.1-utility-pro","type":"image","name":"Recraft V4.1 Utility Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v3":{"id":"recraft/recraft-v3","type":"image","name":"Recraft V3","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-10-30","last_updated":"2024-10","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4.1-pro":{"id":"recraft/recraft-v4.1-pro","type":"image","name":"Recraft V4.1 Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4":{"id":"recraft/recraft-v4","type":"image","name":"Recraft V4","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4-pro":{"id":"recraft/recraft-v4-pro","type":"image","name":"Recraft V4 Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"recraft/recraft-v4.1-flash":{"id":"recraft/recraft-v4.1-flash","type":"image","name":"Recraft V4.1 Flash","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"recraft","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"humansand/ampersand-v0.1":{"id":"humansand/ampersand-v0.1","name":"Ampersand v0.1","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"v0","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0,"output":0}},"zai/glm-5.2-fast":{"id":"zai/glm-5.2-fast","name":"GLM 5.2 Fast","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":2.8,"output":8.8,"cache_read":0.56},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM 5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":64000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-5.3-flashx-legal":{"id":"zai/glm-5.3-flashx-legal","name":"GLM 5.3 FlashX Legal","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"zai/glm-4.5":{"id":"zai/glm-4.5","name":"GLM 4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":96000},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM 4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":120000},"cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5.3-fast":{"id":"zai/glm-5.3-fast","name":"GLM 5.3 Fast","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":2.1,"output":6.6,"cache_read":0.21},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-5.3":{"id":"zai/glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-5.3-flash":{"id":"zai/glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5-turbo":{"id":"zai/glm-5-turbo","name":"GLM 5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202800,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"zai/glm-4.5-air":{"id":"zai/glm-4.5-air","name":"GLM 4.5 Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":96000},"cost":{"input":0.2,"output":1.1,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM 4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":96000},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-4.5v":{"id":"zai/glm-4.5v","name":"GLM 4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":66000,"output":16000},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"zai/glm-5.3-flashx":{"id":"zai/glm-5.3-flashx","name":"GLM 5.3 FlashX","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5v-turbo":{"id":"zai/glm-5v-turbo","name":"GLM 5V Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"zai/glm-4.7-flashx":{"id":"zai/glm-4.7-flashx","name":"GLM 4.7 FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.06,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":131100},"cost":{"input":1,"output":3.2},"canonical_model_id":"zhipuai/glm-5"},"zai/glm-4.7-flash":{"id":"zai/glm-4.7-flash","name":"GLM 4.7 Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131000},"cost":{"input":0.07,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"bfl/flux-kontext-pro":{"id":"bfl/flux-kontext-pro","type":"image","name":"FLUX.1 Kontext Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-29","last_updated":"2025-06","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-3-video":{"id":"bfl/flux-3-video","type":"video","name":"Flux 3","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-04","last_updated":"2026-08-04","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"bfl/flux-2-pro":{"id":"bfl/flux-2-pro","type":"image","name":"FLUX.2 [pro]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2026-06-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":67300,"output":67300},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-3-image-klein":{"id":"bfl/flux-3-image-klein","type":"image","name":"FLUX 3 Image Klein","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-2-flex":{"id":"bfl/flux-2-flex","type":"image","name":"FLUX.2 [flex]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2026-06-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-3-image":{"id":"bfl/flux-3-image","type":"image","name":"FLUX 3 Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-05","last_updated":"2026-10-05","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-2-klein-4b":{"id":"bfl/flux-2-klein-4b","type":"image","name":"FLUX.2 [klein] 4B","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-06-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-kontext-max":{"id":"bfl/flux-kontext-max","type":"image","name":"FLUX.1 Kontext Max","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-29","last_updated":"2025-06","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-pro-1.1":{"id":"bfl/flux-pro-1.1","type":"image","name":"FLUX1.1 [pro]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-10-02","last_updated":"2024-10","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-pro-1.1-ultra":{"id":"bfl/flux-pro-1.1-ultra","type":"image","name":"FLUX1.1 [pro] Ultra","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-11-01","last_updated":"2024-11","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-2-max":{"id":"bfl/flux-2-max","type":"image","name":"FLUX.2 [max]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2026-06-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":67300,"output":67300},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-2-klein-9b":{"id":"bfl/flux-2-klein-9b","type":"image","name":"FLUX.2 [klein] 9B","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-06-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"bfl/flux-pro-1.0-fill":{"id":"bfl/flux-pro-1.0-fill","type":"image","name":"FLUX.1 Fill [pro]","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-10-01","last_updated":"2024-10","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":512,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"tencent/hy-mt2-lite":{"id":"tencent/hy-mt2-lite","name":"Tencent Hy-MT2-Lite","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":4000},"cost":{"input":0.044,"output":0.177}},"tencent/hy-mt2-pro":{"id":"tencent/hy-mt2-pro","name":"Tencent Hy-MT2-Pro","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":4000},"cost":{"input":0.074,"output":0.295}},"tencent/hy4":{"id":"tencent/hy4","name":"Tencent Hy4","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"output":64000},"cost":{"input":0.417,"output":1.2505,"cache_read":0.021},"canonical_model_id":"tencent/hy4"},"tencent/hy-mt2-plus":{"id":"tencent/hy-mt2-plus","name":"Tencent Hy-MT2-Plus","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":4000},"cost":{"input":0.074,"output":0.295}},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Tencent Hy4 Preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"microsoft/mai-voice-2":{"id":"microsoft/mai-voice-2","type":"speech","name":"MAI-Voice-2","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mai","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-voice-2.1":{"id":"microsoft/mai-voice-2.1","type":"speech","name":"MAI-Voice-2.1","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mai","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-voice-2.1-flash":{"id":"microsoft/mai-voice-2.1-flash","type":"speech","name":"MAI-Voice-2.1-Flash","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mai","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-transcribe-2":{"id":"microsoft/mai-transcribe-2","type":"transcription","name":"MAI-Transcribe 2","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"mai","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-03","last_updated":"2026-09-03","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-voice-2-flash":{"id":"microsoft/mai-voice-2-flash","type":"speech","name":"MAI-Voice-2-Flash","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mai","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-transcribe-2-streaming":{"id":"microsoft/mai-transcribe-2-streaming","type":"transcription","name":"MAI-Transcribe-2-Streaming","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"mai","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"microsoft/mai-image-2.6":{"id":"microsoft/mai-image-2.6","type":"image","name":"MAI-Image-2.6","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"mai","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":5,"output":38}},"microsoft/mai-image-2.6-flash":{"id":"microsoft/mai-image-2.6-flash","type":"image","name":"MAI-Image-2.6-Flash","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"mai","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":1.75,"output":19}},"moonshotai/kimi-k3.1-pro-highspeed":{"id":"moonshotai/kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4}},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3-fast":{"id":"moonshotai/kimi-k3-fast","name":"Kimi K3 Fast","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2":{"id":"moonshotai/kimi-k2","name":"Kimi K2 Instruct","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12-31","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2.7-code-highspeed":{"id":"moonshotai/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code High Speed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"topaz/proteus":{"id":"topaz/proteus","type":"video","name":"Proteus","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"topaz/wonder-3.5":{"id":"topaz/wonder-3.5","type":"image","name":"Wonder 3.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"topaz/starlight-precise-2.6":{"id":"topaz/starlight-precise-2.6","type":"video","name":"Starlight Precise 2.6","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3.6-plus":{"id":"alibaba/qwen3.6-plus","name":"Qwen 3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1,"max":131072}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625,"tiers":[{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5}},"canonical_model_id":"alibaba/qwen3.6-plus"},"alibaba/wan-v2.7-t2v":{"id":"alibaba/wan-v2.7-t2v","type":"video","name":"Wan v2.7 Text-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen-3-235b":{"id":"alibaba/qwen-3-235b","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.22,"output":0.88},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"alibaba/wan-v2.6-i2v":{"id":"alibaba/wan-v2.6-i2v","type":"video","name":"Wan v2.6 Image-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","image","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/wan-v2.7-r2v":{"id":"alibaba/wan-v2.7-r2v","type":"video","name":"Wan v2.7 Reference-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3.8-omni-flash":{"id":"alibaba/qwen3.8-omni-flash","name":"Qwen 3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"alibaba/qwen3-vl-instruct":{"id":"alibaba/qwen3-vl-instruct","name":"Qwen3 VL Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.88,"cache_read":0.11}},"alibaba/qwen3-coder":{"id":"alibaba/qwen3-coder","name":"Qwen3 Coder 480B A35B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.22,"output":1.8,"cache_read":0.022,"tiers":[{"input":2.7,"output":13.5,"cache_read":0.54,"tier":{"type":"context","size":32001}},{"input":4.5,"output":22.5,"cache_read":0.9,"tier":{"type":"context","size":128001}}]},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"alibaba/qwen-3-30b":{"id":"alibaba/qwen-3-30b","name":"Qwen3-30B-A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"alibaba/wan-v2.6-t2v":{"id":"alibaba/wan-v2.6-t2v","type":"video","name":"Wan v2.6 Text-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/wan-v3.0-video":{"id":"alibaba/wan-v3.0-video","type":"video","name":"Wan v3.0 Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-23","last_updated":"2026-08-23","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3.8-27b":{"id":"alibaba/qwen3.8-27b","name":"Qwen3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.06,"output":2.2,"cache_read":0.059},"canonical_model_id":"alibaba/qwen3.8-27b"},"alibaba/qwen3.5-flash":{"id":"alibaba/qwen3.5-flash","name":"Qwen 3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"alibaba/qwen3.5-flash"},"alibaba/wan-v2.6-r2v-flash":{"id":"alibaba/wan-v2.6-r2v-flash","type":"video","name":"Wan v2.6 Reference-to-Video Flash","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3.8-flash":{"id":"alibaba/qwen3.8-flash","name":"Qwen 3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":128000},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"alibaba/qwen3-next-80b-a3b-thinking":{"id":"alibaba/qwen3-next-80b-a3b-thinking","name":"Qwen3 Next 80B A3B Thinking","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.15,"output":1.2},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"alibaba/qwen3-embedding-4b":{"id":"alibaba/qwen3-embedding-4b","type":"embedding","name":"Qwen3 Embedding 4B","description":"Multilingual text embedding model for retrieval, code search, classification, and clustering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"alibaba/qwen3-embedding-4b"},"alibaba/qwen3.8-max-prime":{"id":"alibaba/qwen3.8-max-prime","name":"Qwen 3.8 Max Prime","description":"High-throughput edition of Qwen3.8 Max for coding, professional work, multimodal understanding, and long-running agent workflows","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":4,"output":12,"cache_read":0.5,"cache_write":5},"canonical_model_id":"alibaba/qwen3.8-max-prime"},"alibaba/qwen3-coder-30b-a3b":{"id":"alibaba/qwen3-coder-30b-a3b","name":"Qwen 3 Coder 30B A3B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"alibaba/qwen3.8-max-0902":{"id":"alibaba/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"alibaba/qwen-3-14b":{"id":"alibaba/qwen-3-14b","name":"Qwen3-14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.24}},"alibaba/qwen3.8-2.4t-a95b":{"id":"alibaba/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"alibaba/wan-v2.5-t2v-preview":{"id":"alibaba/wan-v2.5-t2v-preview","type":"video","name":"Wan v2.5 Text-to-Video Preview","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-09-24","last_updated":"2025-09-24","modalities":{"input":["text","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3-embedding-8b":{"id":"alibaba/qwen3-embedding-8b","type":"embedding","name":"Qwen3 Embedding 8B","description":"Multilingual text embedding model for retrieval, code search, classification, and clustering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"alibaba/qwen3-embedding-0.6b":{"id":"alibaba/qwen3-embedding-0.6b","type":"embedding","name":"Qwen3 Embedding 0.6B","description":"Compact multilingual text embedding model for retrieval, code search, classification, and clustering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"alibaba/qwen3-embedding-0.6b"},"alibaba/qwen3.7-plus":{"id":"alibaba/qwen3.7-plus","name":"Qwen 3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5}},"canonical_model_id":"alibaba/qwen3.7-plus"},"alibaba/qwen3-max-thinking":{"id":"alibaba/qwen3-max-thinking","name":"Qwen 3 Max Thinking","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-23","last_updated":"2025-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":1.2,"output":6,"cache_read":0.24,"tiers":[{"input":2.4,"output":12,"cache_read":0.48,"tier":{"type":"context","size":32001}},{"input":3,"output":15,"cache_read":0.6,"tier":{"type":"context","size":128001}}]}},"alibaba/qwen3.7-max":{"id":"alibaba/qwen3.7-max","name":"Qwen 3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":64000},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"alibaba/wan-v2.6-i2v-flash":{"id":"alibaba/wan-v2.6-i2v-flash","type":"video","name":"Wan v2.6 Image-to-Video Flash","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","image","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/wan-v2.6-r2v":{"id":"alibaba/wan-v2.6-r2v","type":"video","name":"Wan v2.6 Reference-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/wan-v3.0-video-prime":{"id":"alibaba/wan-v3.0-video-prime","type":"video","name":"Wan v3.0 Video Prime","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"alibaba/qwen3.7-flash":{"id":"alibaba/qwen3.7-flash","name":"Qwen 3.7 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":64000},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"cache_write":0.125,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"cache_write":0.25,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"alibaba/qwen3.6-27b":{"id":"alibaba/qwen3.6-27b","name":"Qwen 3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.6-27b"},"alibaba/qwen3.6-35b-a3b":{"id":"alibaba/qwen3.6-35b-a3b","name":"Qwen 3.6 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.375,"output":2.25},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"alibaba/qwen3.5-plus":{"id":"alibaba/qwen3.5-plus","name":"Qwen 3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5,"tiers":[{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":256001}}],"context_over_200k":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625}},"canonical_model_id":"alibaba/qwen3.5-plus"},"alibaba/qwen3-coder-next":{"id":"alibaba/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.5,"output":1.2},"canonical_model_id":"alibaba/qwen3-coder-next"},"alibaba/qwen3-next-80b-a3b-instruct":{"id":"alibaba/qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262114,"output":262114},"cost":{"input":0.15,"output":1.2},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"alibaba/qwen-3-32b":{"id":"alibaba/qwen-3-32b","name":"Qwen 3.32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-32b"},"alibaba/qwen3.8-max":{"id":"alibaba/qwen3.8-max","name":"Qwen 3.8 Max","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"openai/gpt-6-luna-fast":{"id":"openai/gpt-6-luna-fast","name":"GPT-6 Luna (Fast)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.5,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":0.4,"output":1.5,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-oss-safeguard-120b":{"id":"openai/gpt-oss-safeguard-120b","name":"GPT OSS Safeguard 120B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":112000,"output":16000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT 5.2 ","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT 5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":872000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.4-fast":{"id":"openai/gpt-5.4-fast","name":"GPT 5.4 (Fast)","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-realtime-2.1":{"id":"openai/gpt-realtime-2.1","type":"realtime","name":"gpt-realtime-2.1","description":"Realtime speech-to-speech model with configurable reasoning, tool use, and robust voice-agent behavior","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"input":96000,"output":32000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":4,"output":24,"cache_read":0.4,"input_audio":32,"output_audio":64},"canonical_model_id":"openai/gpt-realtime-2.1"},"openai/gpt-5.6-luna-fast":{"id":"openai/gpt-5.6-luna-fast","name":"GPT 5.6 Luna (Fast)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5,"tiers":[{"input":0.8,"output":3.6,"cache_read":0.08,"cache_write":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.8,"output":3.6,"cache_read":0.08,"cache_write":1}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-realtime-mini":{"id":"openai/gpt-realtime-mini","type":"realtime","name":"GPT-Realtime mini","description":"Cost-efficient realtime speech-to-speech model for voice agents","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32000,"output":4096},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"input_audio":10,"output_audio":20},"canonical_model_id":"openai/gpt-realtime-mini"},"openai/gpt-6.1-sol-fast":{"id":"openai/gpt-6.1-sol-fast","name":"GPT-6.1 Sol (Fast)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.4,"cache_write":10,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.4,"cache_write":10}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/text-embedding-ada-002":{"id":"openai/text-embedding-ada-002","type":"embedding","name":"text-embedding-ada-002","description":"Legacy OpenAI text embedding model","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2022-12-15","last_updated":"2022-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"openai/text-embedding-ada-002"},"openai/gpt-6-sol-fast":{"id":"openai/gpt-6-sol-fast","name":"GPT-6 Sol (Fast)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1014808,"output":32768},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":0.2,"output":0.8,"cache_read":0.06},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.1,"output":0.4,"cache_read":0.03},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-realtime-1.5":{"id":"openai/gpt-realtime-1.5","type":"realtime","name":"GPT-Realtime-1.5","description":"Realtime speech-to-speech model for voice agents and customer support","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32000,"output":4096},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":4,"output":16,"cache_read":0.4,"input_audio":32,"output_audio":64},"canonical_model_id":"openai/gpt-realtime-1.5"},"openai/o1":{"id":"openai/o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"status":"deprecated","cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1014808,"output":32768},"experimental":{"modes":{"fast":{"cost":{"input":0.7,"output":2.8,"cache_read":0.175},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5-mini-fast":{"id":"openai/gpt-5-mini-fast","name":"GPT-5 mini (Fast)","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.45,"output":3.6,"cache_read":0.045},"canonical_model_id":"openai/gpt-5-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":2,"output":8,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.55,"output":2.2,"cache_read":0.1375},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2-Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.1-thinking":{"id":"openai/gpt-5.1-thinking","name":"GPT 5.1 Thinking","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-11-12","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT 5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-realtime-2":{"id":"openai/gpt-realtime-2","type":"realtime","name":"gpt-realtime-2","description":"Realtime speech-to-speech model with configurable reasoning and reliable tool use for voice agents","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"output":32000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":4,"output":24,"cache_read":0.4,"input_audio":32,"output_audio":64},"canonical_model_id":"openai/gpt-realtime-2"},"openai/gpt-5.5-fast":{"id":"openai/gpt-5.5-fast","name":"GPT 5.5 (Fast)","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":872000,"output":128000},"cost":{"input":12.5,"output":75,"cache_read":1.25},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"gpt-oss-safeguard-20b","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"input":112000,"output":16000},"cost":{"input":0.07,"output":0.2},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-image-2.5-flare":{"id":"openai/gpt-image-2.5-flare","type":"image","name":"GPT Image 2.5 Flare","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-flare"},"openai/text-embedding-3-large":{"id":"openai/text-embedding-3-large","type":"embedding","name":"text-embedding-3-large","description":"Most capable OpenAI embedding model for English and non-English text","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"openai/text-embedding-3-large"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.625,"output":5,"cache_read":0.0625},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT 5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1-Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-image-1-mini":{"id":"openai/gpt-image-1-mini","type":"image","name":"GPT Image 1 Mini","description":"Cost-efficient GPT Image 1 variant for image generation and editing","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":2,"output":8,"cache_read":0.2},"canonical_model_id":"openai/gpt-image-1-mini"},"openai/gpt-4o-fast":{"id":"openai/gpt-4o-fast","name":"GPT-4o (Fast)","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":111616,"output":16384},"cost":{"input":4.25,"output":17,"cache_read":2.125},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT 5.6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1-mini-fast":{"id":"openai/gpt-4.1-mini-fast","name":"GPT-4.1 mini (Fast)","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1014808,"output":32768},"cost":{"input":0.7,"output":2.8,"cache_read":0.175},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1014808,"output":32768},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":14,"cache_read":0.875},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-6.1-terra-fast":{"id":"openai/gpt-6.1-terra-fast","name":"GPT-6.1 Terra (Fast)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":14,"cache_read":0.875},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":1,"output":4,"cache_read":0.25},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/tts-1-hd":{"id":"openai/tts-1-hd","type":"speech","name":"TTS-1 HD","description":"Text-to-speech model optimized for audio quality","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"openai/tts-1-hd"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-realtime-whisper":{"id":"openai/gpt-realtime-whisper","type":"transcription","name":"gpt-realtime-whisper","description":"Streaming speech-to-text model for low-latency transcript deltas from live audio","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"openai/gpt-realtime-whisper"},"openai/gpt-image-2":{"id":"openai/gpt-image-2","type":"image","name":"GPT Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2"},"openai/text-embedding-3-small":{"id":"openai/text-embedding-3-small","type":"embedding","name":"text-embedding-3-small","description":"Small, efficient OpenAI text embedding model","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"openai/text-embedding-3-small"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":122880,"output":8192},"cost":{"input":0.03,"output":0.14},"canonical_model_id":"openai/gpt-oss-20b"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/whisper-1":{"id":"openai/whisper-1","type":"transcription","name":"Whisper","description":"General-purpose speech recognition model for transcription and translation","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-03-01","last_updated":"2023-03-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"openai/whisper-1"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":128000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-4o-transcribe":{"id":"openai/gpt-4o-transcribe","type":"transcription","name":"GPT-4o Transcribe","description":"Speech-to-text model powered by GPT-4o for accurate transcription","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-06-01","release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":2.5,"output":10,"input_audio":2.5},"canonical_model_id":"openai/gpt-4o-transcribe"},"openai/gpt-image-1.5":{"id":"openai/gpt-image-1.5","type":"image","name":"GPT Image 1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":5,"output":32,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1.5"},"openai/gpt-5.6-terra-fast":{"id":"openai/gpt-5.6-terra-fast","name":"GPT 5.6 Terra (Fast)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":24,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":36,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":36,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT 5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-5.3-codex-fast":{"id":"openai/gpt-5.3-codex-fast","name":"GPT 5.3 Codex (Fast)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":3.5,"output":28,"cache_read":0.35},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/o3-fast":{"id":"openai/o3-fast","name":"o3 (Fast)","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"cost":{"input":3.5,"output":14,"cache_read":0.875},"canonical_model_id":"openai/o3"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.45,"output":3.6,"cache_read":0.045},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.125,"output":1,"cache_read":0.0125},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT 5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":872000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.1-thinking-fast":{"id":"openai/gpt-5.1-thinking-fast","name":"GPT 5.1 Thinking (Fast)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"release_date":"2025-11-12","last_updated":"2025-11-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":2.5,"output":20,"cache_read":0.25}},"openai/gpt-4o-mini-transcribe":{"id":"openai/gpt-4o-mini-transcribe","type":"transcription","name":"GPT-4o mini Transcribe","description":"Speech-to-text model powered by GPT-4o Mini for fast, accurate transcription","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-06-01","release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":2000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"cost":{"input":1.25,"output":5,"input_audio":1.25},"canonical_model_id":"openai/gpt-4o-mini-transcribe"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT 5.6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT 5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"flex":{"cost":{"input":0.025,"output":0.2,"cache_read":0.0025},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT 5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-image-2.5-sunburst":{"id":"openai/gpt-image-2.5-sunburst","type":"image","name":"GPT Image 2.5 Sunburst","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-sunburst"},"openai/gpt-5.2-fast":{"id":"openai/gpt-5.2-fast","name":"GPT 5.2 (Fast)","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":3.5,"output":28,"cache_read":0.35},"canonical_model_id":"openai/gpt-5.2"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3 Pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":100000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"openai/gpt-5.4-mini-fast":{"id":"openai/gpt-5.4-mini-fast","name":"GPT 5.4 Mini (Fast)","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT 5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o-mini-fast":{"id":"openai/gpt-4o-mini-fast","name":"GPT-4o mini (Fast)","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":111616,"output":16384},"cost":{"input":0.25,"output":1,"cache_read":0.125},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-6-astra-fast":{"id":"openai/gpt-6-astra-fast","name":"GPT-6 Astra (Fast)","description":"Fast variant of GPT-6 Astra for low-latency assistance and high-volume workloads.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":20,"output":100,"cache_read":2,"cache_write":25,"tiers":[{"input":40,"output":150,"cache_read":4,"cache_write":50,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":40,"output":150,"cache_read":4,"cache_write":50}},"canonical_model_id":"openai/gpt-6-astra-fast"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":111616,"output":16384},"experimental":{"modes":{"fast":{"cost":{"input":4.25,"output":17,"cache_read":2.125},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5-codex":{"id":"openai/gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5-codex"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.1,"output":0.5,"cache_read":0.1},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT 5.6 Terra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4.1-fast":{"id":"openai/gpt-4.1-fast","name":"GPT-4.1 (Fast)","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"input":1014808,"output":32768},"cost":{"input":3.5,"output":14,"cache_read":0.875},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-5-fast":{"id":"openai/gpt-5-fast","name":"GPT-5 (Fast)","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":2.5,"output":20,"cache_read":0.25},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol-fast":{"id":"openai/gpt-5.6-sol-fast","name":"GPT 5.6 Sol (Fast)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10,"tiers":[{"input":16,"output":60,"cache_read":1.6,"cache_write":20,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":16,"output":60,"cache_read":1.6,"cache_write":20}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":111616,"output":16384},"experimental":{"modes":{"fast":{"cost":{"input":0.25,"output":1,"cache_read":0.125},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-live-1":{"id":"openai/gpt-live-1","type":"realtime","name":"GPT-Live 1","description":"Full-duplex voice model for natural conversations that delegates reasoning and tools to a backend agent","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"openai/gpt-live-1"},"openai/tts-1":{"id":"openai/tts-1","type":"speech","name":"TTS-1","description":"Text-to-speech model optimized for low latency","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"openai/tts-1"},"elorian/glimpse":{"id":"elorian/glimpse","name":"Glimpse","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":false,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":220000,"output":4096},"cost":{"input":0.6,"output":3,"cache_read":0.06}},"interfaze/interfaze-beta":{"id":"interfaze/interfaze-beta","name":"Interfaze Beta","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"temperature":true,"release_date":"2025-10-07","last_updated":"2026-04-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":1.5,"output":3.5}},"mixedbread/toast-1":{"id":"mixedbread/toast-1","name":"Toast 1","description":"Specialized search model for knowledge-intensive questions, multi-step retrieval, and evidence synthesis","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131000,"output":4000},"cost":{"input":0.3,"output":0.72,"cache_read":0.036},"canonical_model_id":"mixedbread/toast-1"},"cohere/rerank-v5-fast":{"id":"cohere/rerank-v5-fast","type":"reranking","name":"Cohere Rerank 5 Fast","description":"Reranking model for improving retrieval quality in search and recommendation systems","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-21","last_updated":"2026-10-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"}},"cohere/embed-v4.0":{"id":"cohere/embed-v4.0","type":"embedding","name":"Embed v4.0","description":"Multimodal embedding model for text, images, and mixed text-and-image documents","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":1536},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/embed-v4.0"},"cohere/embed-v5.0-fast":{"id":"cohere/embed-v5.0-fast","type":"embedding","name":"Embed 5 Fast","description":"Faster, lighter Embed 5 model sharing Embed 5 Pro's embedding space","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-30","last_updated":"2026-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":2048},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/embed-v5.0-fast"},"cohere/rerank-v4-pro":{"id":"cohere/rerank-v4-pro","type":"reranking","name":"Cohere Rerank 4 Pro","description":"Multilingual reranker for maximum relevance on documents and semi-structured data","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/rerank-v4.0-pro"},"cohere/command-a":{"id":"cohere/command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a"},"cohere/rerank-v5-pro":{"id":"cohere/rerank-v5-pro","type":"reranking","name":"Cohere Rerank 5 Pro","description":"Reranking model for improving retrieval quality in search and recommendation systems","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-21","last_updated":"2026-10-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"}},"cohere/rerank-v4-fast":{"id":"cohere/rerank-v4-fast","type":"reranking","name":"Cohere Rerank 4 Fast","description":"Low-latency multilingual reranker for high-throughput retrieval","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/rerank-v4.0-fast"},"cohere/embed-v5.0-pro":{"id":"cohere/embed-v5.0-pro","type":"embedding","name":"Embed 5 Pro","description":"Cohere's most capable multimodal embedding model for text, images, and mixed documents","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-30","last_updated":"2026-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":2048},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/embed-v5.0-pro"},"cohere/rerank-v3.5":{"id":"cohere/rerank-v3.5","type":"reranking","name":"Cohere Rerank 3.5","description":"Multilingual reranker for documents and semi-structured data","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-12-02","last_updated":"2024-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"cohere/rerank-v3.5"},"klingai/kling-v3.0-t2v":{"id":"klingai/kling-v3.0-t2v","type":"video","name":"Kling v3.0 Text-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v3.0-i2v":{"id":"klingai/kling-v3.0-i2v","type":"video","name":"Kling v3.0 Image-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v2.6-i2v":{"id":"klingai/kling-v2.6-i2v","type":"video","name":"Kling v2.6 Image-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-03","last_updated":"2025-12-21","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v2.6-t2v":{"id":"klingai/kling-v2.6-t2v","type":"video","name":"Kling v2.6 Text-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-03","last_updated":"2025-12-21","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v2.6-motion-control":{"id":"klingai/kling-v2.6-motion-control","type":"video","name":"Kling v2.6 Motion Control","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-18","last_updated":"2025-12-21","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v2.5-turbo-i2v":{"id":"klingai/kling-v2.5-turbo-i2v","type":"video","name":"Kling v2.5 Turbo Image-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v2.5-turbo-t2v":{"id":"klingai/kling-v2.5-turbo-t2v","type":"video","name":"Kling v2.5 Turbo Text-to-Video","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"klingai/kling-v3.0-motion-control":{"id":"klingai/kling-v3.0-motion-control","type":"video","name":"Kling v3.0 Motion Control","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ling","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-04","last_updated":"2026-03-04","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"callstack/apex":{"id":"callstack/apex","name":"Apex","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"release_date":"2026-10-08","last_updated":"2026-10-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.2}},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo V2.6 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-pro-ultraspeed":{"id":"xiaomi/mimo-v2.6-pro-ultraspeed","name":"MiMo V2.6 Pro UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo V2.6 Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"fish-audio/s2.1-pro":{"id":"fish-audio/s2.1-pro","type":"speech","name":"S2.1 Pro","description":"Speech generation model for controllable voice, narration, and audio delivery","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"fish-audio/transcribe-1":{"id":"fish-audio/transcribe-1","type":"transcription","name":"Transcribe-1","description":"Speech transcription model for accurate audio-to-text and captioning workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-01","last_updated":"2026-03-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"fish-audio/s1":{"id":"fish-audio/s1","type":"speech","name":"S1","description":"Speech generation model for controllable voice, narration, and audio delivery","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-20","last_updated":"2025-10-20","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"fish-audio/s2-pro":{"id":"fish-audio/s2-pro","type":"speech","name":"S2 Pro","description":"Speech generation model for controllable voice, narration, and audio delivery","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"fish-audio/drama-3":{"id":"fish-audio/drama-3","type":"speech","name":"Drama 3","description":"Speech generation model for controllable voice, narration, and audio delivery","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.1-lightning":{"id":"minimax/minimax-m2.1-lightning","name":"MiniMax M2.1 Lightning","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-12-23","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":2.4,"cache_read":0.03,"cache_write":0.375}},"minimax/minimax-m2.5-highspeed":{"id":"minimax/minimax-m2.5-highspeed","name":"MiniMax M2.5 High Speed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131000},"cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-h3":{"id":"minimax/minimax-h3","type":"video","name":"MiniMax H3","description":"MiniMax general-purpose video model with multimodal references and synchronized stereo audio. Open H3-Base checkpoints; Context-IR and 2K regeneration are not included in the initial weights release.","family":"minimax","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-31","last_updated":"2026-10-04","modalities":{"input":["text","image"],"output":["video"]},"open_weights":true,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"minimax/MiniMax-H3"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131000},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":196608},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-h3-max":{"id":"minimax/minimax-h3-max","type":"video","name":"MiniMax H3 Max","description":"Fast video model post-trained by fal.ai on MiniMax H3, with synchronized audio at 480p and 768p","family":"minimax","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"minimax/MiniMax-H3-Max"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax M2.7 High Speed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131100},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"Minimax M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":1000000},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"reflection/beam-free":{"id":"reflection/beam-free","name":"Beam 1.0 (Free)","description":"Free provider route for experiments, demos, and cost-sensitive chat workloads","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"reflection/beam":{"id":"reflection/beam","name":"Beam 1.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/llama-3.1-8b":{"id":"meta/llama-3.1-8b","name":"Llama 3.1 8B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.22,"output":0.22},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta/llama-3.1-70b":{"id":"meta/llama-3.1-70b","name":"Llama 3.1 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/llama-4-maverick":{"id":"meta/llama-4-maverick","name":"Llama-4-Maverick-17B-128E-Instruct-FP8","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.24,"output":0.97},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta/llama-3.3-70b":{"id":"meta/llama-3.3-70b","name":"Llama-3.3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta/muse-image-1.0":{"id":"meta/muse-image-1.0","type":"image","name":"Muse Image 1.0","description":"Agentic image generation and editing model that plans, searches and refines before rendering","family":"muse","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-07-07","last_updated":"2026-07-07","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"meta/muse-image-1.0"},"meta/muse-wonder-1.0":{"id":"meta/muse-wonder-1.0","name":"Muse Wonder","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/llama-4-scout":{"id":"meta/llama-4-scout","name":"Llama-4-Scout-17B-16E-Instruct-FP8","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.17,"output":0.66},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"meta/muse-ember":{"id":"meta/muse-ember","name":"Muse Ember","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.5,"cache_read":0.004}},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.35,"output":1.5,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.3-contributor":{"id":"meta/muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"heygen/heygen-video-1":{"id":"heygen/heygen-video-1","type":"video","name":"HeyGen Video","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-09","last_updated":"2026-10-09","modalities":{"input":["text","image","video","audio"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/step-3.7-flash":{"id":"stepfun/step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"fireworks/ember-1":{"id":"fireworks/ember-1","name":"Ember-1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"inception/mercury-2":{"id":"inception/mercury-2","name":"Mercury 2","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":50000},"cost":{"input":0.25,"output":0.75,"cache_read":0.025},"canonical_model_id":"inception/mercury-2"},"inception/mercury-2.5":{"id":"inception/mercury-2.5","name":"Mercury 2.5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":260000,"output":65536},"cost":{"input":0.04,"output":0.15,"cache_read":0.004},"canonical_model_id":"inception/mercury-2.5"},"inception/mercury-coder-small":{"id":"inception/mercury-coder-small","name":"Mercury Coder Small Beta","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"mercury","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-02-26","last_updated":"2025-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":16384},"cost":{"input":0.25,"output":1}},"inception/mercury-3":{"id":"inception/mercury-3","name":"Mercury 3","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1,"output":0.35,"cache_read":0.01}},"voyage/voyage-4-large":{"id":"voyage/voyage-4-large","type":"embedding","name":"voyage-4-large","description":"General-purpose and multilingual embedding model optimized for retrieval quality","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-01-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/voyage-4-large"},"voyage/rerank-2.5":{"id":"voyage/rerank-2.5","type":"reranking","name":"Voyage Rerank 2.5","description":"Instruction-following reranker optimized for retrieval quality","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/rerank-2.5"},"voyage/voyage-code-3":{"id":"voyage/voyage-code-3","type":"embedding","name":"voyage-code-3","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-12-04","last_updated":"2024-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/voyage-3.5-lite":{"id":"voyage/voyage-3.5-lite","type":"embedding","name":"voyage-3.5-lite","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/rerank-3":{"id":"voyage/rerank-3","type":"reranking","name":"Voyage Rerank 3","description":"Reranker optimized for retrieval quality, successor to rerank-2.5","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-30","last_updated":"2026-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/rerank-3"},"voyage/voyage-law-2":{"id":"voyage/voyage-law-2","type":"embedding","name":"voyage-law-2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-04-15","last_updated":"2024-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/rerank-3-lite":{"id":"voyage/rerank-3-lite","type":"reranking","name":"Voyage Rerank 3 Lite","description":"Reranker optimized for latency and cost, successor to rerank-2.5-lite","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-30","last_updated":"2026-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/rerank-3-lite"},"voyage/voyage-4":{"id":"voyage/voyage-4","type":"embedding","name":"voyage-4","description":"General-purpose and multilingual embedding model balancing retrieval quality and cost","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-01-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/voyage-4"},"voyage/voyage-3-large":{"id":"voyage/voyage-3-large","type":"embedding","name":"voyage-3-large","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-01-07","last_updated":"2024-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/voyage-code-2":{"id":"voyage/voyage-code-2","type":"embedding","name":"voyage-code-2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/voyage-3.5":{"id":"voyage/voyage-3.5","type":"embedding","name":"voyage-3.5","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/voyage-finance-2":{"id":"voyage/voyage-finance-2","type":"embedding","name":"voyage-finance-2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-06-03","last_updated":"2024-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"}},"voyage/rerank-2.5-lite":{"id":"voyage/rerank-2.5-lite","type":"reranking","name":"Voyage Rerank 2.5 Lite","description":"Instruction-following reranker optimized for latency and quality","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/cohere","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/rerank-2.5-lite"},"voyage/voyage-4-lite":{"id":"voyage/voyage-4-lite","type":"embedding","name":"voyage-4-lite","description":"Lightweight general-purpose embedding model optimized for latency and cost","family":"voyage","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-15","last_updated":"2026-01-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"voyageai/voyage-4-lite"},"liquid/lfm2.5-24b-a2b":{"id":"liquid/lfm2.5-24b-a2b","name":"LFM2.5-24B-A2B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8200},"cost":{"input":0.05,"output":0.7,"cache_read":0.025}},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65000},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.05,"output":0.2,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/nemotron-3.5-super-vl":{"id":"nvidia/nemotron-3.5-super-vl","name":"NVIDIA Nemotron 3.5 Super VL","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.2,"output":0.5,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-lightning-free":{"id":"nvidia/nemotron-3.5-lightning-free","name":"Nemotron 3.5 Lightning Free","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65000},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-nano-9b-v2":{"id":"nvidia/nemotron-nano-9b-v2","name":"Nvidia Nemotron Nano 9B V2","description":"Compact Nemotron model for efficient reasoning and deployable AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2025-08-18","last_updated":"2025-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.06,"output":0.23},"canonical_model_id":"nvidia/nemotron-nano-9b-v2"},"nvidia/nemotron-3.5-lightning":{"id":"nvidia/nemotron-3.5-lightning","name":"Nemotron 3.5 Lightning 30B","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.06,"output":0.16,"cache_read":0.03},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"NVIDIA Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":0.15,"output":0.65},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/nemotron-nano-12b-v2-vl":{"id":"nvidia/nemotron-nano-12b-v2-vl","name":"Nvidia Nemotron Nano 12B V2 VL","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2025-10-28","last_updated":"2025-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.2,"output":0.6},"canonical_model_id":"nvidia/nemotron-nano-12b-v2-vl"},"stealth/glyph-cluster":{"id":"stealth/glyph-cluster","name":"Glyph Cluster","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0,"output":0}},"quiverai/arrow-2":{"id":"quiverai/arrow-2","name":"Arrow 2","description":"Fast SVG generation model for creation, vectorization, editing, and animation","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"release_date":"2026-09-16","last_updated":"2026-09-16","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"quiverai/arrow-2"},"quiverai/arrow-2-telos":{"id":"quiverai/arrow-2-telos","name":"Arrow 2 Telos","description":"High-fidelity SVG generation model for complex vector work and long-context refinement","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"release_date":"2026-09-16","last_updated":"2026-09-16","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":6,"output":30,"cache_read":0.6,"cache_write":7.5},"canonical_model_id":"quiverai/arrow-2-telos"},"morph/morph-v3-fast":{"id":"morph/morph-v3-fast","name":"Morph V3 Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.8,"output":1.2},"canonical_model_id":"morph/morph-v3-fast"},"morph/morph-v3-large":{"id":"morph/morph-v3-large","name":"Morph V3 Large","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.9,"output":1.9},"canonical_model_id":"morph/morph-v3-large"},"particle/particle-1":{"id":"particle/particle-1","name":"Particle-1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"release_date":"2026-10-28","last_updated":"2026-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.125,"output":0.5,"cache_read":0.015}},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v2":{"id":"sakana/fugu-ultra-v2","name":"Fugu Ultra v2","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra-v2"},"sakana/namazu":{"id":"sakana/namazu","name":"Sakana Namazu","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"sakana-namazu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.95,"output":4,"cache_read":0.15},"canonical_model_id":"sakana/sakana-namazu"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272001}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"scaledown/scaledown-extract-1":{"id":"scaledown/scaledown-extract-1","name":"Extract-1","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":0.05,"output":0}},"scaledown/scaledown-summarize-1":{"id":"scaledown/scaledown-summarize-1","name":"Summarize-1","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000},"cost":{"input":0.05,"output":0}},"spacexai/grok-4.20-reasoning":{"id":"spacexai/grok-4.20-reasoning","name":"Grok 4.20 Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"spacexai/grok-tts":{"id":"spacexai/grok-tts","type":"speech","name":"Grok TTS","description":"Convert text into spoken audio with a single API call. The API supports a rich set of expressive voices, inline speech tags for fine-grained delivery control, and output formats from high-fidelity MP3 to telephony-optimized μ-law.","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":15000,"output":15000},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"xai/grok-tts"},"spacexai/grok-4.5":{"id":"spacexai/grok-4.5","name":"Grok 4.5","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"spacexai/grok-4.3":{"id":"spacexai/grok-4.3","name":"Grok 4.3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"spacexai/grok-4.20-reasoning-beta":{"id":"spacexai/grok-4.20-reasoning-beta","name":"Grok 4.20 Beta Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"spacexai/grok-imagine-video":{"id":"spacexai/grok-imagine-video","type":"video","name":"Grok Imagine","description":"Video model for text-to-video, image-to-video, video editing and extension with native synchronized audio","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-28","last_updated":"2026-01-28","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"xai/grok-imagine-video"},"spacexai/grok-4.7":{"id":"spacexai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"spacexai/grok-stt":{"id":"spacexai/grok-stt","type":"transcription","name":"Grok STT","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"}},"spacexai/grok-4.20-non-reasoning-beta":{"id":"spacexai/grok-4.20-non-reasoning-beta","name":"Grok 4.20 Beta Non-Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.4,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"spacexai/grok-imagine-image":{"id":"spacexai/grok-imagine-image","type":"image","name":"Grok Imagine Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-28","last_updated":"2026-01-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":16000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"xai/grok-imagine-image"},"spacexai/grok-imagine-video-1.5-lite":{"id":"spacexai/grok-imagine-video-1.5-lite","type":"video","name":"Grok Imagine Video 1.5 Lite","description":"Cost-efficient video model for text-to-video and image-to-video generation","family":"grok","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":1024,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"xai/grok-imagine-video-1.5-lite"},"spacexai/grok-4.6":{"id":"spacexai/grok-4.6","name":"Grok 4.6","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"spacexai/grok-imagine-image-2.0":{"id":"spacexai/grok-imagine-image-2.0","type":"image","name":"Grok Imagine Image 2.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":64000,"output":0},"provider":{"npm":"@ai-sdk/openai","api":"https://ai-gateway.vercel.sh/v1"},"canonical_model_id":"xai/grok-imagine-image-2.0"},"spacexai/grok-build-0.1":{"id":"spacexai/grok-build-0.1","name":"Grok Build 0.1","description":"Grok coding model for agentic engineering, edits, and codebase workflows","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"spacexai/grok-4.20-multi-agent":{"id":"spacexai/grok-4.20-multi-agent","name":"Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"release_date":"2026-03-10","last_updated":"2026-03-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"spacexai/grok-4.20-non-reasoning":{"id":"spacexai/grok-4.20-non-reasoning","name":"Grok 4.20 Non-Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"spacexai/grok-imagine-video-1.5":{"id":"spacexai/grok-imagine-video-1.5","type":"video","name":"Grok Imagine Video 1.5","description":"Video model for text-to-video, image-to-video, and reference-to-video generation with optional voice references","family":"grok","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-30","last_updated":"2026-05-30","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":1024,"output":0},"provider":{"api":"https://ai-gateway.vercel.sh/v4/ai"},"canonical_model_id":"xai/grok-imagine-video-1.5"},"spacexai/grok-4.20-multi-agent-beta":{"id":"spacexai/grok-4.20-multi-agent-beta","name":"Grok 4.20 Multi Agent Beta","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200001}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"inference-net/schematron-v2-turbo":{"id":"inference-net/schematron-v2-turbo","name":"Schematron V2 Turbo","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.03,"output":0.15,"cache_read":0.03},"canonical_model_id":"inference-net/schematron-v2-turbo"},"inference-net/schematron-v2-small":{"id":"inference-net/schematron-v2-small","name":"Schematron V2 Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":0.05,"output":0.23,"cache_read":0.05},"canonical_model_id":"inference-net/schematron-v2-small"}}},"longcat":{"id":"longcat","env":["LONGCAT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.longcat.chat/openai","name":"LongCat","doc":"https://longcat.chat/platform/docs/","models":{"LongCat-2.5-Preview":{"id":"LongCat-2.5-Preview","name":"LongCat-2.5-Preview","description":"Meituan's multimodal reasoning model for coding and agent tasks, with image understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"meituan/longcat-2.5-preview"},"LongCat-2.0":{"id":"LongCat-2.0","name":"LongCat-2.0","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"meituan/longcat-2.0"}}},"venice":{"id":"venice","env":["VENICE_API_KEY"],"npm":"venice-ai-sdk-provider","name":"Venice AI","doc":"https://docs.venice.ai","models":{"deepseek-v4-1-flash-1017-ultrafast":{"id":"deepseek-v4-1-flash-1017-ultrafast","name":"DeepSeek V4.1 Flash 1017 Ultrafast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-23","last_updated":"2026-11-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":12,"cache_read":0.06}},"grok-4-6":{"id":"grok-4-6","name":"Grok 4.6","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":200000},"cost":{"input":2.27,"output":6.8,"cache_read":0.57,"tiers":[{"input":4.53,"output":13.6,"cache_read":1.13,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4.53,"output":13.6,"cache_read":1.13}},"canonical_model_id":"xai/grok-4.6"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"openai-gpt-56-sol-pro":{"id":"openai-gpt-56-sol-pro","name":"GPT-5.6 Sol Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"google-gemma-4-26b-a4b-it":{"id":"google-gemma-4-26b-a4b-it","name":"Google Gemma 4 26B A4B Instruct","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.13,"output":0.4,"cache_read":0.05},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"qwen-3-8-27b":{"id":"qwen-3-8-27b","name":"Qwen 3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.45,"output":3.2},"canonical_model_id":"alibaba/qwen3.8-27b"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":198000,"output":32768},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"zai-org-glm-4.7":{"id":"zai-org-glm-4.7","name":"GLM 4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":16384},"cost":{"input":0.55,"output":2.65,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"grok-4-3":{"id":"grok-4-3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":1.42,"output":2.83,"cache_read":0.23,"tiers":[{"input":2.83,"output":5.67,"cache_read":0.45,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.83,"output":5.67,"cache_read":0.45}},"canonical_model_id":"xai/grok-4.3"},"qwen-3-8-2-4t-a95b":{"id":"qwen-3-8-2-4t-a95b","name":"Qwen 3.8 2.4T","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":2.5,"output":7.5,"cache_read":0.3125},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"openai-gpt-54":{"id":"openai-gpt-54","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":131072},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"aion-labs-aion-3-0":{"id":"aion-labs-aion-3-0","name":"Aion 3.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"cost":{"input":3.75,"output":7.5,"cache_read":0.9375},"canonical_model_id":"aion-labs/aion-3.0"},"qwen3-235b-a22b-thinking-2507":{"id":"qwen3-235b-a22b-thinking-2507","name":"Qwen 3 235B A22B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.45,"output":3.5},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"openai-gpt-61-sol-ultrafast":{"id":"openai-gpt-61-sol-ultrafast","name":"GPT-6.1 Sol Ultrafast","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":12,"output":60,"cache_read":0.6,"cache_write":15,"tiers":[{"input":24,"output":90,"cache_read":1.2,"cache_write":30,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":24,"output":90,"cache_read":1.2,"cache_write":30}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai-gpt-56-luna-pro":{"id":"openai-gpt-56-luna-pro","name":"GPT-5.6 Luna Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai-gpt-61-terra":{"id":"openai-gpt-61-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"minimax-m27":{"id":"minimax-m27","name":"MiniMax M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":32768},"cost":{"input":0.375,"output":1.5,"cache_read":0.06875},"canonical_model_id":"minimax/MiniMax-M2.7"},"google-gemma-4-31b-it":{"id":"google-gemma-4-31b-it","name":"Google Gemma 4 31B Instruct","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.12,"output":0.36,"cache_read":0.09},"canonical_model_id":"google/gemma-4-31b-it"},"openai-gpt-54-pro":{"id":"openai-gpt-54-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"muse-wonder":{"id":"muse-wonder","name":"Muse Wonder","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-12","last_updated":"2026-10-15","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":5,"output":25,"cache_read":0.25}},"llama-3.2-3b":{"id":"llama-3.2-3b","name":"Llama 3.2 3B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"meta/llama-3.2-3b"},"xiaomi-mimo-v2-6-flash":{"id":"xiaomi-mimo-v2-6-flash","name":"MiMo-V2.6-Flash","description":"MiMo flash model for fast multimodal assistance and agent workflows","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.175,"output":0.35,"cache_read":0.00375},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"openai-gpt-53-codex":{"id":"openai-gpt-53-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"grok-4-20-multi-agent":{"id":"grok-4-20-multi-agent","name":"Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"release_date":"2026-03-12","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"cost":{"input":1.42,"output":2.83,"cache_read":0.23,"tiers":[{"input":2.83,"output":5.67,"cache_read":0.45,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.83,"output":5.67,"cache_read":0.45}}},"openai-gpt-4o-2024-11-20":{"id":"openai-gpt-4o-2024-11-20","name":"GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai-gpt-55-pro":{"id":"openai-gpt-55-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"deepseek-v4-flash-0731-fast":{"id":"deepseek-v4-flash-0731-fast","name":"DeepSeek V4 Flash 0731 Fast","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32768},"cost":{"input":0.35,"output":0.7,"cache_read":0.0875},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"zai-org-glm-4.6":{"id":"zai-org-glm-4.6","name":"GLM 4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":16384},"cost":{"input":0.43,"output":1.75,"cache_read":0.08},"canonical_model_id":"zhipuai/glm-4.6"},"openai-gpt-6-luna":{"id":"openai-gpt-6-luna","name":"GPT-6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"deepseek-v4-1-flash-uncensored":{"id":"deepseek-v4-1-flash-uncensored","name":"DeepSeek V4.1 Flash Uncensored","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"qwen3-6-27b":{"id":"qwen3-6-27b","name":"Qwen 3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.325,"output":3.25},"canonical_model_id":"alibaba/qwen3.6-27b"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3.75,"output":18.75,"cache_read":0.375},"canonical_model_id":"moonshotai/kimi-k3"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"openai-gpt-56-terra":{"id":"openai-gpt-56-terra","name":"GPT-5.6 Terra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"gemini-3-8-flash":{"id":"gemini-3-8-flash","name":"Gemini 3.8 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.9375,"output":4.6875,"cache_read":0.09375},"canonical_model_id":"google/gemini-3.8-flash"},"gemini-3-6-flash":{"id":"gemini-3-6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.9375,"output":4.6875,"cache_read":0.09375},"canonical_model_id":"google/gemini-3.6-flash"},"kimi-k3-1-pro":{"id":"kimi-k3-1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"grok-4-20":{"id":"grok-4-20","name":"Grok 4.20","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-03-12","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"cost":{"input":1.42,"output":2.83,"cache_read":0.23,"tiers":[{"input":2.83,"output":5.67,"cache_read":0.45,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.83,"output":5.67,"cache_read":0.45}}},"minimax-m3-1-flash":{"id":"minimax-m3-1-flash","name":"MiniMax M3.1 Flash","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1875,"output":0.75,"cache_read":0.01875},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":1.65,"output":4.95,"cache_read":0.165},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"claude-opus-4-8-fast":{"id":"claude-opus-4-8-fast","name":"Claude Opus 4.8 Fast","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-opus-4-8"},"openai-gpt-61-sol":{"id":"openai-gpt-61-sol","name":"GPT-6.1 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"llama-3.3-70b":{"id":"llama-3.3-70b","name":"Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.7,"output":2.8},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"grok-4-7":{"id":"grok-4-7","name":"Grok 4.7","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":200000},"cost":{"input":2.27,"output":6.8,"cache_read":0.57,"tiers":[{"input":4.53,"output":13.6,"cache_read":1.13,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4.53,"output":13.6,"cache_read":1.13}},"canonical_model_id":"xai/grok-4.7"},"kimi-k2-7-code":{"id":"kimi-k2-7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.75,"output":3.5,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"grok-4-5":{"id":"grok-4-5","name":"Grok 4.5","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":32000},"cost":{"input":2.27,"output":6.8,"cache_read":0.34,"tiers":[{"input":4.53,"output":13.6,"cache_read":0.68,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4.53,"output":13.6,"cache_read":0.68}},"canonical_model_id":"xai/grok-4.5"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"Qwen 3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.75},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"z-ai-glm-5-3":{"id":"z-ai-glm-5-3","name":"GLM 5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.75,"output":5.5,"cache_read":0.325},"canonical_model_id":"zhipuai/glm-5.3"},"abliteration-abliterated-model-large-v2":{"id":"abliteration-abliterated-model-large-v2","name":"Abliterated Large V2","description":"Flagship model for demanding analysis, coding, and production agent workflows","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":3,"output":5,"cache_read":0.3}},"grok-build-0-1":{"id":"grok-build-0-1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":1.65,"output":3.301,"cache_read":0.33},"canonical_model_id":"deepseek/deepseek-v4-pro"},"qwen3-5-397b-a17b":{"id":"qwen3-5-397b-a17b","name":"Qwen 3.5 397B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.75,"output":4.5},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"openai-gpt-52":{"id":"openai-gpt-52","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":272000,"output":65536},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2.5,"output":12.5,"cache_read":0.125},"canonical_model_id":"google/gemini-4-argon"},"openai-gpt-56-sol":{"id":"openai-gpt-56-sol","name":"GPT-5.6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"qwen3-next-80b":{"id":"qwen3-next-80b","name":"Qwen 3 Next 80b","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.35,"output":1.9},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen-3-8-max":{"id":"qwen-3-8-max","name":"Qwen 3.8 Max","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.3125,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"muse-spark-open":{"id":"muse-spark-open","name":"Muse Spark Open","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.5625,"output":5.3125,"cache_read":0.1875},"canonical_model_id":"meta/muse-spark-open"},"xiaomi-mimo-v2-5":{"id":"xiaomi-mimo-v2-5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2,"cache_read":0.08},"canonical_model_id":"xiaomi/mimo-v2.5"},"gemini-3-7-flash":{"id":"gemini-3-7-flash","name":"Gemini 3.7 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.9375,"output":4.6875,"cache_read":0.09375},"canonical_model_id":"google/gemini-3.7-flash"},"zai-org-glm-5":{"id":"zai-org-glm-5","name":"GLM 5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":32000},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"kimi-k3-fast-api":{"id":"kimi-k3-fast-api","name":"Kimi K3 Fast","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"aion-labs-aion-3-0-mini":{"id":"aion-labs-aion-3-0-mini","name":"Aion 3.0 Mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"cost":{"input":0.875,"output":1.75,"cache_read":0.225},"canonical_model_id":"aion-labs/aion-3.0-mini"},"openai-gpt-oss-120b":{"id":"openai-gpt-oss-120b","name":"OpenAI GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-120b"},"minimax-m25":{"id":"minimax-m25","name":"MiniMax M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":32768},"cost":{"input":0.27,"output":0.95,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"kimi-k2-6":{"id":"kimi-k2-6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.75,"output":3.5,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"nvidia-nemotron-3-5-super-vl-120b-a12b":{"id":"nvidia-nemotron-3-5-super-vl-120b-a12b","name":"NVIDIA Nemotron 3.5 Super VL 120B","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":102400},"cost":{"input":0.2,"output":0.5,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash 0423","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.138,"output":0.275,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-v4-1-flash":{"id":"deepseek-v4-1-flash","name":"DeepSeek V4.1 Flash","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.0075},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"openai-gpt-56-terra-pro":{"id":"openai-gpt-56-terra-pro","name":"GPT-5.6 Terra Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"kimi-k3-1-pro-highspeed":{"id":"kimi-k3-1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":5,"output":25,"cache_read":0.375}},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"openai-gpt-6-astra-pro":{"id":"openai-gpt-6-astra-pro","name":"GPT-6 Astra Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2-5":{"id":"kimi-k2-5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"status":"deprecated","cost":{"input":0.56,"output":3.5,"cache_read":0.22},"canonical_model_id":"moonshotai/kimi-k2.5"},"qwen-3-7-max":{"id":"qwen-3-7-max","name":"Qwen 3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2.7,"output":8.05,"cache_read":0.27,"cache_write":3.35},"canonical_model_id":"alibaba/qwen3.7-max"},"openai-gpt-6-astra":{"id":"openai-gpt-6-astra","name":"GPT-6 Astra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"gemini-3-5-flash-lite":{"id":"gemini-3-5-flash-lite","name":"Gemini 3.5 Flash-Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.375,"output":3.125,"cache_read":0.0375},"canonical_model_id":"google/gemini-3.5-flash-lite"},"abliteration-abliterated-model-large-flash":{"id":"abliteration-abliterated-model-large-flash","name":"Abliterated Large Flash","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.25,"output":2.5,"cache_read":0.125}},"nvidia-nemotron-3-nano-30b-a3b":{"id":"nvidia-nemotron-3-nano-30b-a3b","name":"NVIDIA Nemotron 3 Nano 30B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.075,"output":0.3},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"deepseek-v4-1-flash-1017-uncensored":{"id":"deepseek-v4-1-flash-1017-uncensored","name":"DeepSeek V4.1 Flash 1017 Uncensored","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-10-27","last_updated":"2026-10-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.33,"output":1.32,"cache_read":0.00825}},"gemini-3-5-flash":{"id":"gemini-3-5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.55,"output":9.45,"cache_read":0.155,"cache_write":0.086},"canonical_model_id":"google/gemini-3.5-flash"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 Preview","description":"Preview model for early access evaluation, prototyping, and compatibility testing","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":1.0425,"output":3.12625,"cache_read":0.0525},"canonical_model_id":"tencent/hy4-preview"},"claude-opus-5-5-fast":{"id":"claude-opus-5-5-fast","name":"Claude Opus 5.5 Fast","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.4,"cache_write":10},"canonical_model_id":"anthropic/claude-opus-5-5"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":0.7,"output":3.75,"cache_read":0.07},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen3-vl-235b-a22b":{"id":"qwen3-vl-235b-a22b","name":"Qwen3 VL 235B","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-01-16","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.21,"output":1.9,"cache_read":0.1}},"openai-gpt-55":{"id":"openai-gpt-55","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":131072},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"z-ai-glm-5-3-flash":{"id":"z-ai-glm-5-3-flash","name":"GLM 5.3 Flash","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org-glm-5-2":{"id":"zai-org-glm-5-2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"gemini-3-1-pro-preview":{"id":"gemini-3-1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":2.5,"output":15,"cache_read":0.5,"cache_write":0.5,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"cache_write":0.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5,"cache_write":0.5}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"qwen3-6-35b-a3b":{"id":"qwen3-6-35b-a3b","name":"Qwen 3.6 35B A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.1,"output":1},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"aion-labs-aion-3-5-mini":{"id":"aion-labs-aion-3-5-mini","name":"Aion 3.5 Mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.875,"output":1.75,"cache_read":0.225}},"openai-gpt-4o-mini-2024-07-18":{"id":"openai-gpt-4o-mini-2024-07-18","name":"GPT-4o Mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"claude-opus-5-fast":{"id":"claude-opus-5-fast","name":"Claude Opus 5 Fast","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-opus-5"},"venice-uncensored-role-play":{"id":"venice-uncensored-role-play","name":"Venice Role Play Uncensored","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"venice","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-02-20","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.5,"output":2}},"qwen3-coder-480b-a35b-instruct-turbo":{"id":"qwen3-coder-480b-a35b-instruct-turbo","name":"Qwen 3 Coder 480B Turbo","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-01-27","last_updated":"2026-06-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.35,"output":1.5,"cache_read":0.04}},"openai-gpt-6-sol":{"id":"openai-gpt-6-sol","name":"GPT-6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"deepseek-v4-1-flash-1017":{"id":"deepseek-v4-1-flash-1017","name":"DeepSeek v4.1 Flash (1017)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.0075},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":160000,"output":32768},"status":"deprecated","cost":{"input":0.33,"output":0.48,"cache_read":0.16},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"google-gemma-3-27b-it":{"id":"google-gemma-3-27b-it","name":"Google Gemma 3 27B Instruct","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":16384},"cost":{"input":0.12,"output":0.2},"canonical_model_id":"google/gemma-3-27b-it"},"mistral-small-3-2-24b-instruct":{"id":"mistral-small-3-2-24b-instruct","name":"Mistral Small 3.2 24B Instruct","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.09375,"output":0.25},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"openai-gpt-54-mini":{"id":"openai-gpt-54-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"minimax-m3-preview":{"id":"minimax-m3-preview","name":"MiniMax M3 Preview","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax-m3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"release_date":"2026-06-12","last_updated":"2026-06-13","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06}},"nvidia-nemotron-3-ultra-550b-a55b":{"id":"nvidia-nemotron-3-ultra-550b-a55b","name":"NVIDIA Nemotron 3 Ultra","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"cost":{"input":0.625,"output":3.125,"cache_read":0.1875},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"qwen-3-8-flash":{"id":"qwen-3-8-flash","name":"Qwen 3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.14,"output":0.49,"cache_read":0.014},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen-3-6-plus":{"id":"qwen-3-6-plus","name":"Qwen 3.6 Plus Uncensored","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.625,"output":3.75,"cache_read":0.0625,"cache_write":0.78,"tiers":[{"input":2.5,"output":7.5,"cache_read":0.0625,"cache_write":0.78,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2.5,"output":7.5,"cache_read":0.0625,"cache_write":0.78}},"canonical_model_id":"alibaba/qwen3.6-plus"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"olafangensan-glm-4.7-flash-heretic":{"id":"olafangensan-glm-4.7-flash-heretic","name":"GLM 4.7 Flash Heretic","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"release_date":"2026-02-04","last_updated":"2026-06-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":24000},"cost":{"input":0.07,"output":0.4,"cache_read":0.035}},"qwen-3-7-plus":{"id":"qwen-3-7-plus","name":"Qwen 3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":2,"cache_read":0.05,"cache_write":0.625,"tiers":[{"input":1.5,"output":6,"cache_read":0.15,"cache_write":1.875,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.5,"output":6,"cache_read":0.15,"cache_write":1.875}},"canonical_model_id":"alibaba/qwen3.7-plus"},"z-ai-glm-5-turbo":{"id":"z-ai-glm-5-turbo","name":"GLM 5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32768},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"openai-gpt-56-luna":{"id":"openai-gpt-56-luna","name":"GPT-5.6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"aion-labs-aion-3-5":{"id":"aion-labs-aion-3-5","name":"Aion 3.5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":3.75,"output":7.5,"cache_read":0.9375}},"z-ai-glm-5v-turbo":{"id":"z-ai-glm-5v-turbo","name":"GLM 5V Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32768},"cost":{"input":1.5,"output":5,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-5v-turbo"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"zai-org-glm-5-1":{"id":"zai-org-glm-5-1","name":"GLM 5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":80000},"cost":{"input":1.54,"output":4.84,"cache_read":0.286},"canonical_model_id":"zhipuai/glm-5.1"},"gemma-4-uncensored":{"id":"gemma-4-uncensored","name":"Gemma 4 Uncensored","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-04-13","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"status":"deprecated","cost":{"input":0.1625,"output":0.5}},"venice-uncensored-1-2":{"id":"venice-uncensored-1-2","name":"Venice Uncensored 1.2","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"venice","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"release_date":"2026-04-01","last_updated":"2026-06-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.2,"output":0.9}},"qwen3-5-35b-a3b":{"id":"qwen3-5-35b-a3b","name":"Qwen 3.5 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.15,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"seed-2-1-turbo":{"id":"seed-2-1-turbo","name":"Seed 2.1 Turbo","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":0.625,"output":3.125,"cache_read":0.125},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"}}},"agnes":{"id":"agnes","env":["AGNES_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://apihub.agnes-ai.com/v1","name":"Agnes AI","doc":"https://agnes-ai.com/doc","models":{"agnes-3.0-flash":{"id":"agnes-3.0-flash","name":"Agnes 3.0 Flash","description":"A new-generation Agnes AI text model with stronger Agnes Code task execution, tool orchestration, and trustworthy delivery.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09","last_updated":"2026-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":512000,"output":65536},"cost":{"input":0,"output":0}},"agnes-2.5-flash":{"id":"agnes-2.5-flash","name":"Agnes 2.5 Flash","description":"Upgraded model with improved coding, agent workflows, tool calling, and multimodal understanding.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07","last_updated":"2026-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":512000,"output":65536},"cost":{"input":0,"output":0}},"agnes-2.5-pro-alpha":{"id":"agnes-2.5-pro-alpha","name":"Agnes 2.5 Pro Alpha","description":"Paid reasoning model for advanced coding, scientific reasoning, long-context analysis, agentic workflows, and multimodal understanding.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0.45,"output":0.9,"cache_read":0.0038}},"agnes-2.0-flash":{"id":"agnes-2.0-flash","name":"Agnes 2.0 Flash","description":"Fast and efficient model for agent workflows, tool calling, coding, and image understanding.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-25","last_updated":"2026-05-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":512000,"output":65536},"status":"deprecated","cost":{"input":0,"output":0}}}},"tencent-coding-plan":{"id":"tencent-coding-plan","env":["TENCENT_CODING_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.lkeap.cloud.tencent.com/coding/v3","name":"Tencent Coding Plan (China)","doc":"https://cloud.tencent.com/document/product/1772/128947","models":{"hunyuan-2.0-thinking":{"id":"hunyuan-2.0-thinking","name":"Tencent HY 2.0 Think","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-03-08","last_updated":"2026-03-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"hunyuan-turbos":{"id":"hunyuan-turbos","name":"Hunyuan-TurboS","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-08","last_updated":"2026-03-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi-K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M2.5"},"hunyuan-2.0-instruct":{"id":"hunyuan-2.0-instruct","name":"Tencent HY 2.0 Instruct","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-08","last_updated":"2026-03-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"hunyuan-t1":{"id":"hunyuan-t1","name":"Hunyuan-T1","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-03-08","last_updated":"2026-03-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"tc-code-latest":{"id":"tc-code-latest","name":"Auto","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-08","last_updated":"2026-03-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"}}},"claudinio":{"id":"claudinio","env":["CLAUDINIO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.claudin.io/v1","name":"Claudinio","doc":"https://claudin.io","models":{"claudinio":{"id":"claudinio","name":"Claudinio","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"knowledge":"2026-05","release_date":"2026-05-12","last_updated":"2026-06-02","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"cost":{"input":0.5,"output":2,"cache_read":0.15}},"claudius":{"id":"claudius","name":"Claudius","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"knowledge":"2026-05","release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"cost":{"input":3,"output":8,"cache_read":0.9}}}},"amd":{"id":"amd","env":["AMD_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://developer.amd.com.cn/radeon/api/v1","name":"AMD","doc":"https://developer.amd.com.cn/radeon/tokenfactory","models":{"DeepSeek-V4-Flash":{"id":"DeepSeek-V4-Flash","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"GLM-5.3-Flash":{"id":"GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"Qwen3.8-Flash-Next":{"id":"Qwen3.8-Flash-Next","name":"Qwen3.8 Flash Next","description":"Open-weight experimental preview of the Qwen4 architecture: hybrid-attention MoE (125B total, 6B active) with vision encoder for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-flash-next"},"MiMo-V2.6-Flash":{"id":"MiMo-V2.6-Flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"DeepSeek-V4-Flash-Vision-Exp":{"id":"DeepSeek-V4-Flash-Vision-Exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"Gemma-4-31B-IT":{"id":"Gemma-4-31B-IT","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"google/gemma-4-31b-it"},"MiniCPM5-2B":{"id":"MiniCPM5-2B","name":"MiniCPM5-2B","description":"Dense 2B-class open-source model for on-device and resource-constrained use, with native long-context support, tool calling, and agentic tasks","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-09-06","last_updated":"2026-09-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"openbmb/minicpm5-2b"},"Qwen3.8-27B":{"id":"Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-27b"},"MiniCPM-V-4.7-35B-A3B":{"id":"MiniCPM-V-4.7-35B-A3B","name":"MiniCPM-V 4.7 35B-A3B","description":"First MoE MiniCPM-V model for single-image, multi-image and video understanding","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"openbmb/minicpm-v-4.7-35b-a3b"},"MiniCPM-V-4.7-1B":{"id":"MiniCPM-V-4.7-1B","name":"MiniCPM-V 4.7 1B","description":"Compact MiniCPM-V model for single-image, multi-image and video understanding","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"openbmb/minicpm-v-4.7-1b"},"DeepSeek-V4.1-Flash":{"id":"DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"prime":{"id":"prime","env":["PRIME_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.pinference.ai/api/v1","name":"Prime Inference","doc":"https://docs.primeintellect.ai/inference/overview","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":1.6,"output":4.8},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6},"canonical_model_id":"xai/grok-4.6"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.039,"output":1.2,"cache_read":0.0012,"cache_write":0.039},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro 0423","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.91,"output":3.83},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash 0423","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.44,"output":1.32},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.44,"output":1.32},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.04368,"output":0.7,"cache_read":0.0024,"cache_write":0.04368},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["audio","image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10},"canonical_model_id":"google/gemini-4-carbon"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.119,"output":0.3},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["audio","image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["audio","image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.35,"output":6.75},"canonical_model_id":"google/gemini-3.7-flash"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.3,"output":1.5},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen3-vl-30b-a3b-instruct":{"id":"qwen/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.2,"output":0.7},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":235929},"cost":{"input":0.99,"output":3.2},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3-30b-a3b-instruct-2507":{"id":"qwen/qwen3-30b-a3b-instruct-2507","name":"Qwen3 30B A3B Instruct 2507","description":"Updated compact Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.13,"output":0.52},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.3,"output":1.5},"canonical_model_id":"alibaba/qwen3-coder-next"},"mistralai/mixtral-8x22b-instruct":{"id":"mistralai/mixtral-8x22b-instruct","name":"Mixtral 8x22B Instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-01-31","release_date":"2024-04-17","last_updated":"2024-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":52428},"cost":{"input":2.2,"output":6.6},"canonical_model_id":"mistral/mixtral-8x22b-instruct"},"mistralai/mistral-large-2512":{"id":"mistralai/mistral-large-2512","name":"Mistral Large 3 2512","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"mistralai/mistral-small-2603":{"id":"mistralai/mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.165,"output":0.66},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/mistral-nemo":{"id":"mistralai/mistral-nemo","name":"Mistral Nemo","description":"Efficient Mistral-NVIDIA open model for multilingual chat and local deployment","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.165,"output":0.17},"canonical_model_id":"mistral/mistral-nemo"},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 0905","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":3.45,"output":17.25},"canonical_model_id":"moonshotai/kimi-k3"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":5,"output":30},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 Nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":942818},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.75,"output":4.5},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5.6-terra-pro":{"id":"openai/gpt-5.6-terra-pro","name":"GPT-5.6 Terra Pro","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2.5,"output":15},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":5,"output":30},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"gpt-oss-20b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.25,"output":2},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.6-luna-pro":{"id":"openai/gpt-5.6-luna-pro","name":"GPT-5.6 Luna Pro","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1,"output":6},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.2,"output":1.2},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.05,"output":0.4},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2.5,"output":15},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.2,"output":1.25},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"gpt-oss-120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2.5,"output":15},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o-mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-5.6-sol-pro":{"id":"openai/gpt-5.6-sol-pro","name":"GPT-5.6 Sol Pro","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":5,"output":30},"canonical_model_id":"openai/gpt-5.6-sol"},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.25,"output":4.25},"canonical_model_id":"meta/muse-spark-open"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":1.54,"output":4.84},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.4,"output":2.464,"cache_read":0.0744,"cache_write":0.4},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.0525,"output":0.25,"cache_read":0.0105,"cache_write":0.0525},"canonical_model_id":"zhipuai/glm-5.3-flash"},"meta-llama/llama-3.3-70b-instruct":{"id":"meta-llama/llama-3.3-70b-instruct","name":"Llama 3.3 70B Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":115200},"cost":{"input":1.04,"output":2.253},"canonical_model_id":"meta/llama-3.3-70b-instruct"}}},"above":{"id":"above","env":["ABOVE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.above.dev/v1","name":"above.dev","doc":"https://above.dev/docs","models":{"glm-5.2-fast":{"id":"glm-5.2-fast","name":"GLM 5.2 Fast","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2.31,"output":7.26,"cache_read":0.231},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.2":{"id":"glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.54,"output":4.84,"cache_read":0.154},"canonical_model_id":"zhipuai/glm-5.2"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo V2.6 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.5077,"output":1.0154,"cache_read":0.0042},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo V2.6 Pro UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":5.0769,"output":10.1538,"cache_read":0.0423},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.165,"output":0.66,"reasoning":0.66,"cache_read":0.0033},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.726,"output":2.178,"reasoning":2.178,"cache_read":0.0242},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo V2.6 Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1692,"output":0.3385,"cache_read":0.0034},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.165,"output":0.66,"reasoning":0.66,"cache_read":0.0033},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.165,"output":0.55,"cache_read":0.0319},"canonical_model_id":"zhipuai/glm-5.3-flash"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen 3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":2.2,"output":6.6,"cache_read":0.275},"canonical_model_id":"alibaba/qwen3.8-max"}}},"qihang-ai":{"id":"qihang-ai","env":["QIHANG_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.qhaigc.net/v1","name":"QiHang","doc":"https://www.qhaigc.net/docs","models":{"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.09,"output":0.71,"tiers":[{"input":0.09,"output":0.71,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.09,"output":0.71}},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0.25,"output":2},"canonical_model_id":"openai/gpt-5.2"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0.14,"output":1.14},"canonical_model_id":"openai/gpt-5.2-codex"},"gemini-3-pro-preview":{"id":"gemini-3-pro-preview","name":"Gemini 3 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65000},"cost":{"input":0.57,"output":3.43},"canonical_model_id":"google/gemini-3-pro-preview"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":0.43,"output":2.14},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":0.14,"output":0.71},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5-Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":0.04,"output":0.29},"canonical_model_id":"openai/gpt-5-mini"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":0.71,"output":3.57},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.07,"output":0.43,"tiers":[{"input":0.07,"output":0.43,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.07,"output":0.43}},"canonical_model_id":"google/gemini-3-flash-preview"}}},"aimlapi":{"id":"aimlapi","env":["AIMLAPI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.aimlapi.com/v1","name":"AI/ML API","doc":"https://docs.aimlapi.com","models":{"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude 4.7 Opus","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.29,"output":26.45,"cache_read":0.529,"cache_write":6.6125},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude 4.8 Opus","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.29,"output":26.45,"cache_read":0.529,"cache_write":6.6125},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude 4.5 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5.29,"output":26.45,"cache_read":0.529,"cache_write":6.6125},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude 4.5 Haiku","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.058,"output":5.29,"cache_read":0.1058,"cache_write":1.3225},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude 4.5 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3.174,"output":15.87,"cache_read":0.3174,"cache_write":3.9675},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude 4.6 Sonnet","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3.174,"output":15.87,"cache_read":0.3174,"cache_write":3.9675},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"anthropic/claude-haiku-5-5"},"aion-labs/aion-rp-llama-3.1-8b":{"id":"aion-labs/aion-rp-llama-3.1-8b","name":"Aion-RP 1.0 (8B)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2025-02-04","last_updated":"2025-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.8464,"output":1.6928},"canonical_model_id":"aion-labs/aion-rp-llama-3.1-8b"},"anthracite-org/magnum-v4-72b":{"id":"anthracite-org/magnum-v4-72b","name":"Magnum v4 72B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":16384},"cost":{"input":3.174,"output":5.29},"canonical_model_id":"anthracite-org/magnum-v4-72b"},"amazon/nova-pro-v1":{"id":"amazon/nova-pro-v1","name":"Nova Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.8464,"output":3.3856},"canonical_model_id":"amazon/nova-pro-v1"},"amazon/nova-lite-v1":{"id":"amazon/nova-lite-v1","name":"Nova Lite 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.06348,"output":0.25392},"canonical_model_id":"amazon/nova-lite-v1"},"amazon/nova-micro-v1":{"id":"amazon/nova-micro-v1","name":"Nova Micro 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":5120},"cost":{"input":0.03703,"output":0.14812},"canonical_model_id":"amazon/nova-micro-v1"},"perplexity/sonar-pro":{"id":"perplexity/sonar-pro","name":"Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"perplexity/sonar":{"id":"perplexity/sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":100000},"cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"rekaai/reka-edge":{"id":"rekaai/reka-edge","name":"Reka Edge","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.1058,"output":0.1058},"canonical_model_id":"rekaai/reka-edge"},"x-ai/grok-4-20-0309-non-reasoning":{"id":"x-ai/grok-4-20-0309-non-reasoning","name":"Grok 4.20 Non-Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1999000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"x-ai/grok-4-fast-non-reasoning":{"id":"x-ai/grok-4-fast-non-reasoning","name":"Grok 4 Fast Non-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1999000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"deepseek/deepseek-chat-v3-0324":{"id":"deepseek/deepseek-chat-v3-0324","name":"DeepSeek V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":124000},"cost":{"input":0.30682,"output":1.20612,"cache_read":0.14812},"canonical_model_id":"deepseek/deepseek-chat-v3-0324"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.84092,"output":3.68184,"cache_read":0.15341},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.9,"output":2.7,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.39,"output":1.56,"cache_read":0.0078},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":117964},"cost":{"input":0.1587,"output":0.48668,"cache_read":0.07935},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-2-27b-it":{"id":"google/gemma-2-27b-it","name":"Gemma 2 27B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-07-13","last_updated":"2024-07-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"cost":{"input":0.6877,"output":0.6877},"canonical_model_id":"google/gemma-2-27b-it"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.587,"output":9.522,"cache_read":0.1587,"cache_write":0.088167},"canonical_model_id":"google/gemini-flash-latest"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3-8-flash":{"id":"google/gemini-3-8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048756,"output":65536},"cost":{"input":2.116,"output":12.696,"cache_read":0.2116,"cache_write":0.39675},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":32768},"cost":{"input":0.0529,"output":0.1058,"cache_read":0.04232},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.5},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite-preview":{"id":"google/gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.2645,"output":1.587,"cache_read":0.02645,"cache_write":0.088167},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B Instruct","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":1.04742,"output":1.57642,"cache_read":1.04742},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.1587,"output":0.6348,"cache_read":0.1587},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":96000},"cost":{"input":0.0529,"output":0.1587,"cache_read":0.04232},"canonical_model_id":"google/gemma-3-12b-it"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"nousresearch/hermes-3-llama-3.1-405b":{"id":"nousresearch/hermes-3-llama-3.1-405b","name":"Hermes 3 405B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"nousresearch","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-16","last_updated":"2024-08-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":1.058,"output":1.058},"canonical_model_id":"nousresearch/hermes-3-llama-3.1-405b"},"nousresearch/hermes-3-llama-3.1-70b":{"id":"nousresearch/hermes-3-llama-3.1-70b","name":"Hermes 3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"nousresearch","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-18","last_updated":"2024-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.7406,"output":0.7406},"canonical_model_id":"nousresearch/hermes-3-llama-3.1-70b"},"thedrummer/unslopnemo-12b":{"id":"thedrummer/unslopnemo-12b","name":"UnslopNemo 12B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-11-08","last_updated":"2024-11-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.4232,"output":0.4232},"canonical_model_id":"thedrummer/unslopnemo-12b"},"thedrummer/cydonia-24b-v4.1":{"id":"thedrummer/cydonia-24b-v4.1","name":"Cydonia 24B V4.1","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-09-27","last_updated":"2025-09-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3174,"output":0.529,"cache_read":0.1587},"canonical_model_id":"thedrummer/cydonia-24b-v4.1"},"thedrummer/skyfall-36b-v2":{"id":"thedrummer/skyfall-36b-v2","name":"Skyfall 36B V2","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.5819,"output":0.8464,"cache_read":0.2645},"canonical_model_id":"thedrummer/skyfall-36b-v2"},"tencent/hy-mt2-7b":{"id":"tencent/hy-mt2-7b","name":"Hy-MT2-7B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.078292,"output":0.31211},"canonical_model_id":"tencent/hy-mt2-7b"},"tencent/hy-mt2-30b-a3b":{"id":"tencent/hy-mt2-30b-a3b","name":"Hy-MT2-30B-A3B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.078292,"output":0.31211},"canonical_model_id":"tencent/hy-mt2-30b-a3b"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.2116,"output":0.8464,"cache_read":0.0529},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.882372,"output":2.646058,"cache_read":0.044436},"canonical_model_id":"tencent/hy4-preview"},"tencent/hy-mt2-1.8b":{"id":"tencent/hy-mt2-1.8b","name":"Hy-MT2-1.8B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.046552,"output":0.187266},"canonical_model_id":"tencent/hy-mt2-1.8b"},"mistralai/voxtral-small-24b-2507":{"id":"mistralai/voxtral-small-24b-2507","name":"Voxtral Small 24B 2507","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32768},"cost":{"input":0.1058,"output":0.3174,"cache_read":0.01058},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"mistralai/codestral-2508":{"id":"mistralai/codestral-2508","name":"Codestral 2508","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"cost":{"input":0.3174,"output":0.9522,"cache_read":0.03174},"canonical_model_id":"mistral/codestral-2508"},"mistralai/mistral-small-3.1-24b-instruct":{"id":"mistralai/mistral-small-3.1-24b-instruct","name":"Small 3.1 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.371358,"output":0.58719},"canonical_model_id":"mistral/mistral-small-3.1-24b-instruct"},"mistralai/mixtral-8x22b-instruct":{"id":"mistralai/mixtral-8x22b-instruct","name":"Mixtral 8x22B Instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-01-31","release_date":"2024-04-17","last_updated":"2024-04-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":52428},"cost":{"input":2.116,"output":6.348,"cache_read":0.2116},"canonical_model_id":"mistral/mixtral-8x22b-instruct"},"mistralai/mistral-medium-3-5":{"id":"mistralai/mistral-medium-3-5","name":"Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.587,"output":7.935},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistralai/ministral-3b-2512":{"id":"mistralai/ministral-3b-2512","name":"Ministral 3 3B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":0.1587,"output":0.1587,"cache_read":0.01058},"canonical_model_id":"mistral/ministral-3b-2512"},"mistralai/ministral-8b-2512":{"id":"mistralai/ministral-8b-2512","name":"Ministral 3 8B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.3174,"output":0.3174,"cache_read":0.01587},"canonical_model_id":"mistral/ministral-8b-2512"},"mistralai/mistral-large-2407":{"id":"mistralai/mistral-large-2407","name":"Large 2407","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":2.116,"output":6.348,"cache_read":0.2116},"canonical_model_id":"mistral/mistral-large-2407"},"mistralai/mistral-small-24b-instruct-2501":{"id":"mistralai/mistral-small-24b-instruct-2501","name":"Small 3","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.0529,"output":0.08464},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"mistralai/mistral-small-3.2-24b-instruct":{"id":"mistralai/mistral-small-3.2-24b-instruct","name":"Small 3.2 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.07935,"output":0.2116},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"mistralai/mistral-medium-3.1":{"id":"mistralai/mistral-medium-3.1","name":"Medium 3.1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-30","release_date":"2025-08-12","last_updated":"2025-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4232,"output":2.116,"cache_read":0.04232},"canonical_model_id":"mistral/mistral-medium-3.1"},"mistralai/mistral-small-2603":{"id":"mistralai/mistral-small-2603","name":"Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.198375,"output":0.7935,"cache_read":0.01587},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/mistral-nemo":{"id":"mistralai/mistral-nemo","name":"Mistral NeMo","description":"Efficient Mistral-NVIDIA open model for multilingual chat and local deployment","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.1587,"output":0.17986,"cache_read":0.1587},"canonical_model_id":"mistral/mistral-nemo"},"mistralai/devstral-2512":{"id":"mistralai/devstral-2512","name":"Devstral 2 2512","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.46552,"output":2.3276,"cache_read":0.046552},"canonical_model_id":"mistral/devstral-2512"},"mistralai/mistral-saba":{"id":"mistralai/mistral-saba","name":"Saba","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-02-17","last_updated":"2025-02-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":26214},"cost":{"input":0.2116,"output":0.6348,"cache_read":0.02116},"canonical_model_id":"mistral/mistral-saba"},"mistralai/mistral-large":{"id":"mistralai/mistral-large","name":"Large","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11-30","release_date":"2024-02-26","last_updated":"2024-02-26","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":102400},"cost":{"input":2.116,"output":6.348,"cache_read":0.2116},"canonical_model_id":"mistral/mistral-large"},"mistralai/mistral-medium-3":{"id":"mistralai/mistral-medium-3","name":"Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4232,"output":2.116,"cache_read":0.04232},"canonical_model_id":"mistral/mistral-medium-3"},"mistralai/ministral-14b-2512":{"id":"mistralai/ministral-14b-2512","name":"Ministral 3 14B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.3703,"output":0.3703,"cache_read":0.02116},"canonical_model_id":"mistral/ministral-14b-2512"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 0905","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":1.058,"output":3.174},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k2":{"id":"moonshotai/kimi-k2","name":"Kimi K2 0711","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12-31","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.60306,"output":2.4334},"canonical_model_id":"moonshotai/kimi-k2"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6348,"output":2.645,"cache_read":0.1587},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"perceptron/perceptron-mk1.5":{"id":"perceptron/perceptron-mk1.5","name":"Mk1.5","description":"Image, video, and audio understanding with visual grounding, reasoning, and function calling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":36864,"output":8192},"cost":{"input":0.1587,"output":1.587},"canonical_model_id":"perceptron/perceptron-mk1.5"},"alibaba/qwen3-coder-480b-a35b-instruct":{"id":"alibaba/qwen3-coder-480b-a35b-instruct","name":"Qwen3 Coder","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":65536},"cost":{"input":1.058,"output":5.15775,"cache_read":1.058},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"alibaba/qwen-max":{"id":"alibaba/qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8192},"cost":{"input":1.6,"output":6.4,"cache_read":0.32},"canonical_model_id":"alibaba/qwen-max"},"alibaba/qwen3.8-27b":{"id":"alibaba/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.4761,"output":3.3856},"canonical_model_id":"alibaba/qwen3.8-27b"},"alibaba/qwen-plus":{"id":"alibaba/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131000,"output":16384},"cost":{"input":0.4,"output":1.2,"cache_read":0.08},"canonical_model_id":"alibaba/qwen-plus"},"alibaba/qwen3.8-flash":{"id":"alibaba/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.16,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"alibaba/qwen3.8-max-prime":{"id":"alibaba/qwen3.8-max-prime","name":"Qwen3.8 Max Prime","description":"High-throughput edition of Qwen3.8 Max for coding, professional work, multimodal understanding, and long-running agent workflows","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":4.232,"output":12.696,"cache_read":0.529},"canonical_model_id":"alibaba/qwen3.8-max-prime"},"alibaba/qwen3.8-2.4t-a95b":{"id":"alibaba/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":52429},"cost":{"input":2.645,"output":6.6125,"cache_read":0.529},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"alibaba/qwen3-next-80b-a3b-instruct":{"id":"alibaba/qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":129024,"output":16384},"cost":{"input":0.1587,"output":1.2696},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"alibaba/qwen3.8-max":{"id":"alibaba/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":22.218,"output":177.744},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.587,"output":9.522,"cache_read":0.1587},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5-4":{"id":"openai/gpt-5-4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5-2":{"id":"openai/gpt-5-2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"gpt-oss-safeguard-20b","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.07935,"output":0.3174,"cache_read":0.039675},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-5.6-terra-pro":{"id":"openai/gpt-5.6-terra-pro","name":"GPT-5.6 Terra Pro","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.116,"output":12.696,"cache_read":0.2116},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT-5.1-Codex-Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":2.645,"output":21.16,"cache_read":0.2645},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":117964},"cost":{"input":0.07935,"output":0.3174,"cache_read":0.039675},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-5-5":{"id":"openai/gpt-5-5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15.87,"output":126.96},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":3.703,"output":29.624,"cache_read":0.3703},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-4o-2024-05-13":{"id":"openai/gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":5.29,"output":15.87},"canonical_model_id":"openai/gpt-4o-2024-05-13"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":31.74,"output":190.44},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna-pro":{"id":"openai/gpt-5.6-luna-pro","name":"GPT-5.6 Luna Pro","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2116,"output":1.2696,"cache_read":0.02116},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":31.74,"output":190.44},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-1":{"id":"openai/gpt-5-1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4-image-2":{"id":"openai/gpt-5.4-image-2","type":"image","name":"GPT-5.4 Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":true,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["image","text","pdf"],"output":["image","text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":8.464,"output":15.87,"cache_read":2.116},"canonical_model_id":"openai/gpt-5.4-image-2"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3 Pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":21.16,"output":84.64},"canonical_model_id":"openai/o3-pro"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2116,"output":1.3225,"cache_read":0.02116},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":117964},"cost":{"input":0.3703,"output":1.0051,"cache_read":0.3703},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o Mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-5.6-sol-pro":{"id":"openai/gpt-5.6-sol-pro","name":"GPT-5.6 Sol Pro","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4.232,"output":21.16,"cache_read":0.4232},"canonical_model_id":"openai/gpt-5.6-sol"},"cognitivecomputations/dolphin-mistral-24b-venice-edition":{"id":"cognitivecomputations/dolphin-mistral-24b-venice-edition","name":"Venice Uncensored","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.2116,"output":0.9522},"canonical_model_id":"cognitivecomputations/dolphin-mistral-24b-venice-edition"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+ (08-2024)","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.645,"output":10.58},"canonical_model_id":"cohere/command-r-plus-08-2024"},"cohere/command-r7b-12-2024":{"id":"cohere/command-r7b-12-2024","name":"Command R7B (12-2024)","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.039675,"output":0.1587},"canonical_model_id":"cohere/command-r7b-12-2024"},"cohere/command-r-08-2024":{"id":"cohere/command-r-08-2024","name":"Command R (08-2024)","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.1587,"output":0.6348},"canonical_model_id":"cohere/command-r-08-2024"},"cohere/command-a":{"id":"cohere/command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":2.645,"output":10.58},"canonical_model_id":"cohere/command-a"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.14812,"output":0.29624,"cache_read":0.002962},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo V2.5 Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.46023,"output":0.92046,"cache_read":0.003809},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"mancer/weaver":{"id":"mancer/weaver","name":"Weaver (alpha)","description":"General-purpose chat model for instruction following, writing, and analysis","family":"alpha","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-08-02","last_updated":"2023-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":2000},"cost":{"input":0.7935,"output":1.058},"canonical_model_id":"mancer/weaver"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":262144},"cost":{"input":0.61364,"output":1.52352,"cache_read":0.122728},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.058,"output":4.2849,"cache_read":0.17986},"canonical_model_id":"thinkingmachines/inkling"},"upstage/solar-pro4":{"id":"upstage/solar-pro4","name":"Solar Pro 4","description":"Upstage's flagship model, specialized for agentic use","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.09522,"output":0.38088,"cache_read":0.019044},"canonical_model_id":"upstage/solar-pro4"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.3225,"output":4.4965,"cache_read":0.1587},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.3225,"output":4.4965,"cache_read":0.1587},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3703,"output":1.587,"cache_read":0.04232},"canonical_model_id":"meta/muse-glimmer-30b"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.3225,"output":4.4965,"cache_read":0.1587},"canonical_model_id":"meta/muse-spark-1.2"},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":64000},"cost":{"input":1.058,"output":2.8566,"cache_read":0.0529},"canonical_model_id":"stepfun/step-5-preview"},"undi95/remm-slerp-l2-13b":{"id":"undi95/remm-slerp-l2-13b","name":"ReMM SLERP 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-07-22","last_updated":"2023-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":6144,"output":4096},"cost":{"input":0.529,"output":0.7935},"canonical_model_id":"undi95/remm-slerp-l2-13b"},"unbiased/pareto":{"id":"unbiased/pareto","name":"Pareto","description":"Blended multimodal model that runs multiple language models in parallel and returns a synthesized answer","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":2.645,"output":7.935,"cache_read":0.2645},"canonical_model_id":"unbiased/pareto"},"z-ai/glm-4.6v":{"id":"z-ai/glm-4.6v","name":"GLM 4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3174,"output":0.9522,"cache_read":0.05819},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM 5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-4.5v":{"id":"z-ai/glm-4.5v","name":"GLM 4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6348,"output":1.9044,"cache_read":0.11638},"canonical_model_id":"zhipuai/glm-4.5v"},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM 5V Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-4.7-flash":{"id":"z-ai/glm-4.7-flash","name":"GLM 4.7 Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"cost":{"input":0.13225,"output":0.529,"cache_read":0.01058},"canonical_model_id":"zhipuai/glm-4.7-flash"},"inception/mercury-2":{"id":"inception/mercury-2","name":"Mercury 2","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":50000},"cost":{"input":0.2645,"output":0.7935,"cache_read":0.02645},"canonical_model_id":"inception/mercury-2"},"inception/mercury-2.5":{"id":"inception/mercury-2.5","name":"Mercury 2.5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":260000,"output":65536},"cost":{"input":0.2116,"output":0.7935,"cache_read":0.02116},"canonical_model_id":"inception/mercury-2.5"},"meta-llama/Llama-3.3-70B-Instruct-Turbo":{"id":"meta-llama/Llama-3.3-70B-Instruct-Turbo","name":"Llama 3.3 70B Instruct Turbo","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":127000},"cost":{"input":0.76176,"output":2.383674},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"morph/morph-v3-large":{"id":"morph/morph-v3-large","name":"V3 Large","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.9522,"output":2.0102},"canonical_model_id":"morph/morph-v3-large"},"morph/morph-v3-fast":{"id":"morph/morph-v3-fast","name":"V3 Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":81920,"output":38000},"cost":{"input":0.8464,"output":1.2696},"canonical_model_id":"morph/morph-v3-fast"},"gryphe/mythomax-l2-13b":{"id":"gryphe/mythomax-l2-13b","name":"MythoMax 13B","description":"Llama 2 merge combining MythoLogic and Huginn for creative writing and roleplay","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":1.98375,"output":1.98375,"cache_read":1.98375},"canonical_model_id":"gryphe/mythomax-l2-13b"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.116,"output":6.348,"cache_read":0.2645},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v2":{"id":"sakana/fugu-ultra-v2","name":"Fugu Ultra v2","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.29,"output":31.74,"cache_read":0.529},"canonical_model_id":"sakana/fugu-ultra-v2"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.29,"output":31.74,"cache_read":0.529},"canonical_model_id":"sakana/fugu-ultra"},"sao10k/l3-lunaris-8b":{"id":"sao10k/l3-lunaris-8b","name":"Llama 3 8B Lunaris","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-13","last_updated":"2024-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":7372},"cost":{"input":0.0529,"output":0.0529},"canonical_model_id":"sao10k/l3-lunaris-8b"},"sao10k/l3.1-euryale-70b":{"id":"sao10k/l3.1-euryale-70b","name":"Llama 3.1 Euryale 70B v2.2","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-28","last_updated":"2024-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":1.534523,"output":1.534523},"canonical_model_id":"sao10k/l3.1-euryale-70b"},"bytedance-seed/seed-1.6-flash":{"id":"bytedance-seed/seed-1.6-flash","name":"Seed 1.6 Flash","description":"Low-latency ByteDance Seed model for high-throughput chat, extraction, and lightweight tool use","family":"seed","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.07935,"output":0.3174},"canonical_model_id":"bytedance-seed/seed-1-6-flash"},"bytedance-seed/seed-2.0-mini":{"id":"bytedance-seed/seed-2.0-mini","name":"Seed-2.0-Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.1058,"output":0.4232},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"bytedance-seed/seed-2.0-lite":{"id":"bytedance-seed/seed-2.0-lite","name":"Seed-2.0-Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.2645,"output":2.116},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"zhipu/glm-5.2":{"id":"zhipu/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zhipu/glm-5.3":{"id":"zhipu/glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"relace/relace-search":{"id":"relace/relace-search","name":"Search","description":"Tool-capable chat model for instruction following and agentic application workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":1.058,"output":3.174},"canonical_model_id":"relace/relace-search"},"relace/relace-apply-3":{"id":"relace/relace-apply-3","name":"Apply 3","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.8993,"output":1.3225},"canonical_model_id":"relace/relace-apply-3"},"inference-net/schematron-v2-turbo":{"id":"inference-net/schematron-v2-turbo","name":"Schematron V2 Turbo","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.03174,"output":0.1587},"canonical_model_id":"inference-net/schematron-v2-turbo"},"inference-net/schematron-v2-small":{"id":"inference-net/schematron-v2-small","name":"Schematron V2 Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":0.0529,"output":0.24334},"canonical_model_id":"inference-net/schematron-v2-small"}}},"pareto":{"id":"pareto","env":["PARETO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.paretoinference.com/v1","name":"Pareto Inference","doc":"https://docs.paretoinference.com/","models":{"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.06,"output":0.2,"cache_read":0.012},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"minimax-cn-coding-plan":{"id":"minimax-cn-coding-plan","env":["MINIMAX_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://api.minimax.cn/anthropic/v1","name":"MiniMax Token Plan (minimax.cn)","doc":"https://platform.minimaxi.com/docs/token-plan/intro","models":{"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5-highspeed":{"id":"MiniMax-M2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.7-highspeed":{"id":"MiniMax-M2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M3.1-Flash-Preview":{"id":"MiniMax-M3.1-Flash-Preview","name":"MiniMax-M3.1-Flash-Preview","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-27","last_updated":"2026-09-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":512000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash-Preview"},"MiniMax-M3.1-Flash":{"id":"MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"MiniMax-M2":{"id":"MiniMax-M2","name":"MiniMax-M2","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0}}}},"zai":{"id":"zai","env":["ZHIPU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.z.ai/api/paas/v4","name":"Z.AI","doc":"https://docs.z.ai/guides/overview/pricing","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"glm-4.6v-flash":{"id":"glm-4.6v-flash","name":"GLM-4.6V-Flash","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.05,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6v"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"glm-4.5":{"id":"glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5-turbo":{"id":"glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5-turbo"},"glm-4.5-air":{"id":"glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-air"},"glm-4.6":{"id":"glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"glm-4.5v":{"id":"glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5v"},"glm-5.3-flashx":{"id":"glm-5.3-flashx","name":"GLM-5.3-FlashX","description":"High-speed GLM-5.3-Flash serving option for coding and agent workflows","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5v-turbo":{"id":"glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5v-turbo"},"glm-4.7-flashx":{"id":"glm-4.7-flashx","name":"GLM-4.7-FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.07,"output":0.4,"cache_read":0.01,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"},"glm-4.7-flash":{"id":"glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"glm-4.5-flash":{"id":"glm-4.5-flash","name":"GLM-4.5-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-flash"}}},"regolo-ai":{"id":"regolo-ai","env":["REGOLO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.regolo.ai/v1","name":"Regolo AI","doc":"https://docs.regolo.ai/","models":{"qwen-image":{"id":"qwen-image","type":"image","name":"Qwen-Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-03-01","last_updated":"2026-03-01","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":4096},"cost":{"input":0.5,"output":2}},"brick-complexity-pro":{"id":"brick-complexity-pro","name":"Brick Complexity Pro","description":"Complexity classifier that powers the Brick semantic router by extracting query difficulty","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-02-06","last_updated":"2026-02-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":100000,"output":15000},"cost":{"input":0.12,"output":0.46}},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":120000,"output":120000},"cost":{"input":0.58,"output":2.42},"canonical_model_id":"alibaba/qwen3.8-27b"},"apertus-70b":{"id":"apertus-70b","name":"Apertus 70B","description":"Fully open 70B multilingual LLM supporting 1800+ languages with 65K context. Trained on 15T tokens of compliant open data. Apache 2.0, EU AI Act compliant.","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":30000,"output":30000},"cost":{"input":0.46,"output":2.42},"canonical_model_id":"swiss-ai/apertus-70b"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT-OSS-20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.11215,"output":0.47103},"canonical_model_id":"openai/gpt-oss-20b"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5-9B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.078505,"output":0.392525},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen3.5-122b":{"id":"qwen3.5-122b","name":"Qwen3.5-122B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":1.1215,"output":4.7103},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"brick-v1-beta":{"id":"brick-v1-beta","name":"Brick v1 Beta","description":"Semantic router by Regolo.ai that directs each request to the most suitable model, optimizing costs and performance","family":"model-router","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-02-06","last_updated":"2026-02-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":100000,"output":15000},"status":"beta","cost":{"input":0,"output":0}},"qwen3-embedding-8b":{"id":"qwen3-embedding-8b","type":"embedding","name":"Qwen3-Embedding-8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"faster-whisper-large-v3":{"id":"faster-whisper-large-v3","type":"transcription","name":"Faster Whisper Large v3","description":"Open Whisper checkpoint for robust multilingual transcription and captioning","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"openai/whisper-large-v3"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama 3.3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":0.6,"output":2.7},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"mistral-small-4-119b":{"id":"mistral-small-4-119b","name":"Mistral Small 4 119B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.56075,"output":2.35515},"canonical_model_id":"mistral/mistral-small-2603"},"qwen3-reranker-4b":{"id":"qwen3-reranker-4b","type":"reranking","name":"Qwen3-Reranker-4B","description":"Reranking model for improving retrieval quality in search and recommendation systems","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-01","last_updated":"2026-02-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.12,"output":0.12}},"qwen3-coder-next":{"id":"qwen3-coder-next","name":"Qwen3-Coder-Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":0.3,"output":1.2},"canonical_model_id":"alibaba/qwen3-coder-next"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT-OSS-120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":1.1215,"output":4.7103},"canonical_model_id":"openai/gpt-oss-120b"},"glm5.2":{"id":"glm5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":96000,"output":96000},"cost":{"input":2.31,"output":6},"canonical_model_id":"zhipuai/glm-5.2"},"deepseek-ocr-2":{"id":"deepseek-ocr-2","name":"DeepSeek OCR 2","description":"High-accuracy OCR model for extracting text from documents, screenshots, receipts, and natural scenes","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":4000,"output":4000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-ocr-2"},"gemma4-31b":{"id":"gemma4-31b","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"output":100000},"cost":{"input":0.46,"output":2.42},"canonical_model_id":"google/gemma-4-31b-it"}}},"watsonx":{"id":"watsonx","env":["WATSONX_AI_APIKEY","WATSONX_AI_PROJECT_ID"],"npm":"watsonx-ai-provider","name":"watsonx.ai","doc":"https://www.ibm.com/docs/en/watsonx/saas?topic=solutions-supported-foundation-models","models":{"ibm/granite-4-h-small":{"id":"ibm/granite-4-h-small","name":"Granite-4.0-H-Small","description":"Open-weight hybrid model for enterprise chat, coding, retrieval-augmented generation, and tool-calling workloads","family":"granite","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-02","last_updated":"2025-10-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.0636,"output":0.265},"canonical_model_id":"ibm/granite-4-h-small"},"mistralai/mistral-small-3-1-24b-instruct-2503":{"id":"mistralai/mistral-small-3-1-24b-instruct-2503","name":"Mistral Small 3.1 24B","description":"Efficient multimodal model for instruction following, coding, reasoning, and function calling","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.106,"output":0.318},"canonical_model_id":"mistral/mistral-small-3-1-24b-instruct-2503"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.159,"output":0.636},"canonical_model_id":"openai/gpt-oss-120b"},"meta-llama/llama-3-3-70b-instruct":{"id":"meta-llama/llama-3-3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.7526,"output":0.7526},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta-llama/llama-4-maverick-17b-128e-instruct-fp8":{"id":"meta-llama/llama-4-maverick-17b-128e-instruct-fp8","name":"Llama 4 Maverick 17B 128E Instruct FP8","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.371,"output":1.484},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"}}},"coralbricks":{"id":"coralbricks","env":["CORAL_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.coralbricks.ai/v1","name":"CoralBricks","doc":"https://www.coralbricks.ai/docs","models":{"deepseek-v4.1-flash-fast":{"id":"deepseek-v4.1-flash-fast","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.25,"output":1.2,"cache_read":0.005,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"}}},"302ai":{"id":"302ai","env":["302AI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.302.ai/v1","name":"302.AI","doc":"https://doc.302.ai","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.8,"tiers":[{"input":1.2,"output":7.2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":7.2}},"canonical_model_id":"alibaba/qwen3.6-plus"},"gemini-3.5-flash-thinking":{"id":"gemini-3.5-flash-thinking","name":"gemini-3.5-flash-thinking","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-3.5-flash"},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.5"},"claude-opus-4-7-thinking":{"id":"claude-opus-4-7-thinking","name":"claude-opus-4-7-thinking","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-7"},"qwen3-30b-a3b":{"id":"qwen3-30b-a3b","name":"Qwen3-30B-A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.11,"output":1.08},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"gpt-5.3-chat-latest":{"id":"gpt-5.3-chat-latest","name":"GPT-5.3 Chat (latest)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.3-chat-latest"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"gemini-2.5-flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"google/gemini-2.5-flash"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"kimi-k2-0905-preview":{"id":"kimi-k2-0905-preview","name":"kimi-k2-0905-preview","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.62854,"output":2.5146},"canonical_model_id":"moonshotai/kimi-k2-0905"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"gpt-4.1-nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"openai/gpt-4.1-nano"},"MiniMax-M1":{"id":"MiniMax-M1","name":"MiniMax-M1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-06-16","last_updated":"2025-06-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.132,"output":1.254}},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"gemini-2.0-flash-lite":{"id":"gemini-2.0-flash-lite","name":"gemini-2.0-flash-lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-11","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":8192},"cost":{"input":0.075,"output":0.3},"canonical_model_id":"google/gemini-2.0-flash-lite"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"gemini-3.1-flash-image-preview":{"id":"gemini-3.1-flash-image-preview","type":"image","name":"gemini-3.1-flash-image-preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":60},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"gpt-5.2":{"id":"gpt-5.2","name":"gpt-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.2"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.5"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"gpt-4.1-mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6},"canonical_model_id":"openai/gpt-4.1-mini"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.4,"output":12,"cache_read":0.24},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.6"},"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.1"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"gpt-5.4-mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"gemini-2.5-flash-nothink":{"id":"gemini-2.5-flash-nothink","name":"gemini-2.5-flash-nothink","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"google/gemini-2.5-flash"},"grok-4-fast-reasoning":{"id":"grok-4-fast-reasoning","name":"grok-4-fast-reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5},"canonical_model_id":"xai/grok-4-fast-reasoning"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5},"canonical_model_id":"xai/grok-4.3"},"qwen3-coder-480b-a35b-instruct":{"id":"qwen3-coder-480b-a35b-instruct","name":"qwen3-coder-480b-a35b-instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.86,"output":3.43,"tiers":[{"input":1.29,"output":5.15,"tier":{"type":"context","size":32000}},{"input":2.15,"output":8.58,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.5"},"gpt-5.6-terra-pro":{"id":"gpt-5.6-terra-pro","name":"gpt-5.6-terra-pro","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"openai/gpt-5.6-terra"},"gpt-5":{"id":"gpt-5","name":"gpt-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"gemini-2.5-pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.25,"output":10,"tiers":[{"input":2.5,"output":15,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15}},"canonical_model_id":"google/gemini-2.5-pro"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.7"},"claude-opus-4-1-20250805-thinking":{"id":"claude-opus-4-1-20250805-thinking","name":"claude-opus-4-1-20250805-thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"claude-opus-5-thinking":{"id":"claude-opus-5-thinking","name":"claude-opus-5-thinking","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-4.1":{"id":"gpt-4.1","name":"gpt-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8},"canonical_model_id":"openai/gpt-4.1"},"deepseek-v3.2-thinking":{"id":"deepseek-v3.2-thinking","name":"DeepSeek-V3.2-Thinking","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.29,"output":0.43},"canonical_model_id":"deepseek/deepseek-v3.2"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8},"canonical_model_id":"openai/o3"},"grok-4.20-beta-0309-reasoning":{"id":"grok-4.20-beta-0309-reasoning","name":"grok-4.20-beta-0309-reasoning","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":0.5},"canonical_model_id":"xai/grok-4.7"},"mistral-large-2512":{"id":"mistral-large-2512","name":"mistral-large-2512","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":262144},"cost":{"input":1.1,"output":3.3},"canonical_model_id":"mistral/mistral-large-2512"},"doubao-seed-1-6-thinking-250715":{"id":"doubao-seed-1-6-thinking-250715","name":"doubao-seed-1-6-thinking-250715","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":16000},"cost":{"input":0.121,"output":1.21}},"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.145,"output":0.43,"tiers":[{"input":0.29,"output":0.86,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v"},"gpt-5-thinking":{"id":"gpt-5-thinking","name":"gpt-5-thinking","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.627,"output":3.3},"canonical_model_id":"moonshotai/kimi-k2.5"},"gemini-3-pro-preview":{"id":"gemini-3-pro-preview","name":"gemini-3-pro-preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":12,"tiers":[{"input":4,"output":18,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18}},"canonical_model_id":"google/gemini-3-pro-preview"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"qwen3-235b-a22b-instruct-2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":65536},"cost":{"input":0.29,"output":1.143},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"glm-4.5":{"id":"glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.286,"output":1.143,"tiers":[{"input":0.5714,"output":2.29,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5"},"gpt-5.1-chat-latest":{"id":"gpt-5.1-chat-latest","name":"gpt-5.1-chat-latest","description":"Chat-tuned GPT-5.1 for polished assistants, writing, and product conversations","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"tiers":[{"input":4,"output":18,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.1-flash-lite"},"glm-4.7":{"id":"glm-4.7","name":"glm-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.286,"output":1.142,"tiers":[{"input":0.572,"output":2.29,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.7"},"gpt-5-pro":{"id":"gpt-5-pro","name":"gpt-5-pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-pro"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"claude-sonnet-4-5-20250929","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4}},"canonical_model_id":"openai/gpt-6-sol"},"deepseek-flash":{"id":"deepseek-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen3-max-2025-09-23":{"id":"qwen3-max-2025-09-23","name":"qwen3-max-2025-09-23","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":258048,"output":65536},"cost":{"input":0.86,"output":3.43,"tiers":[{"input":1.43,"output":5.72,"tier":{"type":"context","size":32000}},{"input":2.15,"output":8.58,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":10,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-argon"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"qwen3.5-35b-a3b":{"id":"qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.06,"output":0.46,"tiers":[{"input":0.23,"output":1.83,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.228,"output":0.92,"cache_read":0.023,"cache_write":0.286,"tiers":[{"input":0.68,"output":2.74,"cache_read":0.068,"cache_write":0.86,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.68,"output":2.74,"cache_read":0.068,"cache_write":0.86}},"canonical_model_id":"alibaba/qwen3.7-plus"},"claude-opus-4-1-20250805":{"id":"claude-opus-4-1-20250805","name":"claude-opus-4-1-20250805","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gemini-2.5-flash-preview-09-2025":{"id":"gemini-2.5-flash-preview-09-2025","name":"gemini-2.5-flash-preview-09-2025","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":2.5}},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.8,"output":5.3},"canonical_model_id":"alibaba/qwen3.7-max"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"grok-4-1-fast-reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window and built-in reasoning","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5.1":{"id":"gpt-5.1","name":"gpt-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"claude-haiku-4-5-20251001","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5-mini":{"id":"gpt-5-mini","name":"gpt-5-mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.19,"output":1.13,"cache_read":0.0171,"cache_write":0.214,"tiers":[{"input":0.76,"output":4.52,"cache_read":0.0686,"cache_write":0.857,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.76,"output":4.52,"cache_read":0.0686,"cache_write":0.857}},"canonical_model_id":"alibaba/qwen3.6-flash"},"gemini-3.1-flash-lite-preview":{"id":"gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"gpt-5.6-luna-pro":{"id":"gpt-5.6-luna-pro","name":"gpt-5.6-luna-pro","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3-pro-image-preview":{"id":"gemini-3-pro-image-preview","type":"image","name":"gemini-3-pro-image-preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-06","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":64000},"cost":{"input":2,"output":120},"canonical_model_id":"google/gemini-3-pro-image-preview"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.075,"output":0.25,"cache_read":0.015},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5"},"glm-5-turbo":{"id":"glm-5-turbo","name":"glm-5-turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":0.72,"output":3.2,"tiers":[{"input":1.1,"output":3.8,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5-turbo"},"doubao-seed-1-8-251215":{"id":"doubao-seed-1-8-251215","name":"doubao-seed-1-8-251215","description":"ByteDance Seed model for multimodal reasoning, long-context analysis, and agent workflows","family":"seed","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-12-28","last_updated":"2025-12-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":224000,"output":64000},"cost":{"input":0.1143,"output":0.286,"tiers":[{"input":0.1715,"output":2.286,"tier":{"type":"context","size":32000}},{"input":0.343,"output":3.43,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-8"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"kimi-k2-thinking":{"id":"kimi-k2-thinking","name":"kimi-k2-thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.575,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"claude-opus-4-5-20251101","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2}},"canonical_model_id":"openai/gpt-6.1-sol"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.72,"output":2.88,"cache_read":0.144,"cache_write":0.9,"tiers":[{"input":1.44,"output":5.76,"cache_read":0.144,"cache_write":0.9,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":1.44,"output":5.76,"cache_read":0.144,"cache_write":0.9}},"canonical_model_id":"minimax/MiniMax-M3"},"doubao-seed-1-6-vision-250815":{"id":"doubao-seed-1-6-vision-250815","name":"doubao-seed-1-6-vision-250815","description":"ByteDance Seed multimodal model for image understanding, visual reasoning, and tool-assisted tasks","family":"seed","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-08-15","last_updated":"2025-08-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.114,"output":1.143},"canonical_model_id":"bytedance-seed/seed-1-6-vision"},"gpt-5.4":{"id":"gpt-5.4","name":"gpt-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":0,"tiers":[{"input":5,"output":22.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5}},"canonical_model_id":"openai/gpt-5.4"},"glm-4.6":{"id":"glm-4.6","name":"glm-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.286,"output":1.142,"tiers":[{"input":0.572,"output":2.29,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"gemini-3-flash-preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.28,"output":1.7},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"gemini-2.5-flash-image","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":30},"canonical_model_id":"google/gemini-2.5-flash-image"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"gpt-5.4-nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.12,"output":0.69,"tiers":[{"input":0.29,"output":1.72,"tier":{"type":"context","size":128000}},{"input":0.58,"output":3.44,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.5-plus"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"gpt-5.2-chat-latest":{"id":"gpt-5.2-chat-latest","name":"gpt-5.2-chat-latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.2-chat-latest"},"glm-4.5v":{"id":"glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16384},"cost":{"input":0.29,"output":0.86,"tiers":[{"input":0.58,"output":1.72,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5v"},"gpt-4o":{"id":"gpt-4o","name":"gpt-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10},"canonical_model_id":"openai/gpt-4o"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"deepseek-v3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.29,"output":0.43},"canonical_model_id":"deepseek/deepseek-v3.2"},"claude-sonnet-4-6-thinking":{"id":"claude-sonnet-4-6-thinking","name":"claude-sonnet-4-6-thinking","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5}},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"qwen3-235b-a22b":{"id":"qwen3-235b-a22b","name":"Qwen3-235B-A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.29,"output":2.86},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"grok-4.1":{"id":"grok-4.1","name":"grok-4.1","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":2,"output":10}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-sonnet-4-5-20250929-thinking":{"id":"claude-sonnet-4-5-20250929-thinking","name":"claude-sonnet-4-5-20250929-thinking","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.16,"output":6.36,"cache_read":0.168,"cache_write":2.58},"canonical_model_id":"alibaba/qwen3.8-max"},"grok-4-fast-non-reasoning":{"id":"grok-4-fast-non-reasoning","name":"grok-4-fast-non-reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"glm-5v-turbo":{"id":"glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":0.72,"output":3.2,"tiers":[{"input":1.1,"output":3.8,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5v-turbo"},"ministral-14b-2512":{"id":"ministral-14b-2512","name":"ministral-14b-2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.33,"output":0.33},"canonical_model_id":"mistral/ministral-14b-2512"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"claude-sonnet-4-6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5}},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"glm-5":{"id":"glm-5","name":"glm-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.6,"tiers":[{"input":0.9,"output":3.2,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5"},"gpt-5.6-sol-pro":{"id":"gpt-5.6-sol-pro","name":"gpt-5.6-sol-pro","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.6-sol"},"MiniMax-M2":{"id":"MiniMax-M2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.33,"output":1.32},"canonical_model_id":"minimax/MiniMax-M2"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"claude-opus-4-7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"qwen3.7-max-2026-06-08":{"id":"qwen3.7-max-2026-06-08","name":"qwen3.7-max-2026-06-08","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.8,"output":5.3},"canonical_model_id":"alibaba/qwen3.7-max"},"gemini-2.5-flash-lite-preview-09-2025":{"id":"gemini-2.5-flash-lite-preview-09-2025","name":"gemini-2.5-flash-lite-preview-09-2025","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4}},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"claude-haiku-4-5","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"runinfra":{"id":"runinfra","env":["RUNINFRA_GATEWAY_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.runinfra.ai/v1","name":"RunInfra","doc":"https://runinfra.ai/docs","models":{"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"status":"deprecated","cost":{"input":0.13,"output":0.27,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"status":"deprecated","cost":{"input":0.6,"output":1.9,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"ornith-ai/Ornith-1.5-35B-A3B":{"id":"ornith-ai/Ornith-1.5-35B-A3B","name":"Ornith 1.5 35B A3B","description":"Mixture-of-experts coding-reasoning model for agentic software tasks, tool use, and image understanding","family":"ornith","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-18","last_updated":"2026-08-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"deepreinforce/ornith-1.5-35b-a3b"},"Inferact/Qwen3.8-2.4T-A95B-NVFP4":{"id":"Inferact/Qwen3.8-2.4T-A95B-NVFP4","name":"Qwen3.8 2.4T A95B (NVFP4)","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"alibaba/qwen3.8-27b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.11,"output":0.45,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":1.3,"output":4.2,"cache_read":0.13},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.05,"output":0.15,"cache_read":0.01},"canonical_model_id":"nvidia/nemotron-3.5-lightning"}}},"qiniu-ai":{"id":"qiniu-ai","env":["QINIU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.qnaigc.com/v1","name":"Qiniu","doc":"https://developer.qiniu.com/aitokenapi","models":{"gemini-2.0-flash":{"id":"gemini-2.0-flash","name":"Gemini 2.0 Flash","description":"Earlier Gemini Flash workhorse for responsive multimodal apps and tool use","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":8192},"status":"deprecated","canonical_model_id":"google/gemini-2.0-flash"},"qwen3-30b-a3b":{"id":"qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40000,"output":4096},"status":"deprecated","cost":{"input":0.10869565,"output":0.43478261},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"deepseek-r1-0528":{"id":"deepseek-r1-0528","name":"DeepSeek-R1-0528","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"deepseek/deepseek-r1-0528"},"qwen2.5-vl-72b-instruct":{"id":"qwen2.5-vl-72b-instruct","name":"Qwen 2.5 VL 72B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-26","last_updated":"2025-01-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":2.31884058,"output":6.95652174},"canonical_model_id":"alibaba/qwen2-5-vl-72b-instruct"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":64000},"status":"deprecated","canonical_model_id":"google/gemini-2.5-flash"},"claude-4.0-opus":{"id":"claude-4.0-opus","name":"Claude 4.0 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","canonical_model_id":"anthropic/claude-opus-4-0"},"claude-4.0-sonnet":{"id":"claude-4.0-sonnet","name":"Claude 4.0 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","canonical_model_id":"anthropic/claude-sonnet-4-0"},"MiniMax-M1":{"id":"MiniMax-M1","name":"MiniMax M1","description":"Open hybrid-attention MoE reasoning model with a million-token context and an 80K thinking budget","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":80000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"minimax/minimax-m1-80k"},"gemini-2.0-flash-lite":{"id":"gemini-2.0-flash-lite","name":"Gemini 2.0 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":8192},"status":"deprecated","canonical_model_id":"google/gemini-2.0-flash-lite"},"claude-4.5-haiku":{"id":"claude-4.5-haiku","name":"Claude 4.5 Haiku","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","canonical_model_id":"anthropic/claude-haiku-4-5"},"doubao-seed-2.0-code":{"id":"doubao-seed-2.0-code","name":"Doubao Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":0.46376812,"output":2.31884058,"cache_read":0.09275362,"tiers":[{"input":0.69565217,"output":3.47826087,"cache_read":0.13913043,"tier":{"type":"context","size":32000}},{"input":1.39130435,"output":6.95652174,"cache_read":0.27826087,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"doubao-seed-2.0-lite":{"id":"doubao-seed-2.0-lite","name":"Doubao Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.08695652,"output":0.52173913,"cache_read":0.0173913,"tiers":[{"input":0.13043478,"output":0.7826087,"cache_read":0.02608696,"tier":{"type":"context","size":32000}},{"input":0.26086957,"output":1.56521739,"cache_read":0.05217391,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"qwen3-235b-a22b-thinking-2507":{"id":"qwen3-235b-a22b-thinking-2507","name":"Qwen3 235B A22B Thinking 2507","description":"Updated large open Qwen3 MoE thinking model for reasoning, math, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4096},"status":"deprecated","cost":{"input":0.28985507,"output":2.89855072},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"qwen3-30b-a3b-thinking-2507":{"id":"qwen3-30b-a3b-thinking-2507","name":"Qwen3 30b A3b Thinking 2507","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-04","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":126000,"output":32000},"status":"deprecated","cost":{"input":0.10869565,"output":1.08695652}},"gemini-3.0-pro-image-preview":{"id":"gemini-3.0-pro-image-preview","type":"image","name":"Gemini 3.0 Pro Image Preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":8192},"status":"deprecated","canonical_model_id":"google/gemini-3-pro-image-preview"},"qwen-vl-max-2025-01-25":{"id":"qwen-vl-max-2025-01-25","name":"Qwen VL-MAX-2025-01-25","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.43478261,"output":1.30434783}},"claude-4.5-opus":{"id":"claude-4.5-opus","name":"Claude 4.5 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":200000},"status":"deprecated","canonical_model_id":"anthropic/claude-opus-4-5"},"qwen3-coder-480b-a35b-instruct":{"id":"qwen3-coder-480b-a35b-instruct","name":"Qwen3 Coder 480B A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":4096},"status":"deprecated","cost":{"input":0.86956522,"output":3.47826087,"tiers":[{"input":1.30434783,"output":5.2173913,"tier":{"type":"context","size":32000}},{"input":2.17391304,"output":8.69565217,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"deepseek-v3.1":{"id":"deepseek-v3.1","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.57971014,"output":1.73913043},"canonical_model_id":"deepseek/deepseek-v3.1"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","canonical_model_id":"google/gemini-2.5-pro"},"qwen3-vl-30b-a3b-thinking":{"id":"qwen3-vl-30b-a3b-thinking","name":"Qwen3-Vl 30b A3b Thinking","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-09","last_updated":"2026-02-09","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.10869565,"output":1.08695652}},"doubao-seed-1.6-flash":{"id":"doubao-seed-1.6-flash","name":"Doubao-Seed 1.6 Flash","description":"Low-latency ByteDance Seed model for high-throughput chat, extraction, and lightweight tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.02173913,"output":0.2173913,"tiers":[{"input":0.04347826,"output":0.43478261,"tier":{"type":"context","size":32000}},{"input":0.08695652,"output":0.86956522,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-6-flash"},"deepseek-r1":{"id":"deepseek-r1","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"deepseek/deepseek-r1"},"qwen3-30b-a3b-instruct-2507":{"id":"qwen3-30b-a3b-instruct-2507","name":"Qwen3 30b A3b Instruct 2507","description":"Updated compact Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.10869565,"output":0.43478261},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"Qwen3 235b A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"status":"deprecated","cost":{"input":0.28985507,"output":1.15942029},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"glm-4.5":{"id":"glm-4.5","name":"GLM 4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"zhipuai/glm-4.5"},"claude-3.5-haiku":{"id":"claude-3.5-haiku","name":"Claude 3.5 Haiku","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-07-31","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"status":"deprecated","canonical_model_id":"anthropic/claude-3-5-haiku-20241022"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"gpt-oss-20b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","canonical_model_id":"openai/gpt-oss-20b"},"qwen3-next-80b-a3b-thinking":{"id":"qwen3-next-80b-a3b-thinking","name":"Qwen3 Next 80B A3B Thinking","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.14492754,"output":1.44927536},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"doubao-1.5-vision-pro":{"id":"doubao-1.5-vision-pro","name":"Doubao 1.5 Vision Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"status":"deprecated","cost":{"input":0.43478261,"output":1.30434783}},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.17391304,"output":1.04347826,"tiers":[{"input":0.43478261,"output":2.60869565,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"mimo-v2-flash":{"id":"mimo-v2-flash","name":"Mimo-V2-Flash","description":"MiMo flash model for fast multimodal assistance and agent workflows","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12-01","release_date":"2025-12-16","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"status":"deprecated","cost":{"input":0.1,"output":0.3,"cache_read":0.01},"canonical_model_id":"xiaomi/mimo-v2-flash"},"doubao-1.5-pro-32k":{"id":"doubao-1.5-pro-32k","name":"Doubao 1.5 Pro 32k","description":"Flagship model for demanding analysis, coding, and production agent workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":12000},"status":"deprecated","cost":{"input":0.11594203,"output":0.28985507}},"deepseek-v3":{"id":"deepseek-v3","name":"DeepSeek-V3","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16000},"status":"deprecated","cost":{"input":0.28985507,"output":1.15942029},"canonical_model_id":"deepseek/deepseek-v3"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":64000},"status":"deprecated","canonical_model_id":"google/gemini-2.5-flash-lite"},"doubao-seed-2.0-mini":{"id":"doubao-seed-2.0-mini","name":"Doubao Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.02898551,"output":0.28985507,"cache_read":0.0057971,"tiers":[{"input":0.05797101,"output":0.57971014,"cache_read":0.0115942,"tier":{"type":"context","size":32000}},{"input":0.11594203,"output":1.15942029,"cache_read":0.02318841,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"claude-3.5-sonnet":{"id":"claude-3.5-sonnet","name":"Claude 3.5 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"status":"deprecated","canonical_model_id":"anthropic/claude-3-5-sonnet-20241022"},"qwen3-max-preview":{"id":"qwen3-max-preview","name":"Qwen3 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-05","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.86956522,"output":3.47826087,"tiers":[{"input":1.44927536,"output":5.79710145,"tier":{"type":"context","size":32000}},{"input":2.17391304,"output":8.69565217,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max-preview"},"kimi-k2":{"id":"kimi-k2","name":"Kimi K2","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12-31","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"moonshotai/kimi-k2"},"doubao-seed-2.0-pro":{"id":"doubao-seed-2.0-pro","name":"Doubao Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":0.46376812,"output":2.31884058,"cache_read":0.09275362,"tiers":[{"input":0.69565217,"output":3.47826087,"cache_read":0.13913043,"tier":{"type":"context","size":32000}},{"input":1.39130435,"output":6.95652174,"cache_read":0.27826087,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"doubao-seed-1.6":{"id":"doubao-seed-1.6","name":"Doubao-Seed 1.6","description":"ByteDance Seed model for long-context reasoning, instruction following, and tool-assisted tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.11594203,"output":1.15942029,"tiers":[{"input":0.17391304,"output":2.31884058,"tier":{"type":"context","size":32000}},{"input":0.34782609,"output":3.47826087,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-6"},"gemini-3.0-flash-preview":{"id":"gemini-3.0-flash-preview","name":"Gemini 3.0 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","canonical_model_id":"google/gemini-3-flash-preview"},"qwen3-max":{"id":"qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.86956522,"output":3.47826087,"tiers":[{"input":1.44927536,"output":5.79710145,"tier":{"type":"context","size":32000}},{"input":2.17391304,"output":8.69565217,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max"},"doubao-1.5-thinking-pro":{"id":"doubao-1.5-thinking-pro","name":"Doubao 1.5 Thinking Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058}},"qwen-turbo":{"id":"qwen-turbo","name":"Qwen-Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":4096},"status":"deprecated","cost":{"input":0.04347826,"output":0.08695652},"canonical_model_id":"alibaba/qwen-turbo"},"claude-4.1-opus":{"id":"claude-4.1-opus","name":"Claude 4.1 Opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","canonical_model_id":"anthropic/claude-opus-4-1"},"glm-4.5-air":{"id":"glm-4.5-air","name":"GLM 4.5 Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":4096},"status":"deprecated","canonical_model_id":"zhipuai/glm-4.5-air"},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"Gemini 2.5 Flash Image","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":32768,"output":8192},"status":"deprecated","canonical_model_id":"google/gemini-2.5-flash-image"},"gemini-3.0-pro-preview":{"id":"gemini-3.0-pro-preview","name":"Gemini 3.0 Pro Preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","canonical_model_id":"google/gemini-3-pro-preview"},"qwen3-next-80b-a3b-instruct":{"id":"qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.14492754,"output":0.57971014},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40000,"output":4096},"status":"deprecated","cost":{"input":0.28985507,"output":1.15942029},"canonical_model_id":"alibaba/qwen3-32b"},"claude-3.7-sonnet":{"id":"claude-3.7-sonnet","name":"Claude 3.7 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"status":"deprecated","canonical_model_id":"anthropic/claude-3-7-sonnet-20250219"},"qwen3-235b-a22b":{"id":"qwen3-235b-a22b","name":"Qwen 3 235B A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.28985507,"output":1.15942029},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"kling-v2-6":{"id":"kling-v2-6","type":"video","name":"Kling-V2 6","description":"Video model for prompt-guided generation, editing, and motion workflows","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-01-13","last_updated":"2026-01-13","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":99999999,"output":99999999}},"qwen-max-2025-01-25":{"id":"qwen-max-2025-01-25","name":"Qwen2.5-Max-2025-01-25","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.34782609,"output":1.39130435},"canonical_model_id":"alibaba/qwen-max"},"claude-4.5-sonnet":{"id":"claude-4.5-sonnet","name":"Claude 4.5 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","canonical_model_id":"anthropic/claude-sonnet-4-5"},"doubao-seed-1.6-thinking":{"id":"doubao-seed-1.6-thinking","name":"Doubao-Seed 1.6 Thinking","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-15","last_updated":"2025-08-15","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.11594203,"output":1.15942029,"tiers":[{"input":0.17391304,"output":2.31884058,"tier":{"type":"context","size":32000}},{"input":0.34782609,"output":3.47826087,"tier":{"type":"context","size":128000}}]}},"meituan/longcat-flash-chat":{"id":"meituan/longcat-flash-chat","name":"Meituan/Longcat-Flash-Chat","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-11-05","last_updated":"2025-11-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"status":"deprecated"},"meituan/longcat-flash-lite":{"id":"meituan/longcat-flash-lite","name":"Meituan/Longcat-Flash-Lite","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-06","last_updated":"2026-02-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":320000},"status":"deprecated","cost":{"input":0,"output":0}},"x-ai/grok-4-fast":{"id":"x-ai/grok-4-fast","name":"x-AI/Grok-4-Fast","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-20","last_updated":"2025-09-20","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated"},"x-ai/grok-4.1-fast-reasoning":{"id":"x-ai/grok-4.1-fast-reasoning","name":"X-Ai/Grok 4.1 Fast Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window and built-in reasoning","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":20000000,"output":2000000},"status":"deprecated","canonical_model_id":"xai/grok-4.1-fast-reasoning"},"x-ai/grok-4-fast-reasoning":{"id":"x-ai/grok-4-fast-reasoning","name":"X-Ai/Grok-4-Fast-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated","canonical_model_id":"xai/grok-4-fast-reasoning"},"x-ai/grok-4.1-fast":{"id":"x-ai/grok-4.1-fast","name":"x-AI/Grok-4.1-Fast","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated"},"x-ai/grok-4.1-fast-non-reasoning":{"id":"x-ai/grok-4.1-fast-non-reasoning","name":"X-Ai/Grok 4.1 Fast Non Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated","canonical_model_id":"xai/grok-4.1-fast"},"x-ai/grok-code-fast-1":{"id":"x-ai/grok-code-fast-1","name":"x-AI/Grok-Code-Fast 1","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":10000},"status":"deprecated","canonical_model_id":"xai/grok-code-fast-1"},"x-ai/grok-4-fast-non-reasoning":{"id":"x-ai/grok-4-fast-non-reasoning","name":"X-Ai/Grok-4-Fast-Non-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated","canonical_model_id":"xai/grok-4-fast-non-reasoning"},"deepseek/deepseek-v3.2-251201":{"id":"deepseek/deepseek-v3.2-251201","name":"Deepseek/DeepSeek-V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.28985507,"output":0.43478261,"cache_read":0.02898551},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v3.2-exp-thinking":{"id":"deepseek/deepseek-v3.2-exp-thinking","name":"DeepSeek/DeepSeek-V3.2-Exp-Thinking","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.28985507,"output":0.43478261}},"deepseek/deepseek-v3.2-exp":{"id":"deepseek/deepseek-v3.2-exp","name":"DeepSeek/DeepSeek-V3.2-Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.28985507,"output":0.43478261}},"deepseek/deepseek-math-v2":{"id":"deepseek/deepseek-math-v2","name":"Deepseek/Deepseek-Math-V2","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-04","last_updated":"2025-12-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":160000,"output":160000},"status":"deprecated"},"deepseek/deepseek-v3.1-terminus":{"id":"deepseek/deepseek-v3.1-terminus","name":"DeepSeek/DeepSeek-V3.1-Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.57971014,"output":1.73913043}},"deepseek/deepseek-v3.1-terminus-thinking":{"id":"deepseek/deepseek-v3.1-terminus-thinking","name":"DeepSeek/DeepSeek-V3.1-Terminus-Thinking","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"status":"deprecated","cost":{"input":0.57971014,"output":1.73913043}},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 0905","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":100000},"status":"deprecated","canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Moonshotai/Kimi-K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"status":"deprecated","cost":{"input":0.57971014,"output":3.04347826},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":100000},"status":"deprecated","cost":{"input":0.57971014,"output":2.31884058},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"OpenAI/GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","canonical_model_id":"openai/gpt-5.2"},"openai/gpt-5":{"id":"openai/gpt-5","name":"OpenAI/GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","canonical_model_id":"openai/gpt-5"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"Minimax/Minimax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"status":"deprecated","cost":{"input":0.30434783,"output":1.2173913},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.5-highspeed":{"id":"minimax/minimax-m2.5-highspeed","name":"Minimax/Minimax-M2.5 Highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"status":"deprecated","cost":{"input":0.60869565,"output":2.43478261},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"Minimax/Minimax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"cost":{"input":0.30434783,"output":1.2173913},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"Minimax/Minimax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","cost":{"input":0.30434783,"output":1.2173913},"canonical_model_id":"minimax/MiniMax-M2"},"stepfun/step-3.5-flash":{"id":"stepfun/step-3.5-flash","name":"Stepfun/Step-3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"input":256000,"output":4096},"status":"deprecated","canonical_model_id":"stepfun/step-3.5-flash"},"z-ai/autoglm-phone-9b":{"id":"z-ai/autoglm-phone-9b","name":"Z-Ai/Autoglm Phone 9b","description":"GLM vision model for visual reasoning, documents, and multimodal agents","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":12800,"output":4096},"status":"deprecated"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"Z-Ai/GLM 4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":200000},"status":"deprecated","cost":{"input":0.45913043,"output":1.81565217},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"Z-AI/GLM 4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":200000},"status":"deprecated","cost":{"input":1.04347826,"output":1.82608696},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"Z-Ai/GLM 5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.57971014,"output":2.60869565,"tiers":[{"input":0.86956522,"output":3.1884058,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5"},"stepfun-ai/gelab-zero-4b-preview":{"id":"stepfun-ai/gelab-zero-4b-preview","name":"Stepfun-Ai/Gelab Zero 4b Preview","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":4096},"status":"deprecated"}}},"amazon-bedrock":{"id":"amazon-bedrock","env":["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_REGION","AWS_BEARER_TOKEN_BEDROCK"],"npm":"@ai-sdk/amazon-bedrock","name":"Amazon Bedrock","doc":"https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html","models":{"global.anthropic.claude-sonnet-4-20250514-v1:0":{"id":"global.anthropic.claude-sonnet-4-20250514-v1:0","name":"Claude Sonnet 4 (Global)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"global.anthropic.claude-sonnet-5":{"id":"global.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (Global)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"global.amazon.nova-2-lite-v1:0":{"id":"global.amazon.nova-2-lite-v1:0","name":"Nova 2 Lite (Global)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.075,"cache_write":0.3},"canonical_model_id":"amazon/nova-2-lite"},"us.xai.grok-4.7":{"id":"us.xai.grok-4.7","name":"Grok 4.7 (US)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2.2,"output":6.6,"cache_read":0.55},"canonical_model_id":"xai/grok-4.7"},"jp.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"jp.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (JP)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"eu.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"eu.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (EU)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"anthropic.claude-opus-4-1-20250805-v1:0":{"id":"anthropic.claude-opus-4-1-20250805-v1:0","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"global.openai.gpt-5.6-luna":{"id":"global.openai.gpt-5.6-luna","name":"GPT-5.6 Luna (Global)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"global.xai.grok-4.7":{"id":"global.xai.grok-4.7","name":"Grok 4.7 (Global)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"deepseek.r1-v1:0":{"id":"deepseek.r1-v1:0","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":1.35,"output":5.4},"canonical_model_id":"deepseek/deepseek-r1"},"us.meta.llama4-maverick-17b-instruct-v1:0":{"id":"us.meta.llama4-maverick-17b-instruct-v1:0","name":"Llama 4 Maverick 17B Instruct (US)","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":8192},"status":"deprecated","cost":{"input":0.24,"output":0.97},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"jp.anthropic.claude-haiku-5-5":{"id":"jp.anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5 (JP)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.55,"output":2.75,"cache_read":0.055,"cache_write":0.6875,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"us.meta.llama4-scout-17b-instruct-v1:0":{"id":"us.meta.llama4-scout-17b-instruct-v1:0","name":"Llama 4 Scout 17B Instruct (US)","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":10000000,"output":8192},"status":"deprecated","cost":{"input":0.17,"output":0.66},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"openai.gpt-6.1-terra":{"id":"openai.gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":1.1,"output":5.5,"cache_read":0.055,"cache_write":1.375,"tiers":[{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75}},"canonical_model_id":"openai/gpt-6.1-terra"},"qwen.qwen3-vl-235b-a22b":{"id":"qwen.qwen3-vl-235b-a22b","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262000},"cost":{"input":0.53,"output":2.66},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"amazon.nova-pro-v1:0":{"id":"amazon.nova-pro-v1:0","name":"Nova Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.8,"output":3.2,"cache_read":0.2,"cache_write":0.8},"canonical_model_id":"amazon/nova-pro"},"anthropic.claude-opus-4-7":{"id":"anthropic.claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"us.xai.grok-4.6":{"id":"us.xai.grok-4.6","name":"Grok 4.6 (US)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2.2,"output":6.6,"cache_read":0.55},"canonical_model_id":"xai/grok-4.6"},"eu.anthropic.claude-haiku-5-5":{"id":"eu.anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5 (EU)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.55,"output":2.75,"cache_read":0.055,"cache_write":0.6875,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"eu.anthropic.claude-opus-5-5":{"id":"eu.anthropic.claude-opus-5-5","name":"Claude Opus 5.5 (EU)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"openai.gpt-5.4":{"id":"openai.gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-06-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":2.75,"output":16.5,"cache_read":0.275},"canonical_model_id":"openai/gpt-5.4"},"in.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"in.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (India)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"global.anthropic.claude-fable-5-1":{"id":"global.anthropic.claude-fable-5-1","name":"Claude Fable 5.1 (Global)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"qwen.qwen3-coder-next":{"id":"qwen.qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.5,"output":1.2},"canonical_model_id":"alibaba/qwen3-coder-next"},"eu.anthropic.claude-opus-4-8":{"id":"eu.anthropic.claude-opus-4-8","name":"Claude Opus 4.8 (EU)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-8"},"us.anthropic.claude-opus-4-8":{"id":"us.anthropic.claude-opus-4-8","name":"Claude Opus 4.8 (US)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-8"},"zai.glm-4.7-flash":{"id":"zai.glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":0.07,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"meta.llama4-scout-17b-instruct-v1:0":{"id":"meta.llama4-scout-17b-instruct-v1:0","name":"Llama 4 Scout 17B Instruct","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":10000000,"output":8192},"status":"deprecated","cost":{"input":0.17,"output":0.66},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"openai.gpt-5.5":{"id":"openai.gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-06-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":5.5,"output":33,"cache_read":0.55},"canonical_model_id":"openai/gpt-5.5"},"global.anthropic.claude-opus-4-6-v1":{"id":"global.anthropic.claude-opus-4-6-v1","name":"Claude Opus 4.6 (Global)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"openai.gpt-oss-120b":{"id":"openai.gpt-oss-120b","name":"gpt-oss-120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/v1","shape":"responses"},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"us.amazon.nova-premier-v1:0":{"id":"us.amazon.nova-premier-v1:0","name":"Nova Premier (US)","description":"Multimodal model for complex analysis, long-context understanding, tool use, and model distillation","family":"nova","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2025-04-30","last_updated":"2025-04-30","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":10000},"status":"deprecated","cost":{"input":2.5,"output":12.5,"cache_read":0.625,"cache_write":2.5},"canonical_model_id":"amazon/nova-premier"},"nvidia.nemotron-super-3-120b":{"id":"nvidia.nemotron-super-3-120b","name":"NVIDIA Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.15,"output":0.65},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"openai.gpt-oss-20b-1:0":{"id":"openai.gpt-oss-20b-1:0","name":"gpt-oss-20b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":128000},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"eu.anthropic.claude-opus-4-7":{"id":"eu.anthropic.claude-opus-4-7","name":"Claude Opus 4.7 (EU)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"au.anthropic.claude-sonnet-5-5":{"id":"au.anthropic.claude-sonnet-5-5","name":"Claude Sonnet 5.5 (AU)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.11,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"openai.gpt-6-astra":{"id":"openai.gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":66,"output":330,"cache_read":6.6,"cache_write":82.5},"provider":{"body":{"service_tier":"ultrafast"}}}}},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75,"tiers":[{"input":22,"output":82.5,"cache_read":2.2,"cache_write":27.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":22,"output":82.5,"cache_read":2.2,"cache_write":27.5}},"canonical_model_id":"openai/gpt-6-astra"},"au.anthropic.claude-opus-4-8":{"id":"au.anthropic.claude-opus-4-8","name":"Claude Opus 4.8 (AU)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-8"},"jp.anthropic.claude-sonnet-4-6":{"id":"jp.anthropic.claude-sonnet-4-6","name":"Claude Sonnet 4.6 (JP)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"us.mistral.pixtral-large-2502-v1:0":{"id":"us.mistral.pixtral-large-2502-v1:0","name":"Pixtral Large (25.02) (US)","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-2502"},"openai.gpt-5.6-luna":{"id":"openai.gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":0.22,"output":1.32,"cache_read":0.022,"cache_write":0.275,"tiers":[{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55}},"canonical_model_id":"openai/gpt-5.6-luna"},"global.moonshotai.kimi-k3.1":{"id":"global.moonshotai.kimi-k3.1","name":"Kimi K3.1 Pro Highspeed (Global)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"us.anthropic.claude-opus-4-7":{"id":"us.anthropic.claude-opus-4-7","name":"Claude Opus 4.7 (US)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"openai.gpt-6-luna":{"id":"openai.gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.22,"output":0.825,"cache_read":0.022,"cache_write":0.275,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.22,"output":0.825,"cache_read":0.022,"cache_write":0.275}},"canonical_model_id":"openai/gpt-6-luna"},"xai.grok-4.6":{"id":"xai.grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":2.2,"output":6.6,"cache_read":0.55},"canonical_model_id":"xai/grok-4.6"},"google.gemma-3-27b-it":{"id":"google.gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.23,"output":0.38},"canonical_model_id":"google/gemma-3-27b-it"},"global.openai.gpt-6-sol":{"id":"global.openai.gpt-6-sol","name":"GPT-6 Sol (Global)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"mistral.devstral-2-123b":{"id":"mistral.devstral-2-123b","name":"Devstral 2 123B","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"status":"deprecated","cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/devstral-2512"},"in.openai.gpt-5.6-luna":{"id":"in.openai.gpt-5.6-luna","name":"GPT-5.6 Luna (India)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.22,"output":1.32,"cache_read":0.022,"cache_write":0.275,"tiers":[{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55}},"canonical_model_id":"openai/gpt-5.6-luna"},"mistral.ministral-3-8b-instruct":{"id":"mistral.ministral-3-8b-instruct","name":"Ministral 3 8B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.15,"output":0.15},"canonical_model_id":"mistral/ministral-3-8b-instruct-2512"},"nvidia.nemotron-nano-12b-v2":{"id":"nvidia.nemotron-nano-12b-v2","name":"NVIDIA Nemotron Nano 12B v2 VL BF16","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-28","last_updated":"2025-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.2,"output":0.6},"canonical_model_id":"nvidia/nemotron-nano-12b-v2-vl"},"global.anthropic.claude-opus-4-7":{"id":"global.anthropic.claude-opus-4-7","name":"Claude Opus 4.7 (Global)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"openai.gpt-5.6-terra":{"id":"openai.gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":2.2,"output":13.2,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-5.6-terra"},"qwen.qwen3-coder-480b-a35b-v1:0":{"id":"qwen.qwen3-coder-480b-a35b-v1:0","name":"Qwen3-Coder 480B-A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-09-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"status":"deprecated","cost":{"input":0.45,"output":1.8},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"mistral.ministral-3-14b-instruct":{"id":"mistral.ministral-3-14b-instruct","name":"Ministral 14B 3.0","description":"Open vision-language model for efficient local deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"minimax.minimax-m2.5":{"id":"minimax.minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":98304},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.5"},"global.moonshotai.kimi-k3":{"id":"global.moonshotai.kimi-k3","name":"Kimi K3 (Global)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"moonshotai/kimi-k3"},"in.openai.gpt-5.6-terra":{"id":"in.openai.gpt-5.6-terra","name":"GPT-5.6 Terra (India)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2,"output":13.2,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-5.6-terra"},"us.meta.llama3-3-70b-instruct-v1:0":{"id":"us.meta.llama3-3-70b-instruct-v1:0","name":"Llama 3.3 70B Instruct (US)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"us.writer.palmyra-x5-v1:0":{"id":"us.writer.palmyra-x5-v1:0","name":"Palmyra X5 (US)","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"palmyra","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"input":1040000,"output":8192},"status":"deprecated","cost":{"input":0.6,"output":6},"canonical_model_id":"writer/palmyra-x5"},"qwen.qwen3-32b-v1:0":{"id":"qwen.qwen3-32b-v1:0","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-09-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-32b"},"xai.grok-4.3":{"id":"xai.grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-06-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"mistral.ministral-3-3b-instruct":{"id":"mistral.ministral-3-3b-instruct","name":"Ministral 3 3B","description":"Compact open vision-language model for edge deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"mistral/ministral-3-3b-instruct-2512"},"anthropic.claude-opus-4-6-v1":{"id":"anthropic.claude-opus-4-6-v1","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-6"},"in.anthropic.claude-sonnet-5":{"id":"in.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (India)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"global.openai.gpt-6-astra":{"id":"global.openai.gpt-6-astra","name":"GPT-6 Astra (Global)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":60,"output":300,"cache_read":6,"cache_write":75},"provider":{"body":{"additionalModelRequestFields":{"service_tier":"ultrafast"}}}}}},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"eu.anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"eu.anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5 (EU)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"global.anthropic.claude-opus-5":{"id":"global.anthropic.claude-opus-5","name":"Claude Opus 5 (Global)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"us.openai.gpt-5.6-terra":{"id":"us.openai.gpt-5.6-terra","name":"GPT-5.6 Terra (US)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2,"output":13.2,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-5.6-terra"},"jp.amazon.nova-2-lite-v1:0":{"id":"jp.amazon.nova-2-lite-v1:0","name":"Nova 2 Lite (JP)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.396,"output":3.311,"cache_read":0.099,"cache_write":0.396},"canonical_model_id":"amazon/nova-2-lite"},"meta.llama3-1-8b-instruct-v1:0":{"id":"meta.llama3-1-8b-instruct-v1:0","name":"Llama 3.1 8B Instruct","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.22,"output":0.22},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"apac.amazon.nova-micro-v1:0":{"id":"apac.amazon.nova-micro-v1:0","name":"Nova Micro (APAC)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.037,"output":0.148,"cache_read":0.00925,"cache_write":0.037},"canonical_model_id":"amazon/nova-micro"},"eu.anthropic.claude-fable-5":{"id":"eu.anthropic.claude-fable-5","name":"Claude Fable 5 (EU)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"us.anthropic.claude-opus-5":{"id":"us.anthropic.claude-opus-5","name":"Claude Opus 5 (US)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"us.anthropic.claude-sonnet-4-20250514-v1:0":{"id":"us.anthropic.claude-sonnet-4-20250514-v1:0","name":"Claude Sonnet 4 (US)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"us.amazon.nova-micro-v1:0":{"id":"us.amazon.nova-micro-v1:0","name":"Nova Micro (US)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.035,"output":0.14,"cache_read":0.00875,"cache_write":0.035},"canonical_model_id":"amazon/nova-micro"},"jp.anthropic.claude-opus-5":{"id":"jp.anthropic.claude-opus-5","name":"Claude Opus 5 (JP)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic.claude-sonnet-5":{"id":"anthropic.claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic.claude-opus-4-8":{"id":"anthropic.claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"au.anthropic.claude-opus-5":{"id":"au.anthropic.claude-opus-5","name":"Claude Opus 5 (AU)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"us.anthropic.claude-fable-5-1":{"id":"us.anthropic.claude-fable-5-1","name":"Claude Fable 5.1 (US)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":0.275,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5-1"},"in.anthropic.claude-opus-5":{"id":"in.anthropic.claude-opus-5","name":"Claude Opus 5 (India)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"global.xai.grok-4.6":{"id":"global.xai.grok-4.6","name":"Grok 4.6 (Global)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"us.moonshotai.kimi-k3":{"id":"us.moonshotai.kimi-k3","name":"Kimi K3 (US)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"moonshotai/kimi-k3"},"au.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"au.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (AU)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"us.moonshotai.kimi-k3.1":{"id":"us.moonshotai.kimi-k3.1","name":"Kimi K3.1 Pro Highspeed (US)","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"qwen.qwen3-coder-30b-a3b-v1:0":{"id":"qwen.qwen3-coder-30b-a3b-v1:0","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-09-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"status":"deprecated","cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"au.anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"au.anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5 (AU)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"nvidia.nemotron-nano-3-30b":{"id":"nvidia.nemotron-nano-3-30b","name":"NVIDIA Nemotron Nano 3 30B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.06,"output":0.24},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"global.anthropic.claude-fable-5":{"id":"global.anthropic.claude-fable-5","name":"Claude Fable 5 (Global)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"writer.palmyra-x5-v1:0":{"id":"writer.palmyra-x5-v1:0","name":"Palmyra X5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"palmyra","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"input":1040000,"output":8192},"status":"deprecated","cost":{"input":0.6,"output":6},"canonical_model_id":"writer/palmyra-x5"},"eu.anthropic.claude-opus-4-5-20251101-v1:0":{"id":"eu.anthropic.claude-opus-4-5-20251101-v1:0","name":"Claude Opus 4.5 (EU)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic.claude-fable-5":{"id":"anthropic.claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"google.gemma-3-12b-it":{"id":"google.gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.09,"output":0.29},"canonical_model_id":"google/gemma-3-12b-it"},"us.anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"us.anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5 (US)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"us.meta.llama3-1-8b-instruct-v1:0":{"id":"us.meta.llama3-1-8b-instruct-v1:0","name":"Llama 3.1 8B Instruct (US)","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.22,"output":0.22},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"anthropic.claude-fable-5-1":{"id":"anthropic.claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"meta.llama4-maverick-17b-instruct-v1:0":{"id":"meta.llama4-maverick-17b-instruct-v1:0","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":8192},"status":"deprecated","cost":{"input":0.24,"output":0.97},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"mistral.pixtral-large-2502-v1:0":{"id":"mistral.pixtral-large-2502-v1:0","name":"Pixtral Large (25.02)","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-2502"},"writer.palmyra-x4-v1:0":{"id":"writer.palmyra-x4-v1:0","name":"Palmyra X4","description":"Enterprise language model for workflow automation, coding, data analysis, and tool use","family":"palmyra","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-10-09","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":122880,"output":8192},"status":"deprecated","cost":{"input":2.5,"output":10},"canonical_model_id":"writer/palmyra-x4"},"us.zai.glm-5.3":{"id":"us.zai.glm-5.3","name":"GLM-5.3 (US)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.848,"output":5.808,"cache_read":0.3432,"cache_write":2.31},"canonical_model_id":"zhipuai/glm-5.3"},"au.anthropic.claude-opus-4-7":{"id":"au.anthropic.claude-opus-4-7","name":"Claude Opus 4.7 (AU)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"openai.gpt-6-sol":{"id":"openai.gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":16.5,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":16.5,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-6-sol"},"us.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"us.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (US)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"us.anthropic.claude-haiku-5-5":{"id":"us.anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5 (US)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.55,"output":2.75,"cache_read":0.055,"cache_write":0.6875,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"apac.amazon.nova-lite-v1:0":{"id":"apac.amazon.nova-lite-v1:0","name":"Nova Lite (APAC)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.063,"output":0.252,"cache_read":0.01575,"cache_write":0.063},"canonical_model_id":"amazon/nova-lite"},"openai.gpt-oss-20b":{"id":"openai.gpt-oss-20b","name":"gpt-oss-20b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/v1","shape":"responses"},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"global.openai.gpt-5.6-sol":{"id":"global.openai.gpt-5.6-sol","name":"GPT-5.6 Sol (Global)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"meta.llama3-3-70b-instruct-v1:0":{"id":"meta.llama3-3-70b-instruct-v1:0","name":"Llama 3.3 70B Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"us.amazon.nova-lite-v1:0":{"id":"us.amazon.nova-lite-v1:0","name":"Nova Lite (US)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.06,"output":0.24,"cache_read":0.015,"cache_write":0.06},"canonical_model_id":"amazon/nova-lite"},"minimax.minimax-m2.1":{"id":"minimax.minimax-m2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.1"},"au.anthropic.claude-opus-5-5":{"id":"au.anthropic.claude-opus-5-5","name":"Claude Opus 5.5 (AU)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic.claude-opus-5":{"id":"anthropic.claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"us.openai.gpt-5.6-luna":{"id":"us.openai.gpt-5.6-luna","name":"GPT-5.6 Luna (US)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.22,"output":1.32,"cache_read":0.022,"cache_write":0.275,"tiers":[{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55}},"canonical_model_id":"openai/gpt-5.6-luna"},"us.openai.gpt-6-luna":{"id":"us.openai.gpt-6-luna","name":"GPT-6 Luna (US)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.22,"output":0.825,"cache_read":0.022,"cache_write":0.275,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.22,"output":0.825,"cache_read":0.022,"cache_write":0.275}},"canonical_model_id":"openai/gpt-6-luna"},"nvidia.nemotron-nano-9b-v2":{"id":"nvidia.nemotron-nano-9b-v2","name":"NVIDIA Nemotron Nano 9B v2","description":"Compact Nemotron model for efficient reasoning and deployable AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09","release_date":"2025-08-18","last_updated":"2025-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.06,"output":0.23},"canonical_model_id":"nvidia/nemotron-nano-9b-v2"},"au.anthropic.claude-sonnet-5":{"id":"au.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (AU)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"moonshot.kimi-k2-thinking":{"id":"moonshot.kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16000},"status":"deprecated","cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"google.gemma-3-4b-it":{"id":"google.gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"status":"deprecated","cost":{"input":0.04,"output":0.08},"canonical_model_id":"google/gemma-3-4b-it"},"au.anthropic.claude-sonnet-4-6":{"id":"au.anthropic.claude-sonnet-4-6","name":"AU Anthropic Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"us.writer.palmyra-x4-v1:0":{"id":"us.writer.palmyra-x4-v1:0","name":"Palmyra X4 (US)","description":"Enterprise language model for workflow automation, coding, data analysis, and tool use","family":"palmyra","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-10-09","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":122880,"output":8192},"status":"deprecated","cost":{"input":2.5,"output":10},"canonical_model_id":"writer/palmyra-x4"},"eu.amazon.nova-micro-v1:0":{"id":"eu.amazon.nova-micro-v1:0","name":"Nova Micro (EU)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.04,"output":0.16,"cache_read":0.01,"cache_write":0.04},"canonical_model_id":"amazon/nova-micro"},"meta.llama3-1-70b-instruct-v1:0":{"id":"meta.llama3-1-70b-instruct-v1:0","name":"Llama 3.1 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"global.anthropic.claude-opus-4-8":{"id":"global.anthropic.claude-opus-4-8","name":"Claude Opus 4.8 (Global)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"apac.amazon.nova-pro-v1:0":{"id":"apac.amazon.nova-pro-v1:0","name":"Nova Pro (APAC)","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.84,"output":3.36,"cache_read":0.21,"cache_write":0.84},"canonical_model_id":"amazon/nova-pro"},"mistral.voxtral-mini-3b-2507":{"id":"mistral.voxtral-mini-3b-2507","name":"Voxtral Mini 3B 2507","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":4096},"status":"deprecated","cost":{"input":0.04,"output":0.04},"canonical_model_id":"mistral/voxtral-mini-3b-2507"},"us.anthropic.claude-opus-5-5":{"id":"us.anthropic.claude-opus-5-5","name":"Claude Opus 5.5 (US)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"us.anthropic.claude-fable-5":{"id":"us.anthropic.claude-fable-5","name":"Claude Fable 5 (US)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"us.amazon.nova-pro-v1:0":{"id":"us.amazon.nova-pro-v1:0","name":"Nova Pro (US)","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.8,"output":3.2,"cache_read":0.2,"cache_write":0.8},"canonical_model_id":"amazon/nova-pro"},"anthropic.claude-opus-4-5-20251101-v1:0":{"id":"anthropic.claude-opus-4-5-20251101-v1:0","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic.claude-haiku-5-5":{"id":"anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"mistral.voxtral-small-24b-2507":{"id":"mistral.voxtral-small-24b-2507","name":"Voxtral Small 24B 2507","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"status":"deprecated","cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"global.openai.gpt-5.6-terra":{"id":"global.openai.gpt-5.6-terra","name":"GPT-5.6 Terra (Global)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"eu.anthropic.claude-sonnet-4-20250514-v1:0":{"id":"eu.anthropic.claude-sonnet-4-20250514-v1:0","name":"Claude Sonnet 4 (EU)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"anthropic.claude-opus-5-5":{"id":"anthropic.claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"global.openai.gpt-6-luna":{"id":"global.openai.gpt-6-luna","name":"GPT-6 Luna (Global)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"eu.anthropic.claude-sonnet-5-5":{"id":"eu.anthropic.claude-sonnet-5-5","name":"Claude Sonnet 5.5 (EU)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.11,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"jp.anthropic.claude-opus-4-8":{"id":"jp.anthropic.claude-opus-4-8","name":"Claude Opus 4.8 (JP)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-8"},"us-gov.openai.gpt-oss-120b-1:0":{"id":"us-gov.openai.gpt-oss-120b-1:0","name":"gpt-oss-120b (GovCloud)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.18,"output":0.72},"canonical_model_id":"openai/gpt-oss-120b"},"google.gemma-4-26b-a4b":{"id":"google.gemma-4-26b-a4b","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":0.13,"output":0.4},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"us.openai.gpt-6-sol":{"id":"us.openai.gpt-6-sol","name":"GPT-6 Sol (US)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":16.5,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":16.5,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-6-sol"},"global.openai.gpt-6.1-sol":{"id":"global.openai.gpt-6.1-sol","name":"GPT-6.1 Sol (Global)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":12,"output":60,"cache_read":0.6,"cache_write":15},"provider":{"body":{"additionalModelRequestFields":{"service_tier":"ultrafast"}}}}}},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"us.anthropic.claude-opus-4-6-v1":{"id":"us.anthropic.claude-opus-4-6-v1","name":"Claude Opus 4.6 (US)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-6"},"eu.anthropic.claude-sonnet-4-6":{"id":"eu.anthropic.claude-sonnet-4-6","name":"Claude Sonnet 4.6 (EU)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"us.openai.gpt-6-astra":{"id":"us.openai.gpt-6-astra","name":"GPT-6 Astra (US)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":66,"output":330,"cache_read":6.6,"cache_write":82.5},"provider":{"body":{"additionalModelRequestFields":{"service_tier":"ultrafast"}}}}}},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75,"tiers":[{"input":22,"output":82.5,"cache_read":2.2,"cache_write":27.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":22,"output":82.5,"cache_read":2.2,"cache_write":27.5}},"canonical_model_id":"openai/gpt-6-astra"},"anthropic.claude-sonnet-5-5":{"id":"anthropic.claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"global.anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"global.anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5 (Global)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"global.anthropic.claude-sonnet-5-5":{"id":"global.anthropic.claude-sonnet-5-5","name":"Claude Sonnet 5.5 (Global)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"global.anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"global.anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5 (Global)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"qwen.qwen3-235b-a22b-2507-v1:0":{"id":"qwen.qwen3-235b-a22b-2507-v1:0","name":"Qwen3 235B-A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-09-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.22,"output":0.88},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"us.anthropic.claude-opus-4-1-20250805-v1:0":{"id":"us.anthropic.claude-opus-4-1-20250805-v1:0","name":"Claude Opus 4.1 (US)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"deepseek.v3.2":{"id":"deepseek.v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2026-02-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":81920},"cost":{"input":0.62,"output":1.85},"canonical_model_id":"deepseek/deepseek-v3.2"},"eu.amazon.nova-pro-v1:0":{"id":"eu.amazon.nova-pro-v1:0","name":"Nova Pro (EU)","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.92,"output":3.68,"cache_read":0.23,"cache_write":0.92},"canonical_model_id":"amazon/nova-pro"},"eu.anthropic.claude-opus-5":{"id":"eu.anthropic.claude-opus-5","name":"Claude Opus 5 (EU)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"jp.anthropic.claude-sonnet-5":{"id":"jp.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (JP)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"eu.amazon.nova-2-lite-v1:0":{"id":"eu.amazon.nova-2-lite-v1:0","name":"Nova 2 Lite (EU)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.374,"output":3.157,"cache_read":0.0935,"cache_write":0.374},"canonical_model_id":"amazon/nova-2-lite"},"us.anthropic.claude-sonnet-4-6":{"id":"us.anthropic.claude-sonnet-4-6","name":"Claude Sonnet 4.6 (US)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"us-gov.openai.gpt-oss-20b-1:0":{"id":"us-gov.openai.gpt-oss-20b-1:0","name":"gpt-oss-20b (GovCloud)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.084,"output":0.36},"canonical_model_id":"openai/gpt-oss-20b"},"ca.amazon.nova-lite-v1:0":{"id":"ca.amazon.nova-lite-v1:0","name":"Nova Lite (CA)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.064,"output":0.256,"cache_read":0.016,"cache_write":0.064},"canonical_model_id":"amazon/nova-lite"},"amazon.nova-lite-v1:0":{"id":"amazon.nova-lite-v1:0","name":"Nova Lite","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.06,"output":0.24,"cache_read":0.015,"cache_write":0.06},"canonical_model_id":"amazon/nova-lite"},"jp.anthropic.claude-opus-5-5":{"id":"jp.anthropic.claude-opus-5-5","name":"Claude Opus 5.5 (JP)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"jp.anthropic.claude-sonnet-4-5-20250929-v1:0":{"id":"jp.anthropic.claude-sonnet-4-5-20250929-v1:0","name":"Claude Sonnet 4.5 (JP)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"eu.amazon.nova-lite-v1:0":{"id":"eu.amazon.nova-lite-v1:0","name":"Nova Lite (EU)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.069,"output":0.276,"cache_read":0.01725,"cache_write":0.069},"canonical_model_id":"amazon/nova-lite"},"us.meta.llama3-1-70b-instruct-v1:0":{"id":"us.meta.llama3-1-70b-instruct-v1:0","name":"Llama 3.1 70B Instruct (US)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"au.anthropic.claude-opus-4-6-v1":{"id":"au.anthropic.claude-opus-4-6-v1","name":"AU Anthropic Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-6"},"moonshotai.kimi-k2.5":{"id":"moonshotai.kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-02-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"us.amazon.nova-2-lite-v1:0":{"id":"us.amazon.nova-2-lite-v1:0","name":"Nova 2 Lite (US)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.33,"output":2.75,"cache_read":0.0825,"cache_write":0.33},"canonical_model_id":"amazon/nova-2-lite"},"google.gemma-4-31b":{"id":"google.gemma-4-31b","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"au.anthropic.claude-haiku-5-5":{"id":"au.anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5 (AU)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.011,"cache_write":0.1375,"tiers":[{"input":0.55,"output":2.75,"cache_read":0.055,"cache_write":0.6875,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic.claude-sonnet-4-6":{"id":"anthropic.claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"deepseek.v3-v1:0":{"id":"deepseek.v3-v1:0","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-09-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":81920},"status":"deprecated","cost":{"input":0.58,"output":1.68},"canonical_model_id":"deepseek/deepseek-v3.1"},"us.anthropic.claude-opus-4-5-20251101-v1:0":{"id":"us.anthropic.claude-opus-4-5-20251101-v1:0","name":"Claude Opus 4.5 (US)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"us.anthropic.claude-sonnet-5-5":{"id":"us.anthropic.claude-sonnet-5-5","name":"Claude Sonnet 5.5 (US)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.11,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"mistral.mistral-large-3-675b-instruct":{"id":"mistral.mistral-large-3-675b-instruct","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"openai.gpt-5.6-sol":{"id":"openai.gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":4.4,"output":22,"cache_read":0.44,"cache_write":5.5,"tiers":[{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11}},"canonical_model_id":"openai/gpt-5.6-sol"},"jp.anthropic.claude-opus-4-7":{"id":"jp.anthropic.claude-opus-4-7","name":"Claude Opus 4.7 (JP)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"global.anthropic.claude-opus-5-5":{"id":"global.anthropic.claude-opus-5-5","name":"Claude Opus 5.5 (Global)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"us.anthropic.claude-sonnet-5":{"id":"us.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (US)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"openai.gpt-6.1-sol":{"id":"openai.gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":13.2,"output":66,"cache_read":0.66,"cache_write":16.5},"provider":{"body":{"service_tier":"ultrafast"}}}}},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":2.2,"output":11,"cache_read":0.11,"cache_write":2.75,"tiers":[{"input":4.4,"output":16.5,"cache_read":0.22,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":16.5,"cache_read":0.22,"cache_write":5.5}},"canonical_model_id":"openai/gpt-6.1-sol"},"amazon.nova-2-lite-v1:0":{"id":"amazon.nova-2-lite-v1:0","name":"Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.33,"output":2.75,"cache_read":0.0825,"cache_write":0.33},"canonical_model_id":"amazon/nova-2-lite"},"qwen.qwen3-next-80b-a3b":{"id":"qwen.qwen3-next-80b-a3b","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-11","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262000},"cost":{"input":0.15,"output":1.2},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"apac.anthropic.claude-sonnet-4-20250514-v1:0":{"id":"apac.anthropic.claude-sonnet-4-20250514-v1:0","name":"Claude Sonnet 4 (APAC)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"mistral.magistral-small-2509":{"id":"mistral.magistral-small-2509","name":"Magistral Small 1.2","description":"Open multimodal reasoning model for transparent analysis of text and images","family":"magistral","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-18","last_updated":"2025-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":40000},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/magistral-small-2509"},"amazon.nova-micro-v1:0":{"id":"amazon.nova-micro-v1:0","name":"Nova Micro","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.035,"output":0.14,"cache_read":0.00875,"cache_write":0.035},"canonical_model_id":"amazon/nova-micro"},"us.openai.gpt-5.6-sol":{"id":"us.openai.gpt-5.6-sol","name":"GPT-5.6 Sol (US)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.44,"cache_write":5.5,"tiers":[{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11}},"canonical_model_id":"openai/gpt-5.6-sol"},"global.openai.gpt-6.1-terra":{"id":"global.openai.gpt-6.1-terra","name":"GPT-6.1 Terra (Global)","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"anthropic.claude-haiku-4-5-20251001-v1:0":{"id":"anthropic.claude-haiku-4-5-20251001-v1:0","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"zai.glm-4.7":{"id":"zai.glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.7"},"anthropic.claude-fable-5-2":{"id":"anthropic.claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"global.anthropic.claude-fable-5-2":{"id":"global.anthropic.claude-fable-5-2","name":"Claude Fable 5.2 (Global)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"eu.mistral.pixtral-large-2502-v1:0":{"id":"eu.mistral.pixtral-large-2502-v1:0","name":"Pixtral Large (25.02) (EU)","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-2502"},"us.openai.gpt-6.1-terra":{"id":"us.openai.gpt-6.1-terra","name":"GPT-6.1 Terra (US)","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1.1,"output":5.5,"cache_read":0.055,"cache_write":1.375,"tiers":[{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75}},"canonical_model_id":"openai/gpt-6.1-terra"},"global.anthropic.claude-haiku-5-5":{"id":"global.anthropic.claude-haiku-5-5","name":"Claude Haiku 5.5 (Global)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"eu.anthropic.claude-opus-4-6-v1":{"id":"eu.anthropic.claude-opus-4-6-v1","name":"Claude Opus 4.6 (EU)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-6"},"us.deepseek.r1-v1:0":{"id":"us.deepseek.r1-v1:0","name":"DeepSeek-R1 (US)","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":1.35,"output":5.4},"canonical_model_id":"deepseek/deepseek-r1"},"global.zai.glm-5.3":{"id":"global.zai.glm-5.3","name":"GLM-5.3 (Global)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.68,"output":5.28,"cache_read":0.312,"cache_write":2.1},"canonical_model_id":"zhipuai/glm-5.3"},"us.openai.gpt-6.1-sol":{"id":"us.openai.gpt-6.1-sol","name":"GPT-6.1 Sol (US)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"ultrafast":{"cost":{"input":13.2,"output":66,"cache_read":0.66,"cache_write":16.5},"provider":{"body":{"additionalModelRequestFields":{"service_tier":"ultrafast"}}}}}},"cost":{"input":2.2,"output":11,"cache_read":0.11,"cache_write":2.75,"tiers":[{"input":4.4,"output":16.5,"cache_read":0.22,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":16.5,"cache_read":0.22,"cache_write":5.5}},"canonical_model_id":"openai/gpt-6.1-sol"},"us.anthropic.claude-fable-5-2":{"id":"us.anthropic.claude-fable-5-2","name":"Claude Fable 5.2 (US)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8.8,"output":44,"cache_read":0.22,"cache_write":11},"canonical_model_id":"anthropic/claude-fable-5-2"},"zai.glm-5":{"id":"zai.glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1,"output":3.2},"canonical_model_id":"zhipuai/glm-5"},"eu.anthropic.claude-sonnet-5":{"id":"eu.anthropic.claude-sonnet-5","name":"Claude Sonnet 5 (EU)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"global.anthropic.claude-opus-4-5-20251101-v1:0":{"id":"global.anthropic.claude-opus-4-5-20251101-v1:0","name":"Claude Opus 4.5 (Global)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"minimax.minimax-m2":{"id":"minimax.minimax-m2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204608,"output":128000},"status":"deprecated","cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2"},"openai.gpt-oss-120b-1:0":{"id":"openai.gpt-oss-120b-1:0","name":"gpt-oss-120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":128000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"global.anthropic.claude-sonnet-4-6":{"id":"global.anthropic.claude-sonnet-4-6","name":"Claude Sonnet 4.6 (Global)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"google.gemma-4-e2b":{"id":"google.gemma-4-e2b","name":"Gemma 4 E2B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"provider":{"npm":"@ai-sdk/amazon-bedrock/mantle","api":"https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1","shape":"responses"},"cost":{"input":0.04,"output":0.08},"canonical_model_id":"google/gemma-4-E2B-it"},"openai.gpt-oss-safeguard-120b":{"id":"openai.gpt-oss-safeguard-120b","name":"GPT OSS Safeguard 120B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"openai.gpt-oss-safeguard-20b":{"id":"openai.gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.07,"output":0.2},"canonical_model_id":"openai/gpt-oss-safeguard-20b"}}},"vispark":{"id":"vispark","env":["VISPARK_LAB_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.lab.vispark.in/v1","name":"Vispark","doc":"https://lab.vispark.in/#vision","models":{"vispark/vision-small":{"id":"vispark/vision-small","name":"Vision Small","description":"Fast, low-cost multimodal model for understanding text, images, audio, video, and PDFs, with tool calling and a 1M-token context window.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-05-15","last_updated":"2026-09","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.05,"output":3.16},"canonical_model_id":"vispark/vision-small"},"vispark/vision-medium":{"id":"vispark/vision-medium","name":"Vision Medium","description":"Balanced multimodal model pairing a 1M-token context window with deeper reasoning for analysis, content creation, and tool use across text, image, audio, video, and PDF inputs.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-05-15","last_updated":"2026-09","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":4.21,"output":12.63},"canonical_model_id":"vispark/vision-medium"},"vispark/vision-large":{"id":"vispark/vision-large","name":"Vision Large","description":"Most capable Vision model for complex reasoning, detailed media analysis, and structured output over a 1M-token context window.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-05-15","last_updated":"2026-09","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":7.37,"output":22.11},"canonical_model_id":"vispark/vision-large"}}},"snowflake-cortex":{"id":"snowflake-cortex","env":["SNOWFLAKE_ACCOUNT","SNOWFLAKE_CORTEX_PAT"],"npm":"@ai-sdk/openai-compatible","api":"https://${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com/api/v2/cortex/v1","name":"Snowflake Cortex","doc":"https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-rest-api","models":{"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"openai-gpt-5-nano":{"id":"openai-gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"input":272000,"output":8192},"cost":{"input":0.06,"output":0.44,"cache_read":0.01},"canonical_model_id":"openai/gpt-5-nano"},"openai-gpt-5":{"id":"openai-gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"input":272000,"output":8192},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5"},"openai-gpt-5.4":{"id":"openai-gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai-gpt-5.5":{"id":"openai-gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"beta","cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"openai-gpt-5-mini":{"id":"openai-gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"input":272000,"output":8192},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5-mini"},"deepseek-r1":{"id":"deepseek-r1","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"canonical_model_id":"deepseek/deepseek-r1"},"openai-gpt-4.1":{"id":"openai-gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"beta","cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"snowflake-llama3.3-70b":{"id":"snowflake-llama3.3-70b","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"openai-gpt-5.6-terra":{"id":"openai-gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai-gpt-5.1":{"id":"openai-gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"input":272000,"output":8192},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"openai-gpt-5.6-sol":{"id":"openai-gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai-gpt-5.6-luna":{"id":"openai-gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"mistral-large2":{"id":"mistral-large2","name":"Mistral Large 2407","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/mistral-large-2407"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"openai-gpt-5.2":{"id":"openai-gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.18},"canonical_model_id":"openai/gpt-5.2"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.1-pro":{"id":"gemini-3.1-pro","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"beta","canonical_model_id":"google/gemini-3.1-pro-preview"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"munito-eu":{"id":"munito-eu","env":["MUNITO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.eu.munito.ai/inference/v1","name":"Munito AI (EU)","doc":"https://docs.munito.ai/regions","models":{"aleph-alpha/kolibri-1":{"id":"aleph-alpha/kolibri-1","name":"Kolibri 1","description":"Aleph Alpha's German and English mixture-of-experts reasoning model (78B total, 3.46B active) for chat, RAG and agents","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-18","release_date":"2026-10-03","last_updated":"2026-10-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.16,"output":0.56,"cache_read":0.094},"canonical_model_id":"aleph-alpha/kolibri-1"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.2,"output":2.7,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3.8-27b"},"deepseek-ai/deepseek-v4-flash":{"id":"deepseek-ai/deepseek-v4-flash","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.11,"output":0.28,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"zai-org/glm-5.3-flash":{"id":"zai-org/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"melious":{"id":"melious","env":["MELIOUS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.melious.ai/v1","name":"Melious","doc":"https://melious.ai/docs/reference/models","models":{"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.669,"output":4.014,"cache_read":0.16725},"canonical_model_id":"moonshotai/kimi-k2.6"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3.17775,"output":15.88875,"cache_read":0.79165},"canonical_model_id":"moonshotai/kimi-k3"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.223,"output":1.115,"cache_read":0.01115},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.115,"output":3.345,"cache_read":0.223},"canonical_model_id":"zhipuai/glm-5.3"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.61325,"output":3.28925,"cache_read":0.16725},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1115,"output":0.446,"cache_read":0.0223},"canonical_model_id":"zhipuai/glm-5.3-flash"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.1115,"output":0.27875,"cache_read":0.0223},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3345,"output":1.338,"cache_read":0.03345},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"togetherai":{"id":"togetherai","env":["TOGETHER_API_KEY"],"npm":"@ai-sdk/togetherai","name":"Together AI","doc":"https://docs.together.ai/docs/serverless-models","models":{"meta-models/Muse-Spark-Open-816B-A42B":{"id":"meta-models/Muse-Spark-Open-816B-A42B","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":524288},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V3-1":{"id":"deepseek-ai/DeepSeek-V3-1","name":"DeepSeek V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":0.6,"output":1.7},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"DeepSeek-V3","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":1.25,"output":1.25},"canonical_model_id":"deepseek/deepseek-v3"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163839,"output":163839},"status":"deprecated","cost":{"input":3,"output":7},"canonical_model_id":"deepseek/deepseek-r1"},"LiquidAI/LFM2-24B-A2B":{"id":"LiquidAI/LFM2-24B-A2B","name":"LFM2-24B-A2B","description":"Efficient open Liquid MoE instruct model for on-device chat and tool calling","family":"liquid","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.03,"output":0.12},"canonical_model_id":"liquid/lfm2-24b-a2b"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K3.1-Pro":{"id":"moonshotai/Kimi-K3.1-Pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":131072},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"reflection/Beam-1.0-501B-A23B":{"id":"reflection/Beam-1.0-501B-A23B","name":"Beam 1.0 501B A23B","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.4,"output":1.2,"cache_read":0.04},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"meta-llama/Llama-3.3-70B-Instruct-Turbo":{"id":"meta-llama/Llama-3.3-70B-Instruct-Turbo","name":"Llama 3.3 70B","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":1.04,"output":1.04},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5 397B A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":130000},"status":"deprecated","cost":{"input":0.6,"output":3.6,"cache_read":0.35},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3-Coder-Next-FP8":{"id":"Qwen/Qwen3-Coder-Next-FP8","name":"Qwen3 Coder Next FP8","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.5,"output":1.2},"canonical_model_id":"alibaba/qwen3-coder-next"},"Qwen/Qwen3-235B-A22B-Instruct-2507-tput":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507-tput","name":"Qwen3 235B A22B Instruct 2507 FP8","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.2,"output":0.6},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen2.5-7B-Instruct-Turbo":{"id":"Qwen/Qwen2.5-7B-Instruct-Turbo","name":"Qwen 2.5 7B Instruct Turbo","description":"Small open Qwen2.5 instruction model for chat, structured output, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.3,"output":0.3},"canonical_model_id":"alibaba/qwen2.5-7b-instruct"},"Qwen/Qwen3.6-Plus":{"id":"Qwen/Qwen3.6-Plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"alibaba/qwen3.6-plus"},"Qwen/Qwen3.7-Max":{"id":"Qwen/Qwen3.7-Max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.7-max"},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.17,"output":0.25},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8","name":"Qwen3 Coder 480B A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":2,"output":2},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":400000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":164000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":262144},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":1,"output":3.2},"canonical_model_id":"zhipuai/glm-5"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512300,"output":512300},"status":"deprecated","cost":{"input":0.6,"output":3.6,"cache_read":0.2},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/NVIDIA-Nemotron-3.5-Super-VL":{"id":"nvidia/NVIDIA-Nemotron-3.5-Super-VL","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.15,"output":0.5,"cache_read":0.02},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"essentialai/Rnj-1-Instruct":{"id":"essentialai/Rnj-1-Instruct","name":"Rnj-1 Instruct","description":"Open 8B Essential AI model for code, STEM reasoning, and agentic tool use","family":"rnj","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-12-04","last_updated":"2025-12-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.15,"output":0.15},"canonical_model_id":"essentialai/rnj-1-instruct"}}},"vivgrid":{"id":"vivgrid","env":["VIVGRID_API_KEY"],"npm":"@ai-sdk/openai","api":"https://api.vivgrid.com/v1","name":"Vivgrid","doc":"https://docs.vivgrid.com/models","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":10,"output":50,"cache_read":0.5,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":128000},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.75,"output":3.75,"cache_read":0.15},"canonical_model_id":"google/gemini-3.8-flash"},"viv-fast":{"id":"viv-fast","name":"Viv Fast","description":"Fast coding model","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-09","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":256000},"cost":{"input":0.13,"output":0.4,"cache_read":0.05},"canonical_model_id":"vivgrid/viv-fast"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":1.2,"output":4.2,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT 5.6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1.1,"output":5.5,"cache_read":0.055,"cache_write":1.375,"tiers":[{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2.2,"output":8.25,"cache_read":0.11,"cache_write":2.75}},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":1.35,"output":3,"reasoning":3,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":3,"output":12,"cache_read":0.3,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.31,"output":1.23,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":1.74,"output":3.48,"cache_read":0.14},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":1.2,"output":4.2,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":10,"output":50,"cache_read":1.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5-mini"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.44,"output":1.32,"reasoning":1.32,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"gemini-3.1-flash-lite-preview":{"id":"gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":1},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.15,"output":0.5,"cache_read":0.04},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT 5.6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":6,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.28,"output":0.42,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v3.2"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT 5.6 Terra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/openai-compatible"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"}}},"google-vertex":{"id":"google-vertex","env":["GOOGLE_VERTEX_PROJECT","GOOGLE_VERTEX_LOCATION","GOOGLE_APPLICATION_CREDENTIALS"],"npm":"@ai-sdk/google-vertex","name":"Vertex","doc":"https://cloud.google.com/vertex-ai/generative-ai/docs/models","models":{"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1}},"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":30,"cache_read":0.025},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"claude-opus-4@20250514":{"id":"claude-opus-4@20250514","name":"Claude Opus 4","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-20250514"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"gemini-2.5-flash-tts":{"id":"gemini-2.5-flash-tts","type":"speech","name":"Gemini 2.5 Flash TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gemini-flash","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-09-30","last_updated":"2025-12-10","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":32768,"input":8192,"output":16384},"cost":{"input":0.5,"output":10},"canonical_model_id":"google/gemini-2.5-flash-tts"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-carbon"},"claude-opus-5@default":{"id":"claude-opus-5@default","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"claude-sonnet-4-6@default":{"id":"claude-sonnet-4-6@default","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-fable-5-1@default":{"id":"claude-fable-5-1@default","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"mistral-small-2503":{"id":"mistral-small-2503","name":"Mistral Small 3.1 24B","description":"Efficient multimodal model for instruction following, coding, reasoning, and function calling","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"provider":{"npm":"@ai-sdk/mistral","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/publishers/mistralai/models"},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/mistral-small-3-1-24b-instruct-2503"},"gemini-2.5-pro-tts":{"id":"gemini-2.5-pro-tts","type":"speech","name":"Gemini 2.5 Pro TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gemini-pro","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-09-30","last_updated":"2025-12-10","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":32768,"input":8192,"output":16384},"cost":{"input":1,"output":20},"canonical_model_id":"google/gemini-2.5-pro-tts"},"claude-opus-4-8@default":{"id":"claude-opus-4-8@default","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-haiku-5-5@default":{"id":"claude-haiku-5-5@default","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"claude-opus-4-1@20250805":{"id":"claude-opus-4-1@20250805","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"gemini-embedding-001":{"id":"gemini-embedding-001","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":1},"cost":{"input":0.15,"output":0},"canonical_model_id":"google/gemini-embedding-001"},"claude-opus-4-6@default":{"id":"claude-opus-4-6@default","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-3.1-flash-image":{"id":"gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":60,"cache_read":0.05},"canonical_model_id":"google/gemini-3.1-flash-image"},"gemini-3.1-pro-preview-customtools":{"id":"gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"beta","cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"claude-sonnet-5@default":{"id":"claude-sonnet-5@default","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"codestral-2":{"id":"codestral-2","name":"Codestral 2","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"provider":{"npm":"@ai-sdk/mistral","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/publishers/mistralai/models"},"cost":{"input":0.3,"output":0.9},"canonical_model_id":"mistral/codestral-2508"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"beta","cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"claude-sonnet-4@20250514":{"id":"claude-sonnet-4@20250514","name":"Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"claude-opus-4-5@20251101":{"id":"claude-opus-4-5@20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"claude-fable-5@default":{"id":"claude-fable-5@default","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"claude-sonnet-4-5@20250929":{"id":"claude-sonnet-4-5@20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"beta","cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":30},"canonical_model_id":"google/gemini-2.5-flash-image"},"gemini-3-pro-image":{"id":"gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":120,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-image"},"claude-fable-5-2@default":{"id":"claude-fable-5-2@default","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":16,"output":80,"cache_read":0.4,"cache_write":20},"provider":{"body":{"speed":"fast"}}}}},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"claude-opus-5-5@default":{"id":"claude-opus-5-5@default","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-opus-4-7@default":{"id":"claude-opus-4-7@default","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-haiku-4-5@20251001":{"id":"claude-haiku-4-5@20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"mistral-medium-3":{"id":"mistral-medium-3","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"provider":{"npm":"@ai-sdk/mistral","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/publishers/mistralai/models"},"cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/mistral-medium-2505"},"claude-sonnet-5-5@default":{"id":"claude-sonnet-5-5@default","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/google-vertex/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"gemini-nano-banana-2.1":{"id":"gemini-nano-banana-2.1","type":"image","name":"Nano Banana 2.1","description":"Image model for prompt-driven generation, multi-turn editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":1.5,"output":30,"cache_read":0.15},"canonical_model_id":"google/gemini-nano-banana-2.1"},"google/gemma-4-26b-a4b-it-maas":{"id":"google/gemma-4-26b-a4b-it-maas","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"status":"alpha","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"qwen/qwen3-235b-a22b-instruct-2507-maas":{"id":"qwen/qwen3-235b-a22b-instruct-2507-maas","name":"Qwen3 235B A22B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-13","last_updated":"2025-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.22,"output":0.88}},"deepseek-ai/deepseek-v3.2-maas":{"id":"deepseek-ai/deepseek-v3.2-maas","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-12-17","last_updated":"2026-04-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.56,"output":1.68,"cache_read":0.056}},"deepseek-ai/deepseek-v3.1-maas":{"id":"deepseek-ai/deepseek-v3.1-maas","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.6,"output":1.7,"cache_read":0.06}},"moonshotai/kimi-k2-thinking-maas":{"id":"moonshotai/kimi-k2-thinking-maas","name":"Kimi K2 Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.6,"output":2.5,"cache_read":0.06}},"openai/gpt-oss-120b-maas":{"id":"openai/gpt-oss-120b-maas","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.09,"output":0.36},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-oss-20b-maas":{"id":"openai/gpt-oss-20b-maas","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.07,"output":0.25,"cache_read":0.007}},"meta/llama-3.3-70b-instruct-maas":{"id":"meta/llama-3.3-70b-instruct-maas","name":"Llama 3.3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.72,"output":0.72}},"meta/llama-4-maverick-17b-128e-instruct-maas":{"id":"meta/llama-4-maverick-17b-128e-instruct-maas","name":"Llama 4 Maverick 17B 128E Instruct","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":8192},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.35,"output":1.15}},"meta/llama-4-scout-17b-16e-instruct-maas":{"id":"meta/llama-4-scout-17b-16e-instruct-maas","name":"Llama 4 Scout 17B Instruct","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1310720,"output":8192},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.25,"output":0.7},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"zai-org/glm-4.7-maas":{"id":"zai-org/glm-4.7-maas","name":"GLM-4.7","description":"GLM model for coding, tool use, and complex reasoning","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-06","last_updated":"2026-01-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.6,"output":2.2,"cache_read":0.06}},"zai-org/glm-5-maas":{"id":"zai-org/glm-5-maas","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":1,"output":3.2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-5"},"zai-org/glm-5.2-maas":{"id":"zai-org/glm-5.2-maas","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"status":"beta","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"xai/grok-4.20-reasoning":{"id":"xai/grok-4.20-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4.1-fast-reasoning":{"id":"xai/grok-4.1-fast-reasoning","name":"Grok 4.1 Fast (Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":30000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":30000},"status":"beta","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":500000},"status":"beta","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.1-fast-non-reasoning":{"id":"xai/grok-4.1-fast-non-reasoning","name":"Grok 4.1 Fast","description":"Fast Grok model for responsive chat, tool-assisted work, and low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":30000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":500000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"xai/grok-4.20-non-reasoning":{"id":"xai/grok-4.20-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${GOOGLE_VERTEX_ENDPOINT}/v1/projects/${GOOGLE_VERTEX_PROJECT}/locations/${GOOGLE_VERTEX_LOCATION}/endpoints/openapi"},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"}}},"nebius":{"id":"nebius","env":["NEBIUS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.tokenfactory.nebius.com/v1","name":"Nebius Token Factory","doc":"https://docs.tokenfactory.nebius.com/","models":{"meta-models/muse-spark-open":{"id":"meta-models/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma-3-27b-it","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":110000,"input":100000,"output":8192},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"google/gemma-3-27b-it"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"MiniMaxAI/MiniMax-M3.1-Flash":{"id":"MiniMaxAI/MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":979000,"output":979000},"cost":{"input":1.32,"output":3.96,"cache_read":0.04},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"NousResearch/Hermes-4-405B":{"id":"NousResearch/Hermes-4-405B","name":"Hermes-4-405B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":120000,"output":8192},"cost":{"input":1,"output":3,"reasoning":3,"cache_read":1},"canonical_model_id":"nousresearch/hermes-4-405b"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":8000},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"gpt-oss-120b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"input":124000,"output":8192},"cost":{"input":0.15,"output":0.6,"reasoning":0.6,"cache_read":0.15},"canonical_model_id":"openai/gpt-oss-120b"},"reflection/beam":{"id":"reflection/beam","name":"Beam 1.0 501B A23B","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.25,"output":1,"cache_read":0.05},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3-30B-A3B-Instruct-2507":{"id":"Qwen/Qwen3-30B-A3B-Instruct-2507","name":"Qwen3-30B-A3B-Instruct-2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":8192},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.2,"output":0.6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen3-Embedding-8B":{"id":"Qwen/Qwen3-Embedding-8B","type":"embedding","name":"Qwen3-Embedding-8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-10","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"input":40960,"output":0},"cost":{"input":0.01,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":1024000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":1024000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/Nemotron-3.5-Super-VL":{"id":"nvidia/Nemotron-3.5-Super-VL","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for coding, visual understanding, and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":0.9,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/Nemotron-3-Ultra-550b-a55b":{"id":"nvidia/Nemotron-3-Ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1,"output":3,"cache_read":0.12},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/Nemotron-3_5-Lightning":{"id":"nvidia/Nemotron-3_5-Lightning","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.06,"output":0.24,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron-3-Super-120B-A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"}}},"unorouter":{"id":"unorouter","env":["UNOROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.unorouter.com/v1","name":"UnoRouter","doc":"https://unorouter.com/models","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1875,"output":1.125},"canonical_model_id":"openai/gpt-5.5"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":1.6001,"output":5.0288},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.05,"output":8.4},"canonical_model_id":"openai/gpt-5.2"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.2675,"output":5.3368},"canonical_model_id":"moonshotai/kimi-k2.6"},"glm-4.5-flash:free":{"id":"glm-4.5-flash:free","name":"GLM-4.5-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.5-flash"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1857,"output":1.1142},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.44,"output":7.2},"canonical_model_id":"anthropic/claude-sonnet-5"},"gemma-4-31b-it:free":{"id":"gemma-4-31b-it:free","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"glm-5.2:free":{"id":"glm-5.2:free","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.2"},"deepseek-v4-pro:free":{"id":"deepseek-v4-pro:free","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.8999,"output":1.7999},"canonical_model_id":"deepseek/deepseek-v4-pro"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.2,"output":6},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.0625,"output":0.125},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-v4-flash:free":{"id":"deepseek-v4-flash:free","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":1.8,"output":10.8},"canonical_model_id":"openai/gpt-5.4"},"qwen3.5-397b-a17b:free":{"id":"qwen3.5-397b-a17b:free","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"step-3.7-flash:free":{"id":"step-3.7-flash:free","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"stepfun/step-3.7-flash"},"nemotron-3-ultra-550b-a55b:free":{"id":"nemotron-3-ultra-550b-a55b:free","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"minimax-m2.7:free":{"id":"minimax-m2.7:free","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"minimax/MiniMax-M2.7"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":0.425,"output":2.125},"canonical_model_id":"anthropic/claude-opus-4-8"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.819,"output":3.276},"canonical_model_id":"minimax/MiniMax-M2.7"},"gpt-5.5:free":{"id":"gpt-5.5:free","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.5"},"gpt-5.4:free":{"id":"gpt-5.4:free","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.4"}}},"stepfun-ai-step-plan":{"id":"stepfun-ai-step-plan","env":["STEPFUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.stepfun.ai/step_plan/v1","name":"StepFun Step Plan (Global)","doc":"https://platform.stepfun.ai/docs/en/step-plan/integrations/reasoning-api","models":{"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"canonical_model_id":"stepfun/step-5-preview"},"step-3.5-flash-2603":{"id":"step-3.5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.7-flash"},"step-3.5-flash":{"id":"step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.5-flash"}}},"aki-io":{"id":"aki-io","env":["AKI_IO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://aki.io/v1","name":"AKI.IO","doc":"https://aki.io/docs/","models":{"mistral4-119b":{"id":"mistral4-119b","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.2243,"output":0.6729},"canonical_model_id":"mistral/mistral-small-2603"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.33645,"output":2.4673,"cache_read":0.11215},"canonical_model_id":"alibaba/qwen3.8-27b"},"deepseek-v4.1-flash-552b":{"id":"deepseek-v4.1-flash-552b","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":81920},"cost":{"input":0.280375,"output":1.1215,"cache_read":0.11215},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen3.6-35b":{"id":"qwen3.6-35b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"status":"deprecated","cost":{"input":0.168225,"output":0.56075},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"glm5.3-754b":{"id":"glm5.3-754b","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":81920},"cost":{"input":1.1215,"output":3.92525,"cache_read":0.280375},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.168225,"output":0.616825},"canonical_model_id":"openai/gpt-oss-120b"},"gemma4-26b":{"id":"gemma4-26b","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"cost":{"input":0.11215,"output":0.56075},"canonical_model_id":"google/gemma-4-26b-a4b-it"}}},"trustedrouter":{"id":"trustedrouter","env":["TRUSTEDROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.trustedrouter.com/v1","name":"TrustedRouter","doc":"https://trustedrouter.com/docs","models":{"trustedrouter/zdr":{"id":"trustedrouter/zdr","name":"Zero Data Retention","description":"TrustedRouter privacy routing alias that prefers zero data retention model endpoints.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/fast":{"id":"trustedrouter/fast","name":"Fast","description":"TrustedRouter speed routing alias that prefers low-latency healthy model endpoints.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/cheap":{"id":"trustedrouter/cheap","name":"Cheap","description":"TrustedRouter low-cost routing alias that prefers inexpensive healthy model endpoints.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-01","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/synth":{"id":"trustedrouter/synth","name":"Synth","description":"TrustedRouter synthesis orchestration alias that combines multiple model responses into one answer.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-20","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/synth-code":{"id":"trustedrouter/synth-code","name":"Synth Code","description":"TrustedRouter code synthesis orchestration alias that combines multiple model responses into one answer.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-20","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/auto":{"id":"trustedrouter/auto","name":"Auto","description":"TrustedRouter automatic routing alias that chooses a healthy supported model endpoint for the request.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-01","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}},"trustedrouter/e2e":{"id":"trustedrouter/e2e","name":"End-to-End Encrypted","description":"TrustedRouter privacy routing alias for end-to-end encrypted provider routes where available.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072}}}},"edenai":{"id":"edenai","env":["EDENAI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.edenai.run/v3","name":"Eden AI","doc":"https://docs.edenai.co","models":{"deepseek-v4-flash-vision-exp":{"id":"deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4-5":{"id":"anthropic/claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-sonnet-latest":{"id":"anthropic/claude-sonnet-latest","name":"Claude Sonnet Latest (Claude Sonnet 5.5)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-latest":{"id":"anthropic/claude-fable-latest","name":"Claude Fable Latest (Claude Fable 5.2)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5-2":{"id":"anthropic/claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-latest":{"id":"anthropic/claude-opus-latest","name":"Claude Opus Latest (Claude Opus 5.5)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-opus-4-5-20251101":{"id":"anthropic/claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-haiku-latest":{"id":"anthropic/claude-haiku-latest","name":"Claude Haiku Latest (Claude Haiku 5.5)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"databricks/databricks-gpt-oss-20b":{"id":"databricks/databricks-gpt-oss-20b","name":"GPT OSS 20B (Databricks)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.30002,"cache_read":0.007,"cache_write":0.07},"canonical_model_id":"openai/gpt-oss-20b"},"databricks/databricks-qwen3-next-80b-a3b-instruct":{"id":"databricks/databricks-qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct (Databricks)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15001,"output":1.20001,"cache_read":0.015001,"cache_write":0.15001},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"databricks/databricks-gpt-oss-120b@eu":{"id":"databricks/databricks-gpt-oss-120b@eu","name":"GPT OSS 120B (Databricks, EU)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15001,"output":0.59997,"cache_read":0.015001,"cache_write":0.15001},"canonical_model_id":"openai/gpt-oss-120b"},"databricks/databricks-gpt-oss-20b@eu":{"id":"databricks/databricks-gpt-oss-20b@eu","name":"GPT OSS 20B (Databricks, EU)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.30002,"cache_read":0.007,"cache_write":0.07},"canonical_model_id":"openai/gpt-oss-20b"},"databricks/databricks-qwen3-next-80b-a3b-instruct@eu":{"id":"databricks/databricks-qwen3-next-80b-a3b-instruct@eu","name":"Qwen3-Next 80B-A3B Instruct (Databricks, EU)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15001,"output":1.20001,"cache_read":0.015001,"cache_write":0.15001},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"databricks/databricks-gpt-oss-120b":{"id":"databricks/databricks-gpt-oss-120b","name":"GPT OSS 120B (Databricks)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15001,"output":0.59997,"cache_read":0.015001,"cache_write":0.15001},"canonical_model_id":"openai/gpt-oss-120b"},"amazon/amazon.nova-pro-v1:0":{"id":"amazon/amazon.nova-pro-v1:0","name":"Nova Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.8,"output":3.2,"cache_read":0.2},"canonical_model_id":"amazon/nova-pro"},"amazon/qwen.qwen3-coder-next":{"id":"amazon/qwen.qwen3-coder-next","name":"Qwen3 Coder Next (Amazon Bedrock)","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.78,"output":1.86},"canonical_model_id":"alibaba/qwen3-coder-next"},"amazon/zai.glm-4.7-flash":{"id":"amazon/zai.glm-4.7-flash","name":"GLM-4.7-Flash (Amazon Bedrock)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":203000,"output":131072},"cost":{"input":0.07,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"amazon/zai.glm-4.7-flash@us":{"id":"amazon/zai.glm-4.7-flash@us","name":"GLM-4.7-Flash (Amazon Bedrock, US)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":203000,"output":131072},"cost":{"input":0.07,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"amazon/google.gemma-3-27b-it":{"id":"amazon/google.gemma-3-27b-it","name":"Gemma 3 27B IT (Amazon Bedrock)","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.23,"output":0.38},"canonical_model_id":"google/gemma-3-27b-it"},"amazon/mistral.pixtral-large-2502-v1:0@us":{"id":"amazon/mistral.pixtral-large-2502-v1:0@us","name":"Pixtral Large (25.02) (Amazon Bedrock, US)","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-2502"},"amazon/amazon.nova-pro-v1:0@us":{"id":"amazon/amazon.nova-pro-v1:0@us","name":"Nova Pro (US)","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.8,"output":3.2,"cache_read":0.2},"canonical_model_id":"amazon/nova-pro"},"amazon/google.gemma-3-4b-it@us":{"id":"amazon/google.gemma-3-4b-it@us","name":"Gemma 3 4B IT (Amazon Bedrock, US)","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.04,"output":0.08},"canonical_model_id":"google/gemma-3-4b-it"},"amazon/google.gemma-3-12b-it":{"id":"amazon/google.gemma-3-12b-it","name":"Gemma 3 12B IT (Amazon Bedrock)","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.09,"output":0.29},"canonical_model_id":"google/gemma-3-12b-it"},"amazon/mistral.pixtral-large-2502-v1:0":{"id":"amazon/mistral.pixtral-large-2502-v1:0","name":"Pixtral Large (25.02) (Amazon Bedrock)","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-2502"},"amazon/mistral.voxtral-mini-3b-2507@us":{"id":"amazon/mistral.voxtral-mini-3b-2507@us","name":"Voxtral Mini 3B 2507 (Amazon Bedrock, US)","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.04,"output":0.04},"canonical_model_id":"mistral/voxtral-mini-3b-2507"},"amazon/moonshot.kimi-k2-thinking":{"id":"amazon/moonshot.kimi-k2-thinking","name":"Kimi K2 Thinking (Amazon Bedrock)","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":262144},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"amazon/google.gemma-3-4b-it":{"id":"amazon/google.gemma-3-4b-it","name":"Gemma 3 4B IT (Amazon Bedrock)","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.04,"output":0.08},"canonical_model_id":"google/gemma-3-4b-it"},"amazon/mistral.voxtral-mini-3b-2507":{"id":"amazon/mistral.voxtral-mini-3b-2507","name":"Voxtral Mini 3B 2507 (Amazon Bedrock)","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.04,"output":0.04},"canonical_model_id":"mistral/voxtral-mini-3b-2507"},"amazon/mistral.voxtral-small-24b-2507":{"id":"amazon/mistral.voxtral-small-24b-2507","name":"Voxtral Small 24B 2507 (Amazon Bedrock)","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"amazon/mistral.voxtral-small-24b-2507@us":{"id":"amazon/mistral.voxtral-small-24b-2507@us","name":"Voxtral Small 24B 2507 (Amazon Bedrock, US)","description":"Open audio-language model for speech transcription, audio understanding, and voice-driven tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"amazon/google.gemma-3-27b-it@us":{"id":"amazon/google.gemma-3-27b-it@us","name":"Gemma 3 27B IT (Amazon Bedrock, US)","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.23,"output":0.38},"canonical_model_id":"google/gemma-3-27b-it"},"amazon/google.gemma-3-12b-it@us":{"id":"amazon/google.gemma-3-12b-it@us","name":"Gemma 3 12B IT (Amazon Bedrock, US)","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.09,"output":0.29},"canonical_model_id":"google/gemma-3-12b-it"},"amazon/amazon.nova-micro-v1:0@us":{"id":"amazon/amazon.nova-micro-v1:0@us","name":"Nova Micro (US)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.035,"output":0.14,"cache_read":0.00875},"canonical_model_id":"amazon/nova-micro"},"amazon/amazon.nova-lite-v1:0":{"id":"amazon/amazon.nova-lite-v1:0","name":"Nova Lite","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.06,"output":0.24,"cache_read":0.015},"canonical_model_id":"amazon/nova-lite"},"amazon/moonshotai.kimi-k2.5":{"id":"amazon/moonshotai.kimi-k2.5","name":"Kimi K2.5 (Amazon Bedrock)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"amazon/amazon.nova-micro-v1:0":{"id":"amazon/amazon.nova-micro-v1:0","name":"Nova Micro","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.035,"output":0.14,"cache_read":0.00875},"canonical_model_id":"amazon/nova-micro"},"amazon/amazon.nova-lite-v1:0@us":{"id":"amazon/amazon.nova-lite-v1:0@us","name":"Nova Lite (US)","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.06,"output":0.24,"cache_read":0.015},"canonical_model_id":"amazon/nova-lite"},"amazon/openai.gpt-oss-safeguard-20b@us":{"id":"amazon/openai.gpt-oss-safeguard-20b@us","name":"GPT OSS Safeguard 20B (Amazon Bedrock, US)","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.07,"output":0.2},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"amazon/openai.gpt-oss-safeguard-20b":{"id":"amazon/openai.gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B (Amazon Bedrock)","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":131072},"cost":{"input":0.07,"output":0.2},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"mistral/voxtral-small-latest@eu":{"id":"mistral/voxtral-small-latest@eu","name":"Voxtral Small (latest) (EU)","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32000},"cost":{"input":0.11,"output":0.44,"cache_read":0.011},"canonical_model_id":"mistral/voxtral-small-latest"},"mistral/ministral-8b-2512@eu":{"id":"mistral/ministral-8b-2512@eu","name":"Ministral 3 8B 2512 (EU)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.165,"output":0.165,"cache_read":0.0165},"canonical_model_id":"mistral/ministral-8b-2512"},"mistral/codestral-2508":{"id":"mistral/codestral-2508","name":"Codestral 25.08","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-2508"},"mistral/mistral-large-latest@eu":{"id":"mistral/mistral-large-latest@eu","name":"Mistral Large (latest) (EU)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":2.2,"output":6.6,"cache_read":0.22},"canonical_model_id":"mistral/mistral-large-latest"},"mistral/mistral-small-2603@eu":{"id":"mistral/mistral-small-2603@eu","name":"Mistral Small 4 (EU)","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.165,"output":0.66,"cache_read":0.0165},"canonical_model_id":"mistral/mistral-small-2603"},"mistral/mistral-medium-2505":{"id":"mistral/mistral-medium-2505","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/mistral-medium-2505"},"mistral/mistral-medium-3-5":{"id":"mistral/mistral-medium-3-5","name":"Mistral Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistral/mistral-medium-3@eu":{"id":"mistral/mistral-medium-3@eu","name":"Mistral Medium 3 (EU)","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":104857},"cost":{"input":0.44,"output":2.2,"cache_read":0.044},"canonical_model_id":"mistral/mistral-medium-3"},"mistral/mistral-medium-3-5@eu":{"id":"mistral/mistral-medium-3-5@eu","name":"Mistral Medium 3.5 (EU)","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.65,"output":8.25,"cache_read":0.165},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistral/mistral-large-2512":{"id":"mistral/mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/ministral-3b-2512":{"id":"mistral/ministral-3b-2512","name":"Ministral 3 3B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":0.1,"output":0.1,"cache_read":0.01},"canonical_model_id":"mistral/ministral-3b-2512"},"mistral/ministral-8b-2512":{"id":"mistral/ministral-8b-2512","name":"Ministral 3 8B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.15,"output":0.15,"cache_read":0.015},"canonical_model_id":"mistral/ministral-8b-2512"},"mistral/ministral-3b-2512@eu":{"id":"mistral/ministral-3b-2512@eu","name":"Ministral 3 3B 2512 (EU)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":0.11,"output":0.11,"cache_read":0.011},"canonical_model_id":"mistral/ministral-3b-2512"},"mistral/mistral-large-2407":{"id":"mistral/mistral-large-2407","name":"Mistral Large 2407","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large-2407"},"mistral/mistral-large-2512@eu":{"id":"mistral/mistral-large-2512@eu","name":"Mistral Large 3 (EU)","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.55,"output":1.65,"cache_read":0.055},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/devstral-medium-latest":{"id":"mistral/devstral-medium-latest","name":"Devstral 2 (latest)","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/devstral-medium-latest"},"mistral/mistral-small-2603":{"id":"mistral/mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-2603"},"mistral/magistral-medium-latest":{"id":"mistral/magistral-medium-latest","name":"Magistral Medium (latest)","description":"Mistral reasoning model for transparent analysis, math, and complex decisions","family":"magistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-03-17","last_updated":"2025-03-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":16384},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/magistral-medium-latest"},"mistral/codestral-latest@eu":{"id":"mistral/codestral-latest@eu","name":"Codestral (latest) (EU)","description":"Mistral code model for completions, refactors, and developer IDE workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-05-29","last_updated":"2025-01-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":0.33,"output":0.99,"cache_read":0.033},"canonical_model_id":"mistral/codestral-latest"},"mistral/codestral-latest":{"id":"mistral/codestral-latest","name":"Codestral (latest)","description":"Mistral code model for completions, refactors, and developer IDE workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-05-29","last_updated":"2025-01-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-latest"},"mistral/mistral-medium-2505@eu":{"id":"mistral/mistral-medium-2505@eu","name":"Mistral Medium 3 (EU)","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"cost":{"input":0.44,"output":2.2},"canonical_model_id":"mistral/mistral-medium-2505"},"mistral/mistral-large-4@eu":{"id":"mistral/mistral-large-4@eu","name":"Mistral Large 4 (EU)","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"cost":{"input":0.748,"output":2.299,"cache_read":0.077},"canonical_model_id":"mistral/mistral-large-4"},"mistral/mistral-medium-latest@eu":{"id":"mistral/mistral-medium-latest@eu","name":"Mistral Medium (latest) (EU)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.65,"output":8.25,"cache_read":0.165},"canonical_model_id":"mistral/mistral-medium-latest"},"mistral/voxtral-small-latest":{"id":"mistral/voxtral-small-latest","name":"Voxtral Small (latest)","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32000},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"mistral/voxtral-small-latest"},"mistral/devstral-2512":{"id":"mistral/devstral-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/devstral-2512"},"mistral/codestral-2508@eu":{"id":"mistral/codestral-2508@eu","name":"Codestral 25.08 (EU)","description":"Mistral code model for low-latency completion, fill-in-the-middle, and code generation","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"cost":{"input":0.33,"output":0.99,"cache_read":0.033},"canonical_model_id":"mistral/codestral-2508"},"mistral/mistral-small-latest":{"id":"mistral/mistral-small-latest","name":"Mistral Small (latest)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-latest"},"mistral/mistral-medium-latest":{"id":"mistral/mistral-medium-latest","name":"Mistral Medium (latest)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-latest"},"mistral/mistral-medium-2604":{"id":"mistral/mistral-medium-2604","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"mistral/mistral-medium-2604"},"mistral/mistral-large-2407@eu":{"id":"mistral/mistral-large-2407@eu","name":"Mistral Large 2407 (EU)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":2.2,"output":6.6,"cache_read":0.22},"canonical_model_id":"mistral/mistral-large-2407"},"mistral/devstral-2512@eu":{"id":"mistral/devstral-2512@eu","name":"Devstral 2 (EU)","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.44,"output":2.2,"cache_read":0.044},"canonical_model_id":"mistral/devstral-2512"},"mistral/magistral-medium-latest@eu":{"id":"mistral/magistral-medium-latest@eu","name":"Magistral Medium (latest) (EU)","description":"Mistral reasoning model for transparent analysis, math, and complex decisions","family":"magistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-03-17","last_updated":"2025-03-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":16384},"cost":{"input":1.65,"output":8.25,"cache_read":0.165},"canonical_model_id":"mistral/magistral-medium-latest"},"mistral/mistral-small-latest@eu":{"id":"mistral/mistral-small-latest@eu","name":"Mistral Small (latest) (EU)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.165,"output":0.66,"cache_read":0.0165},"canonical_model_id":"mistral/mistral-small-latest"},"mistral/mistral-medium-3":{"id":"mistral/mistral-medium-3","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":104857},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-3"},"mistral/ministral-14b-2512":{"id":"mistral/ministral-14b-2512","name":"Ministral 3 14B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.2,"output":0.2,"cache_read":0.02},"canonical_model_id":"mistral/ministral-14b-2512"},"mistral/devstral-medium-latest@eu":{"id":"mistral/devstral-medium-latest@eu","name":"Devstral 2 (latest) (EU)","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.44,"output":2.2},"canonical_model_id":"mistral/devstral-medium-latest"},"mistral/ministral-14b-2512@eu":{"id":"mistral/ministral-14b-2512@eu","name":"Ministral 3 14B 2512 (EU)","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.22,"output":0.22,"cache_read":0.022},"canonical_model_id":"mistral/ministral-14b-2512"},"mistral/mistral-large-latest":{"id":"mistral/mistral-large-latest","name":"Mistral Large (latest)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large-latest"},"mistral/mistral-medium-2604@eu":{"id":"mistral/mistral-medium-2604@eu","name":"Mistral Medium 3.5 (EU)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.65,"output":8.25,"cache_read":0.165},"canonical_model_id":"mistral/mistral-medium-2604"},"perplexityai/sonar-pro":{"id":"perplexityai/sonar-pro","name":"Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"perplexityai/sonar":{"id":"perplexityai/sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":127072,"output":4096},"cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"perplexityai/sonar-reasoning-pro":{"id":"perplexityai/sonar-reasoning-pro","name":"Sonar Reasoning Pro","description":"Web-grounded Sonar for multi-step research questions that need cited reasoning","family":"sonar-reasoning","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":2,"output":8},"canonical_model_id":"perplexity/sonar-reasoning-pro"},"perplexityai/sonar-deep-research":{"id":"perplexityai/sonar-deep-research","name":"Sonar Deep Research","description":"Sonar search model for autonomous research and citation-backed long-form reports","family":"sonar","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-02-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"cost":{"input":2,"output":8,"reasoning":3},"canonical_model_id":"perplexity/sonar-deep-research"},"ovhcloud/gpt-oss-20b":{"id":"ovhcloud/gpt-oss-20b","name":"GPT OSS 20B (OVHcloud)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.05,"output":0.18},"canonical_model_id":"openai/gpt-oss-20b"},"ovhcloud/gpt-oss-120b":{"id":"ovhcloud/gpt-oss-120b","name":"GPT OSS 120B (OVHcloud)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.09,"output":0.47},"canonical_model_id":"openai/gpt-oss-120b"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-chat"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash"},"tensorx/deepseek/deepseek-r1-0528":{"id":"tensorx/deepseek/deepseek-r1-0528","name":"DeepSeek R1 0528 (TensorX)","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":32768},"cost":{"input":0.66,"output":2.6,"cache_read":0.165},"canonical_model_id":"deepseek/deepseek-r1-0528"},"tensorx/deepseek/deepseek-v4-pro-0813":{"id":"tensorx/deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813 (TensorX)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":2,"output":4,"cache_read":0.5},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"tensorx/deepseek/deepseek-v4.1-flash":{"id":"tensorx/deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (TensorX)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.5,"output":1.5,"cache_read":0.125},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"tensorx/deepseek/deepseek-v4-flash-0731":{"id":"tensorx/deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (TensorX)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.25,"output":0.3,"cache_read":0.0625},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"tensorx/deepseek/deepseek-v4.1-flash-1017":{"id":"tensorx/deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (TensorX)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.5,"output":1.5,"cache_read":0.125},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"tensorx/moonshotai/kimi-k2.5":{"id":"tensorx/moonshotai/kimi-k2.5","name":"Kimi K2.5 (TensorX)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":2.8,"cache_read":0.125},"canonical_model_id":"moonshotai/kimi-k2.5"},"cloudflare/@cf/aisingapore/gemma-sea-lion-v4-27b-it":{"id":"cloudflare/@cf/aisingapore/gemma-sea-lion-v4-27b-it","name":"Gemma-SEA-LION-v4-27B-IT (Cloudflare)","description":"Gemma 3 27B tuned by AI Singapore for Southeast Asian languages and instruction following","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"aisingapore/gemma-sea-lion-v4-27b-it"},"cloudflare/@cf/qwen/qwen2.5-coder-32b-instruct":{"id":"cloudflare/@cf/qwen/qwen2.5-coder-32b-instruct","name":"Qwen2.5-Coder-32B-Instruct (Cloudflare)","description":"Open coding-focused Qwen model for code generation, repair, and repository reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.66,"output":1},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"cloudflare/@cf/deepseek-ai/deepseek-v4-pro-0813":{"id":"cloudflare/@cf/deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813 (Cloudflare)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731":{"id":"cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Cloudflare)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"cloudflare/@cf/deepseek-ai/deepseek-v4.1-flash-1017":{"id":"cloudflare/@cf/deepseek-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Cloudflare)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"cloudflare/@cf/mistralai/mistral-small-3.1-24b-instruct":{"id":"cloudflare/@cf/mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B (Cloudflare)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":102400},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"mistral/mistral-small-3.1-24b-instruct"},"cloudflare/@cf/openai/gpt-oss-20b":{"id":"cloudflare/@cf/openai/gpt-oss-20b","name":"GPT OSS 20B (Cloudflare)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.2,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"cloudflare/@cf/openai/gpt-oss-120b":{"id":"cloudflare/@cf/openai/gpt-oss-120b","name":"GPT OSS 120B (Cloudflare)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"cloudflare/@cf/meta/llama-3.2-3b-instruct":{"id":"cloudflare/@cf/meta/llama-3.2-3b-instruct","name":"Llama 3.2 3B Instruct (Cloudflare)","description":"Small instruction-tuned Llama model for multilingual dialogue and agentic retrieval","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":80000,"output":131072},"cost":{"input":0.0509,"output":0.335},"canonical_model_id":"meta/llama-3.2-3b-instruct"},"cloudflare/@cf/meta/llama-guard-3-8b":{"id":"cloudflare/@cf/meta/llama-guard-3-8b","name":"Llama-Guard-3-8B (Cloudflare)","description":"Llama 3.1-based safety classifier for moderating prompts and model responses","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.484,"output":0.03},"canonical_model_id":"meta/llama-guard-3-8b"},"cloudflare/@cf/meta/llama-3.2-1b-instruct":{"id":"cloudflare/@cf/meta/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct (Cloudflare)","description":"Compact instruction-tuned Llama model for multilingual dialogue and on-device assistants","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":60000,"output":32000},"cost":{"input":0.027,"output":0.201},"canonical_model_id":"meta/llama-3.2-1b-instruct"},"cloudflare/@cf/zai-org/glm-4.7-flash":{"id":"cloudflare/@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash (Cloudflare)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.0605,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"google/deep-research-preview-04-2026":{"id":"google/deep-research-preview-04-2026","name":"Gemini Deep Research Preview","description":"Agentic model for autonomous multi-step research, synthesis, and cited reports","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12},"canonical_model_id":"google/deep-research-preview-04-2026"},"google/gemini-3.1-flash-lite-image":{"id":"google/gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.1-flash-image-preview":{"id":"google/gemini-3.1-flash-image-preview","type":"image","name":"Nano Banana 2 Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-carbon"},"google/gemini-pro-latest":{"id":"google/gemini-pro-latest","name":"Gemini Pro Latest (Gemini 4 Argon)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-robotics-er-2-preview":{"id":"google/gemini-robotics-er-2-preview","name":"Gemini Robotics-ER 2 Preview","description":"Embodied reasoning model for robotics: spatial understanding, video progress, and multi-robot orchestration","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","pdf","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1,"output":5,"reasoning":5,"cache_read":0.1,"input_audio":1},"canonical_model_id":"google/gemini-robotics-er-2-preview"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"reasoning":9,"cache_read":0.15,"cache_write":0.083333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest (Gemini 3.8 Flash)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-flash-image":{"id":"google/gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"google/deep-research-max-preview-04-2026":{"id":"google/deep-research-max-preview-04-2026","name":"Deep Research Max Preview","description":"Maximum-comprehensiveness agentic researcher for multi-step investigation, synthesis, and cited reports","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12},"canonical_model_id":"google/deep-research-max-preview-04-2026"},"google/gemini-3.1-flash-lite-preview":{"id":"google/gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"google/gemini-3-pro-image-preview":{"id":"google/gemini-3-pro-image-preview","type":"image","name":"Nano Banana Pro Preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2},"canonical_model_id":"google/gemini-3-pro-image-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"reasoning":3,"cache_read":0.05,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-2.5-flash-image":{"id":"google/gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["audio","image","text","video"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemini-3-pro-image":{"id":"google/gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2},"canonical_model_id":"google/gemini-3-pro-image"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.7-flash"},"google/gemini-nano-banana-2.1":{"id":"google/gemini-nano-banana-2.1","type":"image","name":"Nano Banana 2.1","description":"Image model for prompt-driven generation, multi-turn editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"google/gemini-nano-banana-2.1"},"greenference/gpt-oss-20b":{"id":"greenference/gpt-oss-20b","name":"GPT OSS 20B (Greenference)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.009,"output":0.045,"cache_read":0.0045},"canonical_model_id":"openai/gpt-oss-20b"},"flexai/DeepSeek-V4.1-Flash-1017":{"id":"flexai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (FlexAI)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.0225},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"flexai/DeepSeek-V4-Flash-0731":{"id":"flexai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731 (FlexAI)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.119,"output":0.238,"cache_read":0.0178},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"flexai/gpt-oss-20b":{"id":"flexai/gpt-oss-20b","name":"GPT OSS 20B (FlexAI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.02,"output":0.1,"cache_read":0.003},"canonical_model_id":"openai/gpt-oss-20b"},"flexai/DeepSeek-V4-Flash-0731@eu":{"id":"flexai/DeepSeek-V4-Flash-0731@eu","name":"DeepSeek V4 Flash 0731 (FlexAI, EU)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.119,"output":0.238,"cache_read":0.0178},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"flexai/Muse-Glimmer-30B":{"id":"flexai/Muse-Glimmer-30B","name":"Muse Glimmer 30B (FlexAI)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.045},"canonical_model_id":"meta/muse-glimmer-30b"},"flexai/gpt-oss-120b":{"id":"flexai/gpt-oss-120b","name":"GPT OSS 120B (FlexAI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.0075},"canonical_model_id":"openai/gpt-oss-120b"},"qwen/qwen3.8-omni-flash":{"id":"qwen/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen/qwen-max":{"id":"qwen/qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":1.6,"output":6.4,"cache_read":0.32},"canonical_model_id":"alibaba/qwen-max"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32768},"cost":{"input":0.5,"output":3,"cache_read":0.1,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/deepseek-v4-pro-0813":{"id":"qwen/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813 (Alibaba)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.066},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen-mt-plus":{"id":"qwen/qwen-mt-plus","name":"Qwen MT Plus","description":"Flagship Qwen translation model with terminology control and support for 92 languages","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-24","last_updated":"2025-07-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":8192},"cost":{"input":2.46,"output":7.37},"canonical_model_id":"alibaba/qwen-mt-plus"},"qwen/deepseek-v4.1-flash":{"id":"qwen/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Alibaba)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/deepseek-v4-flash-0731":{"id":"qwen/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Alibaba)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/deepseek-v4.1-flash-1017":{"id":"qwen/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Alibaba)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"alibaba/qwen3-coder-flash"},"together_ai/meta-models/Muse-Glimmer-30B":{"id":"together_ai/meta-models/Muse-Glimmer-30B","name":"Muse Glimmer 30B (Together AI)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.35,"output":1.5,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"together_ai/deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"together_ai/deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (Together AI)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"together_ai/deepseek-ai/DeepSeek-V4.1-Flash":{"id":"together_ai/deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash (Together AI)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"together_ai/deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"together_ai/deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813 (Together AI)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"together_ai/openai/gpt-oss-120b":{"id":"together_ai/openai/gpt-oss-120b","name":"GPT OSS 120B (Together AI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"together_ai/thinkingmachines/Inkling":{"id":"together_ai/thinkingmachines/Inkling","name":"Inkling (Together AI)","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"together_ai/reflection/Beam-1.0-501B-A23B":{"id":"together_ai/reflection/Beam-1.0-501B-A23B","name":"Beam 1.0 501B A23B (Together AI)","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.4,"output":1.2,"cache_read":0.04},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-4.6v":{"id":"zai/glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.05},"canonical_model_id":"zhipuai/glm-4.6v"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5.3":{"id":"zai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-5.3-flash":{"id":"zai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5-turbo":{"id":"zai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-5v-turbo":{"id":"zai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"fireworks_ai/gpt-oss-120b":{"id":"fireworks_ai/gpt-oss-120b","name":"GPT OSS 120B (Fireworks AI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.014},"canonical_model_id":"openai/gpt-oss-120b"},"fireworks_ai/accounts/fireworks/models/muse-spark-open":{"id":"fireworks_ai/accounts/fireworks/models/muse-spark-open","name":"Muse Spark Open (Fireworks AI)","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"fireworks_ai/accounts/fireworks/models/ember-1":{"id":"fireworks_ai/accounts/fireworks/models/ember-1","name":"Ember-1 (Fireworks AI)","description":"Specialized model from Fireworks built on Kimi K3, producing shorter reasoning traces with approximately 40% fewer tokens while maintaining comparable quality","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"fireworks_ai/accounts/fireworks/models/inkling":{"id":"fireworks_ai/accounts/fireworks/models/inkling","name":"Inkling (Fireworks AI)","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"fireworks_ai/accounts/fireworks/models/gpt-oss-120b":{"id":"fireworks_ai/accounts/fireworks/models/gpt-oss-120b","name":"GPT OSS 120B (Fireworks AI)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"openai/gpt-oss-120b"},"nebius/meta-models/muse-spark-open":{"id":"nebius/meta-models/muse-spark-open","name":"Muse Spark Open (Nebius)","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":1.25},"canonical_model_id":"meta/muse-spark-open"},"nebius/google/gemma-3-27b-it":{"id":"nebius/google/gemma-3-27b-it","name":"Gemma 3 27B IT (Nebius)","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":110000,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"google/gemma-3-27b-it"},"nebius/deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"nebius/deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (Nebius)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.3},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"nebius/deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"nebius/deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813 (Nebius)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":1.32},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"nebius/openai/gpt-oss-120b":{"id":"nebius/openai/gpt-oss-120b","name":"GPT OSS 120B (Nebius)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.15},"canonical_model_id":"openai/gpt-oss-120b"},"nebius/Qwen/Qwen3-30B-A3B-Instruct-2507":{"id":"nebius/Qwen/Qwen3-30B-A3B-Instruct-2507","name":"Qwen3 30B-A3B Instruct 2507 (Nebius)","description":"Updated compact Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"nebius/Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"nebius/Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507 (Nebius)","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.2,"output":0.6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"nebius/nvidia/Nemotron-3-Ultra-550b-a55b":{"id":"nebius/nvidia/Nemotron-3-Ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B (Nebius)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":1,"output":3,"cache_read":1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nebius/nvidia/nemotron-3-super-120b-a12b":{"id":"nebius/nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B (Nebius)","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":0.9,"cache_read":0.3},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"tencent/step-5-preview":{"id":"tencent/step-5-preview","name":"Step 5 Preview (Tencent)","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":1,"output":2.7,"cache_read":0.05},"canonical_model_id":"stepfun/step-5-preview"},"tencent/hy4":{"id":"tencent/hy4","name":"Hy4 (Tencent)","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4"},"tencent/deepseek-v4-pro-0813":{"id":"tencent/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813 (Tencent)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"tencent/deepseek-v4.1-flash":{"id":"tencent/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Tencent)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3 (Tencent)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview (Tencent)","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"tencent/deepseek-v4.1-flash-1017":{"id":"tencent/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Tencent)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"microsoft/o3-mini":{"id":"microsoft/o3-mini","name":"o3-mini (Microsoft)","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"microsoft/gpt-4":{"id":"microsoft/gpt-4","name":"GPT-4 (Microsoft)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":8192},"cost":{"input":30,"output":60},"canonical_model_id":"openai/gpt-4"},"greenpt/qwen3-235b-a22b-instruct-2507":{"id":"greenpt/qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B-A22B Instruct 2507 (Greenpt)","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":250000,"output":16384},"cost":{"input":1.00143,"output":3.004289},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"greenpt/deepseek-v4.1-flash":{"id":"greenpt/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Greenpt)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.244794,"output":1.22397,"cache_read":0.01224},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"greenpt/llama-3.3-70b-instruct":{"id":"greenpt/llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct (Greenpt)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":1.22397,"output":1.22397},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"greenpt/deepseek-v4-flash-0731":{"id":"greenpt/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Greenpt)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.155778,"output":0.389445,"cache_read":0.044508},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"greenpt/gpt-oss-120b":{"id":"greenpt/gpt-oss-120b","name":"GPT OSS 120B (Greenpt)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.22254,"output":0.77889},"canonical_model_id":"openai/gpt-oss-120b"},"groq/openai/gpt-oss-safeguard-20b":{"id":"groq/openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B (Groq)","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"groq/openai/gpt-oss-20b":{"id":"groq/openai/gpt-oss-20b","name":"GPT OSS 20B (Groq)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-20b"},"groq/openai/gpt-oss-120b":{"id":"groq/openai/gpt-oss-120b","name":"GPT OSS 120B (Groq)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-oss-120b"},"groq/meta-llama/llama-prompt-guard-2-86m":{"id":"groq/meta-llama/llama-prompt-guard-2-86m","name":"Llama Prompt Guard 2 86M (Groq)","description":"86M-parameter (mDeBERTa-base) multilingual classifier that detects prompt injection and jailbreak attempts","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":512},"cost":{"input":0.04,"output":0.04,"cache_read":0.02},"canonical_model_id":"meta/llama-prompt-guard-2-86m"},"groq/meta-llama/llama-prompt-guard-2-22m":{"id":"groq/meta-llama/llama-prompt-guard-2-22m","name":"Llama Prompt Guard 2 22M (Groq)","description":"22M-parameter (DeBERTa-xsmall) English classifier that detects prompt injection and jailbreak attempts","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":512},"cost":{"input":0.03,"output":0.03,"cache_read":0.015},"canonical_model_id":"meta/llama-prompt-guard-2-22m"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-mini-latest":{"id":"openai/gpt-mini-latest","name":"GPT Mini Latest (GPT-5.6 Luna)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5-search-api":{"id":"openai/gpt-5-search-api","type":"chat","name":"GPT-5 Search API","description":"GPT-5 model trained for web search in the Chat Completions API","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":100000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-search-api"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-latest":{"id":"openai/gpt-latest","name":"GPT Latest (GPT-6 Astra)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-pro-latest":{"id":"openai/gpt-pro-latest","name":"GPT Pro Latest (GPT-5.6 Sol)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3-pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","pdf","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-r-plus-08-2024"},"cohere/command-r7b-12-2024":{"id":"cohere/command-r7b-12-2024","name":"Command R7B","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":132000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-12-2024"},"cohere/c4ai-aya-expanse-32b":{"id":"cohere/c4ai-aya-expanse-32b","name":"Aya Expanse 32B","description":"Open multilingual model optimized for generation across 23 languages","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-10-24","last_updated":"2024-10-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"cohere/c4ai-aya-expanse-32b"},"cohere/command-r-08-2024":{"id":"cohere/command-r-08-2024","name":"Command R","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"cohere/command-r-08-2024"},"cohere/command-a-03-2025":{"id":"cohere/command-a-03-2025","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":288000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-03-2025"},"vertex/gemini-3.6-flash@us":{"id":"vertex/gemini-3.6-flash@us","name":"Gemini 3.6 Flash (Vertex AI, US)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"vertex/gemini-3.1-flash-lite-image":{"id":"vertex/gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite (Vertex AI)","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"vertex/gemini-3.8-flash":{"id":"vertex/gemini-3.8-flash","name":"Gemini 3.8 Flash (Vertex AI)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"vertex/gemini-4-carbon":{"id":"vertex/gemini-4-carbon","name":"Gemini 4 Carbon (Vertex AI)","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-carbon"},"vertex/gemini-3.6-flash@eu":{"id":"vertex/gemini-3.6-flash@eu","name":"Gemini 3.6 Flash (Vertex AI, EU)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"vertex/gemini-3.7-flash@us":{"id":"vertex/gemini-3.7-flash@us","name":"Gemini 3.7 Flash (Vertex AI, US)","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.7-flash"},"vertex/gemini-4-argon@eu":{"id":"vertex/gemini-4-argon@eu","name":"Gemini 4 Argon (Vertex AI, EU)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"vertex/gemini-4-carbon@us":{"id":"vertex/gemini-4-carbon@us","name":"Gemini 4 Carbon (Vertex AI, US)","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-carbon"},"vertex/gemini-3.1-flash-lite@eu":{"id":"vertex/gemini-3.1-flash-lite@eu","name":"Gemini 3.1 Flash Lite (Vertex AI, EU)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"vertex/gemini-pro-latest":{"id":"vertex/gemini-pro-latest","name":"Gemini Pro Latest (Gemini 4 Argon, Vertex AI)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"vertex/gemini-3.5-flash":{"id":"vertex/gemini-3.5-flash","name":"Gemini 3.5 Flash (Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"reasoning":9,"cache_read":0.15,"cache_write":0.083333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"vertex/gemini-3.1-flash-lite@us":{"id":"vertex/gemini-3.1-flash-lite@us","name":"Gemini 3.1 Flash Lite (Vertex AI, US)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"vertex/gemini-flash-latest":{"id":"vertex/gemini-flash-latest","name":"Gemini Flash Latest (Gemini 3.8 Flash, Vertex AI)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"vertex/gemini-3.6-flash":{"id":"vertex/gemini-3.6-flash","name":"Gemini 3.6 Flash (Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"vertex/gemini-3.5-flash@eu":{"id":"vertex/gemini-3.5-flash@eu","name":"Gemini 3.5 Flash (Vertex AI, EU)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"reasoning":9,"cache_read":0.15,"cache_write":0.083333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"vertex/gemini-3.8-flash@us":{"id":"vertex/gemini-3.8-flash@us","name":"Gemini 3.8 Flash (Vertex AI, US)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"vertex/gemini-3.5-flash-lite@us":{"id":"vertex/gemini-3.5-flash-lite@us","name":"Gemini 3.5 Flash Lite (Vertex AI, US)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"vertex/gemini-3.8-flash@eu":{"id":"vertex/gemini-3.8-flash@eu","name":"Gemini 3.8 Flash (Vertex AI, EU)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.8-flash"},"vertex/gemini-3.1-flash-image":{"id":"vertex/gemini-3.1-flash-image","type":"image","name":"Nano Banana 2 (Vertex AI)","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"vertex/gemini-3.1-pro-preview":{"id":"vertex/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview (Vertex AI)","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"vertex/gemini-3.1-flash-lite":{"id":"vertex/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite (Vertex AI)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"vertex/gemini-4-argon":{"id":"vertex/gemini-4-argon","name":"Gemini 4 Argon (Vertex AI)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"vertex/gemini-4-carbon@eu":{"id":"vertex/gemini-4-carbon@eu","name":"Gemini 4 Carbon (Vertex AI, EU)","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-carbon"},"vertex/gemini-3.5-flash@us":{"id":"vertex/gemini-3.5-flash@us","name":"Gemini 3.5 Flash (Vertex AI, US)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"reasoning":9,"cache_read":0.15,"cache_write":0.083333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"vertex/gemini-3.5-flash-lite":{"id":"vertex/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite (Vertex AI)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"vertex/gemini-3-flash-preview":{"id":"vertex/gemini-3-flash-preview","name":"Gemini 3 Flash Preview (Vertex AI)","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"reasoning":3,"cache_read":0.05,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"vertex/gemini-2.5-flash-image":{"id":"vertex/gemini-2.5-flash-image","type":"image","name":"Nano Banana (Vertex AI)","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash-image"},"vertex/gemini-3-pro-image":{"id":"vertex/gemini-3-pro-image","type":"image","name":"Nano Banana Pro (Vertex AI)","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2},"canonical_model_id":"google/gemini-3-pro-image"},"vertex/gemini-3.7-flash@eu":{"id":"vertex/gemini-3.7-flash@eu","name":"Gemini 3.7 Flash (Vertex AI, EU)","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.7-flash"},"vertex/gemini-3.7-flash":{"id":"vertex/gemini-3.7-flash","name":"Gemini 3.7 Flash (Vertex AI)","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"reasoning":7.5,"cache_read":0.15,"cache_write":0.083333,"input_audio":1.5},"canonical_model_id":"google/gemini-3.7-flash"},"vertex/gemini-4-argon@us":{"id":"vertex/gemini-4-argon@us","name":"Gemini 4 Argon (Vertex AI, US)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"reasoning":20,"cache_read":0.2,"cache_write":0.375,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"vertex/gemini-3.5-flash-lite@eu":{"id":"vertex/gemini-3.5-flash-lite@eu","name":"Gemini 3.5 Flash Lite (Vertex AI, EU)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"vertex/gemini-nano-banana-2.1":{"id":"vertex/gemini-nano-banana-2.1","type":"image","name":"Nano Banana 2.1 (Vertex AI)","description":"Image model for prompt-driven generation, multi-turn editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","medium","high"]}],"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"google/gemini-nano-banana-2.1"},"moonshot/kimi-k3.1-pro":{"id":"moonshot/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshot/kimi-k2.6":{"id":"moonshot/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot/kimi-k2.7-code":{"id":"moonshot/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshot/kimi-k2.7-code-highspeed":{"id":"moonshot/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"cerebras/gpt-oss-120b":{"id":"cerebras/gpt-oss-120b","name":"GPT OSS 120B (Cerebras)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.35,"output":0.75,"cache_read":0.35},"canonical_model_id":"openai/gpt-oss-120b"},"scaleway/qwen3-coder-30b-a3b-instruct":{"id":"scaleway/qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct (Scaleway)","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":65536},"cost":{"input":0.2245,"output":0.898},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"scaleway/gemma-3-27b-it":{"id":"scaleway/gemma-3-27b-it","name":"Gemma 3 27B IT (Scaleway)","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":40000,"output":131072},"cost":{"input":0.287125,"output":0.57425},"canonical_model_id":"google/gemma-3-27b-it"},"scaleway/qwen3-235b-a22b-instruct-2507":{"id":"scaleway/qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B-A22B Instruct 2507 (Scaleway)","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":250000,"output":16384},"cost":{"input":0.834525,"output":2.503575},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"scaleway/deepseek-v4.1-flash":{"id":"scaleway/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash (Scaleway)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":384000},"cost":{"input":0.669,"output":2.007,"cache_read":0.1338},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"scaleway/llama-3.3-70b-instruct":{"id":"scaleway/llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct (Scaleway)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":1.00143,"output":1.00143},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"scaleway/deepseek-v4-flash-0731":{"id":"scaleway/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (Scaleway)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":384000},"cost":{"input":0.44508,"output":0.89016,"cache_read":0.089016},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"scaleway/gpt-oss-120b":{"id":"scaleway/gpt-oss-120b","name":"GPT OSS 120B (Scaleway)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.166905,"output":0.66762},"canonical_model_id":"openai/gpt-oss-120b"},"scaleway/deepseek-v4.1-flash-1017":{"id":"scaleway/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017 (Scaleway)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":384000},"cost":{"input":0.66762,"output":2.00286,"cache_read":0.133524},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"minimax/MiniMax-M2.1":{"id":"minimax/MiniMax-M2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/MiniMax-M2.5":{"id":"minimax/MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/MiniMax-M2.7":{"id":"minimax/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"minimax/MiniMax-M3":{"id":"minimax/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/MiniMax-M3.1-Flash":{"id":"minimax/MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/MiniMax-M2":{"id":"minimax/MiniMax-M2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3 (Meta)","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1 (Meta)","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-wonder-1.0":{"id":"meta/muse-wonder-1.0","name":"Muse Wonder (Meta)","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2 (Meta)","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"deepinfra/nemotron-3-ultra-550b-a55b":{"id":"deepinfra/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B (Deep Infra)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.5,"output":2.2,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"deepinfra/nemotron-3-super-120b-a12b":{"id":"deepinfra/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B (Deep Infra)","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.075,"output":0.4},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"deepinfra/meta-models/Muse-Glimmer-30B":{"id":"deepinfra/meta-models/Muse-Glimmer-30B","name":"Muse Glimmer 30B (Deep Infra)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"deepinfra/google/gemma-3-27b-it":{"id":"deepinfra/google/gemma-3-27b-it","name":"Gemma 3 27B IT (Deep Infra)","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.08,"output":0.16},"canonical_model_id":"google/gemma-3-27b-it"},"deepinfra/google/gemma-3-4b-it":{"id":"deepinfra/google/gemma-3-4b-it","name":"Gemma 3 4B IT (Deep Infra)","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-4b-it"},"deepinfra/google/gemma-3-12b-it":{"id":"deepinfra/google/gemma-3-12b-it","name":"Gemma 3 12B IT (Deep Infra)","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.15},"canonical_model_id":"google/gemma-3-12b-it"},"deepinfra/deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepinfra/deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (Deep Infra)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepinfra/deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepinfra/deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731 (Deep Infra)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.06,"output":0.18,"cache_read":0.015},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepinfra/deepseek-ai/DeepSeek-V3":{"id":"deepinfra/deepseek-ai/DeepSeek-V3","name":"DeepSeek-V3 (Deep Infra)","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":8192},"cost":{"input":0.32,"output":0.89},"canonical_model_id":"deepseek/deepseek-v3"},"deepinfra/deepseek-ai/DeepSeek-V3-0324":{"id":"deepinfra/deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324 (Deep Infra)","description":"March 2025 checkpoint of DeepSeek-V3 with improved reasoning and coding","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.24,"output":0.9,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepinfra/deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepinfra/deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash (Deep Infra)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepinfra/deepseek-ai/DeepSeek-R1-0528":{"id":"deepinfra/deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek R1 0528 (Deep Infra)","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.5,"output":2.15,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepinfra/deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepinfra/deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813 (Deep Infra)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.3,"output":2.6,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepinfra/deepseek-ai/DeepSeek-R1":{"id":"deepinfra/deepseek-ai/DeepSeek-R1","name":"DeepSeek-R1 (Deep Infra)","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.7,"output":2.4},"canonical_model_id":"deepseek/deepseek-r1"},"deepinfra/NousResearch/Hermes-3-Llama-3.1-70B":{"id":"deepinfra/NousResearch/Hermes-3-Llama-3.1-70B","name":"Hermes 3 70B Instruct (Deep Infra)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"nousresearch","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-18","last_updated":"2024-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.7,"output":0.7},"canonical_model_id":"nousresearch/hermes-3-llama-3.1-70b"},"deepinfra/NousResearch/Hermes-3-Llama-3.1-405B":{"id":"deepinfra/NousResearch/Hermes-3-Llama-3.1-405B","name":"Hermes 3 405B Instruct (Deep Infra)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"nousresearch","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-16","last_updated":"2024-08-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":1,"output":1},"canonical_model_id":"nousresearch/hermes-3-llama-3.1-405b"},"deepinfra/tencent/Hy4-preview":{"id":"deepinfra/tencent/Hy4-preview","name":"Hy4 preview (Deep Infra)","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"deepinfra/tencent/Hy3":{"id":"deepinfra/tencent/Hy3","name":"Hy3 (Deep Infra)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.13,"output":0.53,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"deepinfra/mistralai/Mistral-Small-24B-Instruct-2501":{"id":"deepinfra/mistralai/Mistral-Small-24B-Instruct-2501","name":"Mistral Small 3 (Deep Infra)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.05,"output":0.08},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"deepinfra/mistralai/Mixtral-8x7B-Instruct-v0.1":{"id":"deepinfra/mistralai/Mixtral-8x7B-Instruct-v0.1","name":"Mixtral 8x7B Instruct v0.1 (Deep Infra)","description":"Open sparse mixture-of-experts Mistral instruction model","family":"mistral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.4,"output":0.4},"canonical_model_id":"mistral/mixtral-8x7b-instruct-v0.1"},"deepinfra/microsoft/WizardLM-2-8x22B":{"id":"deepinfra/microsoft/WizardLM-2-8x22B","name":"WizardLM 2 8x22B (Deep Infra)","description":"Microsoft WizardLM instruction-tuned Mixtral MoE for multilingual dialogue and complex tasks","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-04-15","last_updated":"2024-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":8000},"cost":{"input":0.48,"output":0.48},"canonical_model_id":"microsoft/wizardlm-2-8x22b"},"deepinfra/moonshotai/Kimi-K2.5":{"id":"deepinfra/moonshotai/Kimi-K2.5","name":"Kimi K2.5 (Deep Infra)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"deepinfra/moonshotai/Kimi-K2-Instruct":{"id":"deepinfra/moonshotai/Kimi-K2-Instruct","name":"Kimi K2 Instruct (Deep Infra)","description":"Non-thinking Kimi K2 MoE instruction model for coding and tool-using agents","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":2},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"deepinfra/openai/gpt-oss-20b":{"id":"deepinfra/openai/gpt-oss-20b","name":"GPT OSS 20B (Deep Infra)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.03,"output":0.14},"canonical_model_id":"openai/gpt-oss-20b"},"deepinfra/openai/gpt-oss-120b":{"id":"deepinfra/openai/gpt-oss-120b","name":"GPT OSS 120B (Deep Infra)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.037,"output":0.17},"canonical_model_id":"openai/gpt-oss-120b"},"deepinfra/ByteDance/Seed-2.0-mini":{"id":"deepinfra/ByteDance/Seed-2.0-mini","name":"Seed 2.0 Mini (Deep Infra)","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.1,"output":0.4,"cache_read":0.02},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"deepinfra/ByteDance/Seed-2.0-code":{"id":"deepinfra/ByteDance/Seed-2.0-code","name":"Seed 2.0 Code (Deep Infra)","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"deepinfra/ibm-granite/granite-4.2-8b":{"id":"deepinfra/ibm-granite/granite-4.2-8b","name":"Granite 4.2 8B (Deep Infra)","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.06,"output":0.25,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"deepinfra/thinkingmachines/Inkling-Small":{"id":"deepinfra/thinkingmachines/Inkling-Small","name":"Inkling Small (Deep Infra)","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"deepinfra/thinkingmachines/Inkling":{"id":"deepinfra/thinkingmachines/Inkling","name":"Inkling (Deep Infra)","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"cost":{"input":0.95,"output":4.05,"cache_read":0.16},"canonical_model_id":"thinkingmachines/inkling"},"deepinfra/meta-llama/Llama-3.2-11B-Vision-Instruct":{"id":"deepinfra/meta-llama/Llama-3.2-11B-Vision-Instruct","name":"Llama-3.2-11B-Vision-Instruct (Deep Infra)","description":"Open multimodal Llama model for image understanding, captioning, and visual QA","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.345,"output":0.345},"canonical_model_id":"meta/llama-3.2-11b-vision-instruct"},"deepinfra/meta-llama/Llama-3.2-3B-Instruct":{"id":"deepinfra/meta-llama/Llama-3.2-3B-Instruct","name":"Llama 3.2 3B Instruct (Deep Infra)","description":"Small instruction-tuned Llama model for multilingual dialogue and agentic retrieval","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.02,"output":0.02},"canonical_model_id":"meta/llama-3.2-3b-instruct"},"deepinfra/meta-llama/Llama-Guard-4-12B":{"id":"deepinfra/meta-llama/Llama-Guard-4-12B","name":"Llama Guard 4 12B (Deep Infra)","description":"Multimodal Llama 4-based safety classifier for moderating prompts and responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.18,"output":0.18},"canonical_model_id":"meta/llama-guard-4-12b"},"deepinfra/meta-llama/Llama-Guard-3-8B":{"id":"deepinfra/meta-llama/Llama-Guard-3-8B","name":"Llama-Guard-3-8B (Deep Infra)","description":"Llama 3.1-based safety classifier for moderating prompts and model responses","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.055,"output":0.055},"canonical_model_id":"meta/llama-guard-3-8b"},"deepinfra/meta-llama/Llama-3.3-70B-Instruct":{"id":"deepinfra/meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct (Deep Infra)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.1,"output":0.32},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"deepinfra/Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"deepinfra/Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen3 VL 30B A3B Instruct (Deep Infra)","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"deepinfra/Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"deepinfra/Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3 235B-A22B Thinking 2507 (Deep Infra)","description":"Updated large open Qwen3 MoE thinking model for reasoning, math, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.23,"output":2.3,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"deepinfra/Qwen/Qwen3-VL-235B-A22B-Instruct":{"id":"deepinfra/Qwen/Qwen3-VL-235B-A22B-Instruct","name":"Qwen3 VL 235B A22B Instruct (Deep Infra)","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.88,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"deepinfra/Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"deepinfra/Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next 80B-A3B Instruct (Deep Infra)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.09,"output":1.1},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen3-Coder 480B-A35B Instruct (Deep Infra)","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":1.6},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"deepinfra/Qwen/Qwen3-Max":{"id":"deepinfra/Qwen/Qwen3-Max","name":"Qwen3 Max (Deep Infra)","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":1.2,"output":6,"cache_read":0.24},"canonical_model_id":"alibaba/qwen3-max"},"deepinfra/Qwen/Qwen2.5-7B-Instruct":{"id":"deepinfra/Qwen/Qwen2.5-7B-Instruct","name":"Qwen2.5 7B Instruct (Deep Infra)","description":"Small open Qwen2.5 instruction model for chat, structured output, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.04,"output":0.1},"canonical_model_id":"alibaba/qwen2.5-7b-instruct"},"deepinfra/Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"deepinfra/Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507 (Deep Infra)","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.09,"output":0.55},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"deepinfra/zai-org/GLM-4.7-Flash":{"id":"deepinfra/zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash (Deep Infra)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.06,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"},"deepinfra/nvidia/Nemotron-3-Nano-30B-A3B":{"id":"deepinfra/nvidia/Nemotron-3-Nano-30B-A3B","name":"Nemotron 3 Nano 30B A3B (Deep Infra)","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.05,"output":0.2,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"deepinfra/nvidia/Llama-3.1-Nemotron-70B-Instruct":{"id":"deepinfra/nvidia/Llama-3.1-Nemotron-70B-Instruct","name":"Llama 3.1 Nemotron 70B Instruct (Deep Infra)","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.6,"output":0.6},"canonical_model_id":"nvidia/llama-3.1-nemotron-70b-instruct"},"deepinfra/stepfun-ai/Step-3.5-Flash":{"id":"deepinfra/stepfun-ai/Step-3.5-Flash","name":"Step 3.5 Flash (Deep Infra)","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.09,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash"},"deepinfra/stepfun-ai/Step-5-Preview":{"id":"deepinfra/stepfun-ai/Step-5-Preview","name":"Step 5 Preview (Deep Infra)","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1000000},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"deepinfra/stepfun-ai/Step-3.7-Flash":{"id":"deepinfra/stepfun-ai/Step-3.7-Flash","name":"Step 3.7 Flash (Deep Infra)","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"deepinfra/Gryphe/MythoMax-L2-13b":{"id":"deepinfra/Gryphe/MythoMax-L2-13b","name":"MythoMax L2 13B (Deep Infra)","description":"Llama 2 merge combining MythoLogic and Huginn for creative writing and roleplay","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":3200},"cost":{"input":0.4,"output":0.4},"canonical_model_id":"gryphe/mythomax-l2-13b"},"azure/gpt-4.1-nano":{"id":"azure/gpt-4.1-nano","name":"GPT-4.1 nano (Azure)","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"azure/gpt-5.2-codex":{"id":"azure/gpt-5.2-codex","name":"GPT-5.2 Codex (Azure)","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"azure/gpt-5.1-codex-max":{"id":"azure/gpt-5.1-codex-max","name":"GPT-5.1 Codex Max (Azure)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"azure/gpt-5.1-codex":{"id":"azure/gpt-5.1-codex","name":"GPT-5.1 Codex (Azure)","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"azure/gpt-4.1-nano@eu":{"id":"azure/gpt-4.1-nano@eu","name":"GPT-4.1 nano (Azure, EU)","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.11,"output":0.44,"cache_read":0.0275},"canonical_model_id":"openai/gpt-4.1-nano"},"azure/gpt-5.1-codex-mini":{"id":"azure/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini (Azure)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"arkanecloud/ministral-14b":{"id":"arkanecloud/ministral-14b","name":"Ministral 14B (Arkanecloud)","description":"Compact multimodal Mistral model for local assistants, edge agents, and efficient tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":262144},"cost":{"input":0.15,"output":0.15,"cache_read":0.15},"canonical_model_id":"mistral/ministral-14b"},"arkanecloud/deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"arkanecloud/deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (Arkanecloud)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.075},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"arkanecloud/deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"arkanecloud/deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731 (Arkanecloud)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.4,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"arkanecloud/deepseek-ai/DeepSeek-V4.1-Flash":{"id":"arkanecloud/deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash (Arkanecloud)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.075},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"arkanecloud/openai/gpt-oss-120b":{"id":"arkanecloud/openai/gpt-oss-120b","name":"GPT OSS 120B (Arkanecloud)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-oss-120b"},"arkanecloud/Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"arkanecloud/Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507 (Arkanecloud)","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":16384},"cost":{"input":0.25,"output":1,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"arkanecloud/nvidia/nemotron-3-ultra-550b-a55b":{"id":"arkanecloud/nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B (Arkanecloud)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512288,"output":128000},"cost":{"input":0.6,"output":3.5,"cache_read":0.2},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"arkanecloud/nvidia/nemotron-3-super-120b-a12b":{"id":"arkanecloud/nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B (Arkanecloud)","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":262144},"cost":{"input":0.4,"output":0.8,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"sference/deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"sference/deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017 (Sference)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.35,"output":1.32,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"sference/deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"sference/deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731 (Sference)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"xai/grok-4.20-0309-non-reasoning":{"id":"xai/grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.20-0309-reasoning":{"id":"xai/grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-latest":{"id":"xai/grok-latest","name":"Grok Latest (Grok 4.7)","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"xai/grok-build-0.1":{"id":"xai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"xai/grok-4-fast-non-reasoning":{"id":"xai/grok-4-fast-non-reasoning","name":"X-Ai/Grok-4-Fast-Non-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05,"tiers":[{"input":0.4,"output":1,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"tsystems/gpt-oss-120b":{"id":"tsystems/gpt-oss-120b","name":"GPT OSS 120B (Tsystems)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.22254,"output":0.723255,"cache_read":0.033381},"canonical_model_id":"openai/gpt-oss-120b"},"infomaniak/mistralai/Ministral-3-14B-Instruct-2512":{"id":"infomaniak/mistralai/Ministral-3-14B-Instruct-2512","name":"Ministral 3 14B (Infomaniak)","description":"Open vision-language model for efficient local deployment, instruction following, and tool use","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"output":262144},"cost":{"input":0.33381,"output":0.44508},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"ionos/openai/gpt-oss-120b":{"id":"ionos/openai/gpt-oss-120b","name":"GPT OSS 120B (IONOS)","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.166905,"output":0.723255},"canonical_model_id":"openai/gpt-oss-120b"},"ionos/meta-llama/Llama-3.3-70B-Instruct":{"id":"ionos/meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct (IONOS)","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.723255,"output":0.723255},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"ionos/Qwen/Qwen3-Coder-Next":{"id":"ionos/Qwen/Qwen3-Coder-Next","name":"Qwen3 Coder Next (IONOS)","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":65536},"cost":{"input":0.166905,"output":0.89016},"canonical_model_id":"alibaba/qwen3-coder-next"}}},"ai-router":{"id":"ai-router","env":["AI_ROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.ai-router.dev/v1","name":"AI-ROUTER","doc":"https://ai-router.dev/openai-compatible-api-gateway/","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"openai/gpt-5.6-sol"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":6,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"openai/gpt-5.6-terra"}}},"bothub":{"id":"bothub","env":["BOTHUB_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://openai.bothub.ru/v1","name":"Bothub","doc":"https://bothub.ru/models","models":{"gemma-4-31b-it:free":{"id":"gemma-4-31b-it:free","name":"Gemma 4 31B IT (free)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.7671,"output":5.3011},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4243,"output":4.4765},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1566,"output":0.522},"canonical_model_id":"zhipuai/glm-5.3-flash"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2677,"output":1.6064},"canonical_model_id":"openai/gpt-5.6-luna"},"nemotron-3-ultra-550b-a55b:free":{"id":"nemotron-3-ultra-550b-a55b:free","name":"Nemotron 3 Ultra (free)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.589,"output":1.7671},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"muse-spark-1.3-contributor":{"id":"muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.2},"canonical_model_id":"meta/muse-spark-1.3"}}},"minimax-coding-plan":{"id":"minimax-coding-plan","env":["MINIMAX_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://api.minimax.io/anthropic/v1","name":"MiniMax Token Plan (minimax.io)","doc":"https://platform.minimax.io/docs/token-plan/intro","models":{"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5-highspeed":{"id":"MiniMax-M2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.7-highspeed":{"id":"MiniMax-M2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M3.1-Flash-Preview":{"id":"MiniMax-M3.1-Flash-Preview","name":"MiniMax-M3.1-Flash-Preview","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-27","last_updated":"2026-09-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":512000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash-Preview"},"MiniMax-M3.1-Flash":{"id":"MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"MiniMax-M2":{"id":"MiniMax-M2","name":"MiniMax-M2","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0}}}},"neuralwatt":{"id":"neuralwatt","env":["NEURALWATT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.neuralwatt.com/v1","name":"Neuralwatt","doc":"https://portal.neuralwatt.com/docs","models":{"glm-5.3-flex":{"id":"glm-5.3-flex","name":"GLM 5.3 Flex","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":0.9425,"output":2.925,"cache_read":0.09425},"canonical_model_id":"zhipuai/glm-5.3"},"qwen-3.8-27b-flex":{"id":"qwen-3.8-27b-flex","name":"Qwen3.8 27B Flex","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":131072},"cost":{"input":0.2925,"output":2.08,"cache_read":0.1625},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen3.6-35b-flex":{"id":"qwen3.6-35b-flex","name":"Qwen3.6 35B Flex","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131056,"output":131056},"cost":{"input":0.1885,"output":0.7475,"cache_read":0.01885},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"kimi-k3-flex":{"id":"kimi-k3-flex","name":"Kimi K3 Flex","description":"Kimi K3 on the flex tier: discounted, best-effort latency, requests may be held under load","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":1.95,"output":9.75,"cache_read":0.195},"canonical_model_id":"moonshotai/kimi-k3"},"gemma-4-31b":{"id":"gemma-4-31b","name":"Gemma 4 31B","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":16384},"cost":{"input":0.144,"output":0.42,"cache_read":0.0144},"canonical_model_id":"google/gemma-4-31b-it"},"kimi-k3-fast":{"id":"kimi-k3-fast","name":"Kimi K3 Fast","description":"Kimi K3 with thinking disabled for low-latency tool calling, vision, and JSON work","family":"kimi-k3","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"kimi-k2.7-code-fast":{"id":"kimi-k2.7-code-fast","name":"Kimi K2.7 Code Fast","description":"Kimi K2.7 Code with reasoning capped to a short budget for lower latency; reasoning cannot be disabled on this model","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":262128},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.095},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash-speed":{"id":"deepseek-v4-flash-speed","name":"DeepSeek V4 Flash (Speed)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"glm-5.3-flash-flex":{"id":"glm-5.3-flash-flex","name":"GLM-5.3 Flash Flex","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":0.0975,"output":0.325,"cache_read":0.0195},"canonical_model_id":"zhipuai/glm-5.3-flash"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.87,"output":1.74,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"qwen-3.8-27b":{"id":"qwen-3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":131072},"cost":{"input":0.45,"output":3.2,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-27b"},"glm-5.3":{"id":"glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":1.45,"output":4.5,"cache_read":0.145},"canonical_model_id":"zhipuai/glm-5.3"},"mimo-v2.6-pro-flex":{"id":"mimo-v2.6-pro-flex","name":"MiMo-V2.6-Pro Flex","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.5655,"output":1.131,"cache_read":0.0234},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":262128},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.095},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen3.6-35b-fast":{"id":"qwen3.6-35b-fast","name":"Qwen3.6 35B Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131056,"output":131056},"cost":{"input":0.29,"output":1.15,"cache_read":0.029},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":1048560},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"deepseek-v4.1-flash-flex":{"id":"deepseek-v4.1-flash-flex","name":"DeepSeek V4.1 Flash Flex","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.0975,"output":0.39,"cache_read":0.00975},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"qwen3.6-35b":{"id":"qwen3.6-35b","name":"Qwen3.6 35B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131056,"output":131056},"cost":{"input":0.29,"output":1.15,"cache_read":0.029},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"deepseek-v4-flash-flex":{"id":"deepseek-v4-flash-flex","name":"DeepSeek V4 Flash Flex","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048560,"output":393216},"cost":{"input":0.091,"output":0.182,"cache_read":0.0182},"canonical_model_id":"deepseek/deepseek-v4-flash"},"kimi-k2.7-code-flex":{"id":"kimi-k2.7-code-flex","name":"Kimi K2.7 Code Flex","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262128,"output":262128},"status":"deprecated","cost":{"input":0.6175,"output":2.6,"cache_read":0.06175},"canonical_model_id":"moonshotai/kimi-k2.7-code"}}},"meganova":{"id":"meganova","env":["MEGANOVA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.meganova.ai/v1","name":"Meganova","doc":"https://docs.meganova.ai","models":{"XiaomiMiMo/MiMo-V2-Flash":{"id":"XiaomiMiMo/MiMo-V2-Flash","name":"MiMo V2 Flash","description":"MiMo flash model for fast multimodal assistance and agent workflows","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12-01","release_date":"2025-12-16","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32000},"status":"deprecated","cost":{"input":0.1,"output":0.3},"canonical_model_id":"xiaomi/mimo-v2-flash"},"MiniMaxAI/MiniMax-M2.1":{"id":"MiniMaxAI/MiniMax-M2.1","name":"MiniMax M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.28,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.1"},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.15},"canonical_model_id":"minimax/MiniMax-M2.5"},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.19,"output":0.79},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V3.2-Exp":{"id":"deepseek-ai/DeepSeek-V3.2-Exp","name":"DeepSeek V3.2 Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-10","last_updated":"2025-10-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.26,"output":0.38,"cache_read":0.13}},"deepseek-ai/DeepSeek-V3-0324":{"id":"deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.275,"output":1.1},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-07","release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":64000},"cost":{"input":0.5,"output":2.15,"cache_read":0.4},"canonical_model_id":"deepseek/deepseek-r1-0528"},"mistralai/Mistral-Small-3.2-24B-Instruct-2506":{"id":"mistralai/Mistral-Small-3.2-24B-Instruct-2506","name":"Mistral Small 3.2 24B Instruct","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"mistral/mistral-small-2506"},"mistralai/Mistral-Nemo-Instruct-2407":{"id":"mistralai/Mistral-Nemo-Instruct-2407","name":"Mistral Nemo Instruct 2407","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.02,"output":0.04},"canonical_model_id":"mistral/mistral-nemo"},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2026-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/Kimi-K2-Thinking":{"id":"moonshotai/Kimi-K2-Thinking","name":"Kimi K2 Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":2.6},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama 3.3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen2.5-VL-32B-Instruct":{"id":"Qwen/Qwen2.5-VL-32B-Instruct","name":"Qwen2.5 VL 32B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.2,"output":0.6}},"Qwen/Qwen3.5-Plus":{"id":"Qwen/Qwen3.5-Plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2.4,"reasoning":2.4},"canonical_model_id":"alibaba/qwen3.5-plus"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.09,"output":0.1},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.45,"output":1.9},"canonical_model_id":"zhipuai/glm-4.6"},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.4,"output":1.75,"cache_read":0.08},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.8,"output":2.56,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"}}},"crusoe":{"id":"crusoe","env":["CRUSOE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inference.crusoecloud.com/v1","name":"Crusoe","doc":"https://docs.crusoecloud.com/managed-inference/overview","models":{"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.14,"output":0.4,"cache_read":0.14},"canonical_model_id":"google/gemma-4-31b-it"},"deepseek-ai/DeepSeek-V3-0324":{"id":"deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324","description":"March 2025 checkpoint of DeepSeek-V3 with improved reasoning and coding","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"status":"deprecated","cost":{"input":0.5,"output":1.5,"cache_read":0.25},"canonical_model_id":"deepseek/deepseek-v3-0324"},"zai/GLM-5.2":{"id":"zai/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai/GLM-5.1":{"id":"zai/GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"status":"deprecated","cost":{"input":1.2,"output":4.4,"cache_read":0.25},"canonical_model_id":"zhipuai/glm-5.1"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.7,"output":3.5,"cache_read":0.35},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.05,"output":0.25,"cache_read":0.05},"canonical_model_id":"openai/gpt-oss-120b"},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.25,"output":0.75,"cache_read":0.13},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":0.22,"output":0.8,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B":{"id":"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":2.4,"cache_read":0.15},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B":{"id":"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.05,"output":0.2,"cache_read":0.03},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/Nemotron-3-Nano-Omni-Reasoning-30B-A3B":{"id":"nvidia/Nemotron-3-Nano-Omni-Reasoning-30B-A3B","name":"Nemotron 3 Nano Omni 30B A3B Reasoning","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.3,"output":1.83,"cache_read":0.3,"input_audio":0.5},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"}}},"llmgateway":{"id":"llmgateway","env":["LLMGATEWAY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.llmgateway.io/v1","name":"DevPass (LLM Gateway)","doc":"https://llmgateway.io/docs","models":{"gpt-live-transcribe":{"id":"gpt-live-transcribe","type":"transcription","name":"GPT-Live-Transcribe","description":"Low-latency streaming speech-to-text model with keyword and language hints","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-live-transcribe"},"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625,"tiers":[{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5}},"canonical_model_id":"alibaba/qwen3.6-plus"},"glm-5.2-fast":{"id":"glm-5.2-fast","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2.156,"output":6.776,"cache_read":0.429},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-5.2-pro":{"id":"gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"grok-4-6":{"id":"grok-4-6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"qwen3-30b-a3b":{"id":"qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.095,"output":0.285},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"qwen3-vl-235b-a22b-instruct":{"id":"qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.2,"output":0.88,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen-plus-latest":{"id":"qwen-plus-latest","name":"Qwen Plus Latest","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-01-25","last_updated":"2025-01-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":8192},"cost":{"input":0.4,"output":1.2,"cache_read":0.08,"cache_write":0.5}},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"ling-3.0-flash-vl":{"id":"ling-3.0-flash-vl","name":"Ling 3.0 Flash VL","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"codestral-2508":{"id":"codestral-2508","name":"Codestral","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":16384},"cost":{"input":0.3,"output":0.9},"canonical_model_id":"mistral/codestral-2508"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.8-flash"},"kimi-k3.1-pro-highspeed":{"id":"kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4}},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.605,"output":2.123,"cache_read":0.154,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"mistral-small-2506":{"id":"mistral-small-2506","name":"Mistral Small 3.2","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/mistral-small-2506"},"grok-4-3":{"id":"grok-4-3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-carbon"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.9,"output":9.5,"cache_read":0.19,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.8,"output":3.4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"fugu-max":{"id":"fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"llama-4-scout-17b-instruct":{"id":"llama-4-scout-17b-instruct","name":"Llama 4 Scout 17B Instruct","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":2048},"cost":{"input":0.18,"output":0.59},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"seed-2-0-pro-260328":{"id":"seed-2-0-pro-260328","name":"Seed 2.0 Pro (260328)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-28","last_updated":"2026-03-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":3,"cache_read":0.1}},"qwen3.8-omni-flash":{"id":"qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"seed-2-0-lite-260428":{"id":"seed-2-0-lite-260428","name":"Seed 2.0 Lite (260428)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.25,"output":2,"cache_read":0.05}},"minimax-m2.1":{"id":"minimax-m2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.27,"output":1.1},"canonical_model_id":"minimax/MiniMax-M2.1"},"glm-4.5-x":{"id":"glm-4.5-x","name":"GLM-4.5 X","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"beta","cost":{"input":2.2,"output":8.9,"cache_read":0.45}},"grok-4-20-reasoning":{"id":"grok-4-20-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"gemini-pro-latest":{"id":"gemini-pro-latest","name":"Gemini Pro Latest","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-27","last_updated":"2026-02-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2}},"minimax-m2.1-lightning":{"id":"minimax-m2.1-lightning","name":"MiniMax M2.1 Lightning","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.12,"output":0.48}},"reka-edge-2603":{"id":"reka-edge-2603","name":"Reka Edge 2603","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-09","last_updated":"2026-10-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":16384},"cost":{"input":0.1,"output":0.1}},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"minimax-m2.5-highspeed":{"id":"minimax-m2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"qwen-max":{"id":"qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":1.6,"output":6.4},"canonical_model_id":"alibaba/qwen-max"},"muse-spark-1.1":{"id":"muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"kimi-k3-fast":{"id":"kimi-k3-fast","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1040384,"output":131072},"cost":{"input":4.5,"output":22.5,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"mistral-medium-3-5":{"id":"mistral-medium-3-5","name":"Mistral Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"mistral/mistral-medium-3-5"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"qwen3-14b":{"id":"qwen3-14b","name":"Qwen3 14B","description":"Tool-capable chat model for instruction following and agentic application workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.076,"output":0.228}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"glm-4.5-airx":{"id":"glm-4.5-airx","name":"GLM-4.5 AirX","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.1,"output":4.5,"cache_read":0.22}},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.6-flash"},"minimax-text-01":{"id":"minimax-text-01","name":"MiniMax Text 01","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-01-15","last_updated":"2025-01-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.2,"output":1.1}},"qwen3-vl-30b-a3b-instruct":{"id":"qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"grok-4":{"id":"grok-4","name":"Grok 4","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":3,"output":15,"cache_read":0.75}},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"openai/gpt-6-luna"},"seed-2-0-code-preview-260328":{"id":"seed-2-0-code-preview-260328","name":"Seed 2.0 Code Preview (260328)","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-28","last_updated":"2026-03-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":3,"cache_read":0.1}},"mistral-large-2512":{"id":"mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32768},"cost":{"input":0.08,"output":0.35,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.05},"canonical_model_id":"zhipuai/glm-4.6v"},"ministral-3b-2512":{"id":"ministral-3b-2512","name":"Ministral 3B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"mistral/ministral-3b-2512"},"ministral-8b-2512":{"id":"ministral-8b-2512","name":"Ministral 8B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.15,"output":0.15},"canonical_model_id":"mistral/ministral-8b-2512"},"grok-4-7":{"id":"grok-4-7","name":"Grok 4.7","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"qwen-plus":{"id":"qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.4,"output":1.2,"reasoning":4,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen-plus"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1.38,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.574,"output":3.011,"cache_read":0.225},"canonical_model_id":"moonshotai/kimi-k2.5"},"grok-4-5":{"id":"grok-4-5","name":"Grok 4.5","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"sonar":{"id":"sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":130000,"output":4096},"cost":{"input":0.25,"output":2.5,"cache_write":0.25},"canonical_model_id":"perplexity/sonar"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"glm-4.5":{"id":"glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32766},"cost":{"input":0.04,"output":0.19,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-20b"},"grok-build-0-1":{"id":"grok-build-0-1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":228700,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"hy-mt2-plus":{"id":"hy-mt2-plus","name":"Hy-MT2 Plus","description":"Tool-capable chat model for instruction following and agentic application workflows","family":"Hy","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0.074,"output":0.295}},"qwen35-397b-a17b":{"id":"qwen35-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1,"output":0.15},"canonical_model_id":"alibaba/qwen3.5-9b"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":384000},"cost":{"input":0.135,"output":0.54,"cache_read":0.0027},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"mistral-small-2603":{"id":"mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"mistral/mistral-small-2603"},"custom":{"id":"custom","name":"Custom Model","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0,"output":0}},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.1-flash-lite"},"minimax-m2":{"id":"minimax-m2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.2,"output":1,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"ling-3.0-flash":{"id":"ling-3.0-flash","name":"InclusionAI Ling 3.0 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash"},"fugu-ultra-v2.0":{"id":"fugu-ultra-v2.0","name":"Fugu Ultra v2.0","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5}},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.45,"output":2,"cache_read":0.19,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"gpt-5-pro":{"id":"gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"glm-5.3-fast":{"id":"glm-5.3-fast","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2.8,"output":8.8,"cache_read":0.56},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-6-sol"},"gpt-4o-transcribe":{"id":"gpt-4o-transcribe","name":"GPT-4o Transcribe","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":16000},"cost":{"input":2.5,"output":10}},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":0.375},"canonical_model_id":"google/gemini-4-argon"},"qwen3.8-2.4t-a95b":{"id":"qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1010000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"muse-wonder-1.0":{"id":"muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.5,"output":2,"cache_read":0.15},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"qwen3.5-35b-a3b":{"id":"qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.1,"output":0.5,"cache_read":0.005},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"muse-spark-1.2-contributor":{"id":"muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"granite-4.2-8b":{"id":"granite-4.2-8b","name":"Granite 4.2 8B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.06,"output":0.25,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"glm-4-32b-0414-128k":{"id":"glm-4-32b-0414-128k","name":"GLM-4 32B (0414-128k)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.1,"output":0.1}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.28,"output":1.1,"cache_read":0.056},"canonical_model_id":"minimax/MiniMax-M3"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.25,"output":3.75,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"Grok 4.1 Fast Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"kimi-k2":{"id":"kimi-k2","name":"Kimi K2","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.57,"output":2.3,"cache_read":0.5}},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":1050000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.737,"output":3.08,"cache_read":0.143},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"grok-4-20-beta-0309-reasoning":{"id":"grok-4-20-beta-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"llama-3.1-70b-instruct":{"id":"llama-3.1-70b-instruct","name":"Llama 3.1 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":2048},"status":"beta","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"grok-4-20-beta-0309-non-reasoning":{"id":"grok-4-20-beta-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":384000},"cost":{"input":0.076,"output":0.153,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"nemotron-3-ultra-550b":{"id":"nemotron-3-ultra-550b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":0.5,"output":2.2,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"gpt-4o-mini-transcribe":{"id":"gpt-4o-mini-transcribe","name":"GPT-4o Mini Transcribe","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-03-20","last_updated":"2025-03-20","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":16000,"output":16000},"cost":{"input":1.25,"output":5}},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.135,"output":0.4},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.05,"cache_write":0.3125},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen3.7-flash":{"id":"qwen3.7-flash","name":"Qwen3.7 Flash","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":1000000},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.0375},"canonical_model_id":"alibaba/qwen3.7-flash"},"kimi-k2.7-code-highspeed":{"id":"kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.088,"output":0.25,"cache_read":0.025},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"grok-4-20-non-reasoning":{"id":"grok-4-20-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"glm-5-turbo":{"id":"glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.5-flash-lite"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.25,"cache_read":0.01},"canonical_model_id":"google/gemma-4-31b-it"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.4-pro"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":128000},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"qwen3.6-27b":{"id":"qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":65536},"cost":{"input":0.15,"output":1.35},"canonical_model_id":"alibaba/qwen3.6-27b"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"glm-4.5-air":{"id":"glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-air"},"devstral-2512":{"id":"devstral-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/devstral-2512"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"glm-4.6":{"id":"glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.55,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.248,"output":1.485},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"auto":{"id":"auto","name":"Auto Route","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-01-01","last_updated":"2024-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0,"output":0}},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.07,"output":0.34},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"glm-4.5v":{"id":"glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"deepseek-v4.1-flash-cyber":{"id":"deepseek-v4.1-flash-cyber","name":"DeepSeek V4.1 Flash Cyber","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-29","last_updated":"2026-10-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"output":1040000},"cost":{"input":0.3,"output":1,"cache_read":0.007}},"minimax-m2.7-highspeed":{"id":"minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"qwen-flash":{"id":"qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.05,"output":0.4,"cache_read":0.01,"cache_write":0.0625},"canonical_model_id":"alibaba/qwen-flash"},"muse-glimmer-30b":{"id":"muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"llama-3.2-11b-instruct":{"id":"llama-3.2-11b-instruct","name":"Llama 3.2 11B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.07,"output":0.33}},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.36,"output":0.87,"reasoning":8.4},"canonical_model_id":"alibaba/qwen3-32b"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"muse-ember-1.0":{"id":"muse-ember-1.0","name":"Muse Ember 1.0","description":"Muse Ember is Meta's smallest and most efficient reasoning model, built for the work agents repeat all day: tool calls, coding subtasks, routing, extraction, and long-document parsing. It pairs with Muse Wonder or Muse Spark, which plan while Muse Ember handles the volume.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":524288},"cost":{"input":0.1,"output":0.5,"cache_read":0.004},"canonical_model_id":"meta/muse-ember-1.0"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"deepseek-v4-flash-0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":384000},"cost":{"input":0.08,"output":0.18,"cache_read":0.016},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"glm-5.3-flashx":{"id":"glm-5.3-flashx","name":"GLM-5.3 FlashX","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"kimi-k2.8-preview":{"id":"kimi-k2.8-preview","name":"Kimi K2.8 Preview","description":"Kimi coding model with more efficient thinking and up to 1M context, available through Kimi Code","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1,"output":4,"cache_read":0.25},"canonical_model_id":"moonshotai/kimi-k2.8-preview"},"qwen3-vl-plus":{"id":"qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":1.6,"reasoning":4.8,"cache_read":0.04,"cache_write":0.25},"canonical_model_id":"alibaba/qwen3-vl-plus"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32766},"cost":{"input":0.05,"output":0.25,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-120b"},"fugu-ultra":{"id":"fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"openai/gpt-5.6-terra"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"gpt-transcribe":{"id":"gpt-transcribe","type":"transcription","name":"GPT-Transcribe","description":"High-accuracy speech-to-text model for audio files and committed Realtime turns","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-07-28","last_updated":"2026-07-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-transcribe"},"seed-2-0-mini-260428":{"id":"seed-2-0-mini-260428","name":"Seed 2.0 Mini (260428)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.4,"cache_read":0.02}},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.54,"output":4.631,"cache_read":0.198,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"qwen3.5-27b":{"id":"qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"cost":{"input":1.36,"output":4.18,"cache_read":0.14},"canonical_model_id":"mistral/mistral-large-4"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"glm-5v-turbo":{"id":"glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":1050000},"cost":{"input":0.135,"output":0.54,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"ministral-14b-2512":{"id":"ministral-14b-2512","name":"Ministral 14B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"mistral/ministral-14b-2512"},"glm-4.7-flashx":{"id":"glm-4.7-flashx","name":"GLM-4.7-FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.07,"output":0.4,"cache_read":0.01,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"qwen3-coder-flash":{"id":"qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":997952,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"alibaba/qwen3-coder-flash"},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202800,"output":131072},"cost":{"input":0.573,"output":2.58,"cache_read":0.144,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"},"deepseek-v4.1-flash-uncensored":{"id":"deepseek-v4.1-flash-uncensored","name":"DeepSeek V4.1 Flash 1017 Uncensored (HeimdaLLM)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.18,"output":0.65,"cache_read":0.005}},"llama-4-maverick-17b-instruct":{"id":"llama-4-maverick-17b-instruct","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":2048},"cost":{"input":0.27,"output":0.85},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"muse-spark-1.3-contributor":{"id":"muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.7-flash"},"glm-4.6v-flashx":{"id":"glm-4.6v-flashx","name":"GLM-4.6V FlashX","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":0.04,"output":0.4,"cache_read":0.004}},"mistral-large-latest":{"id":"mistral-large-latest","name":"Mistral Large (latest)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":262144},"cost":{"input":4,"output":12},"canonical_model_id":"mistral/mistral-large-latest"},"qwen3.5-122b-a10b":{"id":"qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"tokengo":{"id":"tokengo","env":["TOKENGO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.tokengo.com/v1","name":"TokenGo","doc":"https://www.tokengo.com/docs","models":{"deepseek/deepseek-v3.1":{"id":"deepseek/deepseek-v3.1","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.19,"output":0.71,"cache_read":0.06},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.435,"output":0.87},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.098,"output":0.196,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":64000},"cost":{"input":0.2174,"output":0.326,"cache_read":0.06},"canonical_model_id":"deepseek/deepseek-v3.2"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":2.65,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.89,"output":3.2647,"cache_read":0.2226},"canonical_model_id":"zhipuai/glm-5"}}},"ebcloud":{"id":"ebcloud","env":["EBCLOUD_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://maas-api.ebcloud.com/v1","name":"EBCloud","doc":"https://docs.ebtech.com/ai/model-api.html","models":{"DeepSeek-V4-Flash":{"id":"DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.143,"output":0.2857},"canonical_model_id":"deepseek/deepseek-v4-flash"},"Kimi-K2.6":{"id":"Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.9286,"output":3.8571},"canonical_model_id":"moonshotai/kimi-k2.6"},"GLM-5.1":{"id":"GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.8571,"output":3.4286},"canonical_model_id":"zhipuai/glm-5.1"},"DeepSeek-V4-Pro":{"id":"DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.4286,"output":0.8571},"canonical_model_id":"deepseek/deepseek-v4-pro"}}},"moonshotai":{"id":"moonshotai","env":["MOONSHOT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.moonshot.ai/v1","name":"Moonshot AI","doc":"https://platform.moonshot.ai/docs/api/chat","models":{"kimi-k3.1-pro-highspeed":{"id":"kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"kimi-k2.7-code-highspeed":{"id":"kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code HighSpeed","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code"}}},"greenpt":{"id":"greenpt","env":["GREENPT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.greenpt.ai/v1","name":"GreenPT","doc":"https://docs.greenpt.ai","models":{"voxtral-small-24b-2507":{"id":"voxtral-small-24b-2507","name":"Voxtral Small 24B","description":"Mistral Voxtral audio-understanding model for speech and transcription tasks","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"status":"deprecated","cost":{"input":0.228,"output":0.513},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"qwen3-coder-30b-a3b-instruct":{"id":"qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":0.285,"output":1.083},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"green-l-raw":{"id":"green-l-raw","name":"Green L Raw","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.285,"output":0.912},"canonical_model_id":"mistral/mistral-small-2506"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"gemma4":{"id":"gemma4","name":"gemma4","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.57,"output":1.71},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"glm-5.2-caveman-ultra":{"id":"glm-5.2-caveman-ultra","name":"GLM-5.2 Caveman Ultra","description":"glm-5.2 carrying a built-in ruleset that compresses prose, keeping code and technical detail verbatim. The most aggressive tier, close to answer-only. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"green-r-raw":{"id":"green-r-raw","name":"Green R Raw","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.399,"output":1.083},"canonical_model_id":"openai/gpt-oss-120b"},"pixtral-12b-2409":{"id":"pixtral-12b-2409","name":"Pixtral 12B","description":"Mistral vision-language model for image understanding and multimodal chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2024-09-11","last_updated":"2024-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.285,"output":0.285},"canonical_model_id":"mistral/pixtral-12b"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.7524,"output":4.275,"cache_read":0.2508},"canonical_model_id":"moonshotai/kimi-k2.6"},"glm-5.2-ponytail-ultra":{"id":"glm-5.2-ponytail-ultra","name":"GLM-5.2 Ponytail Ultra","description":"glm-5.2 carrying a built-in ruleset that compresses generated code, preferring platform features over custom code. The most aggressive tier, close to answer-only. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"mistral-medium-3.5-128b":{"id":"mistral-medium-3.5-128b","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":2.052,"output":10.26},"canonical_model_id":"mistral/mistral-medium-2604"},"gemma-3-27b-it":{"id":"gemma-3-27b-it","name":"Gemma 3 27B","description":"Google Gemma 3 multimodal model for chat, reasoning, and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":40000,"output":8192},"status":"deprecated","cost":{"input":0.342,"output":0.684},"canonical_model_id":"google/gemma-3-27b-it"},"green-s":{"id":"green-s","type":"transcription","name":"Green S","description":"GreenPT speech-to-text model for pre-recorded and live transcription","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-01","last_updated":"2025-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":8192},"provider":{"api":"https://api.greenpt.ai"}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3.762,"output":18.81,"cache_read":0.9405},"canonical_model_id":"moonshotai/kimi-k3"},"glm-5.2-caveman-lite":{"id":"glm-5.2-caveman-lite","name":"GLM-5.2 Caveman Lite","description":"glm-5.2 carrying a built-in ruleset that compresses prose, keeping code and technical detail verbatim. The gentlest tier: it cuts filler only and keeps the explanation intact. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.2-ponytail-lite":{"id":"glm-5.2-ponytail-lite","name":"GLM-5.2 Ponytail Lite","description":"glm-5.2 carrying a built-in ruleset that compresses generated code, preferring platform features over custom code. The gentlest tier: it cuts filler only and keeps the explanation intact. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.2-ponytail":{"id":"glm-5.2-ponytail","name":"GLM-5.2 Ponytail","description":"glm-5.2 carrying a built-in ruleset that compresses generated code, preferring platform features over custom code. The middle tier, and the ruleset as its authors wrote it. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.2-honey-ultra":{"id":"glm-5.2-honey-ultra","name":"GLM-5.2 Honey Ultra","description":"glm-5.2 carrying a built-in ruleset that compresses both generated code and prose. The most aggressive tier, close to answer-only. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"mistral-small-3.2-24b-instruct-2506":{"id":"mistral-small-3.2-24b-instruct-2506","name":"Mistral Small 3.2","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.228,"output":0.456},"canonical_model_id":"mistral/mistral-small-2506"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"status":"deprecated","cost":{"input":1.756,"output":5.518},"canonical_model_id":"zhipuai/glm-5.1"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen3 235B MoE instruct model for long-context multilingual chat and reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":1.026,"output":3.078},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"glm-5.2-honey":{"id":"glm-5.2-honey","name":"GLM-5.2 Honey","description":"glm-5.2 carrying a built-in ruleset that compresses both generated code and prose. The middle tier, and the ruleset as its authors wrote it. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.798,"output":4.959},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.49346,"output":2.4673,"cache_read":0.123365},"canonical_model_id":"minimax/MiniMax-M2.5"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.255552,"output":1.27776,"cache_read":0.0127776},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.2-caveman":{"id":"glm-5.2-caveman","name":"GLM-5.2 Caveman","description":"glm-5.2 carrying a built-in ruleset that compresses prose, keeping code and technical detail verbatim. The middle tier, and the ruleset as its authors wrote it. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.27754,"output":5.11016,"cache_read":0.319385},"canonical_model_id":"zhipuai/glm-5.3"},"green-s-pro":{"id":"green-s-pro","type":"transcription","name":"Green S Pro","description":"GreenPT advanced speech-to-text model with multilingual transcription support","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-02","last_updated":"2025-02","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":8192},"provider":{"api":"https://api.greenpt.ai"}},"green-l":{"id":"green-l","name":"Green L","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.285,"output":0.912},"canonical_model_id":"mistral/mistral-small-2506"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.863555,"output":4.317775,"cache_read":0.222057},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"holo2-30b-a3b":{"id":"holo2-30b-a3b","name":"Holo2 30B A3B","description":"H Company Holo2 vision model for GUI navigation and computer-use agents","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-11","last_updated":"2025-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":22016,"output":16384},"status":"deprecated","cost":{"input":0.399,"output":0.969}},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"output":16384},"cost":{"input":1.254,"output":1.254},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"kimi-k2.6-fast":{"id":"kimi-k2.6-fast","name":"Kimi K2.6 Fast","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":1.655,"output":8.778},"canonical_model_id":"moonshotai/kimi-k2.6"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.127754,"output":0.511016,"cache_read":0.0255508},"canonical_model_id":"zhipuai/glm-5.3-flash"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.342,"output":2.052},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"green-r":{"id":"green-r","name":"Green R","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.399,"output":1.083},"canonical_model_id":"openai/gpt-oss-120b"},"glm-5.2-honey-lite":{"id":"glm-5.2-honey-lite","name":"GLM-5.2 Honey Lite","description":"glm-5.2 carrying a built-in ruleset that compresses both generated code and prose. The gentlest tier: it cuts filler only and keeps the explanation intact. Same upstream model and price per token as glm-5.2, with fewer output tokens.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.738325,"output":5.1589,"cache_read":0.4486},"canonical_model_id":"zhipuai/glm-5.2"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.1596,"output":0.399,"cache_read":0.0456},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.228,"output":0.798},"canonical_model_id":"openai/gpt-oss-120b"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.402192,"output":1.61994,"cache_read":0.044688},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"devstral-2-123b-instruct-2512":{"id":"devstral-2-123b-instruct-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":16384},"status":"deprecated","cost":{"input":0.57,"output":2.736},"canonical_model_id":"mistral/devstral-2512"}}},"jalapeno":{"id":"jalapeno","env":["JALAPENO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.jalapeno-cloud.ai/v1","name":"Jalapeno Cloud","doc":"https://www.jalapeno-cloud.ai/docs/","models":{"Kimi-K3":{"id":"Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"DeepSeek-V4-Flash":{"id":"DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"Qwen3.5-397B-A17B":{"id":"Qwen3.5-397B-A17B","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Kimi-K2.7-Code":{"id":"Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":271360,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"Qwen3.5-27B":{"id":"Qwen3.5-27B","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen3-VL-235B-A22B-Instruct":{"id":"Qwen3-VL-235B-A22B-Instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":129024,"output":32768},"status":"deprecated","cost":{"input":0.3,"output":1.5},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"GLM-5.2":{"id":"GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":129024,"output":32768},"status":"deprecated","cost":{"input":0.15,"output":1.5},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"Kimi-K2.5":{"id":"Kimi-K2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":180224},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"Qwen3.5-122B-A10B":{"id":"Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"Qwen3-Next-80B-A3B-Thinking":{"id":"Qwen3-Next-80B-A3B-Thinking","name":"Qwen3-Next 80B-A3B (Thinking)","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0.15,"output":1.5},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"Hy3":{"id":"Hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"input":192000,"output":128000},"status":"deprecated","cost":{"input":0.14,"output":0.58},"canonical_model_id":"tencent/hy3"},"GLM-5.1":{"id":"GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1.38,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"DeepSeek-V4-Pro":{"id":"DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.6,"output":3.38,"cache_read":0.14},"canonical_model_id":"deepseek/deepseek-v4-pro"},"Qwen3.5-35B-A3B":{"id":"Qwen3.5-35B-A3B","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"Qwen3-VL-235B-A22B-Thinking":{"id":"Qwen3-VL-235B-A22B-Thinking","name":"Qwen3 VL 235B A22B Thinking","description":"Qwen vision-language thinking model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.98,"output":3.95},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-thinking"}}},"stackit":{"id":"stackit","env":["STACKIT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1","name":"STACKIT","doc":"https://docs.stackit.cloud/products/data-and-ai/ai-model-serving/basics/available-shared-models","models":{"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":37000,"output":4096},"status":"deprecated","cost":{"input":0.53,"output":0.76},"canonical_model_id":"google/gemma-3-27b-it"},"intfloat/e5-mistral-7b-instruct":{"id":"intfloat/e5-mistral-7b-instruct","type":"embedding","name":"E5 Mistral 7B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0.02243,"output":0}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.18,"output":0.29},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":8192},"cost":{"input":0.53,"output":0.76},"canonical_model_id":"openai/gpt-oss-120b"},"cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic":{"id":"cortecs/Llama-3.3-70B-Instruct-FP8-Dynamic","name":"Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.53,"output":0.76},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3-VL-235B-A22B-Instruct-FP8":{"id":"Qwen/Qwen3-VL-235B-A22B-Instruct-FP8","name":"Qwen3-VL 235B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":218000,"output":16384},"cost":{"input":1.76,"output":2.05},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":0.53,"output":0.76},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-VL-Embedding-8B":{"id":"Qwen/Qwen3-VL-Embedding-8B","type":"embedding","name":"Qwen3-VL Embedding 8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"cost":{"input":0.09,"output":0}}}},"tencent-token-plan":{"id":"tencent-token-plan","env":["TENCENT_TOKEN_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.lkeap.cloud.tencent.com/plan/v3","name":"Tencent Token Plan","doc":"https://cloud.tencent.com/document/product/1823/130060","models":{"hy4":{"id":"hy4","name":"Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"tencent/hy3"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"}}},"alibaba":{"id":"alibaba","env":["DASHSCOPE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://dashscope-intl.aliyuncs.com/compatible-mode/v1","name":"Alibaba","doc":"https://www.alibabacloud.com/help/en/model-studio/models","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625,"tiers":[{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.2,"cache_write":2.5}}},"qwen3-coder-30b-a3b-instruct":{"id":"qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.45,"output":2.25,"tiers":[{"input":0.75,"output":3.75,"tier":{"type":"context","size":32000}},{"input":1.2,"output":6,"tier":{"type":"context","size":128000}}]}},"qwen-vl-plus":{"id":"qwen-vl-plus","name":"Qwen-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-08-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.21,"output":0.63}},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.28,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"qwen3.8-omni-flash":{"id":"qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen3-coder-480b-a35b-instruct":{"id":"qwen3-coder-480b-a35b-instruct","name":"Qwen3-Coder 480B-A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":1.5,"output":7.5,"tiers":[{"input":2.7,"output":13.5,"tier":{"type":"context","size":32000}},{"input":4.5,"output":22.5,"tier":{"type":"context","size":128000}}]}},"qwen2-5-omni-7b":{"id":"qwen2-5-omni-7b","name":"Qwen2.5-Omni 7B","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-12","last_updated":"2024-12","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":true,"limit":{"context":32768,"output":2048},"status":"deprecated","cost":{"input":0.1,"output":0.4,"input_audio":6.76}},"qwen3-livetranslate-flash-realtime":{"id":"qwen3-livetranslate-flash-realtime","type":"realtime","name":"Qwen3-LiveTranslate Flash Realtime","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":53248,"output":4096},"status":"deprecated","provider":{"api":"wss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime"},"cost":{"input":10,"output":10,"input_audio":10,"output_audio":38}},"qwen-max":{"id":"qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":1.6,"output":6.4}},"qwen3-coder-plus":{"id":"qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1,"output":5}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"qwen3-14b":{"id":"qwen3-14b","name":"Qwen3 14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.35,"output":1.4,"reasoning":4.2}},"qwen3-omni-flash-realtime":{"id":"qwen3-omni-flash-realtime","type":"realtime","name":"Qwen3-Omni Flash Realtime","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":65536,"output":16384},"status":"deprecated","provider":{"api":"wss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime"},"cost":{"input":0.52,"output":1.99,"input_audio":4.57,"output_audio":18.13}},"qwen-plus-character-ja":{"id":"qwen-plus-character-ja","name":"Qwen Plus Character (Japanese)","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":512},"cost":{"input":0.5,"output":1.4}},"qwen3.6-max-preview":{"id":"qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":1.3,"output":7.8,"cache_read":0.13,"cache_write":1.625}},"qwen3.5-flash":{"id":"qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen-plus":{"id":"qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.2,"reasoning":4,"cache_read":0.08,"cache_write":0.5,"tiers":[{"input":1.2,"output":3.6,"reasoning":12,"cache_read":0.24,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":3.6,"reasoning":12,"cache_read":0.24,"cache_write":1.5}}},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen3-next-80b-a3b-thinking":{"id":"qwen3-next-80b-a3b-thinking","name":"Qwen3-Next 80B-A3B (Thinking)","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.5,"output":6}},"qwen3-omni-flash":{"id":"qwen3-omni-flash","name":"Qwen3-Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":65536,"output":16384},"cost":{"input":0.43,"output":1.66,"input_audio":3.81,"output_audio":15.11}},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6}},"qwen-mt-plus":{"id":"qwen-mt-plus","name":"Qwen-MT Plus","description":"Translation model for multilingual conversion, localization, and cross-language workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-01","last_updated":"2025-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"cost":{"input":2.46,"output":7.37}},"qwen3-vl-30b-a3b":{"id":"qwen3-vl-30b-a3b","name":"Qwen3-VL 30B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.2,"output":0.8,"reasoning":2.4}},"qwen3.5-35b-a3b":{"id":"qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2}},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-04","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5}}},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"cache_write":3.125}},"qwen3-asr-flash":{"id":"qwen3-asr-flash","type":"transcription","name":"Qwen3-ASR Flash","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-04","release_date":"2025-09-08","last_updated":"2025-09-08","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":53248,"output":4096}},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.3125,"tiers":[{"input":1,"output":4,"cache_read":0.1,"cache_write":1.25,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1,"output":4,"cache_read":0.1,"cache_write":1.25}}},"qwen3.7-flash":{"id":"qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":131072},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.0375,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"cache_write":0.125,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"cache_write":0.25,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen3-max":{"id":"qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":1.2,"output":6}},"qwen-mt-turbo":{"id":"qwen-mt-turbo","name":"Qwen-MT Turbo","description":"Translation model for multilingual conversion, localization, and cross-language workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-01","last_updated":"2025-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"status":"deprecated","cost":{"input":0.16,"output":0.49}},"qwen-omni-turbo":{"id":"qwen-omni-turbo","name":"Qwen-Omni Turbo","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-19","last_updated":"2025-03-26","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32768,"output":2048},"status":"deprecated","cost":{"input":0.07,"output":0.27,"input_audio":4.44,"output_audio":8.89}},"qwen-turbo":{"id":"qwen-turbo","name":"Qwen Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":16384},"status":"deprecated","cost":{"input":0.05,"output":0.2,"reasoning":0.5}},"qwen3.6-27b":{"id":"qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.6,"output":3.6}},"qwen3-vl-235b-a22b":{"id":"qwen3-vl-235b-a22b","name":"Qwen3-VL 235B-A22B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.7,"output":2.8,"reasoning":8.4}},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.375,"output":2.25}},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2.4,"reasoning":2.4,"tiers":[{"input":0.5,"output":3,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.5,"output":3}}},"qwq-plus":{"id":"qwq-plus","name":"QwQ Plus","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-05","last_updated":"2025-03-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.8,"output":2.4}},"qwen-flash":{"id":"qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.05,"output":0.4,"cache_read":0.01,"cache_write":0.0625,"tiers":[{"input":0.25,"output":2,"cache_read":0.05,"cache_write":0.3125,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.25,"output":2,"cache_read":0.05,"cache_write":0.3125}}},"qwen3-next-80b-a3b-instruct":{"id":"qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.5,"output":2}},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.7,"output":2.8,"reasoning":8.4}},"qwen3-8b":{"id":"qwen3-8b","name":"Qwen3 8B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.18,"output":0.7,"reasoning":2.1}},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.088},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen-omni-turbo-realtime":{"id":"qwen-omni-turbo-realtime","type":"realtime","name":"Qwen-Omni Turbo Realtime","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-05-08","last_updated":"2025-05-08","modalities":{"input":["text","image","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32768,"output":2048},"status":"deprecated","provider":{"api":"wss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime"},"cost":{"input":0.27,"output":1.07,"input_audio":4.44,"output_audio":8.89}},"qwen3-235b-a22b":{"id":"qwen3-235b-a22b","name":"Qwen3 235B-A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.7,"output":2.8,"reasoning":8.4}},"qwen3-vl-plus":{"id":"qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":1.6,"cache_read":0.04,"cache_write":0.25,"tiers":[{"input":0.3,"output":2.4,"cache_read":0.06,"cache_write":0.375,"tier":{"type":"context","size":32000}},{"input":0.6,"output":4.8,"cache_read":0.12,"cache_write":0.75,"tier":{"type":"context","size":128000}}]}},"qwen-vl-max":{"id":"qwen-vl-max","name":"Qwen-VL Max","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-08","last_updated":"2025-08-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.8,"output":3.2}},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen3.5-27b":{"id":"qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4}},"qwen3-coder-flash":{"id":"qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.06,"cache_write":0.375,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.1,"cache_write":0.625,"tier":{"type":"context","size":32000}},{"input":0.8,"output":4,"cache_read":0.16,"cache_write":1,"tier":{"type":"context","size":128000}},{"input":1.6,"output":9.6,"cache_read":0.32,"cache_write":2,"tier":{"type":"context","size":256000}}]}},"qwen-vl-ocr":{"id":"qwen-vl-ocr","name":"Qwen-VL OCR","description":"OCR model for extracting structured text from documents and screenshots","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-10-28","last_updated":"2025-04-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":34096,"output":4096},"cost":{"input":0.07,"output":0.16}},"qwen3.5-122b-a10b":{"id":"qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2}},"qvq-max":{"id":"qvq-max","name":"QVQ Max","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qvq","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-25","last_updated":"2025-03-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":1.2,"output":4.8}}}},"groq":{"id":"groq","env":["GROQ_API_KEY"],"npm":"@ai-sdk/groq","name":"Groq","doc":"https://console.groq.com/docs/models","models":{"whisper-large-v3":{"id":"whisper-large-v3","type":"transcription","name":"Whisper","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"canonical_model_id":"openai/whisper-large-v3"},"llama-3.1-8b-instant":{"id":"llama-3.1-8b-instant","name":"Llama 3.1 8B","description":"Compact Llama instruction model for fast chat and local deployment","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":0.05,"output":0.08},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"allam-2-7b":{"id":"allam-2-7b","name":"ALLaM-2-7b","description":"ALLaM-2-7b instruction tuned model by SDAIA","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-01-23","last_updated":"2025-01-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"sdaia/allam-2-7b"},"llama-3.3-70b-versatile":{"id":"llama-3.3-70b-versatile","name":"Llama 3.3 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.59,"output":0.79},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"whisper-large-v3-turbo":{"id":"whisper-large-v3-turbo","type":"transcription","name":"Whisper Large V3 Turbo","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2024-10-01","last_updated":"2024-10-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"canonical_model_id":"openai/whisper-large-v3-turbo"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","default","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"beta","cost":{"input":0.8,"output":4},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","default"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.6,"output":3,"cache_read":0.3},"canonical_model_id":"alibaba/qwen3.6-27b"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"Safety GPT OSS 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"status":"beta","cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-oss-120b"},"meta-llama/llama-prompt-guard-2-86m":{"id":"meta-llama/llama-prompt-guard-2-86m","name":"Prompt Guard 2 86M","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":512},"status":"beta","cost":{"input":0.04,"output":0.04},"canonical_model_id":"meta/llama-prompt-guard-2-86m"},"meta-llama/llama-prompt-guard-2-22m":{"id":"meta-llama/llama-prompt-guard-2-22m","name":"Llama Prompt Guard 2 22M","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":512},"status":"beta","cost":{"input":0.03,"output":0.03},"canonical_model_id":"meta/llama-prompt-guard-2-22m"},"canopylabs/orpheus-v1-english":{"id":"canopylabs/orpheus-v1-english","type":"speech","name":"Canopy Labs Orpheus V1 English","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"canopylabs","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-19","last_updated":"2025-12-19","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":4000,"output":50000},"status":"beta","provider":{"npm":"@ai-sdk/openai","api":"https://api.groq.com/openai/v1"},"canonical_model_id":"canopylabs/orpheus-v1-english"},"canopylabs/orpheus-arabic-saudi":{"id":"canopylabs/orpheus-arabic-saudi","type":"speech","name":"Canopy Labs Orpheus Arabic Saudi","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"canopylabs","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":4000,"output":50000},"status":"beta","provider":{"npm":"@ai-sdk/openai","api":"https://api.groq.com/openai/v1"},"canonical_model_id":"canopylabs/orpheus-arabic-saudi"}}},"openai":{"id":"openai","env":["OPENAI_API_KEY"],"npm":"@ai-sdk/openai","name":"OpenAI","doc":"https://platform.openai.com/docs/models","models":{"gpt-daybreak-red-latest":{"id":"gpt-daybreak-red-latest","name":"Daybreak Red","description":"Alias for advanced cybersecurity models for authorized vulnerability research and security testing","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":12.5,"output":75,"cache_read":1.25,"cache_write":15.625},"canonical_model_id":"openai/gpt-5.6-cyber"},"gpt-5.2-pro":{"id":"gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}}},"gpt-realtime-2.1":{"id":"gpt-realtime-2.1","type":"realtime","name":"GPT-Realtime-2.1","description":"Realtime speech-to-speech model with configurable reasoning, tool use, and robust voice-agent behavior","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text","audio","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"input":96000,"output":32000},"cost":{"input":4,"output":24,"cache_read":0.4,"input_audio":32,"output_audio":64},"canonical_model_id":"openai/gpt-realtime-2.1"},"text-embedding-ada-002":{"id":"text-embedding-ada-002","type":"embedding","name":"text-embedding-ada-002","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2022-12","release_date":"2022-12-15","last_updated":"2022-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.1,"output":0}},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":0.2,"output":0.8,"cache_read":0.05},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.1,"output":0.4,"cache_read":0.025}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":28,"cache_read":0.35},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.875,"output":7,"cache_read":0.0875},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"o1":{"id":"o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":15,"output":60,"cache_read":7.5}},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"experimental":{"modes":{"fast":{"cost":{"input":0.7,"output":2.8,"cache_read":0.175},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.4,"output":1.6,"cache_read":0.1}},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":2,"output":8,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.55,"output":2.2,"cache_read":0.1375},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.1,"output":4.4,"cache_read":0.275}},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.375,"output":2.25,"cache_read":0.0375},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075}},"o1-pro":{"id":"o1-pro","name":"o1-pro","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2025-03-19","last_updated":"2025-03-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":150,"output":600}},"chatgpt-image-latest":{"id":"chatgpt-image-latest","type":"image","name":"chatgpt-image-latest","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-16","last_updated":"2025-12-16","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"input":0,"output":0},"status":"deprecated"},"text-embedding-3-large":{"id":"text-embedding-3-large","type":"embedding","name":"text-embedding-3-large","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-01","release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":3072},"cost":{"input":0.13,"output":0}},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.625,"output":5,"cache_read":0.0625},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"gpt-image-1-mini":{"id":"gpt-image-1-mini","type":"image","name":"gpt-image-1-mini","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"input":0,"output":0},"status":"deprecated"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":14,"cache_read":0.875},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":8,"cache_read":0.5}},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":14,"cache_read":0.875},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":1,"output":4,"cache_read":0.25},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":2,"output":8,"cache_read":0.5}},"gpt-4o-2024-11-20":{"id":"gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25}},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.2,"output":1,"cache_read":0.02,"cache_write":0.25},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"gpt-image-2":{"id":"gpt-image-2","type":"image","name":"gpt-image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"input":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2"},"text-embedding-3-small":{"id":"text-embedding-3-small","type":"embedding","name":"text-embedding-3-small","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-01","release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":1536},"cost":{"input":0.02,"output":0}},"o3-mini":{"id":"o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.55}},"gpt-5.6":{"id":"gpt-5.6","name":"GPT-5.6","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"gpt-5.3-codex-spark":{"id":"gpt-5.3-codex-spark","name":"GPT-5.3 Codex Spark","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex-spark","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":100000,"output":32000},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"gpt-4":{"id":"gpt-4","name":"GPT-4","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"status":"deprecated","cost":{"input":30,"output":60}},"gpt-5-pro":{"id":"gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120}},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"gpt-image-1.5":{"id":"gpt-image-1.5","type":"image","name":"gpt-image-1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"input":0,"output":0},"status":"deprecated","canonical_model_id":"openai/gpt-image-1.5"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":28,"cache_read":0.35},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"gpt-4o-2024-05-13":{"id":"gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":8.75,"output":26.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":15}},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":20,"output":100,"cache_read":2,"cache_write":25},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}},"ultrafast":{"cost":{"input":60,"output":300,"cache_read":6,"cache_write":75},"provider":{"body":{"service_tier":"ultrafast"}}}}},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.625,"output":5,"cache_read":0.0625},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.45,"output":3.6,"cache_read":0.045},"provider":{"body":{"service_tier":"priority"}}},"flex":{"cost":{"input":0.125,"output":1,"cache_read":0.0125},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.25,"output":2,"cache_read":0.025}},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.5},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}},"ultrafast":{"cost":{"input":12,"output":60,"cache_read":0.6,"cache_write":15},"provider":{"body":{"service_tier":"ultrafast"}}}}},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}}},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"flex":{"cost":{"input":0.025,"output":0.2,"cache_read":0.0025},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.05,"output":0.4,"cache_read":0.005}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}}},"gpt-3.5-turbo":{"id":"gpt-3.5-turbo","name":"GPT-3.5-turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"status":"deprecated","cost":{"input":0.5,"output":1.5,"cache_read":0}},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":10,"output":30}},"gpt-daybreak-blue-latest":{"id":"gpt-daybreak-blue-latest","name":"Daybreak Blue","description":"Alias for flagship general-purpose models with safeguards for defensive cybersecurity work","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"o3-pro":{"id":"o3-pro","name":"o3-pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80}},"gpt-4o-2024-08-06":{"id":"gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25}},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"flex":{"cost":{"input":0.1,"output":0.625,"cache_read":0.01},"provider":{"body":{"service_tier":"flex"}}}}},"cost":{"input":0.2,"output":1.25,"cache_read":0.02}},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"experimental":{"modes":{"fast":{"cost":{"input":4.25,"output":17,"cache_read":2.125},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":10,"cache_read":1.25}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":24,"cache_read":0.4,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}},"pro":{"provider":{"body":{"reasoning":{"mode":"pro"}}}}}},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"experimental":{"modes":{"fast":{"cost":{"input":0.25,"output":1,"cache_read":0.125},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.15,"output":0.6,"cache_read":0.075}}}},"volcengine":{"id":"volcengine","env":["ARK_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://ark.cn-beijing.volces.com/api/v3","name":"Volcengine Ark","doc":"https://www.volcengine.com/docs/82379/1330310","models":{"doubao-seed-2-1-pro-260628":{"id":"doubao-seed-2-1-pro-260628","name":"Seed 2.1 Pro","description":"Flagship ByteDance Seed 2.1 model for complex multimodal reasoning, coding, and agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.8906,"output":4.45301,"cache_read":0.17812},"canonical_model_id":"bytedance-seed/seed-2.1-pro"},"deepseek-v4-flash-ga-260731":{"id":"deepseek-v4-flash-ga-260731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.4453,"output":1.3359,"cache_read":0.01484},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"doubao-seed-character-260628":{"id":"doubao-seed-character-260628","name":"Seed Character","description":"ByteDance Seed model optimized for character-driven dialogue and consistent conversational behavior","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.11875,"output":0.29687,"cache_read":0.02375,"tiers":[{"input":0.17812,"output":0.8906,"cache_read":0.02375,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"bytedance-seed/seed-character"},"doubao-seed-2-0-mini-260428":{"id":"doubao-seed-2-0-mini-260428","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":0.02969,"output":0.29687,"cache_read":0.00594,"tiers":[{"input":0.05937,"output":0.59374,"cache_read":0.01187,"tier":{"type":"context","size":32000}},{"input":0.11875,"output":1.18747,"cache_read":0.02375,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"doubao-seed-1-6-251015":{"id":"doubao-seed-1-6-251015","name":"Seed 1.6","description":"ByteDance Seed model for long-context reasoning, instruction following, and tool-assisted tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.11875,"output":1.18747,"cache_read":0.02375,"tiers":[{"input":0.17812,"output":2.37494,"cache_read":0.02375,"tier":{"type":"context","size":32000}},{"input":0.35624,"output":3.56241,"cache_read":0.02375,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-6"},"doubao-seed-1-6-flash-250828":{"id":"doubao-seed-1-6-flash-250828","name":"Seed 1.6 Flash","description":"Low-latency ByteDance Seed model for high-throughput chat, extraction, and lightweight tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.02227,"output":0.22265,"cache_read":0.00445,"tiers":[{"input":0.04453,"output":0.4453,"cache_read":0.00445,"tier":{"type":"context","size":32000}},{"input":0.08906,"output":0.8906,"cache_read":0.00445,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-6-flash"},"glm-5-2-260617":{"id":"glm-5-2-260617","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.18747,"output":4.15615,"cache_read":0.29687},"canonical_model_id":"zhipuai/glm-5.2"},"doubao-seed-2-0-lite-260428":{"id":"doubao-seed-2-0-lite-260428","name":"Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":0.08906,"output":0.53436,"cache_read":0.01781,"tiers":[{"input":0.13359,"output":0.80154,"cache_read":0.02672,"tier":{"type":"context","size":32000}},{"input":0.26718,"output":1.60308,"cache_read":0.05344,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"glm-5-3-flash-260828":{"id":"glm-5-3-flash-260828","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11875,"output":0.41563,"cache_read":0.03414},"canonical_model_id":"zhipuai/glm-5.3-flash"},"doubao-seed-1-8-251228":{"id":"doubao-seed-1-8-251228","name":"Seed 1.8","description":"ByteDance Seed model for multimodal reasoning, long-context analysis, and agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-12-28","last_updated":"2025-12-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.11875,"output":1.18747,"cache_read":0.02375,"tiers":[{"input":0.17812,"output":2.37494,"cache_read":0.02375,"tier":{"type":"context","size":32000}},{"input":0.35624,"output":3.56241,"cache_read":0.02375,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-8"},"doubao-seed-1-6-vision-250815":{"id":"doubao-seed-1-6-vision-250815","name":"Seed 1.6 Vision","description":"ByteDance Seed multimodal model for image understanding, visual reasoning, and tool-assisted tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-08-15","last_updated":"2025-08-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.11875,"output":1.18747,"cache_read":0.02375,"tiers":[{"input":0.17812,"output":2.37494,"cache_read":0.02375,"tier":{"type":"context","size":32000}},{"input":0.35624,"output":3.56241,"cache_read":0.02375,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-6-vision"},"doubao-seed-2-0-code-preview-260215":{"id":"doubao-seed-2-0-code-preview-260215","name":"Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"status":"deprecated","cost":{"input":0.47499,"output":2.37494,"cache_read":0.095,"tiers":[{"input":0.71248,"output":3.56241,"cache_read":0.1425,"tier":{"type":"context","size":32000}},{"input":1.42496,"output":7.12482,"cache_read":0.28499,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"doubao-seed-evolving":{"id":"doubao-seed-evolving","name":"Seed Evolving","description":"Rolling ByteDance Seed model for rapidly updated reasoning, coding, and agent capabilities","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.8906,"output":4.45301,"cache_read":0.17812},"canonical_model_id":"bytedance-seed/seed-evolving"},"doubao-seed-2-1-turbo-260628":{"id":"doubao-seed-2-1-turbo-260628","name":"Seed 2.1 Turbo","description":"Faster ByteDance Seed 2.1 model for multimodal reasoning and latency-sensitive agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.4453,"output":2.22651,"cache_read":0.08906},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"deepseek-v4-pro-ga-260813":{"id":"deepseek-v4-pro-ga-260813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.3359,"output":4.00771,"cache_read":0.04453},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"doubao-seed-2-0-pro-260215":{"id":"doubao-seed-2-0-pro-260215","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":0.47499,"output":2.37494,"cache_read":0.095,"tiers":[{"input":0.71248,"output":3.56241,"cache_read":0.1425,"tier":{"type":"context","size":32000}},{"input":1.42496,"output":7.12482,"cache_read":0.28499,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"}}},"zhipuai-coding-plan":{"id":"zhipuai-coding-plan","env":["ZHIPU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://open.bigmodel.cn/api/coding/paas/v4","name":"Zhipu AI Coding Plan","doc":"https://docs.bigmodel.cn/cn/coding-plan/overview","models":{"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6v"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"}}},"wafer.ai":{"id":"wafer.ai","env":["WAFER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://pass.wafer.ai/v1","name":"Wafer","doc":"https://docs.wafer.ai/wafer-pass","models":{"GLM-5.2":{"id":"GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"Kimi-K2.6":{"id":"Kimi-K2.6","name":"Kimi K2.6","description":"Kimi K2.6 sparse MoE model with a 262K context window. Available serverless and not included in standard Wafer Pass. Non-ZDR only: requests with `Wafer-ZDR: required` are rejected.","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":1.14,"output":4.8,"cache_read":0.19,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"GLM-5.1":{"id":"GLM-5.1","name":"GLM-5.1","description":"General Language Model 5.1 — high-quality bilingual (EN/ZH) generation with strong coding and reasoning capabilities.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"status":"deprecated","cost":{"input":1,"output":3.2,"cache_read":0.1,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"status":"deprecated","cost":{"input":0.33,"output":1.32,"cache_read":0.07,"cache_write":0,"tiers":[{"input":0.66,"output":2.64,"cache_read":0.13,"cache_write":0,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.66,"output":2.64,"cache_read":0.13,"cache_write":0}},"canonical_model_id":"minimax/MiniMax-M3"},"glm5.2-fast":{"id":"glm5.2-fast","name":"GLM5.2-Fast","description":"The same model served for high TPS.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":3,"output":10.25,"cache_read":0.5,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"}}},"the-grid-ai":{"id":"the-grid-ai","env":["THEGRID_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.thegrid.ai/v1","name":"The Grid AI","doc":"https://thegrid.ai/docs","models":{"bytedance-pro-latest":{"id":"bytedance-pro-latest","name":"ByteDance Pro Latest","description":"Lab latest market for ByteDance Pro supply. You contract for the latest qualifying route, not a specific model.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"input":256000,"output":131072}},"code-max":{"id":"code-max","name":"Code Max","description":"Frontier models for complex research, architectural decisions, debugging, and multi-file development. Any model that meets the contract spec can serve your request.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-05-04","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"status":"beta"},"deepseek-pro-latest":{"id":"deepseek-pro-latest","name":"DeepSeek Pro Latest","description":"Lab latest market for DeepSeek Pro supply. You contract for the latest qualifying route, not a specific model.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":384000}},"gemini-pro-latest":{"id":"gemini-pro-latest","name":"Gemini Pro Latest","description":"Lab latest market for Gemini Pro frontier supply. You contract for the latest qualifying route, not a specific model.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":65536}},"text-prime":{"id":"text-prime","name":"Text Prime","description":"Reliable models for everyday text generation, editing, and analysis across diverse workflows. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-26","last_updated":"2026-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"input":120000,"output":131072}},"gpt-sol-latest":{"id":"gpt-sol-latest","name":"GPT Sol Latest","description":"Lab latest market for GPT frontier supply. You contract for the latest qualifying route, not a specific model.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000}},"agent-prime":{"id":"agent-prime","name":"Agent Prime","description":"Reliable models for dependable agentic applications, multi-step tool use, and reasoning workflows. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-04","last_updated":"2026-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"input":120000,"output":131072},"status":"beta"},"agent-max":{"id":"agent-max","name":"Agent Max","description":"Frontier models for autonomous research, deep multi-step tool chains, and complex long-horizon tasks. Any model that meets the contract spec can serve your request.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-05-04","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"status":"beta"},"glm-latest":{"id":"glm-latest","name":"GLM Latest","description":"Lab latest market for GLM supply. You contract for the latest qualifying route, not a specific model.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":917504,"output":131072}},"kimi-latest":{"id":"kimi-latest","name":"Kimi Latest","description":"Lab latest market for Kimi supply. You contract for the latest qualifying route, not a specific model.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":922000,"output":943718}},"code-standard":{"id":"code-standard","name":"Code Standard","description":"Price-optimized models for rapid autocomplete, linting, high-frequency suggestions, and batch edits. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-04","last_updated":"2026-10-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":120000,"output":65536},"status":"beta"},"text-standard":{"id":"text-standard","name":"Text Standard","description":"Price-optimized models with low-latency, high-throughput and shorter maximum outputs. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-26","last_updated":"2026-10-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":120000,"output":65536}},"claude-opus-latest":{"id":"claude-opus-latest","name":"Claude Opus Latest","description":"Lab latest market for Claude Opus frontier supply. You contract for the latest qualifying route, not a specific model.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000}},"minimax-latest":{"id":"minimax-latest","name":"MiniMax Latest","description":"Lab latest market for MiniMax supply. You contract for the latest qualifying route, not a specific model.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":512000}},"code-prime":{"id":"code-prime","name":"Code Prime","description":"Reliable models for everyday software tasks, code completion, review, and standard debugging. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-04","last_updated":"2026-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"input":120000,"output":131072},"status":"beta"},"agent-standard":{"id":"agent-standard","name":"Agent Standard","description":"Price-optimized models for fast tool calls, simple agent loops, high-throughput automation, and orchestration. Any model that meets the contract spec can serve your request.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-04","last_updated":"2026-10-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":120000,"output":65536},"status":"beta"},"text-max":{"id":"text-max","name":"Text Max","description":"Frontier models for deep reasoning, long context, and complex workflows. Any model that meets the contract spec can serve your request.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-02-26","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000}}}},"inco":{"id":"inco","env":["INCO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inco.ai/v1","name":"Inco","doc":"https://platform.inco.ai/docs","models":{"minimax-m3:fast":{"id":"minimax-m3:fast","name":"MiniMax M3 Fast","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"minimax/MiniMax-M3"},"kimi-k3:fast":{"id":"kimi-k3:fast","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":6,"output":30,"cache_read":0.6},"canonical_model_id":"moonshotai/kimi-k3"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash:fast":{"id":"glm-5.3-flash:fast","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.3,"output":1,"cache_read":0.06},"canonical_model_id":"zhipuai/glm-5.3-flash"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-v4.1-flash:fast":{"id":"deepseek-v4.1-flash:fast","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.6,"output":2.4,"cache_read":0.012},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3:fast":{"id":"glm-5.3:fast","name":"GLM-5.3 Fast","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":2.8,"output":8.8,"cache_read":0.52},"canonical_model_id":"zhipuai/glm-5.3"}}},"impossibl":{"id":"impossibl","env":["IMPOSSIBL_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.impossibl.com/v1","name":"Impossibl","doc":"https://impossibl.com/docs/models","models":{"anthropic/claude-opus-4-5":{"id":"anthropic/claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.19,"output":0.51,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"qwen/qwen3.8-max-preview":{"id":"qwen/qwen3.8-max-preview","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":2.5,"output":7.5},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"tier":{"type":"context","size":262144}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.05,"tiers":[{"input":1,"output":4,"cache_read":0.2,"tier":{"type":"context","size":262144}}],"context_over_200k":{"input":1,"output":4,"cache_read":0.2}},"canonical_model_id":"alibaba/qwen3.6-flash"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-4.5":{"id":"zai/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5-turbo":{"id":"zai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"zai/glm-4.5-air":{"id":"zai/glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"groq/gpt-oss-20b":{"id":"groq/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-20b"},"groq/gpt-oss-120b":{"id":"groq/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/o1":{"id":"openai/o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"cache_read":3,"tiers":[{"input":60,"output":270,"cache_read":3,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270,"cache_read":3}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"cache_read":3,"tiers":[{"input":60,"output":270,"cache_read":3,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270,"cache_read":3}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-3.5-turbo":{"id":"openai/gpt-3.5-turbo","name":"GPT-3.5-turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"openai/gpt-3.5-turbo"},"openai/gpt-4-turbo":{"id":"openai/gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":10,"output":30},"canonical_model_id":"openai/gpt-4-turbo"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5-codex":{"id":"openai/gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-codex"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.003},"canonical_model_id":"xiaomi/mimo-v2.5"},"cerebras/gpt-oss-120b":{"id":"cerebras/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"fireworks/glm-5.2":{"id":"fireworks/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"fireworks/gpt-oss-20b":{"id":"fireworks/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.07,"output":0.3,"cache_read":0.035},"canonical_model_id":"openai/gpt-oss-20b"},"fireworks/gpt-oss-120b":{"id":"fireworks/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"openai/gpt-oss-120b"},"xai/grok-4.20-0309-non-reasoning":{"id":"xai/grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.20-0309-reasoning":{"id":"xai/grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-build-0.1":{"id":"xai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"}}},"gitlab":{"id":"gitlab","env":["GITLAB_TOKEN"],"npm":"gitlab-ai-provider","name":"GitLab Duo","doc":"https://docs.gitlab.com/user/duo_agent_platform/","models":{"duo-chat-opus-5-5":{"id":"duo-chat-opus-5-5","name":"Agentic Chat (Claude Opus 5.5)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-5-5"},"duo-chat-gpt-5-mini":{"id":"duo-chat-gpt-5-mini","name":"Agentic Chat (GPT-5 Mini)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5-mini"},"duo-chat-opus-4-7":{"id":"duo-chat-opus-4-7","name":"Agentic Chat (Claude Opus 4.7)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-4-7"},"duo-chat-gpt-5-4-nano":{"id":"duo-chat-gpt-5-4-nano","name":"Agentic Chat (GPT-5.4 Nano)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.4-nano"},"duo-chat-gpt-5-6-terra":{"id":"duo-chat-gpt-5-6-terra","name":"Agentic Chat (GPT-5.6 Terra)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-5.6-terra"},"duo-chat-gpt-6-astra":{"id":"duo-chat-gpt-6-astra","name":"Agentic Chat (GPT-6 Astra)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-6-astra"},"duo-chat-opus-5":{"id":"duo-chat-opus-5","name":"Agentic Chat (Claude Opus 5)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-5"},"duo-chat-gpt-5-2":{"id":"duo-chat-gpt-5-2","name":"Agentic Chat (GPT-5.2)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.2"},"duo-chat-sonnet-4-5":{"id":"duo-chat-sonnet-4-5","name":"Agentic Chat (Claude Sonnet 4.5)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"duo-chat-gpt-5-3-codex":{"id":"duo-chat-gpt-5-3-codex","name":"Agentic Chat (GPT-5.3 Codex)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.3-codex"},"duo-chat-fable-5":{"id":"duo-chat-fable-5","name":"Agentic Chat (Claude Fable 5)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-fable-5"},"duo-chat-gpt-5-6-sol":{"id":"duo-chat-gpt-5-6-sol","name":"Agentic Chat (GPT-5.6 Sol)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-5.6-sol"},"duo-chat-gpt-6-sol":{"id":"duo-chat-gpt-6-sol","name":"Agentic Chat (GPT-6 Sol)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-6-sol"},"duo-chat-gpt-5-codex":{"id":"duo-chat-gpt-5-codex","name":"Agentic Chat (GPT-5 Codex)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5-codex"},"duo-chat-gpt-5-2-codex":{"id":"duo-chat-gpt-5-2-codex","name":"Agentic Chat (GPT-5.2 Codex)","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.2-codex"},"duo-chat-gpt-5-5":{"id":"duo-chat-gpt-5-5","name":"Agentic Chat (GPT-5.5)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.5"},"duo-chat-opus-4-5":{"id":"duo-chat-opus-4-5","name":"Agentic Chat (Claude Opus 4.5)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"duo-chat-haiku-5-5":{"id":"duo-chat-haiku-5-5","name":"Agentic Chat (Claude Haiku 5.5)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-haiku-5-5"},"duo-chat-gpt-6-1-sol":{"id":"duo-chat-gpt-6-1-sol","name":"Agentic Chat (GPT-6.1 Sol)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-6.1-sol"},"duo-chat-haiku-4-5":{"id":"duo-chat-haiku-4-5","name":"Agentic Chat (Claude Haiku 4.5)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"duo-chat-opus-4-6":{"id":"duo-chat-opus-4-6","name":"Agentic Chat (Claude Opus 4.6)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-4-6"},"duo-chat-gpt-5-4-mini":{"id":"duo-chat-gpt-5-4-mini","name":"Agentic Chat (GPT-5.4 Mini)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.4-mini"},"duo-chat-gpt-5-1":{"id":"duo-chat-gpt-5-1","name":"Agentic Chat (GPT-5.1)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.1"},"duo-chat-opus-4-8":{"id":"duo-chat-opus-4-8","name":"Agentic Chat (Claude Opus 4.8)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-opus-4-8"},"duo-chat-sonnet-4-6":{"id":"duo-chat-sonnet-4-6","name":"Agentic Chat (Claude Sonnet 4.6)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"duo-chat-sonnet-5":{"id":"duo-chat-sonnet-5","name":"Agentic Chat (Claude Sonnet 5)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-sonnet-5"},"duo-chat-gpt-5-6-luna":{"id":"duo-chat-gpt-5-6-luna","name":"Agentic Chat (GPT-5.6 Luna)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-5.6-luna"},"duo-chat-sonnet-5-5":{"id":"duo-chat-sonnet-5-5","name":"Agentic Chat (Claude Sonnet 5.5)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"duo-chat-fable-5-1":{"id":"duo-chat-fable-5-1","name":"Agentic Chat (Claude Fable 5.1)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"anthropic/claude-fable-5-1"},"duo-chat-gpt-5-4":{"id":"duo-chat-gpt-5-4","name":"Agentic Chat (GPT-5.4)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.4"},"duo-chat-gpt-6-luna":{"id":"duo-chat-gpt-6-luna","name":"Agentic Chat (GPT-6 Luna)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-6-luna"}}},"cohere":{"id":"cohere","env":["COHERE_API_KEY"],"npm":"@ai-sdk/cohere","name":"Cohere","doc":"https://docs.cohere.com/docs/models","models":{"tiny-aya-global":{"id":"tiny-aya-global","name":"Tiny Aya Global","description":"Compact multilingual model balanced across 70 languages and regions","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":8000},"canonical_model_id":"cohere/tiny-aya-global"},"tiny-aya-fire":{"id":"tiny-aya-fire","name":"Tiny Aya Fire","description":"Compact multilingual model specialized for South Asian languages","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":8000},"canonical_model_id":"cohere/tiny-aya-fire"},"command-r-plus-08-2024":{"id":"command-r-plus-08-2024","name":"Command R+","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-r-plus-08-2024"},"command-r7b-12-2024":{"id":"command-r7b-12-2024","name":"Command R7B","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-12-2024"},"north-mini-code-1-0":{"id":"north-mini-code-1-0","name":"North Mini Code","description":"Cohere coding model for practical software engineering and agentic edits","family":"north","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-09-23","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://api.cohere.ai/compatibility/v1"},"cost":{"input":0,"output":0},"canonical_model_id":"cohere/north-mini-code-1-0"},"tiny-aya-water":{"id":"tiny-aya-water","name":"Tiny Aya Water","description":"Compact multilingual model specialized for European and Asia-Pacific languages","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":8000},"canonical_model_id":"cohere/tiny-aya-water"},"command-a-reasoning-08-2025":{"id":"command-a-reasoning-08-2025","name":"Command A Reasoning","description":"Cohere reasoning model for multilingual enterprise agents, tools, and complex workflows","family":"command-a","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-reasoning-08-2025"},"c4ai-aya-expanse-32b":{"id":"c4ai-aya-expanse-32b","name":"Aya Expanse 32B","description":"Open multilingual model optimized for generation across 23 languages","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-10-24","last_updated":"2024-10-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"cohere/c4ai-aya-expanse-32b"},"command-r-08-2024":{"id":"command-r-08-2024","name":"Command R","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"cohere/command-r-08-2024"},"tiny-aya-earth":{"id":"tiny-aya-earth","name":"Tiny Aya Earth","description":"Compact multilingual model specialized for West Asian and African languages","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-17","last_updated":"2026-02-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":8000},"canonical_model_id":"cohere/tiny-aya-earth"},"command-a-03-2025":{"id":"command-a-03-2025","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-03-2025"},"command-a-translate-08-2025":{"id":"command-a-translate-08-2025","name":"Command A Translate","description":"Translation model for multilingual conversion, localization, and cross-language workflows","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-translate-08-2025"},"command-r7b-arabic-02-2025":{"id":"command-r7b-arabic-02-2025","name":"Command R7B Arabic","description":"Open Command R model optimized for Arabic enterprise chat, RAG, and cultural knowledge","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-02-27","last_updated":"2025-02-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-arabic-02-2025"},"c4ai-aya-vision-32b":{"id":"c4ai-aya-vision-32b","name":"Aya Vision 32B","description":"Open multilingual vision model for OCR, visual reasoning, and image question answering","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-04","last_updated":"2025-05-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4000},"canonical_model_id":"cohere/c4ai-aya-vision-32b"},"north-small-translate-09-2026":{"id":"north-small-translate-09-2026","name":"North Small Translate","description":"Open-weight translation model for more than 50 languages and locale variants","family":"north","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-09-09","last_updated":"2026-09-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16000},"cost":{"input":0,"output":0},"canonical_model_id":"cohere/north-small-translate-1-0"},"command-a-plus-05-2026":{"id":"command-a-plus-05-2026","name":"Command A Plus","description":"Cohere's stronger command model for multilingual agents and enterprise workflows","family":"command-a","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04-01","release_date":"2026-05-20","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":64000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-plus-05-2026"},"command-a-vision-07-2025":{"id":"command-a-vision-07-2025","name":"Command A Vision","description":"Cohere vision model for multilingual document analysis, OCR, and image understanding","family":"command-a","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-vision-07-2025"}}},"synthetic":{"id":"synthetic","env":["SYNTHETIC_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.synthetic.new/openai/v1","name":"Synthetic","doc":"https://synthetic.new/pricing","models":{"hf:zai-org/GLM-5.3-Flash":{"id":"hf:zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"cost":{"input":0.15,"output":0.5,"cache_read":0.04},"canonical_model_id":"zhipuai/glm-5.3-flash"},"hf:zai-org/GLM-5.2":{"id":"hf:zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":1.4},"canonical_model_id":"zhipuai/glm-5.2"},"hf:zai-org/GLM-4.7-Flash":{"id":"hf:zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":65536},"cost":{"input":0.1,"output":0.5,"cache_read":0.02},"canonical_model_id":"zhipuai/glm-4.7-flash"},"hf:zai-org/GLM-5.3":{"id":"hf:zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4":{"id":"hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":1,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"hf:Qwen/Qwen3.6-27B":{"id":"hf:Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.45,"output":3.6,"cache_read":0.45},"canonical_model_id":"alibaba/qwen3.6-27b"},"hf:MiniMaxAI/MiniMax-M3":{"id":"hf:MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"status":"deprecated","cost":{"input":0.6,"output":1.2,"cache_read":0.6},"canonical_model_id":"minimax/MiniMax-M3"},"hf:openai/gpt-oss-120b":{"id":"hf:openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.1,"output":0.1,"cache_read":0.02},"canonical_model_id":"openai/gpt-oss-120b"},"hf:moonshotai/Kimi-K3":{"id":"hf:moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"cost":{"input":3,"output":15,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"hf:moonshotai/Kimi-K2.7-Code":{"id":"hf:moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.95},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"hf:deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"hf:deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"cost":{"input":0.6,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"hf:deepseek-ai/DeepSeek-V4.1-Flash":{"id":"hf:deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":65536},"cost":{"input":0.6,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash"}}},"kosmik":{"id":"kosmik","env":["KOSMIK_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.koscompute.com/v1","name":"Kosmik Compute","doc":"https://api.koscompute.com/docs/","models":{"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.35,"output":2.2,"cache_read":0.09},"canonical_model_id":"alibaba/qwen3.8-27b"}}},"bee":{"id":"bee","env":["BEE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.bee.heossi.com/bee","name":"Bee by HEOSSI","doc":"https://bee.heossi.com/docs/sdks","models":{"bee-cell":{"id":"bee-cell","name":"Bee Cell 1.0","description":"Fast hosted AI for chat, coding help, document question answering, image understanding, and lightweight technical reasoning.","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.36}},"bee-comb":{"id":"bee-comb","name":"Bee Comb 2.0","description":"Stronger local/workstation AI for coding, architecture, security reasoning, larger RAG, and domain-specific workflows. The default workhorse for engineers and dev teams.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":16384},"cost":{"input":1.25,"output":5,"cache_read":0.125,"cache_write":1.5}},"bee-hive":{"id":"bee-hive","name":"Bee Hive 1.0","description":"Scalable Bee serving with quantum-reasoning routing and multi-base domain-adapter routing for shared knowledge workflows, document intelligence, and lower-cost cloud inference. Domain adapters activate per customer domain after evaluation.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":5,"output":20,"cache_read":0.5,"cache_write":6}},"bee-buzz":{"id":"bee-buzz","name":"Bee Buzz 1.0","description":"Mid-tier production model for tool-using agents, multi-step workflows, and builder/integration work. Bigger context than Comb, deeper planning, faster than Hive on routine tasks.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":24576},"cost":{"input":2.5,"output":10,"cache_read":0.25,"cache_write":3}},"bee-brood":{"id":"bee-brood","name":"Bee Brood 1.0","description":"Production multimodal reasoning for image and video analysis, tool-enabled workflows, and multi-step planning at controlled cost.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":16384},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.72}},"bee-swarm":{"id":"bee-swarm","name":"Bee Swarm 1.0","description":"Premium reasoning, multi-model cloud execution, large-document analysis, and high-value technical work. Includes the evolution engine and stronger eval gates by default.","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":false,"structured_output":false,"release_date":"2026-07-10","last_updated":"2026-09-28","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":25,"output":150,"cache_read":2.5,"cache_write":30}}}},"sensenova":{"id":"sensenova","env":["SENSENOVA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token.sensenova.cn/v1","name":"SenseNova (China)","doc":"https://platform.sensenova.cn/docs","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.2"},"sensenova-6.8-flash-lite":{"id":"sensenova-6.8-flash-lite","name":"SenseNova 6.8 Flash Lite","description":"SenseNova lightweight multimodal agent model for real-world complex tasks, data analysis, and complex information presentation","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-11","last_updated":"2026-08-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0,"cache_read":0}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k3"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash is a high-performance conversational model by DeepSeek, supporting thinking/non-thinking modes, 1M context window, and tool calling.","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash"}}},"salad-cloud":{"id":"salad-cloud","env":["SALAD_CLOUD_API_KEY"],"npm":"@saladtechnologies-oss/ai-sdk-provider","name":"SaladCloud AI Gateway","doc":"https://docs.salad.com/ai-gateway/explanation/overview","models":{"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Qwen MoE for agentic tasks, complex reasoning, code generation, and instruction following","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.09,"output":0.6},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"}}},"xiaomi":{"id":"xiaomi","env":["XIAOMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.xiaomimimo.com/v1","name":"Xiaomi","doc":"https://platform.xiaomimimo.com/#/docs","models":{"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"MiMo Pro model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"mimo-v2.5-pro-ultraspeed":{"id":"mimo-v2.5-pro-ultraspeed","name":"MiMo-V2.5-Pro-UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-06-08","last_updated":"2026-06-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1.305,"output":2.61,"cache_read":0.0108},"canonical_model_id":"xiaomi/mimo-v2.5-pro-ultraspeed"}}},"aihubmix":{"id":"aihubmix","env":["AIHUBMIX_API_KEY"],"npm":"@aihubmix/ai-sdk-provider","name":"AIHubMix","doc":"https://docs.aihubmix.com","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":65536},"cost":{"input":0.282,"output":1.692,"cache_read":0.0282,"cache_write":0.3525,"tiers":[{"input":1.128,"output":6.768,"cache_read":0.1128,"cache_write":1.41,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.128,"output":6.768,"cache_read":0.1128,"cache_write":1.41}},"canonical_model_id":"alibaba/qwen3.6-plus"},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"coding-minimax-m2.7":{"id":"coding-minimax-m2.7","name":"Coding MiniMax M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128100},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"minimax/MiniMax-M2.7"},"deep-deepseek-v4-flash":{"id":"deep-deepseek-v4-flash","name":"DeepSeek V4 Flash (DeepSeek)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.154,"output":0.308,"cache_read":0.0308},"canonical_model_id":"deepseek/deepseek-v4-flash"},"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.375,"output":4.675,"cache_read":0.165},"canonical_model_id":"meta/muse-spark-1.3"},"claude-opus-4-6-think":{"id":"claude-opus-4-6-think","name":"Claude Opus 4.6 Thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.499,"cache_read":0.03,"input_audio":0.9999},"canonical_model_id":"google/gemini-2.5-flash"},"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"interleaved":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"cost":{"input":0.25,"output":1.5,"cache_read":0.025},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":0.275,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5-1"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"zai-glm-5.1":{"id":"zai-glm-5.1","name":"GLM-5.1 (Z.ai)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","cost":{"input":0.845,"output":3.38,"cache_read":0.183112},"canonical_model_id":"zhipuai/glm-5.1"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.1268,"output":3.9438,"cache_read":0.2817},"canonical_model_id":"zhipuai/glm-5.2"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"coding-glm-5.1":{"id":"coding-glm-5.1","name":"Coding GLM 5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.06,"output":0.22,"cache_read":0.013},"canonical_model_id":"zhipuai/glm-5.1"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":1000000},"cost":{"input":2.2,"output":6.6,"cache_read":0.55,"tiers":[{"input":4.4,"output":13.2,"cache_read":1.1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4.4,"output":13.2,"cache_read":1.1}},"canonical_model_id":"xai/grok-4.5"},"doubao-seed-2-0-code-preview":{"id":"doubao-seed-2-0-code-preview","name":"Doubao Seed 2.0 Code Preview","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.4822,"output":2.411,"cache_read":0.09644,"tiers":[{"input":0.72328,"output":3.6164,"cache_read":0.144656,"tier":{"type":"context","size":32000}},{"input":1.4466,"output":7.233,"cache_read":0.28932,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"qwen3.8-omni-flash":{"id":"qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1126,"output":0.380025,"cache_read":0.014075,"cache_write":0.1759375},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"xiaomi-mimo-v2.5-pro-free":{"id":"xiaomi-mimo-v2.5-pro-free","name":"Xiaomi MiMo-V2.5-Pro (free)","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo-v2.5-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"doubao-seed-2-0-mini-260428":{"id":"doubao-seed-2-0-mini-260428","name":"Doubao Seed 2.0 Mini 260428","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.030136,"output":0.30136,"cache_read":0.0060272,"input_audio":0.423,"tiers":[{"input":0.060274,"output":0.60274,"cache_read":0.0120548,"tier":{"type":"context","size":32000}},{"input":0.120548,"output":1.20548,"cache_read":0.0241096,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","type":"image","name":"GPT Image 2.5 Flare","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-flare"},"deepseek-v4-flash-0731-fast":{"id":"deepseek-v4-flash-0731-fast","name":"DeepSeek V4 Flash 0731 Fast","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.28,"output":1.4,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":64000},"cost":{"input":1.08,"output":3.0888,"cache_read":0.054},"canonical_model_id":"stepfun/step-5-preview"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"muse-spark-1.1":{"id":"muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.375,"output":4.675},"canonical_model_id":"meta/muse-spark-1.1"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"glm-4.7-flash-free":{"id":"glm-4.7-flash-free","name":"GLM-4.7-Flash (free)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"coding-glm-5.3-flash-free":{"id":"coding-glm-5.3-flash-free","name":"GLM-5.3-Flash (Coding, free)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"alicloud-deepseek-v4-flash":{"id":"alicloud-deepseek-v4-flash","name":"DeepSeek V4 Flash (Alibaba Cloud)","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"claude-sonnet-4-6-think":{"id":"claude-sonnet-4-6-think","name":"Claude Sonnet 4.6 Thinking","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.137,"output":0.411,"cache_read":0.0274,"tiers":[{"input":0.274,"output":0.822,"cache_read":0.0548,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v"},"nemotron-3.5-lightning-free":{"id":"nemotron-3.5-lightning-free","name":"Nemotron 3.5 Lightning 30B A3B (free)","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"claude-sonnet-4-5-think":{"id":"claude-sonnet-4-5-think","name":"Claude Sonnet 4.5 Thinking","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125,"tiers":[{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"qwen3.6-max-preview":{"id":"qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":240000,"output":64000},"status":"deprecated","cost":{"input":1.27,"output":7.61,"cache_read":0.1268,"cache_write":1.585,"tiers":[{"input":2.11,"output":12.67,"cache_read":0.2112,"cache_write":2.64,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.6-max-preview"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.6918,"output":2.0754,"cache_read":0.023057694},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3.5-flash":{"id":"qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.0282,"output":0.282,"cache_read":0.00282,"cache_write":0.03525,"tiers":[{"input":0.1126,"output":1.126,"cache_read":0.01126,"cache_write":0.14075,"tier":{"type":"context","size":128000}},{"input":0.169,"output":1.69,"cache_read":0.0169,"cache_write":0.21125,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1126,"output":0.380025,"cache_read":0.014075,"cache_write":0.1759375},"canonical_model_id":"alibaba/qwen3.8-flash"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"gpt-image-2":{"id":"gpt-image-2","type":"image","name":"GPT-Image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2"},"nemotron-3-nano-omni-30b-a3b-reasoning-free":{"id":"nemotron-3-nano-omni-30b-a3b-reasoning-free","name":"Nemotron 3 Nano Omni 30B A3B Reasoning (free)","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.48,"output":0.96,"cache_read":0.00384},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"gemini-3.1-flash-image":{"id":"gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"interleaved":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"gemini-3.1-pro-preview-customtools":{"id":"gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.8,"output":9.6,"cache_read":0.0384},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1644,"output":0.9864,"tiers":[{"input":0.411,"output":2.466,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.155,"output":0.62,"cache_read":0.0031},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":1,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"xiaomi-mimo-v2.5":{"id":"xiaomi-mimo-v2.5","name":"Xiaomi MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo-v2.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.44,"output":2.2,"cache_read":0.088,"tiers":[{"input":0.88,"output":4.4,"cache_read":0.176,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.88,"output":4.4,"cache_read":0.176}},"canonical_model_id":"xiaomi/mimo-v2.5"},"deepseek-v4-flash-vision-exp":{"id":"deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.155,"output":0.62,"cache_read":0.0031},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.273974,"output":1.095896,"cache_read":0.0547948,"tiers":[{"input":0.547946,"output":2.191784,"cache_read":0.1095892,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.7"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"qwen3.8-max-preview":{"id":"qwen3.8-max-preview","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0.338,"output":1.014,"cache_read":0.0676,"cache_write":0.4225},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"gpt-image-1.5":{"id":"gpt-image-1.5","type":"image","name":"GPT-Image-1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":32},"canonical_model_id":"openai/gpt-image-1.5"},"coding-xiaomi-mimo-v2.5":{"id":"coding-xiaomi-mimo-v2.5","name":"Coding Xiaomi MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo-v2.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.08,"output":0.16,"cache_read":0.0016},"canonical_model_id":"xiaomi/mimo-v2.5"},"doubao-seed-2-0-pro":{"id":"doubao-seed-2-0-pro","name":"Doubao Seed 2.0 Pro","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.4958,"output":2.479,"cache_read":0.09916,"tiers":[{"input":0.7436,"output":3.718,"cache_read":0.14872,"tier":{"type":"context","size":32000}},{"input":1.4872,"output":7.436,"cache_read":0.29744,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"qwen3.8-2.4t-a95b":{"id":"qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.1268,"output":3.9438,"cache_read":0.2817},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"qwen3.8-max-free":{"id":"qwen3.8-max-free","name":"Qwen3.8 Max (free)","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen3.5-35b-a3b":{"id":"qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.0564,"output":0.4512,"tiers":[{"input":0.2254,"output":1.8032,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"coding-glm-5.1-free":{"id":"coding-glm-5.1-free","name":"Coding GLM 5.1 (free)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.1"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.155,"output":0.31,"cache_read":0.0031},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":64000},"cost":{"input":0.282,"output":1.128,"cache_read":0.0564,"cache_write":0.3525,"tiers":[{"input":0.845,"output":3.38,"cache_read":0.169,"cache_write":1.05625,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.845,"output":3.38,"cache_read":0.169,"cache_write":1.05625}},"canonical_model_id":"alibaba/qwen3.7-plus"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"cost":{"input":0.288,"output":1.152},"canonical_model_id":"minimax/MiniMax-M3"},"doubao-seed-2-0-lite-260428":{"id":"doubao-seed-2-0-lite-260428","name":"Doubao Seed 2.0 Lite 260428","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.09041,"output":0.54246,"cache_read":0.018082,"input_audio":1.35615,"tiers":[{"input":0.135616,"output":0.813696,"cache_read":0.0271232,"tier":{"type":"context","size":32000}},{"input":0.271232,"output":1.627392,"cache_read":0.0542464,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":131072},"cost":{"input":1.69,"output":5.07,"cache_read":0.169,"cache_write":2.1125},"canonical_model_id":"alibaba/qwen3.7-max"},"longcat-2.0":{"id":"longcat-2.0","name":"LongCat-2.0","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.7746,"output":3.0984,"cache_read":0.015492},"canonical_model_id":"meituan/longcat-2.0"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.95,"output":3.9995,"cache_read":0.160835},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"coding-glm-5.2-free":{"id":"coding-glm-5.2-free","name":"GLM-5.2 (Coding, free)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":65536},"cost":{"input":0.169,"output":1.014,"cache_read":0.0169,"cache_write":0.21125,"tiers":[{"input":0.676,"output":4.056,"cache_read":0.0676,"cache_write":0.845,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.676,"output":4.056,"cache_read":0.0676,"cache_write":0.845}},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen3.7-flash":{"id":"qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"input":991808,"output":131072},"cost":{"input":0.0282,"output":0.1128,"cache_read":0.00564,"cache_write":0.03525,"tiers":[{"input":0.0845,"output":0.338,"cache_read":0.0169,"cache_write":0.105625,"tier":{"type":"context","size":32000}},{"input":0.169,"output":0.676,"cache_read":0.0338,"cache_write":0.21125,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"kimi-k2.7-code-highspeed":{"id":"kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":1.9,"output":7.999,"cache_read":0.32167},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11268,"output":0.39438,"cache_read":0.02817},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.155,"output":0.31,"cache_read":0.0031},"canonical_model_id":"xiaomi/mimo-v2.5"},"qwen3-max":{"id":"qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.4508,"output":2.7048,"cache_read":0.09016,"cache_write":0.5635,"tiers":[{"input":0.902,"output":5.412,"cache_read":0.1804,"cache_write":1.1275,"tier":{"type":"context","size":32000}},{"input":1.3522,"output":8.1132,"cache_read":0.27044,"cache_write":1.69025,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.499999,"cache_read":0.03,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"nemotron-3-ultra-550b-a55b-free":{"id":"nemotron-3-ultra-550b-a55b-free","name":"Nemotron 3 Ultra 550B A55B (free)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"qwen3.8-flash-free":{"id":"qwen3.8-flash-free","name":"Qwen3.8 Flash (free)","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.8-flash"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0.1562,"output":0.6248,"cache_read":0.03905},"canonical_model_id":"tencent/hy3"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.48,"output":0.96,"cache_read":0.00384},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.845,"output":2.535,"cache_read":0.04225},"canonical_model_id":"tencent/hy4-preview"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","type":"image","name":"GPT Image 2.5 Sunburst","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-sunburst"},"glm-4.6":{"id":"glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.273974,"output":1.095896,"cache_read":0.0547948,"tiers":[{"input":0.547946,"output":2.191784,"cache_read":0.1095892,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.254,"output":1.524},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"alicloud-deepseek-v4-pro":{"id":"alicloud-deepseek-v4-pro","name":"DeepSeek V4 Pro (Alibaba Cloud)","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":1.69,"output":3.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":30,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash-image"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"gemini-3-pro-image":{"id":"gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"interleaved":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":120},"canonical_model_id":"google/gemini-3-pro-image"},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1096,"output":0.6576,"cache_read":0.01096,"cache_write":0.137,"tiers":[{"input":0.274,"output":1.644,"cache_read":0.0274,"cache_write":0.3425,"tier":{"type":"context","size":128000}},{"input":0.548,"output":3.288,"cache_read":0.0548,"cache_write":0.685,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.5-plus"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"claude-opus-4-5-think":{"id":"claude-opus-4-5-think","name":"Claude Opus 4.5 Thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"glm-4.5v":{"id":"glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":16384},"cost":{"input":0.274,"output":1.096,"tiers":[{"input":0.548,"output":1.644,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5v"},"coding-xiaomi-mimo-v2.5-pro":{"id":"coding-xiaomi-mimo-v2.5-pro","name":"Coding Xiaomi MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo-v2.5-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.2,"output":0.4,"cache_read":0.0016},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"coding-minimax-m2.7-highspeed":{"id":"coding-minimax-m2.7-highspeed","name":"Coding MiniMax M2.7 Highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128100},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"coding-glm-5.3-free":{"id":"coding-glm-5.3-free","name":"GLM-5.3 (Coding, free)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"deep-deepseek-v4-pro":{"id":"deep-deepseek-v4-pro","name":"DeepSeek V4 Pro (DeepSeek)","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.478,"output":0.956,"cache_read":0.004302},"canonical_model_id":"deepseek/deepseek-v4-pro"},"grok-build-0.1":{"id":"grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.142,"output":0.284,"cache_read":0.0284},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"coding-minimax-m2.7-free":{"id":"coding-minimax-m2.7-free","name":"Coding MiniMax M2.7 (Free)","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128100},"cost":{"input":0,"output":0},"canonical_model_id":"minimax/MiniMax-M2.7"},"qwen3-vl-plus":{"id":"qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.137,"output":1.37,"cache_read":0,"tiers":[{"input":0.2054,"output":2.054,"tier":{"type":"context","size":32000}},{"input":0.411,"output":4.11,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-vl-plus"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"alicloud-glm-5.1":{"id":"alicloud-glm-5.1","name":"GLM-5.1 (Alibaba Cloud)","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"status":"deprecated","cost":{"input":0.84,"output":3.38,"cache_read":0.169,"cache_write":1.05625},"canonical_model_id":"zhipuai/glm-5.1"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"xiaomi-mimo-v2.5-pro":{"id":"xiaomi-mimo-v2.5-pro","name":"Xiaomi MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo-v2.5-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1.1,"output":3.3,"cache_read":0.22,"tiers":[{"input":2.2,"output":6.6,"cache_read":0.44,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2.2,"output":6.6,"cache_read":0.44}},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":991000,"output":131072},"cost":{"input":1.69,"output":5.07,"cache_read":0.169,"cache_write":2.1125},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen3.5-27b":{"id":"qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.0846,"output":0.6768,"tiers":[{"input":0.2536,"output":2.0288,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-27b"},"claude-opus-4-8-think":{"id":"claude-opus-4-8-think","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125,"tiers":[{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.22,"output":1.32,"cache_read":0.044},"canonical_model_id":"stepfun/step-3.7-flash"},"xiaomi-mimo-v2.5-free":{"id":"xiaomi-mimo-v2.5-free","name":"Xiaomi MiMo-V2.5 (free)","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo-v2.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-05-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"ling-3.0-flash-free":{"id":"ling-3.0-flash-free","name":"Ling 3.0 Flash (free)","description":"Hybrid-linear MoE reasoning model with 124B total and 5.1B active parameters for efficient agents","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"inclusionai/ling-3.0-flash"},"glm-5v-turbo":{"id":"glm-5v-turbo","name":"GLM 5 Vision Turbo","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":0.7042,"output":3.09848,"cache_read":0.169008,"tiers":[{"input":0.986,"output":3.662004,"cache_read":0.253402,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5v-turbo"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.375,"output":4.675},"canonical_model_id":"meta/muse-spark-1.2"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"hy3-preview":{"id":"hy3-preview","name":"Hy3 Preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":0.17,"output":0.566661,"cache_read":0.051},"canonical_model_id":"tencent/hy3-preview"},"nemotron-3-super-120b-a12b-free":{"id":"nemotron-3-super-120b-a12b-free","name":"Nemotron 3 Super 120B A12B (free)","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nemotron-3.5-content-safety-free":{"id":"nemotron-3.5-content-safety-free","name":"Nemotron 3.5 Content Safety (free)","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"qwen3.5-122b-a10b":{"id":"qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1126,"output":0.9008,"tiers":[{"input":0.2818,"output":2.2544,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5"},"claude-opus-4-7-think":{"id":"claude-opus-4-7-think","name":"Claude Opus 4.7 Thinking","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"}}},"klokintegration":{"id":"klokintegration","env":["KLOKINTEGRATION_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api-gw.klok.ipaas.se/proxy/kloker-key/v1","name":"klokintegration.se","doc":"https://klokintegration.se/docs/ai-api","models":{"Kloker-Integration-Architect":{"id":"Kloker-Integration-Architect","name":"Kloker Integration Architect","description":"Knows the customer integration environment and Klok best practices. Opinionated about structure. The gateway runs ecosystem lookup tools server-side and appends a system-prompt injection (data contracts, CloudEvents, event-driven flows). Client system prompts and OpenAI tool calls are preserved.","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-29","last_updated":"2026-08-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":50000},"status":"beta","cost":{"input":0.23,"output":1.16}},"Kloker":{"id":"Kloker","name":"Kloker","description":"Cheap general model with a clean context. Nothing from the customer environment is packed in. It tracks the current best open source model. The Klok team verifies it and upgrades it periodically.","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-29","last_updated":"2026-08-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":50000},"status":"beta","cost":{"input":0.23,"output":1.16}},"Kloker-Integration-Developer":{"id":"Kloker-Integration-Developer","name":"Kloker Integration Developer","description":"Knows the customer integration environment and Klok best practices. Opinionated about implementation. The gateway runs ecosystem lookup tools server-side and appends a system-prompt injection. Client system prompts and OpenAI tool calls are preserved.","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-29","last_updated":"2026-08-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":50000},"status":"beta","cost":{"input":0.23,"output":1.16}}}},"modelis":{"id":"modelis","env":["MODELIS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://modelishub.com/v1","name":"Modelis","doc":"https://modelishub.com/pricing","models":{"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"google/gemini-2.5-flash"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10},"canonical_model_id":"google/gemini-2.5-pro"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.435,"output":0.87},"canonical_model_id":"deepseek/deepseek-v4-pro"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"anthropic/claude-fable-5"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.0983,"output":0.1966},"canonical_model_id":"deepseek/deepseek-v4-flash"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.768,"output":3.072},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":9},"canonical_model_id":"alibaba/qwen3.7-max"}}},"standardcompute":{"id":"standardcompute","env":["STANDARDCOMPUTE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.stdcmpt.com/v1","name":"Standard Compute","doc":"https://docs.standardcompute.com/models","models":{"standardcompute":{"id":"standardcompute","name":"Standard Compute","description":"Flat-rate smart-routing gateway: one model id, each request routed across the customer's enabled models from a curated ~1M-context catalog (Claude, GPT, Gemini, DeepSeek, GLM, Qwen, Kimi, MiniMax, Grok, MiMo) or pinned to a user-selected model","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-03-01","last_updated":"2026-10-31","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"}},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":30000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.122,"output":3.366,"cache_read":0.1122},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.14,"output":0.42,"cache_read":0.0042},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.044,"output":2.088,"cache_read":0.2088},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.0826,"output":0.1652,"cache_read":0.01652},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.041667},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.25,"output":10,"cache_read":0.125,"cache_write":0.375,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":0.375,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333},"canonical_model_id":"google/gemini-3.5-flash-lite"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.425,"output":2.55,"cache_read":0.085,"cache_write":0.53125},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.32,"output":1.28,"cache_read":0.064,"cache_write":0.4,"tiers":[{"input":0.96,"output":3.84,"cache_read":0.192,"cache_write":1.2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.96,"output":3.84,"cache_read":0.192,"cache_write":1.2}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.475,"output":4.425,"cache_read":0.295,"cache_write":1.84375},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"cache_write":0.125,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"cache_write":0.25,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"mistralai/mistral-large-4-0":{"id":"mistralai/mistral-large-4-0","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.43,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.5625,"output":1.8,"cache_read":0.105},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":850000,"output":50000},"provider":{"npm":"@openrouter/ai-sdk-provider"},"cost":{"input":0.08,"output":0.5,"cache_read":0.012},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"inceptron":{"id":"inceptron","env":["INCEPTRON_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inceptron.io/v1","name":"Inceptron","doc":"https://docs.inceptron.io","models":{"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.13,"output":0.495,"cache_read":0.027,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3.5,"cache_read":0.16,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.7995,"output":3.75,"cache_read":0.156,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.175,"output":0.5,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1,"output":4.396,"cache_read":0.14,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"}}},"vancine":{"id":"vancine","env":["VANCINE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://vancine.com/v1","name":"Vancine","doc":"https://vancine.com/docs","models":{"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.4,"output":12,"cache_read":0.24},"canonical_model_id":"moonshotai/kimi-k3"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.12,"output":0.38,"cache_read":0.013},"canonical_model_id":"alibaba/qwen3.8-flash"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.24,"output":0.96,"cache_read":0.0048},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.12,"output":3.52,"cache_read":0.208},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.12,"output":0.4,"cache_read":0.024},"canonical_model_id":"zhipuai/glm-5.3-flash"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"status":"deprecated","cost":{"input":0.24,"output":0.96,"cache_read":0.048},"canonical_model_id":"minimax/MiniMax-M3"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.67,"output":2,"cache_read":0.034},"canonical_model_id":"tencent/hy4-preview"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.6,"output":4.8,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-max"}}},"google-vertex-anthropic":{"id":"google-vertex-anthropic","env":["GOOGLE_VERTEX_PROJECT","GOOGLE_VERTEX_LOCATION","GOOGLE_APPLICATION_CREDENTIALS"],"npm":"@ai-sdk/google-vertex/anthropic","name":"Vertex (Anthropic)","doc":"https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude","models":{"claude-opus-4@20250514":{"id":"claude-opus-4@20250514","name":"Claude Opus 4","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-20250514"},"claude-opus-5@default":{"id":"claude-opus-5@default","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"claude-sonnet-4-6@default":{"id":"claude-sonnet-4-6@default","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-fable-5-1@default":{"id":"claude-fable-5-1@default","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"claude-opus-4-8@default":{"id":"claude-opus-4-8@default","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-haiku-5-5@default":{"id":"claude-haiku-5-5@default","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-opus-4-1@20250805":{"id":"claude-opus-4-1@20250805","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"claude-opus-4-6@default":{"id":"claude-opus-4-6@default","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"claude-sonnet-5@default":{"id":"claude-sonnet-5@default","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"claude-sonnet-4@20250514":{"id":"claude-sonnet-4@20250514","name":"Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"claude-opus-4-5@20251101":{"id":"claude-opus-4-5@20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"claude-fable-5@default":{"id":"claude-fable-5@default","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"claude-sonnet-4-5@20250929":{"id":"claude-sonnet-4-5@20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"claude-fable-5-2@default":{"id":"claude-fable-5-2@default","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":16,"output":80,"cache_read":0.4,"cache_write":20},"provider":{"body":{"speed":"fast"}}}}},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"claude-opus-5-5@default":{"id":"claude-opus-5-5@default","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-opus-4-7@default":{"id":"claude-opus-4-7@default","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-haiku-4-5@20251001":{"id":"claude-haiku-4-5@20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"claude-sonnet-5-5@default":{"id":"claude-sonnet-5-5@default","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"}}},"hpc-ai":{"id":"hpc-ai","env":["HPC_AI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.hpc-ai.com/inference/v1","name":"HPC-AI","doc":"https://www.hpc-ai.com/doc/docs/quickstart/","models":{"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-4-7"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1002000,"output":128000},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196000,"output":195000},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"zai-org/glm-5.2":{"id":"zai-org/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/glm-5.1":{"id":"zai-org/glm-5.1","name":"GLM 5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202000,"output":202000},"cost":{"input":0.615,"output":2.46,"cache_read":0.133},"canonical_model_id":"zhipuai/glm-5.1"}}},"cerebras":{"id":"cerebras","env":["CEREBRAS_API_KEY"],"npm":"@ai-sdk/cerebras","name":"Cerebras","doc":"https://inference-docs.cerebras.ai/models/overview","models":{"qwen-3.8-27b":{"id":"qwen-3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.99,"output":1.49,"cache_read":0.99},"canonical_model_id":"alibaba/qwen3.8-27b"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.35,"output":0.75,"cache_read":0.35},"canonical_model_id":"openai/gpt-oss-120b"}}},"perplexity-agent":{"id":"perplexity-agent","env":["PERPLEXITY_API_KEY"],"npm":"@ai-sdk/openai","api":"https://api.perplexity.ai/v1","name":"Perplexity Agent","doc":"https://docs.perplexity.ai/docs/agent-api/models","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4-5":{"id":"anthropic/claude-opus-4-5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"perplexity/nemotron-3.5-super-120b-a12b":{"id":"perplexity/nemotron-3.5-super-120b-a12b","name":"Nemotron 3.5 Super 120B A12B","description":"NVIDIA Nemotron 3.5 Super reasoning model (120B total, 12B active) served with text-only input","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.2,"output":0.5,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-3.5-super-120b-a12b"},"perplexity/kimi-k3":{"id":"perplexity/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"perplexity/deepseek-v4-pro-0813":{"id":"perplexity/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"perplexity/sonar":{"id":"perplexity/sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.25,"output":2.5,"cache_read":0.0625},"canonical_model_id":"perplexity/sonar"},"perplexity/glm-5.3":{"id":"perplexity/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"perplexity/glm-5.3-flash":{"id":"perplexity/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"tiers":[{"input":0.5,"output":3,"cache_read":0.05,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.5,"output":3,"cache_read":0.05}},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"moonshot-ai/kimi-k3":{"id":"moonshot-ai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot-ai/kimi-k2.7-code":{"id":"moonshot-ai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"openai/gpt-5.6-terra"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32000},"status":"deprecated","cost":{"input":0.25,"output":2.5},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"xai/grok-4-1-fast-non-reasoning":{"id":"xai/grok-4-1-fast-non-reasoning","name":"Grok 4.1 Fast (Non-Reasoning)","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"status":"deprecated","cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"}}},"engy":{"id":"engy","env":["ENGY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.engy.ai/v1","name":"engy","doc":"https://engy.ai/pricing","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":229376,"output":32768},"cost":{"input":0.68,"output":1.5,"cache_read":0.18},"canonical_model_id":"zhipuai/glm-5.2"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1113088,"input":1047552,"output":65536},"cost":{"input":1.4,"output":7,"cache_read":0.14},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1113088,"input":1047552,"output":65536},"cost":{"input":1.95,"output":9.75,"cache_read":0.195},"canonical_model_id":"moonshotai/kimi-k3"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1001536,"input":936000,"output":65536},"cost":{"input":0.045,"output":0.32,"cache_read":0.015},"canonical_model_id":"alibaba/qwen3.8-27b"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":983040,"output":65536},"cost":{"input":0.03,"output":0.12,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"input":294912,"output":32768},"cost":{"input":0.98,"output":3.08,"cache_read":0.18},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"input":294912,"output":32768},"cost":{"input":0.135,"output":0.45,"cache_read":0.027},"canonical_model_id":"zhipuai/glm-5.3-flash"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":208192,"input":200000,"output":8192},"cost":{"input":0.045,"output":0.3,"cache_read":0.015},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":920576,"output":128000},"cost":{"input":0.045,"output":0.09,"cache_read":0.009},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":983040,"output":65536},"cost":{"input":0.03,"output":0.12,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"poe":{"id":"poe","env":["POE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.poe.com/v1","name":"Poe","doc":"https://creator.poe.com/docs/external-applications/openai-compatible-api","models":{"anthropic/claude-sonnet-3.7":{"id":"anthropic/claude-sonnet-3.7","name":"Claude-Sonnet-3.7","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-10-31","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"output":128000},"status":"deprecated","cost":{"input":2.6,"output":13,"cache_read":0.26,"cache_write":3.2},"canonical_model_id":"anthropic/claude-3-7-sonnet-20250219"},"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude-Opus-4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"temperature":false,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":983040,"output":128000},"cost":{"input":4.2929,"output":21.4646,"cache_read":0.4293,"cache_write":5.3662},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude-Opus-4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":128000},"cost":{"input":4.2929,"output":21.4646,"cache_read":0.4293,"cache_write":5.3662},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude-Opus-4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":128000},"cost":{"input":4.2929,"output":21.4646,"cache_read":0.4293,"cache_write":5.3662},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-haiku-3":{"id":"anthropic/claude-haiku-3","name":"Claude-Haiku-3","description":"Legacy model retained for compatibility with older integrations","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-08-31","release_date":"2024-03-13","last_updated":"2024-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":189096,"output":8192},"status":"deprecated","cost":{"input":0.21,"output":1.1,"cache_read":0.021,"cache_write":0.26},"canonical_model_id":"anthropic/claude-3-haiku-20240307"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude-Opus-4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":0,"max":63999}],"tool_call":true,"temperature":false,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"output":64000},"cost":{"input":4.2929,"output":21.4646,"cache_read":0.4293,"cache_write":5.3662},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude-Haiku-4.5","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":63999}],"tool_call":true,"temperature":false,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":192000,"output":64000},"cost":{"input":0.8586,"output":4.2929,"cache_read":0.0859,"cache_write":1.0732},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-3.5":{"id":"anthropic/claude-sonnet-3.5","name":"Claude-Sonnet-3.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-04-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":189096,"output":8192},"status":"deprecated","cost":{"input":2.6,"output":13,"cache_read":0.26,"cache_write":3.2},"canonical_model_id":"anthropic/claude-3-5-sonnet-20241022"},"anthropic/claude-haiku-3.5":{"id":"anthropic/claude-haiku-3.5","name":"Claude-Haiku-3.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-07-31","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":189096,"output":8192},"status":"deprecated","cost":{"input":0.68,"output":3.4,"cache_read":0.068,"cache_write":0.85},"canonical_model_id":"anthropic/claude-3-5-haiku-20241022"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude-Sonnet-4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":31999}],"tool_call":true,"temperature":false,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":983040,"output":32768},"cost":{"input":2.5758,"output":12.8788,"cache_read":0.2576,"cache_write":3.2197},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude-Opus-4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":31999}],"tool_call":true,"temperature":false,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":196608,"output":32000},"status":"deprecated","cost":{"input":13,"output":64,"cache_read":1.3,"cache_write":16},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude-Sonnet-4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":983040,"output":128000},"cost":{"input":2.5758,"output":12.8788,"cache_read":0.2576,"cache_write":3.2197},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-sonnet-4":{"id":"anthropic/claude-sonnet-4","name":"Claude-Sonnet-4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":983040,"output":64000},"status":"deprecated","cost":{"input":2.6,"output":13,"cache_read":0.26,"cache_write":3.2},"canonical_model_id":"anthropic/claude-sonnet-4-0"},"anthropic/claude-opus-4":{"id":"anthropic/claude-opus-4","name":"Claude-Opus-4","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":192512,"output":28672},"status":"deprecated","cost":{"input":13,"output":64,"cache_read":1.3,"cache_write":16},"canonical_model_id":"anthropic/claude-opus-4-0"},"anthropic/claude-sonnet-3.5-june":{"id":"anthropic/claude-sonnet-3.5-june","name":"Claude-Sonnet-3.5-June","description":"Legacy model retained for compatibility with older integrations","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-11-18","last_updated":"2024-11-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":189096,"output":8192},"status":"deprecated","cost":{"input":2.6,"output":13,"cache_read":0.26,"cache_write":3.2}},"elevenlabs/elevenlabs-v3":{"id":"elevenlabs/elevenlabs-v3","type":"speech","name":"ElevenLabs-v3","description":"Expressive text-to-speech model with inline audio tags across 70+ languages","family":"elevenlabs","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-08-20","last_updated":"2025-08-20","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":128000,"output":0},"canonical_model_id":"elevenlabs/eleven_v3"},"elevenlabs/elevenlabs-music":{"id":"elevenlabs/elevenlabs-music","name":"ElevenLabs-Music","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"elevenlabs","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-08-29","last_updated":"2025-08-29","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":2000,"output":0}},"elevenlabs/elevenlabs-v2.5-turbo":{"id":"elevenlabs/elevenlabs-v2.5-turbo","type":"speech","name":"ElevenLabs-v2.5-Turbo","description":"Low-latency multilingual text-to-speech model, superseded by Flash v2.5","family":"elevenlabs","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-07-19","last_updated":"2024-07-19","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":128000,"output":0},"canonical_model_id":"elevenlabs/eleven_turbo_v2_5"},"empiriolabs/deepseek-v4-flash-el":{"id":"empiriolabs/deepseek-v4-flash-el","name":"DeepSeek-V4-Flash-EL","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":384000},"cost":{"input":0.14,"output":0.28},"canonical_model_id":"deepseek/deepseek-v4-flash"},"empiriolabs/deepseek-v4-pro-el":{"id":"empiriolabs/deepseek-v4-pro-el","name":"DeepSeek-V4-Pro-EL","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":384000},"cost":{"input":1.67,"output":3.33},"canonical_model_id":"deepseek/deepseek-v4-pro"},"ideogramai/ideogram-v2a":{"id":"ideogramai/ideogram-v2a","type":"image","name":"Ideogram-v2a","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"ideogram","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-02-27","last_updated":"2025-02-27","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":150,"output":0}},"ideogramai/ideogram-v2a-turbo":{"id":"ideogramai/ideogram-v2a-turbo","type":"image","name":"Ideogram-v2a-Turbo","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"ideogram","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-02-27","last_updated":"2025-02-27","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":150,"output":0}},"ideogramai/ideogram":{"id":"ideogramai/ideogram","type":"image","name":"Ideogram","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"ideogram","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-04-03","last_updated":"2024-04-03","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":150,"output":0}},"ideogramai/ideogram-v2":{"id":"ideogramai/ideogram-v2","type":"image","name":"Ideogram-v2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"ideogram","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-08-21","last_updated":"2024-08-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":150,"output":0}},"fireworks-ai/kimi-k2.5-fw":{"id":"fireworks-ai/kimi-k2.5-fw","name":"Kimi-K2.5-FW","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":245760,"output":16384},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"google/gemini-2.0-flash":{"id":"google/gemini-2.0-flash","name":"Gemini-2.0-Flash","description":"Earlier Gemini Flash workhorse for responsive multimodal apps and tool use","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":990000,"output":8192},"status":"deprecated","cost":{"input":0.1,"output":0.42},"canonical_model_id":"google/gemini-2.0-flash"},"google/imagen-4-ultra":{"id":"google/imagen-4-ultra","type":"image","name":"Imagen-4-Ultra","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"imagen","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-05-24","last_updated":"2025-05-24","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini-2.5-Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1065535,"output":65535},"status":"deprecated","cost":{"input":0.21,"output":1.8,"cache_read":0.021},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini-3.8-Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.7576,"output":3.7879,"cache_read":0.0758},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-2.0-flash-lite":{"id":"google/gemini-2.0-flash-lite","name":"Gemini-2.0-Flash-Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":990000,"output":8192},"status":"deprecated","cost":{"input":0.052,"output":0.21},"canonical_model_id":"google/gemini-2.0-flash-lite"},"google/veo-3.1-fast":{"id":"google/veo-3.1-fast","type":"video","name":"Veo-3.1-Fast","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":480,"output":0}},"google/veo-3":{"id":"google/veo-3","type":"video","name":"Veo-3","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-05-21","last_updated":"2025-05-21","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/imagen-3":{"id":"google/imagen-3","type":"image","name":"Imagen-3","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"imagen","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-10-15","last_updated":"2024-10-15","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/gemma-4-31b":{"id":"google/gemma-4-31b","name":"Gemma-4-31B","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-deep-research":{"id":"google/gemini-deep-research","name":"gemini-deep-research","description":"Legacy model retained for compatibility with older integrations","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":0},"status":"deprecated","cost":{"input":1.6,"output":9.6}},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini-2.5-Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":32768}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1065535,"output":65535},"status":"deprecated","cost":{"input":0.87,"output":7,"cache_read":0.087},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini-3.5-Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5152,"output":9.0909,"cache_read":0.1515},"canonical_model_id":"google/gemini-3.5-flash"},"google/nano-banana":{"id":"google/nano-banana","type":"image","name":"Nano-Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":0},"status":"deprecated","cost":{"input":0.21,"output":1.8,"cache_read":0.021},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini-3.6-Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.7576,"output":3.7879,"cache_read":0.0758},"canonical_model_id":"google/gemini-3.6-flash"},"google/veo-2":{"id":"google/veo-2","type":"video","name":"Veo-2","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-12-02","last_updated":"2024-12-02","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/nano-banana-pro":{"id":"google/nano-banana-pro","type":"image","name":"Nano-Banana-Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":65536,"output":0},"cost":{"input":2.0202,"output":12.1212,"cache_read":0.202},"canonical_model_id":"google/gemini-3-pro-image-preview"},"google/veo-3-fast":{"id":"google/veo-3-fast","type":"video","name":"Veo-3-Fast","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-13","last_updated":"2025-10-13","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/imagen-3-fast":{"id":"google/imagen-3-fast","type":"image","name":"Imagen-3-Fast","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"imagen","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-10-17","last_updated":"2024-10-17","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":480,"output":0},"status":"deprecated"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini-3.1-Flash-Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.2525,"output":1.5152},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini-2.5-Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"output":64000},"status":"deprecated","cost":{"input":0.07,"output":0.28},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/imagen-4":{"id":"google/imagen-4","type":"image","name":"Imagen-4","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"imagen","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":480,"output":0}},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini-3.5-Flash-Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.303,"output":2.5253,"cache_read":0.0303},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemini-3-flash":{"id":"google/gemini-3-flash","name":"Gemini-3-Flash","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.404,"output":2.4242,"cache_read":0.0404},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-omni-1.1-flash":{"id":"google/gemini-omni-1.1-flash","type":"video","name":"Gemini-Omni-1.1-Flash","description":"Video generation and editing model for scene extension, frame interpolation, and reference-guided multimodal control","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":false,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":131072,"output":57920},"cost":{"input":1.5152,"output":9.0909},"canonical_model_id":"google/gemini-omni-1.1-flash"},"google/imagen-4-fast":{"id":"google/imagen-4-fast","type":"image","name":"Imagen-4-Fast","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"imagen","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-06-25","last_updated":"2025-06-25","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":480,"output":0}},"google/veo-3.1":{"id":"google/veo-3.1","type":"video","name":"Veo-3.1","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":480,"output":0}},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini-3.7-Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.7576,"output":3.7879,"cache_read":0.0758},"canonical_model_id":"google/gemini-3.7-flash"},"google/gemini-3.1-pro":{"id":"google/gemini-3.1-pro","name":"Gemini-3.1-Pro","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2.0202,"output":12.1212,"cache_read":0.202},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/lyria":{"id":"google/lyria","name":"Lyria","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"lyria","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-06-04","last_updated":"2025-06-04","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0}},"runwayml/runway-gen-4-turbo":{"id":"runwayml/runway-gen-4-turbo","type":"video","name":"Runway-Gen-4-Turbo","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"runway","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-05-09","last_updated":"2025-05-09","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":256,"output":0},"status":"deprecated"},"runwayml/runway":{"id":"runwayml/runway","type":"video","name":"Runway","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"runway","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-10-11","last_updated":"2024-10-11","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":256,"output":0},"status":"deprecated"},"topazlabs-co/topazlabs":{"id":"topazlabs-co/topazlabs","type":"image","name":"TopazLabs","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"topazlabs","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":204,"output":0}},"poetools/claude-code":{"id":"poetools/claude-code","name":"claude-code","description":"Claude model for careful reasoning, writing, coding, and tool use","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]},{"type":"budget_tokens"}],"tool_call":true,"temperature":false,"release_date":"2025-11-27","last_updated":"2025-11-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0}},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2-Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":19.0909,"output":152.7273},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":400000,"input":922000,"output":128000},"cost":{"input":4.5455,"output":27.2727,"cache_read":0.4545},"canonical_model_id":"openai/gpt-5.5"},"openai/o3-deep-research":{"id":"openai/o3-deep-research","name":"o3-deep-research","description":"Research model for long-horizon investigation, synthesis, and analytical reports","family":"o","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-26","last_updated":"2025-06-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":9,"output":36,"cache_read":2.2},"canonical_model_id":"openai/o3-deep-research"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1-nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.09,"output":0.36,"cache_read":0.022},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-3.5-turbo-instruct":{"id":"openai/gpt-3.5-turbo-instruct","name":"GPT-3.5-Turbo-Instruct","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2023-09-20","last_updated":"2023-09-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":3500,"output":1024},"status":"deprecated","cost":{"input":1.4,"output":1.8}},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.5909,"output":12.7273,"cache_read":0.1591},"canonical_model_id":"openai/gpt-5.2"},"openai/o1":{"id":"openai/o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":14,"output":54},"canonical_model_id":"openai/o1"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1-mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.3636,"output":1.4545,"cache_read":0.0909},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":0.99,"output":4,"cache_read":0.25},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2-Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.6,"output":13,"cache_read":0.16},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4-Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.6818,"output":4.0909,"cache_read":0.0682},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/o1-pro":{"id":"openai/o1-pro","name":"o1-pro","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2025-03-19","last_updated":"2025-03-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":140,"output":540},"canonical_model_id":"openai/o1-pro"},"openai/gpt-5.3-instant":{"id":"openai/gpt-5.3-instant","name":"GPT-5.3-Instant","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":111616,"output":16384},"status":"deprecated","cost":{"input":1.6,"output":13,"cache_read":0.16},"canonical_model_id":"openai/gpt-5.3-chat-latest"},"openai/sora-2-pro":{"id":"openai/sora-2-pro","type":"video","name":"Sora-2-Pro","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"sora","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"status":"deprecated"},"openai/gpt-4o-aug":{"id":"openai/gpt-4o-aug","name":"GPT-4o-Aug","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2.2727,"output":9.0909,"cache_read":1.1364},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1364,"output":9.0909,"cache_read":0.1136},"canonical_model_id":"openai/gpt-5"},"openai/sora-2":{"id":"openai/sora-2","type":"video","name":"Sora-2","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"sora","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"status":"deprecated"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT-5.1-Codex-Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.1,"output":9,"cache_read":0.11},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1-Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.1,"output":9,"cache_read":0.11},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-image-1-mini":{"id":"openai/gpt-image-1-mini","type":"image","name":"GPT-Image-1-Mini","description":"Cost-efficient GPT Image 1 variant for image generation and editing","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"canonical_model_id":"openai/gpt-image-1-mini"},"openai/gpt-5-chat":{"id":"openai/gpt-5-chat","name":"GPT-5-Chat","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":16384},"status":"deprecated","cost":{"input":1.1,"output":9,"cache_read":0.11},"canonical_model_id":"openai/gpt-5-chat-latest"},"openai/gpt-3.5-turbo-raw":{"id":"openai/gpt-3.5-turbo-raw","name":"GPT-3.5-Turbo-Raw","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":4524,"output":2048},"status":"deprecated","cost":{"input":0.45,"output":1.4},"canonical_model_id":"openai/gpt-3.5-turbo"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":1.8182,"output":7.2727,"cache_read":0.4545},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.8182,"output":7.2727,"cache_read":0.4545},"canonical_model_id":"openai/o3"},"openai/gpt-image-2":{"id":"openai/gpt-image-2","type":"image","name":"GPT-Image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5.0505,"output":30.303,"cache_read":1.2626},"canonical_model_id":"openai/gpt-image-2"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":0.99,"output":4},"canonical_model_id":"openai/o3-mini"},"openai/gpt-5.1-instant":{"id":"openai/gpt-5.1-instant","name":"GPT-5.1-Instant","description":"Chat-tuned GPT-5.1 for polished assistants, writing, and product conversations","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":1.1,"output":9,"cache_read":0.11},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"openai/gpt-5.3-codex-spark":{"id":"openai/gpt-5.3-codex-spark","name":"GPT-5.3-Codex-Spark","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex-spark","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":100000,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-5.3-codex-spark"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5-Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":13.6364,"output":109.0909},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-image-1.5":{"id":"openai/gpt-image-1.5","type":"image","name":"gpt-image-1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":128000,"output":0},"canonical_model_id":"openai/gpt-image-1.5"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.5909,"output":12.7273,"cache_read":0.1591},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/chatgpt-4o-latest":{"id":"openai/chatgpt-4o-latest","name":"ChatGPT-4o-Latest","description":"Legacy model retained for compatibility with older integrations","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-08-14","last_updated":"2024-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":4.5,"output":14}},"openai/o4-mini-deep-research":{"id":"openai/o4-mini-deep-research","name":"o4-mini-deep-research","description":"Research model for long-horizon investigation, synthesis, and analytical reports","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-26","last_updated":"2025-06-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.8,"output":7.2,"cache_read":0.45},"canonical_model_id":"openai/o4-mini-deep-research"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1364,"output":9.0909,"cache_read":0.1136},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5-mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2273,"output":1.8182,"cache_read":0.0227},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1-Codex-Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0.22,"output":1.8,"cache_read":0.022},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5-Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":400000,"input":922000,"output":128000},"cost":{"input":27.2727,"output":163.6364},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-4o-mini-search":{"id":"openai/gpt-4o-mini-search","name":"GPT-4o-mini-Search","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-03-11","last_updated":"2025-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.14,"output":0.54}},"openai/o3-mini-high":{"id":"openai/o3-mini-high","name":"o3-mini-high","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":0.99,"output":4},"canonical_model_id":"openai/o3-mini"},"openai/dall-e-3":{"id":"openai/dall-e-3","type":"image","name":"DALL-E-3","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"dall-e","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":800,"output":0},"status":"deprecated"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4-Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":27.2727,"output":163.6364},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5-nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.0455,"output":0.3636,"cache_read":0.0045},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2727,"output":13.6364,"cache_read":0.2273},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-3.5-turbo":{"id":"openai/gpt-3.5-turbo","name":"GPT-3.5-Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":2048},"status":"deprecated","cost":{"input":0.45,"output":1.4},"canonical_model_id":"openai/gpt-3.5-turbo"},"openai/gpt-4-turbo":{"id":"openai/gpt-4-turbo","name":"GPT-4-Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":9,"output":27},"canonical_model_id":"openai/gpt-4-turbo"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3-pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":18.1818,"output":72.7273},"canonical_model_id":"openai/o3-pro"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4-Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.1818,"output":1.1364,"cache_read":0.0182},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-5.2-instant":{"id":"openai/gpt-5.2-instant","name":"GPT-5.2-Instant","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":1.6,"output":13,"cache_read":0.16},"canonical_model_id":"openai/gpt-5.2-chat-latest"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5-codex":{"id":"openai/gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.1,"output":9},"canonical_model_id":"openai/gpt-5-codex"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o-mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":124096,"output":4096},"cost":{"input":0.1364,"output":0.5455,"cache_read":0.0682},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-image-1":{"id":"openai/gpt-image-1","type":"image","name":"GPT-Image-1","description":"OpenAI image model for production generation, edits, and brand-safe visual workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-04-24","last_updated":"2025-04-24","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":128000,"output":0},"status":"deprecated","canonical_model_id":"openai/gpt-image-1"},"openai/gpt-4o-search":{"id":"openai/gpt-4o-search","name":"GPT-4o-Search","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-03-11","last_updated":"2025-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":2.2727,"output":9.0909}},"novita/glm-4.7-n":{"id":"novita/glm-4.7-n","name":"glm-4.7-n","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131072},"canonical_model_id":"zhipuai/glm-4.7"},"novita/kimi-k2.6":{"id":"novita/kimi-k2.6","name":"Kimi-K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":262144,"output":262144},"cost":{"input":0.9596,"output":4.0404,"cache_read":0.1616},"canonical_model_id":"moonshotai/kimi-k2.6"},"novita/minimax-m2.1":{"id":"novita/minimax-m2.1","name":"minimax-m2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131072},"cost":{"input":0.303,"output":1.2121,"cache_read":0.1515},"canonical_model_id":"minimax/MiniMax-M2.1"},"novita/glm-4.6v":{"id":"novita/glm-4.6v","name":"glm-4.6v","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":32768},"canonical_model_id":"zhipuai/glm-4.6v"},"novita/kimi-k2.5":{"id":"novita/kimi-k2.5","name":"Kimi-K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":262144},"status":"deprecated","cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"novita/glm-4.7":{"id":"novita/glm-4.7","name":"glm-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131072},"status":"deprecated","canonical_model_id":"zhipuai/glm-4.7"},"novita/kimi-k2-thinking":{"id":"novita/kimi-k2-thinking","name":"kimi-k2-thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":0},"status":"deprecated","canonical_model_id":"moonshotai/kimi-k2-thinking"},"novita/glm-4.6":{"id":"novita/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0},"cost":{"input":0.6061,"output":2.2222,"cache_read":0.1111},"canonical_model_id":"zhipuai/glm-4.6"},"novita/deepseek-v3.2":{"id":"novita/deepseek-v3.2","name":"DeepSeek-V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":0},"cost":{"input":0.2626,"output":0.3838,"cache_read":0.1313},"canonical_model_id":"deepseek/deepseek-v3.2"},"novita/glm-5":{"id":"novita/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"novita/glm-4.7-flash":{"id":"novita/glm-4.7-flash","name":"glm-4.7-flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":false,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":65500},"cost":{"input":0.0707,"output":0.404},"canonical_model_id":"zhipuai/glm-4.7-flash"},"cerebras/llama-3.3-70b-cs":{"id":"cerebras/llama-3.3-70b-cs","name":"llama-3.3-70b-cs","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0},"status":"deprecated","canonical_model_id":"meta/llama-3.3-70b-instruct"},"cerebras/llama-3.1-8b-cs":{"id":"cerebras/llama-3.1-8b-cs","name":"Llama-3.1-8B-CS","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":0},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"cerebras/gpt-oss-120b-cs":{"id":"cerebras/gpt-oss-120b-cs","name":"GPT-OSS-120B-CS","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":0},"cost":{"input":0.3535,"output":0.7576},"canonical_model_id":"openai/gpt-oss-120b"},"cerebras/qwen3-235b-2507-cs":{"id":"cerebras/qwen3-235b-2507-cs","name":"qwen3-235b-2507-cs","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0},"status":"deprecated","canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"cerebras/qwen3-32b-cs":{"id":"cerebras/qwen3-32b-cs","name":"qwen3-32b-cs","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":0},"status":"deprecated","canonical_model_id":"alibaba/qwen3-32b"},"stabilityai/stablediffusionxl":{"id":"stabilityai/stablediffusionxl","type":"image","name":"StableDiffusionXL","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"stable-diffusion","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2023-07-09","last_updated":"2023-07-09","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":200,"output":0}},"trytako/tako":{"id":"trytako/tako","name":"Tako","description":"Tool-capable chat model for instruction following and agentic application workflows","family":"tako","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2024-08-15","last_updated":"2024-08-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":0}},"xai/grok-4.1-fast-reasoning":{"id":"xai/grok-4.1-fast-reasoning","name":"Grok-4.1-Fast-Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window and built-in reasoning","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"status":"deprecated","canonical_model_id":"xai/grok-4.1-fast-reasoning"},"xai/grok-4-fast-reasoning":{"id":"xai/grok-4-fast-reasoning","name":"Grok-4-Fast-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"status":"deprecated","cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4-fast-reasoning"},"xai/grok-4":{"id":"xai/grok-4","name":"Grok-4","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-07-10","last_updated":"2025-07-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.75}},"xai/grok-3":{"id":"xai/grok-3","name":"Grok 3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-04-11","last_updated":"2025-04-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":3,"output":15,"cache_read":0.75}},"xai/grok-4.1-fast-non-reasoning":{"id":"xai/grok-4.1-fast-non-reasoning","name":"Grok-4.1-Fast-Non-Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"status":"deprecated","canonical_model_id":"xai/grok-4.1-fast"},"xai/grok-code-fast-1":{"id":"xai/grok-code-fast-1","name":"Grok Code Fast 1","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.2,"output":1.5,"cache_read":0.02},"canonical_model_id":"xai/grok-code-fast-1"},"xai/grok-4.20-multi-agent":{"id":"xai/grok-4.20-multi-agent","name":"Grok-4.20-Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"temperature":false,"release_date":"2026-03-13","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":0},"cost":{"input":1.2626,"output":2.5253,"cache_read":0.202}},"xai/grok-4-fast-non-reasoning":{"id":"xai/grok-4-fast-non-reasoning","name":"Grok-4-Fast-Non-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"status":"deprecated","cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"xai/grok-3-mini":{"id":"xai/grok-3-mini","name":"Grok 3 Mini","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"release_date":"2025-04-11","last_updated":"2025-04-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.3,"output":0.5,"cache_read":0.075}},"lumalabs/ray2":{"id":"lumalabs/ray2","type":"video","name":"Ray2","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"ray","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"release_date":"2025-02-20","last_updated":"2025-02-20","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":5000,"output":0}}}},"blueclaw":{"id":"blueclaw","env":["BLUECLAW_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://openai.blueclaw.network/v1","name":"Blue Claw","doc":"https://blueclaw.network","models":{"Qwen3.8-27B":{"id":"Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"beta","canonical_model_id":"alibaba/qwen3.8-27b"}}},"zai-coding-plan":{"id":"zai-coding-plan","env":["ZHIPU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.z.ai/api/coding/paas/v4","name":"Z.AI Coding Plan","doc":"https://docs.z.ai/devpack/overview","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.2-highspeed":{"id":"glm-5.2-highspeed","name":"GLM-5.2 Highspeed","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-5-turbo":{"id":"glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5-turbo"},"glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"}}},"wandb":{"id":"wandb","env":["WANDB_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inference.wandb.ai/v1","name":"CoreWeave","doc":"https://docs.wandb.ai/inference","models":{"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B","description":"Gemma 4 31B Dense is designed for advanced reasoning, agentic workflows, and longer context and is natively trained on 140+ languages.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.34,"cache_read":0.1},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B","description":"Gemma 4 26B A4B is a multimodal MoE model with LoRA support and function calling for agentic workflows.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax M3","description":"MiniMax M3 is a multimodal MoE model with 23B active parameters optimized for coding and agentic workflows.","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.23,"output":0.96,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek V3.1","description":"A large hybrid model that supports both thinking and non-thinking modes via prompt templates.","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":161000,"output":161000},"cost":{"input":0.5,"output":1.5,"cache_read":0.2},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"DeepSeek V4.1 Flash 1017 is a multimodal MoE model for coding, reasoning, and faster agentic workflows with 1M context.","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"DeepSeek V4-Flash-0731 is an MoE model great for coding, reasoning, and agentic workloads.","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.13,"output":0.27,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash is a multimodal MoE model for coding, reasoning, and agentic workloads with long contexts.","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.13,"output":0.65,"cache_read":0.002},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4-Pro-0813 is a 1.6T-parameter MoE model excelling at advanced reasoning, coding, and complex agentic workloads.","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.31,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Kimi K2.7 Code is a 1T-parameter MoE model with 32B active parameters purpose-built for long-horizon agentic coding and software engineering.","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.12},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Kimi K2.6 is a multimodal Mixture-of-Experts language model featuring 32 billion activated parameters and a total of 1 trillion parameters.","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.65,"output":3.41,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"gpt-oss-20b","description":"Lower latency Mixture-of-Experts model trained on OpenAI's Harmony response format with reasoning capabilities.","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.03,"output":0.13,"cache_read":0.03},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"gpt-oss-120b","description":"Efficient Mixture-of-Experts model designed for high-reasoning, agentic and general-purpose use cases.","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.03,"output":0.17,"cache_read":0.03},"canonical_model_id":"openai/gpt-oss-120b"},"ibm-granite/granite-4.2-8b":{"id":"ibm-granite/granite-4.2-8b","name":"Granite 4.2 8B","description":"Granite 4.2 8B is an instruct model capable of enhanced tool calling, instruction following, and chat capabilities.","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.06,"output":0.15,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"reflection/Beam-1.0-501B-A23B":{"id":"reflection/Beam-1.0-501B-A23B","name":"Beam 1.0 501B A23B","description":"Beam is a 501B-parameter MoE model with 23B active parameters built for coding, reasoning, and agentic workflows.","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1,"cache_read":0.04},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"meta-llama/Llama-3.1-8B-Instruct":{"id":"meta-llama/Llama-3.1-8B-Instruct","name":"Llama 3.1 8B","description":"Efficient conversational model optimized for responsive multilingual chatbot interactions.","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.22,"output":0.22,"cache_read":0.22},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama 3.3 70B","description":"Multilingual model excelling in conversational tasks, detailed instruction-following, and coding.","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.71,"output":0.71,"cache_read":0.71},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Qwen3.8-27B is a dense multimodal model suited for coding, research, vision, and long-running agent tasks.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":3,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B A3B","description":"Qwen3.6-35B-A3B is an MoE multimodal model with 262K context optimized for agentic coding workflows.","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.89,"cache_read":0.035},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","description":"GLM-5.3-Flash is a natively multimodal model with 320B total parameters and 18B active parameters.","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.12,"output":0.38,"cache_read":0.02},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM 5.2","description":"GLM-5.2 is a Mixture-of-Experts language model featuring 40 billion activated parameters and a total of 744 billion parameters.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.62,"output":2.42,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","description":"GLM-5.3 is a 744B-parameter MoE model built for advanced reasoning, software engineering, and long-horizon agentic tasks.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.75,"output":3,"cache_read":0.19},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B","name":"Nemotron 3 Ultra","description":"Nemotron 3 Ultra is a powerful MoE model designed for long-running agents across coding, deep research, and enterprise automation.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":2.15,"cache_read":0.1},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B":{"id":"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B","name":"Nemotron 3.5 Super VL","description":"Nemotron 3.5 Super VL is a multimodal MoE model built for visual understanding, reasoning, and agentic workflows.","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.15,"output":0.47,"cache_read":0.02},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B":{"id":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B","name":"Nemotron 3.5 Lightning","description":"Nemotron 3.5 Lightning is an MoE model built for fast, reliable agentic tasks across use cases such as financial services, cybersecurity, telecom, and retail.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.07,"output":0.2,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-3.5-lightning"}}},"hopper":{"id":"hopper","env":["HOPPER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.withhopper.com/v1","name":"Hopper","doc":"https://withhopper.com/agents/deepseek-v4.1-flash-1017","models":{"deepseek-v4.1-flash-1017-abliterated":{"id":"deepseek-v4.1-flash-1017-abliterated","name":"DeepSeek V4.1 Flash 1017 Abliterated","description":"Abliterated variant of DeepSeek V4.1 Flash 1017 hosted by Hopper.","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.09,"output":0.85,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"modelscope":{"id":"modelscope","env":["MODELSCOPE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api-inference.modelscope.cn/v1","name":"ModelScope","doc":"https://modelscope.cn/docs/model-service/API-Inference/intro","models":{"ZhipuAI/GLM-4.6":{"id":"ZhipuAI/GLM-4.6","name":"GLM-4.6","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":98304},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.6"},"ZhipuAI/GLM-4.5":{"id":"ZhipuAI/GLM-4.5","name":"GLM-4.5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.5"},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3-235B-A22B-Thinking-2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"Qwen/Qwen3-30B-A3B-Thinking-2507":{"id":"Qwen/Qwen3-30B-A3B-Thinking-2507","name":"Qwen3 30B A3B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0}},"Qwen/Qwen3-30B-A3B-Instruct-2507":{"id":"Qwen/Qwen3-30B-A3B-Instruct-2507","name":"Qwen3 30B A3B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen3 Coder 30B A3B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"}}},"kuae-cloud-coding-plan":{"id":"kuae-cloud-coding-plan","env":["KUAE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://coding-plan-endpoint.kuaecloud.net/v1","name":"KUAE Cloud Coding Plan","doc":"https://docs.mthreads.com/kuaecloud/kuaecloud-doc-online/coding_plan/","models":{"GLM-4.7":{"id":"GLM-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"}}},"scaleway":{"id":"scaleway","env":["SCALEWAY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.scaleway.ai/v1","name":"Scaleway","doc":"https://www.scaleway.com/en/docs/generative-apis/","models":{"whisper-large-v3":{"id":"whisper-large-v3","type":"transcription","name":"Whisper Large v3","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2023-09","release_date":"2023-09-01","last_updated":"2026-03-17","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":8192}},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":2.0187,"output":6.16825},"canonical_model_id":"zhipuai/glm-5.2"},"lightonocr-3-0.8b":{"id":"lightonocr-3-0.8b","name":"LightOnOCR-3 0.8B","description":"LightOnOCR-3-0.8B is the lightest model of LightOn's LightOnOCR-3 family, with the same layout and visual understanding features as its larger siblings.","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-10-08","last_updated":"2026-10-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":2.464,"output":0},"canonical_model_id":"lightonai/lightonocr-3-0.8b"},"mistral-medium-3.5-128b":{"id":"mistral-medium-3.5-128b","name":"Mistral Medium 3.5 128B","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":1.68225,"output":8.41125},"canonical_model_id":"mistral/mistral-medium-2604"},"bge-multilingual-gemma2":{"id":"bge-multilingual-gemma2","type":"embedding","name":"BGE Multilingual Gemma2","description":"Multilingual Gemma 2 based embedding model for retrieval and semantic search","family":"bge","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-07-25","last_updated":"2024-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8191,"output":0},"cost":{"input":0.11215,"output":0},"canonical_model_id":"baai/bge-multilingual-gemma2"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"beta","cost":{"input":0.684,"output":3.762,"reasoning":3.762,"cache_read":0.137},"canonical_model_id":"alibaba/qwen3.8-27b"},"mistral-small-3.2-24b-instruct-2506":{"id":"mistral-small-3.2-24b-instruct-2506","name":"Mistral Small 3.2 24B Instruct (2506)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.168225,"output":0.392525},"canonical_model_id":"mistral/mistral-small-2506"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":260000,"output":16384},"cost":{"input":0.841125,"output":2.523375},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.6729,"output":4.0374},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"status":"beta","cost":{"input":2.01,"output":6.15},"canonical_model_id":"zhipuai/glm-5.3"},"qwen3-embedding-8b":{"id":"qwen3-embedding-8b","type":"embedding","name":"Qwen3 Embedding 8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"cost":{"input":0.11215,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"output":16384},"cost":{"input":1.00935,"output":1.00935},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"status":"beta","cost":{"input":0.280375,"output":1.68225},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"status":"beta","cost":{"input":0.280375,"output":0.56075},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"status":"beta","cost":{"input":0.468,"output":0.936,"reasoning":0.936,"cache_read":0.0936},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT-OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.168225,"output":0.6729},"canonical_model_id":"openai/gpt-oss-120b"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32768},"status":"beta","cost":{"input":0.672,"output":2.016,"reasoning":2.016,"cache_read":0.134},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"minimax":{"id":"minimax","env":["MINIMAX_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://api.minimax.io/anthropic/v1","name":"MiniMax (minimax.io)","doc":"https://platform.minimax.io/docs/guides/quickstart","models":{"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375}},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375}},"MiniMax-M2.5-highspeed":{"id":"MiniMax-M2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375}},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"tiers":[{"input":0.6,"output":2.4,"cache_read":0.12,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.6,"output":2.4,"cache_read":0.12}}},"MiniMax-M2.7-highspeed":{"id":"MiniMax-M2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375}},"MiniMax-M3.1-Flash":{"id":"MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"MiniMax-M2":{"id":"MiniMax-M2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.3,"output":1.2}}}},"requesty":{"id":"requesty","env":["REQUESTY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://router.requesty.ai/v1","name":"Requesty","doc":"https://requesty.ai/solution/llm-routing/models","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.6-plus"},"glm-5.2-fast":{"id":"glm-5.2-fast","name":"glm-5.2-fast","description":"GLM-5.2 introduces a robust 1M-token context and advanced, multi-effort coding capabilities to significantly enhance performance on long-horizon tasks. Its new IndexShare architecture and improved MTP layer simultaneously boost efficiency by reducing per-token FLOPs and increasing speculative decoding lengths. A 743B-parameter model in Zhipu AI's GLM series, designed to plan, execute, and iterate autonomously on extended, engineering-grade tasks.","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-07-13","last_updated":"2026-07-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.1,"output":6.6,"cache_read":0.21}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5.5,"output":33,"cache_read":0.55},"canonical_model_id":"openai/gpt-5.5"},"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"nemotron-3-nano-omni":{"id":"nemotron-3-nano-omni","name":"nemotron-3-nano-omni","description":"The most open, efficient, and accurate omni modal reasoning model for agentic AI.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-20","last_updated":"2026-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":300000},"cost":{"input":0.06,"output":0.24,"cache_read":0.06}},"claude-opus-5-5@eu":{"id":"claude-opus-5-5@eu","name":"Claude Opus 5.5 (EU)","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.22,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-opus-4-7@eu":{"id":"claude-opus-4-7@eu","name":"Claude Opus 4.7 (EU)","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"gpt-4.1@eu":{"id":"gpt-4.1@eu","name":"GPT-4.1 (EU)","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2.2,"output":8.8,"cache_read":0.55},"canonical_model_id":"openai/gpt-4.1"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"nemotron-3-ultra-550b-a55b":{"id":"nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"glm-5.3-flash@eu":{"id":"glm-5.3-flash@eu","name":"GLM-5.3-Flash (EU)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.2,"output":0.6,"cache_read":0.07},"canonical_model_id":"zhipuai/glm-5.3-flash"},"ling-3.0-tiny":{"id":"ling-3.0-tiny","name":"ling-3.0-tiny","description":"Ling-3.0-tiny is an efficient 7.9B parameter MoE model from inclusionAI with only 1.3B active parameters per token. Built for responsive agents, reliable instruction following and multi turn conversation, with a 256K context window, native function calling, prompt caching and switchable Thinking and Instant modes.","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0}},"kimi-k3.1-pro-highspeed":{"id":"kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":4},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":2.55,"cache_read":0.16},"canonical_model_id":"zhipuai/glm-5.2"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":1,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1,"cache_write":4}},"canonical_model_id":"xai/grok-4.5"},"mistral-small-2603@eu":{"id":"mistral-small-2603@eu","name":"Mistral Small 4 (EU)","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.165,"output":0.66,"cache_read":0.165},"canonical_model_id":"mistral/mistral-small-2603"},"nemotron-3.5-lightning-30b-a3b":{"id":"nemotron-3.5-lightning-30b-a3b","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"kimi-k2.6@eu":{"id":"kimi-k2.6@eu","name":"Kimi K2.6 (EU)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":128000},"cost":{"input":0.95,"output":4,"cache_read":0.95},"canonical_model_id":"moonshotai/kimi-k2.6"},"kat-coder-pro":{"id":"kat-coder-pro","name":"kat-coder-pro","description":"KAT-Coder-Pro V2 by KwaiKAT is a non-reasoning model optimized for agentic coding. It delivers strong performance on reasoning-style tasks while requiring significantly fewer output tokens than peer models. With the 1210 release, it achieved a score of 64 on the Artificial Analysis Intelligence Index, placing it in the global Top 10 and ranking first among all non-reasoning models.","family":"kat-coder","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-03-27","last_updated":"2026-03-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.3,"output":1.2}},"nemotron-lightning-3.5-30b-a3b":{"id":"nemotron-lightning-3.5-30b-a3b","name":"nemotron-lightning-3.5-30b-a3b","description":"Nemotron-Lightning-3.5-30B-A3B is a 30B-parameter Mixture-of-Experts language model (3B active) from NVIDIA's Nemotron-H family, built on a hybrid Mamba-Transformer architecture for efficient long-context inference. Like other models in the family, it responds to queries by first generating a reasoning trace and then concluding with a final response, with reasoning behavior configurable through a flag in the chat template. It includes a multi-token prediction (MTP) speculative decoding head for low-latency serving.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-08-15","last_updated":"2026-08-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.05,"output":0.2,"cache_read":0.01}},"gpt-4.1-mini@eu":{"id":"gpt-4.1-mini@eu","name":"GPT-4.1 mini (EU)","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.44,"output":1.76,"cache_read":0.11},"canonical_model_id":"openai/gpt-4.1-mini"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5-mini@eu":{"id":"gpt-5-mini@eu","name":"GPT-5 Mini (EU)","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":0.275,"output":2.2,"cache_read":0.0275},"canonical_model_id":"openai/gpt-5-mini"},"nvidia-nemotron-3-super-120b-a12b":{"id":"nvidia-nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"claude-fable-5.1@eu":{"id":"claude-fable-5.1@eu","name":"Claude Fable 5.1 (EU)","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":0.275,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5-1"},"claude-fable-5@eu":{"id":"claude-fable-5@eu","name":"Claude Fable 5 (EU)","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"deepseek-v4-pro@eu":{"id":"deepseek-v4-pro@eu","name":"DeepSeek V4 Pro (EU)","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.75,"output":3.5,"cache_read":0.44},"canonical_model_id":"deepseek/deepseek-v4-pro"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"cache_write":1.25,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"cache_write":2.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4,"cache_write":2.5}},"canonical_model_id":"xai/grok-4.3"},"gemini-4-argon@eu":{"id":"gemini-4-argon@eu","name":"Gemini 4 Argon (EU)","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2.2,"output":11,"cache_read":0.11},"canonical_model_id":"google/gemini-4-argon"},"gemini-3.1-flash-lite@eu":{"id":"gemini-3.1-flash-lite@eu","name":"Gemini 3.1 Flash Lite (EU)","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.275,"output":1.65,"cache_read":0.0275,"cache_write":0.091663},"canonical_model_id":"google/gemini-3.1-flash-lite"},"nemotron-3-nano-omni@eu":{"id":"nemotron-3-nano-omni@eu","name":"nemotron-3-nano-omni@eu","description":"The most open, efficient, and accurate omni modal reasoning model for agentic AI.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-20","last_updated":"2026-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":300000},"cost":{"input":0.06,"output":0.24,"cache_read":0.06}},"gpt-5@eu":{"id":"gpt-5@eu","name":"GPT-5 (EU)","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.375,"output":11,"cache_read":0.1375},"canonical_model_id":"openai/gpt-5"},"grok-4.2-beta":{"id":"grok-4.2-beta","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":0.4,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.4,"cache_write":4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"nvidia-nemotron-3-ultra":{"id":"nvidia-nemotron-3-ultra","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.5,"output":2.5},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"gpt-6.1-sol@eu":{"id":"gpt-6.1-sol@eu","name":"GPT-6.1 Sol (EU)","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.4,"output":12,"cache_read":0.12,"cache_write":3,"tiers":[{"input":4.8,"output":18,"cache_read":0.24,"cache_write":6,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.8,"output":18,"cache_read":0.24,"cache_write":6}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.1@eu":{"id":"gpt-5.1@eu","name":"GPT-5.1 (EU)","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.375,"output":11,"cache_read":0.1375},"canonical_model_id":"openai/gpt-5.1"},"gpt-5.6-luna@eu":{"id":"gpt-5.6-luna@eu","name":"GPT-5.6 Luna (EU)","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.22,"output":1.32,"cache_read":0.022,"cache_write":0.275,"tiers":[{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.44,"output":1.98,"cache_read":0.044,"cache_write":0.55}},"canonical_model_id":"openai/gpt-5.6-luna"},"ring-2.6-1t":{"id":"ring-2.6-1t","name":"ring-2.6-1t","description":"Inclusion AI ring-2.6-1t","family":"ring","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-05-08","last_updated":"2026-05-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":2.5}},"laguna-m.1":{"id":"laguna-m.1","name":"Laguna M.1","description":"Poolside's open-weight model for agentic coding and long-horizon work","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"poolside/laguna-m.1"},"glm-5.3@eu":{"id":"glm-5.3@eu","name":"GLM-5.3 (EU)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.2,"output":4.2,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3.1-flash@eu":{"id":"minimax-m3.1-flash@eu","name":"MiniMax-M3.1-Flash (EU)","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.07},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":1,"output":2.7,"cache_read":0.05},"canonical_model_id":"stepfun/step-5-preview"},"inkling-256k":{"id":"inkling-256k","name":"Inkling 256K","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"mistral-medium-3-5":{"id":"mistral-medium-3-5","name":"Mistral Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.65,"output":8.25,"cache_read":1.65},"canonical_model_id":"mistral/mistral-medium-3-5"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":3,"output":15,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":1.583},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"claude-opus-4-5@eu":{"id":"claude-opus-4-5@eu","name":"Claude Opus 4.5 (latest) (EU)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"mistral-medium-3-5@eu":{"id":"mistral-medium-3-5@eu","name":"Mistral Medium 3.5 (EU)","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.65,"output":8.25,"cache_read":1.65},"canonical_model_id":"mistral/mistral-medium-3-5"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.5,"output":7,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"deepseek-v4-pro-0813@eu":{"id":"deepseek-v4-pro-0813@eu","name":"DeepSeek V4 Pro 0813 (EU)","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":1.75,"output":3.5,"cache_read":0.44},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"gemini-3.5-flash@eu":{"id":"gemini-3.5-flash@eu","name":"Gemini 3.5 Flash (EU)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.65,"output":9.9,"cache_read":0.165,"cache_write":1.7413},"canonical_model_id":"google/gemini-3.5-flash"},"gpt-5.4@eu":{"id":"gpt-5.4@eu","name":"GPT-5.4 (EU)","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.75,"output":16.5,"cache_read":0.275,"tiers":[{"input":5.5,"output":24.75,"cache_read":0.55,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5.5,"output":24.75,"cache_read":0.55}},"canonical_model_id":"openai/gpt-5.4"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"deepseek-v4.1-flash@eu":{"id":"deepseek-v4.1-flash@eu","name":"DeepSeek V4.1 Flash (EU)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2},"canonical_model_id":"xai/grok-4.7"},"leanstral-1-5":{"id":"leanstral-1-5","name":"leanstral-1-5","description":"Leanstral 1.5 is an updated Lean 4 formal proof engineering model from Mistral AI, optimized for automated theorem proving and autoformalization. It has 119B total parameters with 6.5B active and supports a 256K token context window. It supports native function calling and structured output.","family":"leanstral","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-27","last_updated":"2026-05-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0}},"qwen3.8-flash-next":{"id":"qwen3.8-flash-next","name":"Qwen3.8 Flash Next","description":"Open-weight experimental preview of the Qwen4 architecture: hybrid-attention MoE (125B total, 6B active) with vision encoder for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.5,"cache_read":0.05,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash-next"},"seed-2.0-code":{"id":"seed-2.0-code","name":"Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"kimi-k2.7-code@eu":{"id":"kimi-k2.7-code@eu","name":"Kimi K2.7 Code (EU)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.25,"output":4.5,"cache_read":0.31},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash-0731@eu":{"id":"deepseek-v4-flash-0731@eu","name":"DeepSeek V4 Flash 0731 (EU)","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.16,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"gemini-3.8-flash@eu":{"id":"gemini-3.8-flash@eu","name":"Gemini 3.8 Flash (EU)","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.825,"output":4.125,"cache_read":0.0825},"canonical_model_id":"google/gemini-3.8-flash"},"devstral-latest@eu":{"id":"devstral-latest@eu","name":"devstral-latest@eu","description":"An enterprise grade text model, that excels at using tools to explore codebases, editing multiple files and power software engineering agents.","family":"devstral","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-27","last_updated":"2026-05-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.44,"output":2.2,"cache_read":0.44}},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.43,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"gemini-3.1-flash-image":{"id":"gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":2},"canonical_model_id":"google/gemini-3.1-flash-image"},"nemotron-3-nano-omni-30b-a3b-reasoning":{"id":"nemotron-3-nano-omni-30b-a3b-reasoning","name":"Nemotron 3 Nano Omni 30B A3B Reasoning","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":20480},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"deepseek-v4.1-flash-1017@eu":{"id":"deepseek-v4.1-flash-1017@eu","name":"DeepSeek V4.1 Flash 1017 (EU)","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"glm-5.2@eu":{"id":"glm-5.2@eu","name":"GLM-5.2 (EU)","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1.2,"output":4.2,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"o4-mini@eu":{"id":"o4-mini@eu","name":"o4-mini (EU)","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.21,"output":4.84,"cache_read":0.3025},"canonical_model_id":"openai/o4-mini"},"gpt-5.6-sol@eu":{"id":"gpt-5.6-sol@eu","name":"GPT-5.6 Sol (EU)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4.4,"output":22,"cache_read":0.44,"cache_write":5.5,"tiers":[{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8.8,"output":33,"cache_read":0.88,"cache_write":11}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":4.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":9,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":9}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"claude-fable-5.1":{"id":"claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"minimax-m3@eu":{"id":"minimax-m3@eu","name":"MiniMax-M3 (EU)","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.4,"output":2,"cache_read":0.1},"canonical_model_id":"minimax/MiniMax-M3"},"mistral-small-2603":{"id":"mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.165,"output":0.66,"cache_read":0.165},"canonical_model_id":"mistral/mistral-small-2603"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.08333},"canonical_model_id":"google/gemini-3.1-flash-lite"},"leanstral-1-5@eu":{"id":"leanstral-1-5@eu","name":"leanstral-1-5@eu","description":"Leanstral 1.5 is an updated Lean 4 formal proof engineering model from Mistral AI, optimized for automated theorem proving and autoformalization. It has 119B total parameters with 6.5B active and supports a 256K token context window. It supports native function calling and structured output.","family":"leanstral","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-27","last_updated":"2026-05-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0}},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"seed-2.0-mini":{"id":"seed-2.0-mini","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.1,"output":0.4,"cache_read":0.02},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"gpt-6-sol@eu":{"id":"gpt-6-sol@eu","name":"GPT-6 Sol (EU)","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.4,"output":12,"cache_read":0.24,"cache_write":3,"tiers":[{"input":4.8,"output":18,"cache_read":0.48,"cache_write":6,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.8,"output":18,"cache_read":0.48,"cache_write":6}},"canonical_model_id":"openai/gpt-6-sol"},"gpt-5-nano@eu":{"id":"gpt-5-nano@eu","name":"GPT-5 Nano (EU)","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":0.055,"output":0.44,"cache_read":0.0055},"canonical_model_id":"openai/gpt-5-nano"},"seed-2.0-pro":{"id":"seed-2.0-pro","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"qwen3.8-2.4T-A95B":{"id":"qwen3.8-2.4T-A95B","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen3.8-2.4T-A95B@eu":{"id":"qwen3.8-2.4T-A95B@eu","name":"Qwen3.8 2.4T A95B (EU)","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":2.5,"output":6,"cache_read":0.63,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"gpt-4.1-nano@eu":{"id":"gpt-4.1-nano@eu","name":"GPT-4.1 nano (EU)","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.11,"output":0.44,"cache_read":0.0275},"canonical_model_id":"openai/gpt-4.1-nano"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"muse-wonder-1.0":{"id":"muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.2,"output":4.2,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"qwen3.5-35b-a3b":{"id":"qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.14,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"gpt-6.1-terra@eu":{"id":"gpt-6.1-terra@eu","name":"GPT-6.1 Terra (EU)","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1.2,"output":6,"cache_read":0.06,"cache_write":1.5,"tiers":[{"input":2.4,"output":9,"cache_read":0.12,"cache_write":3,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2.4,"output":9,"cache_read":0.12,"cache_write":3}},"canonical_model_id":"openai/gpt-6.1-terra"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0027},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.32,"output":1.28,"cache_read":0.032,"cache_write":0.4},"canonical_model_id":"alibaba/qwen3.7-plus"},"claude-haiku-4-5@eu":{"id":"claude-haiku-4-5@eu","name":"Claude Haiku 4.5 (latest) (EU)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"muse-spark-open":{"id":"muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"mistral-large-4@eu":{"id":"mistral-large-4@eu","name":"Mistral Large 4 (EU)","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"seed-1.8":{"id":"seed-1.8","name":"Seed 1.8","description":"ByteDance Seed model for multimodal reasoning, long-context analysis, and agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-28","last_updated":"2025-12-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"cost":{"input":0.25,"output":2,"cache_read":0.05},"canonical_model_id":"bytedance-seed/seed-1-8"},"claude-sonnet-4-5@eu":{"id":"claude-sonnet-4-5@eu","name":"Claude Sonnet 4.5 (latest) (EU)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.3,"cache_write":4.125,"tiers":[{"input":6.6,"output":24.75,"cache_read":0.6,"cache_write":8.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6.6,"output":24.75,"cache_read":0.6,"cache_write":8.25}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.5-pro"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash"},"claude-sonnet-4-6@eu":{"id":"claude-sonnet-4-6@eu","name":"Claude Sonnet 4.6 (EU)","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.3,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-sonnet-5-5@eu":{"id":"claude-sonnet-5-5@eu","name":"Claude Sonnet 5.5 (EU)","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"qwen3.8-flash-next@eu":{"id":"qwen3.8-flash-next@eu","name":"Qwen3.8 Flash Next (EU)","description":"Open-weight experimental preview of the Qwen4 architecture: hybrid-attention MoE (125B total, 6B active) with vision encoder for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.5,"cache_read":0.05,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash-next"},"gemini-2.5-pro@eu":{"id":"gemini-2.5-pro@eu","name":"Gemini 2.5 Pro (EU)","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.25,"output":10,"cache_read":0.31,"cache_write":2.375,"tiers":[{"input":2.5,"output":15,"cache_read":0.62,"cache_write":4.75,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.62,"cache_write":4.75}},"canonical_model_id":"google/gemini-2.5-pro"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.2,"output":0.6,"cache_read":0.07},"canonical_model_id":"zhipuai/glm-5.3-flash"},"gpt-4o-mini@eu":{"id":"gpt-4o-mini@eu","name":"GPT-4o mini (EU)","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":0.165,"output":0.66,"cache_read":0.0825},"canonical_model_id":"openai/gpt-4o-mini"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"mistral-medium-latest@eu":{"id":"mistral-medium-latest@eu","name":"Mistral Medium (latest) (EU)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.44,"output":2.2,"cache_read":0.44},"canonical_model_id":"mistral/mistral-medium-latest"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"nemotron-3-ultra-nvfp4":{"id":"nemotron-3-ultra-nvfp4","name":"nemotron-3-ultra-nvfp4","description":"Nemotron-3-Ultra-550B-A55B-NVFP4 is a frontier-scale large language model (LLM) trained by NVIDIA, designed to deliver strong agentic, reasoning, and conversational capabilities. It is optimized for the most demanding workloads, including complex multi-step agents, long-context analysis, and high-accuracy reasoning over code, math, and science. The model employs a hybrid Latent Mixture-of-Experts (LatentMoE) architecture, utilizing interleaved Mamba-2 and MoE layers, along with select Attention layers. Like the Super model, the Ultra model incorporates Multi-Token Prediction (MTP) layers for faster text generation and improved quality, and it is trained using an NVFP4 pre-training recipe to maximize compute efficiency. The model has 55B active parameters and 550B parameters in total.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":2.4,"cache_read":0.12}},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"cache_read":30},"canonical_model_id":"openai/gpt-5.4-pro"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"gpt-6-luna@eu":{"id":"gpt-6-luna@eu","name":"GPT-6 Luna (EU)","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.12,"output":0.6,"cache_read":0.012,"cache_write":0.15,"tiers":[{"input":0.24,"output":0.9,"cache_read":0.024,"cache_write":0.3,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.24,"output":0.9,"cache_read":0.024,"cache_write":0.3}},"canonical_model_id":"openai/gpt-6-luna"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"gemini-2.5-flash@eu":{"id":"gemini-2.5-flash@eu","name":"Gemini 2.5 Flash (EU)","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.075,"cache_write":0.55},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.75,"output":16.5,"cache_read":0.275},"canonical_model_id":"openai/gpt-5.4"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.07,"output":0.34,"cache_read":0.07},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"inkling":{"id":"inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":32768},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"gemini-3-pro-image":{"id":"gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":4.5},"canonical_model_id":"google/gemini-3-pro-image"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":1,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1,"cache_write":4}},"canonical_model_id":"xai/grok-4.6"},"claude-opus-5@eu":{"id":"claude-opus-5@eu","name":"Claude Opus 5 (EU)","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"mistral-medium-latest":{"id":"mistral-medium-latest","name":"Mistral Medium (latest)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.44,"output":2.2,"cache_read":0.44},"canonical_model_id":"mistral/mistral-medium-latest"},"gemini-3.7-flash@eu":{"id":"gemini-3.7-flash@eu","name":"Gemini 3.7 Flash (EU)","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.825,"output":4.125,"cache_read":0.0825},"canonical_model_id":"google/gemini-3.7-flash"},"devstral-latest":{"id":"devstral-latest","name":"devstral-latest","description":"An enterprise grade text model, that excels at using tools to explore codebases, editing multiple files and power software engineering agents.","family":"devstral","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"release_date":"2026-05-27","last_updated":"2026-05-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.44,"output":2.2,"cache_read":0.44}},"minimax-m2.7-highspeed":{"id":"minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":1.2},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"gpt-5.6-terra@eu":{"id":"gpt-5.6-terra@eu","name":"GPT-5.6 Terra (EU)","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2,"output":13.2,"cache_read":0.22,"cache_write":2.75,"tiers":[{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4.4,"output":19.8,"cache_read":0.44,"cache_write":5.5}},"canonical_model_id":"openai/gpt-5.6-terra"},"muse-glimmer-30b":{"id":"muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":20480},"cost":{"input":0,"output":0},"canonical_model_id":"meta/muse-glimmer-30b"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"nemotron-3-super-120b-a12b":{"id":"nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"grok-build-0.1":{"id":"grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.1},"canonical_model_id":"xai/grok-build-0.1"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"claude-opus-4-6@eu":{"id":"claude-opus-4-6@eu","name":"Claude Opus 4.6 (EU)","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-6"},"claude-opus-4-8@eu":{"id":"claude-opus-4-8@eu","name":"Claude Opus 4.8 (EU)","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-8"},"fugu-ultra":{"id":"fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":1.2},"canonical_model_id":"minimax/MiniMax-M2.7"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen3.5-27b":{"id":"qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.26,"output":2.6},"canonical_model_id":"alibaba/qwen3.5-27b"},"mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"cost":{"input":0.68,"output":2.09,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"glm-5.1@eu":{"id":"glm-5.1@eu","name":"GLM-5.1 (EU)","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":1.4},"canonical_model_id":"zhipuai/glm-5.1"},"gemini-2.5-flash-lite@eu":{"id":"gemini-2.5-flash-lite@eu","name":"Gemini 2.5 Flash-Lite (EU)","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.18333},"canonical_model_id":"google/gemini-2.5-flash-lite"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"nemotron-3.5-content-safety":{"id":"nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"kimi-k2.5@eu":{"id":"kimi-k2.5@eu","name":"Kimi K2.5 (EU)","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16000},"cost":{"input":0.72,"output":3.6,"cache_read":0.72,"cache_write":0.72},"canonical_model_id":"moonshotai/kimi-k2.5"},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Claude Opus 4.1 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.13,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.63,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4@eu":{"id":"claude-sonnet-4@eu","name":"Claude Sonnet 4 (latest) (EU)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-0"},"kimi-k3@eu":{"id":"kimi-k3@eu","name":"Kimi K3 (EU)","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":3,"output":15,"cache_read":0.45},"canonical_model_id":"moonshotai/kimi-k3"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-sonnet-5@eu":{"id":"claude-sonnet-5@eu","name":"Claude Sonnet 5 (EU)","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"laguna-xs.2":{"id":"laguna-xs.2","name":"Laguna XS.2","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"poolside/laguna-xs.2"},"ling-2.6-1t":{"id":"ling-2.6-1t","name":"ling-2.6-1t","description":"Inclusion AI ling-2.6-1t","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":2.5}},"ling-2.6-flash":{"id":"ling-2.6-flash","name":"ling-2.6-flash","description":"Inclusion AI ling-2.6-flash","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.3}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"qwen3.5-2b":{"id":"qwen3.5-2b","name":"Qwen3.5 2B","description":"Compact Qwen3.5 multimodal model for fast chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.02,"output":0.1},"canonical_model_id":"alibaba/qwen3.5-2b"},"gpt-5.5@eu":{"id":"gpt-5.5@eu","name":"GPT-5.5 (EU)","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5.5,"output":33,"cache_read":0.55,"tiers":[{"input":11,"output":49.5,"cache_read":1.1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":11,"output":49.5,"cache_read":1.1}},"canonical_model_id":"openai/gpt-5.5"},"gemini-3.5-flash-lite@eu":{"id":"gemini-3.5-flash-lite@eu","name":"Gemini 3.5 Flash Lite (EU)","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.33,"output":2.75,"cache_read":0.033},"canonical_model_id":"google/gemini-3.5-flash-lite"},"claude-haiku-5-5@eu":{"id":"claude-haiku-5-5@eu","name":"Claude Haiku 5.5 (EU)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.11,"output":0.55,"cache_read":0.02,"cache_write":0.14,"tiers":[{"input":0.55,"output":2.75,"cache_read":0.06,"cache_write":0.69,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"siliconflow-cn":{"id":"siliconflow-cn","env":["SILICONFLOW_CN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.siliconflow.cn/v1","name":"SiliconFlow (China)","doc":"https://cloud.siliconflow.com/models","models":{"Pro/deepseek-ai/DeepSeek-V3.2":{"id":"Pro/deepseek-ai/DeepSeek-V3.2","name":"Pro/deepseek-ai/DeepSeek-V3.2","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":0.89668487,"cache_read":0.05977899},"canonical_model_id":"deepseek/deepseek-v3.2"},"Pro/deepseek-ai/DeepSeek-V3.1-Terminus":{"id":"Pro/deepseek-ai/DeepSeek-V3.1-Terminus","name":"Pro/deepseek-ai/DeepSeek-V3.1-Terminus","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":1.79336973,"cache_read":0.05977899}},"Pro/deepseek-ai/DeepSeek-V3":{"id":"Pro/deepseek-ai/DeepSeek-V3","name":"Pro/deepseek-ai/DeepSeek-V3","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.29889496,"output":1.19557982,"cache_read":0.0298895},"canonical_model_id":"deepseek/deepseek-v3-0324"},"Pro/deepseek-ai/DeepSeek-R1":{"id":"Pro/deepseek-ai/DeepSeek-R1","name":"Pro/deepseek-ai/DeepSeek-R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":2.39115964,"cache_read":0.05977899},"canonical_model_id":"deepseek/deepseek-r1-0528"},"Pro/moonshotai/Kimi-K2.5":{"id":"Pro/moonshotai/Kimi-K2.5","name":"Pro/moonshotai/Kimi-K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"status":"deprecated","cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"Pro/moonshotai/Kimi-K2.6":{"id":"Pro/moonshotai/Kimi-K2.6","name":"Pro/moonshotai/Kimi-K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.97140861,"output":4.0350819,"cache_read":0.16439223},"canonical_model_id":"moonshotai/kimi-k2.6"},"Pro/zai-org/GLM-5":{"id":"Pro/zai-org/GLM-5","name":"Pro/zai-org/GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":205000},"status":"deprecated","cost":{"input":1,"output":3.2},"canonical_model_id":"zhipuai/glm-5"},"Pro/zai-org/GLM-5.1":{"id":"Pro/zai-org/GLM-5.1","name":"Pro/zai-org/GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":205000},"cost":{"input":0.89668487,"output":3.58673947,"cache_read":0.19428172,"cache_write":0,"tiers":[{"input":1.19557982,"output":4.18452938,"cache_read":0.29889496,"cache_write":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5.1"},"ByteDance-Seed/Seed-OSS-36B-Instruct":{"id":"ByteDance-Seed/Seed-OSS-36B-Instruct","name":"ByteDance-Seed/Seed-OSS-36B-Instruct","description":"Tool-capable chat model for instruction following and agentic application workflows","family":"seed","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-04","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.22417122,"output":0.59778991}},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"deepseek-ai/DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":0.89668487,"cache_read":0.05977899},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44834243,"output":1.3450273,"cache_read":0.04483424},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V3.1-Terminus":{"id":"deepseek-ai/DeepSeek-V3.1-Terminus","name":"deepseek-ai/DeepSeek-V3.1-Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":1.79336973,"cache_read":0.05977899}},"deepseek-ai/DeepSeek-OCR":{"id":"deepseek-ai/DeepSeek-OCR","name":"deepseek-ai/DeepSeek-OCR","description":"OCR model for extracting structured text from documents and screenshots","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-10-20","last_updated":"2025-10-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0}},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"deepseek-ai/DeepSeek-V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.29889496,"output":1.19557982,"cache_read":0.0298895},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"deepseek-ai/DeepSeek-V4-Pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":393000},"cost":{"input":1.79336973,"output":3.58673947,"cache_read":0.14944748},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"deepseek-ai/DeepSeek-R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.59778991,"output":2.39115964,"cache_read":0.05977899},"canonical_model_id":"deepseek/deepseek-r1-0528"},"tencent/Hunyuan-A13B-Instruct":{"id":"tencent/Hunyuan-A13B-Instruct","name":"tencent/Hunyuan-A13B-Instruct","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14944748,"output":0.59778991}},"PaddlePaddle/PaddleOCR-VL-1.5":{"id":"PaddlePaddle/PaddleOCR-VL-1.5","name":"PaddlePaddle/PaddleOCR-VL-1.5","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-29","last_updated":"2026-01-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0,"output":0}},"inclusionAI/Ling-flash-2.0":{"id":"inclusionAI/Ling-flash-2.0","name":"inclusionAI/Ling-flash-2.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-18","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14944748,"output":0.59778991}},"Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen/Qwen3-VL-30B-A3B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.10461323,"output":0.41845294},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"Qwen/Qwen2.5-72B-Instruct":{"id":"Qwen/Qwen2.5-72B-Instruct","name":"Qwen/Qwen2.5-72B-Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-18","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":33000,"output":4000},"cost":{"input":0.61721808,"output":0.61721808}},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen/Qwen3-32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14944748,"output":0.59778991},"canonical_model_id":"alibaba/qwen3-32b"},"Qwen/Qwen3-VL-30B-A3B-Thinking":{"id":"Qwen/Qwen3-VL-30B-A3B-Thinking","name":"Qwen/Qwen3-VL-30B-A3B-Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-11","last_updated":"2025-11-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.10461323,"output":0.41845294}},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen/Qwen3.5-27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.08966849,"output":0.71734789,"tiers":[{"input":0.26900546,"output":2.15204368,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.44980438,"output":2.69882628},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-VL-32B-Thinking":{"id":"Qwen/Qwen3-VL-32B-Thinking","name":"Qwen/Qwen3-VL-32B-Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-21","last_updated":"2025-11-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.14944748,"output":1.49447478}},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen/Qwen3.5-122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.11955798,"output":0.95646386,"tiers":[{"input":0.29889496,"output":2.39115964,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"Qwen/Qwen3-VL-32B-Instruct":{"id":"Qwen/Qwen3-VL-32B-Instruct","name":"Qwen/Qwen3-VL-32B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-21","last_updated":"2025-11-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.14944748,"output":0.59778991}},"Qwen/Qwen3-VL-8B-Instruct":{"id":"Qwen/Qwen3-VL-8B-Instruct","name":"Qwen/Qwen3-VL-8B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-15","last_updated":"2025-11-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.07472374,"output":0.29889496}},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen/Qwen3.5-9B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.07472374,"output":0.59778991,"tiers":[{"input":0.22417122,"output":1.79336973,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen2.5-7B-Instruct":{"id":"Qwen/Qwen2.5-7B-Instruct","name":"Qwen/Qwen2.5-7B-Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":33000,"output":4000},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen2.5-7b-instruct"},"Qwen/Qwen3-14B":{"id":"Qwen/Qwen3-14B","name":"Qwen/Qwen3-14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-30","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.07472374,"output":0.29889496}},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.44980438,"output":1.79921752},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3-30B-A3B-Instruct-2507":{"id":"Qwen/Qwen3-30B-A3B-Instruct-2507","name":"Qwen/Qwen3-30B-A3B-Instruct-2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.10461323,"output":0.41845294},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen/Qwen3-Coder-30B-A3B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.10461323,"output":0.41845294},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"Qwen/Qwen3-8B":{"id":"Qwen/Qwen3-8B","name":"Qwen/Qwen3-8B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-8b"},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen/Qwen3.5-35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.05977899,"output":0.47823193,"tiers":[{"input":0.23911596,"output":1.91292771,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"Qwen/Qwen3.5-4B":{"id":"Qwen/Qwen3.5-4B","name":"Qwen/Qwen3.5-4B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-4b"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen/Qwen3.6-35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.26900546,"output":1.61403276},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.11994783,"output":0.41981742,"cache_read":0.034485},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":262000},"cost":{"input":1.19557982,"output":4.18452938,"cache_read":0.29889496,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.19947835,"output":4.19817421,"cache_read":0.29986959},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"zai-org/GLM-4.5-Air","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-air","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14944748,"output":0.89668487},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai-org/GLM-4.5V":{"id":"zai-org/GLM-4.5V","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.14993479,"output":0.89960876},"canonical_model_id":"zhipuai/glm-4.5v"},"stepfun-ai/Step-3.5-Flash":{"id":"stepfun-ai/Step-3.5-Flash","name":"stepfun-ai/Step-3.5-Flash","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.10461323,"output":0.3138397},"canonical_model_id":"stepfun/step-3.5-flash"}}},"thinkingmachines":{"id":"thinkingmachines","env":["TINKER_API_KEY"],"npm":"@ai-sdk/anthropic","api":"https://tinker.thinkingmachines.dev/services/tinker-prod/anthropic/api/v1","name":"Thinking Machines","doc":"https://tinker-docs.thinkingmachines.ai/tinker/compatible-apis/anthropic/","models":{"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":1.695,"output":4.215,"cache_read":0.339},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V4.1-Flash-1017:peft:262144":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017:peft:262144","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3.6,"cache_read":0.12},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4.1-Flash:peft:262144":{"id":"deepseek-ai/DeepSeek-V4.1-Flash:peft:262144","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3.6,"cache_read":0.12},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"moonshotai/Kimi-K2.6:peft:131072":{"id":"moonshotai/Kimi-K2.6:peft:131072","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":2.205,"output":5.49,"cache_read":0.441},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":2.205,"output":5.49,"cache_read":0.441},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.18,"output":0.45,"cache_read":0.036},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.33,"output":0.84,"cache_read":0.066},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-oss-120b:peft:131072":{"id":"openai/gpt-oss-120b:peft:131072","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.33,"output":0.84,"cache_read":0.066},"canonical_model_id":"openai/gpt-oss-120b"},"thinkingmachines/Inkling:peft:262144":{"id":"thinkingmachines/Inkling:peft:262144","name":"Inkling (256K)","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"thinkingmachines/Inkling-Small:peft:262144:sampling-nvfp4":{"id":"thinkingmachines/Inkling-Small:peft:262144:sampling-nvfp4","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/Inkling:peft:262144:sampling-nvfp4":{"id":"thinkingmachines/Inkling:peft:262144:sampling-nvfp4","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"thinkingmachines/Inkling-Small:peft:262144":{"id":"thinkingmachines/Inkling-Small:peft:262144","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.58,"output":1.44,"cache_read":0.116},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.58,"output":1.44,"cache_read":0.116},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":1.65,"output":7.5,"cache_read":0.33},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":1.86,"output":5.595,"cache_read":0.372},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3.8-27B:peft:262144":{"id":"Qwen/Qwen3.8-27B:peft:262144","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6975,"output":5.595,"cache_read":0.1395},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.3,"output":0.807,"cache_read":0.06},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen3.5-9B-Base":{"id":"Qwen/Qwen3.5-9B-Base","name":"Qwen3.5 9B Base","description":"Pre-trained Qwen3.5 base checkpoint for fine-tuning and research, without instruction tuning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.3,"output":0.807,"cache_read":0.06},"canonical_model_id":"alibaba/qwen3.5-9b-base"},"Qwen/Qwen3.5-35B-A3B-Base":{"id":"Qwen/Qwen3.5-35B-A3B-Base","name":"Qwen3.5 35B-A3B Base","description":"Pre-trained Qwen3.5 base checkpoint for fine-tuning and research, without instruction tuning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.54,"output":1.335,"cache_read":0.108},"canonical_model_id":"alibaba/qwen3.5-35b-a3b-base"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.6975,"output":5.595,"cache_read":0.1395},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.6-35B-A3B:peft:262144":{"id":"Qwen/Qwen3.6-35B-A3B:peft:262144","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":1.335,"cache_read":0.09},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"Qwen/Qwen3-8B":{"id":"Qwen/Qwen3-8B","name":"Qwen3 8B","description":"Dense 8B Qwen3 model with switchable thinking for chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.195,"output":0.6,"cache_read":0.039},"canonical_model_id":"alibaba/qwen3-8b"},"Qwen/Qwen3.5-4B":{"id":"Qwen/Qwen3.5-4B","name":"Qwen3.5 4B","description":"Small Qwen3.5 multimodal model for low-cost chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.33,"output":1.005,"cache_read":0.066},"canonical_model_id":"alibaba/qwen3.5-4b"},"Qwen/Qwen3.5-4B:peft:262144":{"id":"Qwen/Qwen3.5-4B:peft:262144","name":"Qwen3.5 4B","description":"Small Qwen3.5 multimodal model for low-cost chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.33,"output":1.005,"cache_read":0.066},"canonical_model_id":"alibaba/qwen3.5-4b"},"Qwen/Qwen3.5-397B-A17B:peft:262144":{"id":"Qwen/Qwen3.5-397B-A17B:peft:262144","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.65,"output":7.5,"cache_read":0.33},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.45,"output":1.335,"cache_read":0.09},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.3-Flash:peft:262144":{"id":"zai-org/GLM-5.3-Flash:peft:262144","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.84,"output":2.11,"cache_read":0.168},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.3:peft:262144":{"id":"zai-org/GLM-5.3:peft:262144","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":3.78,"output":12.15,"cache_read":0.756},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.184,"output":0.495,"cache_read":0.0368},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16:peft:262144":{"id":"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16:peft:262144","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.57,"output":1.44,"cache_read":0.114},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.195,"output":0.495,"cache_read":0.039},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":1.8,"output":6.225,"cache_read":0.36},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16:peft:262144":{"id":"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16:peft:262144","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.57,"output":1.44,"cache_read":0.114},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16:peft:262144":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16:peft:262144","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.8,"output":6.225,"cache_read":0.36},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.57,"output":1.44,"cache_read":0.114},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16:peft:262144":{"id":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16:peft:262144","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.184,"output":0.495,"cache_read":0.0368},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.57,"output":1.44,"cache_read":0.114},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"}}},"moonshotai-cn":{"id":"moonshotai-cn","env":["MOONSHOT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.moonshot.cn/v1","name":"Moonshot AI (China)","doc":"https://platform.moonshot.cn/docs/api/chat","models":{"kimi-k3.1-pro-highspeed":{"id":"kimi-k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3.8874,"output":20.3342,"cache_read":0.1944,"cache_write":3.8874},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.9437,"output":10.1671,"cache_read":0.1944,"cache_write":1.9437},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.9711,"output":4.0337,"cache_read":0.1643},"canonical_model_id":"moonshotai/kimi-k2.6"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.9879,"output":14.9395,"cache_read":0.2988,"cache_write":2.9879},"canonical_model_id":"moonshotai/kimi-k3"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.9711,"output":4.0337,"cache_read":0.1942},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"kimi-k2.7-code-highspeed":{"id":"kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code HighSpeed","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9421,"output":8.0673,"cache_read":0.3884},"canonical_model_id":"moonshotai/kimi-k2.7-code"}}},"opencode-go":{"id":"opencode-go","env":["OPENCODE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://opencode.ai/inference/go/openai/v1","name":"OpenCode Go","doc":"https://opencode.ai/v2/docs/console/go/","models":{"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"gemini-4-argon-contributor":{"id":"gemini-4-argon-contributor","name":"Gemini 4 Argon Contributor","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/go/google/v1beta"},"cost":{"input":4,"output":20,"cache_read":0.2,"input_audio":4},"canonical_model_id":"google/gemini-4-argon"},"iceman-contributor-free":{"id":"iceman-contributor-free","name":"Iceman Contributor Free","description":"Stealth model, free for a limited time","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"release_date":"2026-10-24","last_updated":"2026-10-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"cat-jam-free":{"id":"cat-jam-free","name":"Cat Jam Free","description":"A text-only reasoning model for coding and agentic workflows, with tool calling and structured JSON outputs.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"hy4":{"id":"hy4","name":"Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.435,"output":0.87,"cache_read":0.003625},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"beam-free":{"id":"beam-free","name":"Beam Free","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://opencode.ai/inference/go/google/v1beta"},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax M3.1 Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qwen3.7-plus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":0.4,"output":1.6,"cache_read":0.04,"cache_write":0.5,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.12,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.12,"cache_write":1.5}},"canonical_model_id":"alibaba/qwen3.7-plus"},"muse-spark-1.2-contributor":{"id":"muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.2"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax-m3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"tiers":[{"input":0.6,"output":2.4,"cache_read":0.12,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.6,"output":2.4,"cache_read":0.12}},"canonical_model_id":"minimax/MiniMax-M3"},"longcat-2.0":{"id":"longcat-2.0","name":"LongCat-2.0","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"meituan/longcat-2.0"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"longcat-2.5-free":{"id":"longcat-2.5-free","name":"LongCat 2.5 Free","description":"Meituan's multimodal reasoning model for long-horizon coding and agent tasks, with visual understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meituan/longcat-2.5"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo V2.5","description":"MiMo omni model for text, image, video, audio, and agents","family":"mimo-v2.5","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"space-bunny":{"id":"space-bunny","name":"Space Bunny","description":"Anonymous preview reasoning model for coding, agentic tasks, tool use, and multimodal input","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":524288,"output":524288},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.15,"output":0.6,"cache_read":0.03,"cache_write":0}},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo V2.5 Pro","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo-v2.5-pro","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":128000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.435,"output":0.87,"cache_read":0.003625},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"hy4-preview":{"id":"hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"step-5-preview-free":{"id":"step-5-preview-free","name":"Step 5 Preview Free","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"stepfun/step-5-preview"},"crouton-alpha-free":{"id":"crouton-alpha-free","name":"Crouton Alpha Free","description":"Stealth reasoning model with text, image, video and PDF input and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-03","last_updated":"2026-11-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":270000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0}},"minimax-m3.1-flash-free":{"id":"minimax-m3.1-flash-free","name":"MiniMax M3.1 Flash Free","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter multimodal flagship for coding, professional work, and long-horizon agentic workflows","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"longcat-2.5-preview-free":{"id":"longcat-2.5-preview-free","name":"LongCat 2.5 Preview Free","description":"Meituan's multimodal reasoning model for coding and agent tasks, with image understanding and a 1M-token context window","family":"longcat","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","provider":{"api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"meituan/longcat-2.5-preview"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://opencode.ai/inference/go/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"muse-spark-1.3-contributor":{"id":"muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for coding and agentic workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"provider":{"npm":"@ai-sdk/openai","api":"https://opencode.ai/inference/go/openai/v1"},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.3"}}},"alibaba-token-plan":{"id":"alibaba-token-plan","env":["ALIBABA_TOKEN_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1","name":"Alibaba Token Plan","doc":"https://www.alibabacloud.com/help/en/model-studio/token-plan-overview","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-plus"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"happyhorse-1.1-r2v":{"id":"happyhorse-1.1-r2v","type":"video","name":"HappyHorse 1.1 Reference-to-Video","description":"Video model for reference-guided video generation","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["image","text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"qwen-image-2.0":{"id":"qwen-image-2.0","type":"image","name":"Qwen Image 2.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"input":196601,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M2.5"},"qwen-image-2.0-pro":{"id":"qwen-image-2.0-pro","type":"image","name":"Qwen Image 2.0 Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"happyhorse-1.1-i2v":{"id":"happyhorse-1.1-i2v","type":"video","name":"HappyHorse 1.1 Image-to-Video","description":"Video model for image-to-video generation","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["image","text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-pro"},"qwen3.8-max-preview":{"id":"qwen3.8-max-preview","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"happyhorse-1.1-t2v":{"id":"happyhorse-1.1-t2v","type":"video","name":"HappyHorse 1.1 Text-to-Video","description":"Video model for prompt-driven text-to-video generation","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-17","last_updated":"2026-07-17","modalities":{"input":["text"],"output":["video"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/alibaba","api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com"},"cost":{"input":0,"output":0}},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-max"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-flash"},"wan2.7-image":{"id":"wan2.7-image","type":"image","name":"Wan2.7 Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-03","last_updated":"2025-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"status":"deprecated","cost":{"input":0,"output":0}},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-max"},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"wan2.7-image-pro":{"id":"wan2.7-image-pro","type":"image","name":"Wan2.7 Image Pro","description":"Image model for prompt-driven generation, editing, and visual design workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":8192,"output":0},"provider":{"api":"https://token-plan.ap-southeast-1.maas.aliyuncs.com/api/v1"},"cost":{"input":0,"output":0}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":16384},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"}}},"reflection":{"id":"reflection","env":["REFLECTION_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.reflection.ai/openai/v1","name":"Reflection","doc":"https://developers.reflection.ai/models","models":{"Beam-1.0-501B-A23B":{"id":"Beam-1.0-501B-A23B","name":"Beam 1.0 501B A23B","description":"Sparse mixture-of-experts reasoning model with 23B active parameters for coding and agentic workflows","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"reflection/beam-1.0-501b-a23b"}}},"helicone":{"id":"helicone","env":["HELICONE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://ai-gateway.helicone.ai/v1","name":"Helicone","doc":"https://helicone.ai/models","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"xAI Grok 4.1 Fast Non-Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast"},"sonar-reasoning":{"id":"sonar-reasoning","name":"Perplexity Sonar Reasoning","description":"Web-grounded reasoning model for multi-step research and cited answers","family":"sonar-reasoning","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-01-27","last_updated":"2025-01-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":127000,"output":4096},"cost":{"input":1,"output":5}},"claude-3.5-sonnet-v2":{"id":"claude-3.5-sonnet-v2","name":"Anthropic: Claude 3.5 Sonnet v2","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-3-5-sonnet-20241022"},"qwen3-coder-30b-a3b-instruct":{"id":"qwen3-coder-30b-a3b-instruct","name":"Qwen3 Coder 30B A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"qwen3-30b-a3b":{"id":"qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":41000,"output":41000},"cost":{"input":0.08,"output":0.29},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"qwen3-vl-235b-a22b-instruct":{"id":"qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.3,"output":1.5},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Google Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.075,"cache_write":0.3},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"OpenAI GPT-4.1 Nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"claude-4.5-haiku":{"id":"claude-4.5-haiku","name":"Anthropic: Claude 4.5 Haiku","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-10","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"o1":{"id":"o1","name":"OpenAI: o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"OpenAI GPT-4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"o4-mini":{"id":"o4-mini","name":"OpenAI o4 Mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"llama-prompt-guard-2-86m":{"id":"llama-prompt-guard-2-86m","name":"Meta Llama Prompt Guard 2 86M","description":"86M-parameter (mDeBERTa-base) multilingual classifier that detects prompt injection and jailbreak attempts","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-10","release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":2},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"meta/llama-prompt-guard-2-86m"},"kimi-k2-0905":{"id":"kimi-k2-0905","name":"Kimi K2 (09/05)","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.5,"output":2,"cache_read":0.4},"canonical_model_id":"moonshotai/kimi-k2-0905"},"llama-prompt-guard-2-22m":{"id":"llama-prompt-guard-2-22m","name":"Meta Llama Prompt Guard 2 22M","description":"22M-parameter (DeBERTa-xsmall) English classifier that detects prompt injection and jailbreak attempts","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-10","release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":2},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"meta/llama-prompt-guard-2-22m"},"grok-4-fast-reasoning":{"id":"grok-4-fast-reasoning","name":"xAI: Grok 4 Fast Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4-fast-reasoning"},"claude-4.5-opus":{"id":"claude-4.5-opus","name":"Anthropic: Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"mistral-large-2411":{"id":"mistral-large-2411","name":"Mistral-Large","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-11-18","last_updated":"2024-11-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/mistral-large-2411"},"gpt-5":{"id":"gpt-5","name":"OpenAI GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"llama-3.1-8b-instant":{"id":"llama-3.1-8b-instant","name":"Meta Llama 3.1 8B Instant","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32678},"cost":{"input":0.05,"output":0.08},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"qwen3-coder":{"id":"qwen3-coder","name":"Qwen3 Coder 480B A35B Instruct Turbo","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.22,"output":0.95},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"OpenAI: GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"qwen2.5-coder-7b-fast":{"id":"qwen2.5-coder-7b-fast","name":"Qwen2.5 Coder 7B fast","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-09","release_date":"2024-09-15","last_updated":"2024-09-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8192},"cost":{"input":0.03,"output":0.09}},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Google Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.3125,"cache_write":1.25},"canonical_model_id":"google/gemini-2.5-pro"},"sonar-pro":{"id":"sonar-pro","name":"Perplexity Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":4096},"cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"claude-3-haiku-20240307":{"id":"claude-3-haiku-20240307","name":"Anthropic: Claude 3 Haiku","description":"Legacy model retained for compatibility with older integrations","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-03","release_date":"2024-03-13","last_updated":"2024-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":4096},"cost":{"input":0.25,"output":1.25,"cache_read":0.03,"cache_write":0.3},"canonical_model_id":"anthropic/claude-3-haiku-20240307"},"gpt-4.1-mini-2025-04-14":{"id":"gpt-4.1-mini-2025-04-14","name":"OpenAI GPT-4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"llama-4-maverick":{"id":"llama-4-maverick","name":"Meta Llama 4 Maverick 17B 128E","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"gpt-4.1":{"id":"gpt-4.1","name":"OpenAI GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"o3":{"id":"o3","name":"OpenAI o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"grok-4":{"id":"grok-4","name":"xAI Grok 4","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-09","last_updated":"2024-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":3,"output":15,"cache_read":0.75}},"deepseek-reasoner":{"id":"deepseek-reasoner","name":"DeepSeek Reasoner","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":64000},"cost":{"input":0.56,"output":1.68,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-reasoner"},"sonar":{"id":"sonar","name":"Perplexity Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":127000,"output":4096},"cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"gemini-3-pro-preview":{"id":"gemini-3-pro-preview","name":"Google Gemini 3 Pro Preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-preview"},"claude-3.5-haiku":{"id":"claude-3.5-haiku","name":"Anthropic: Claude 3.5 Haiku","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":0.8,"output":4,"cache_read":0.08,"cache_write":1},"canonical_model_id":"anthropic/claude-3-5-haiku-20241022"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"OpenAI GPT-OSS 20b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.2},"canonical_model_id":"openai/gpt-oss-20b"},"o3-mini":{"id":"o3-mini","name":"OpenAI o3 Mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2023-10","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"gpt-5.1-chat-latest":{"id":"gpt-5.1-chat-latest","name":"OpenAI GPT-5.1 Chat","description":"Chat-tuned GPT-5.1 for polished assistants, writing, and product conversations","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"deepseek-tng-r1t2-chimera":{"id":"deepseek-tng-r1t2-chimera","name":"DeepSeek TNG R1T2 Chimera","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek-thinking","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-02","last_updated":"2025-07-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":130000,"output":163840},"cost":{"input":0.3,"output":1.2}},"llama-3.1-8b-instruct":{"id":"llama-3.1-8b-instruct","name":"Meta Llama 3.1 8B Instruct","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.02,"output":0.05},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"o1-mini":{"id":"o1-mini","name":"OpenAI: o1-mini","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":65536},"cost":{"input":1.1,"output":4.4,"cache_read":0.55}},"deepseek-v3":{"id":"deepseek-v3","name":"DeepSeek V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.56,"output":1.68,"cache_read":0.07}},"deepseek-v3.1-terminus":{"id":"deepseek-v3.1-terminus","name":"DeepSeek V3.1 Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.27,"output":1,"cache_read":0.216}},"gpt-5-pro":{"id":"gpt-5-pro","name":"OpenAI: GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":32768},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Anthropic: Claude Sonnet 4.5 (20250929)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"sonar-reasoning-pro":{"id":"sonar-reasoning-pro","name":"Perplexity Sonar Reasoning Pro","description":"Web-grounded Sonar for multi-step research questions that need cited reasoning","family":"sonar-reasoning","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":127000,"output":4096},"cost":{"input":2,"output":8},"canonical_model_id":"perplexity/sonar-reasoning-pro"},"kimi-k2-0711":{"id":"kimi-k2-0711","name":"Kimi K2 (07/11)","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Google Gemini 2.5 Flash Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.1,"output":0.4,"cache_read":0.025,"cache_write":0.1},"canonical_model_id":"google/gemini-2.5-flash-lite"},"grok-3":{"id":"grok-3","name":"xAI Grok 3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2024-06-01","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.75}},"chatgpt-4o-latest":{"id":"chatgpt-4o-latest","name":"OpenAI ChatGPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2024-08-14","last_updated":"2024-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":5,"output":20,"cache_read":2.5}},"claude-opus-4-1-20250805":{"id":"claude-opus-4-1-20250805","name":"Anthropic: Claude Opus 4.1 (20250805)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"temperature":true,"knowledge":"2025-08","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"ernie-4.5-21b-a3b-thinking":{"id":"ernie-4.5-21b-a3b-thinking","name":"Baidu Ernie 4.5 21B A3B Thinking","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-03","release_date":"2025-03-16","last_updated":"2025-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8000},"cost":{"input":0.07,"output":0.28}},"hermes-2-pro-llama-3-8b":{"id":"hermes-2-pro-llama-3-8b","name":"Hermes 2 Pro Llama 3 8B","description":"Llama 3 fine-tune optimized for function calling, structured JSON responses, and dialogue","family":"hermes","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-05","release_date":"2024-04-30","last_updated":"2024-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.14,"output":0.14},"canonical_model_id":"nousresearch/hermes-2-pro-llama-3-8b"},"claude-sonnet-4":{"id":"claude-sonnet-4","name":"Anthropic: Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-0"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"xAI Grok 4.1 Fast Reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window and built-in reasoning","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"gpt-5.1":{"id":"gpt-5.1","name":"OpenAI GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Anthropic: Claude 4.5 Haiku (20251001)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-10","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"llama-3.3-70b-versatile":{"id":"llama-3.3-70b-versatile","name":"Meta Llama 3.3 70B Versatile","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32678},"cost":{"input":0.59,"output":0.79},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"gpt-5-mini":{"id":"gpt-5-mini","name":"OpenAI GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"OpenAI: GPT-5.1 Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Meta Llama 3.3 70B Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16400},"cost":{"input":0.13,"output":0.39},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"llama-4-scout":{"id":"llama-4-scout","name":"Meta Llama 4 Scout 17B 16E","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.08,"output":0.3},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"kimi-k2-thinking":{"id":"kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":262144},"cost":{"input":0.48,"output":2},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"claude-opus-4":{"id":"claude-opus-4","name":"Anthropic: Claude Opus 4","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-0"},"mistral-nemo":{"id":"mistral-nemo","name":"Mistral Nemo","description":"Efficient Mistral-NVIDIA open model for multilingual chat and local deployment","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16400},"cost":{"input":20,"output":40},"canonical_model_id":"mistral/mistral-nemo"},"llama-guard-4":{"id":"llama-guard-4","name":"Meta Llama Guard 4 12B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":1024},"cost":{"input":0.21,"output":0.21}},"gpt-5-nano":{"id":"gpt-5-nano","name":"OpenAI GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"glm-4.6":{"id":"glm-4.6","name":"Zai GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.45,"output":1.5},"canonical_model_id":"zhipuai/glm-4.6"},"o3-pro":{"id":"o3-pro","name":"OpenAI o3 Pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"deepseek-r1-distill-llama-70b":{"id":"deepseek-r1-distill-llama-70b","name":"DeepSeek R1 Distill Llama 70B","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-01-20","last_updated":"2025-01-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":0.03,"output":0.13}},"grok-code-fast-1":{"id":"grok-code-fast-1","name":"xAI Grok Code Fast 1","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":10000},"cost":{"input":0.2,"output":1.5,"cache_read":0.02},"canonical_model_id":"xai/grok-code-fast-1"},"gemma2-9b-it":{"id":"gemma2-9b-it","name":"Google Gemma 2","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2024-06-25","last_updated":"2024-06-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0.01,"output":0.03}},"gpt-4o":{"id":"gpt-4o","name":"OpenAI GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-05","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"qwen3-next-80b-a3b-instruct":{"id":"qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":16384},"cost":{"input":0.14,"output":1.4},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.29,"output":0.59},"canonical_model_id":"alibaba/qwen3-32b"},"gpt-5-codex":{"id":"gpt-5-codex","name":"OpenAI: GPT-5 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-codex"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":65536},"cost":{"input":0.27,"output":0.41},"canonical_model_id":"deepseek/deepseek-v3.2"},"qwen3-235b-a22b-thinking":{"id":"qwen3-235b-a22b-thinking","name":"Qwen3 235B A22B Thinking","description":"Updated large open Qwen3 MoE thinking model for reasoning, math, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.3,"output":2.9},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"claude-3.7-sonnet":{"id":"claude-3.7-sonnet","name":"Anthropic: Claude 3.7 Sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-3-7-sonnet-20250219"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"OpenAI GPT-OSS 120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.04,"output":0.16},"canonical_model_id":"openai/gpt-oss-120b"},"gemma-3-12b-it":{"id":"gemma-3-12b-it","name":"Google Gemma 3 12B","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-12","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-12b-it"},"mistral-small":{"id":"mistral-small","name":"Mistral Small 3.2","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.075,"output":0.2},"canonical_model_id":"mistral/mistral-small-2506"},"gpt-5-chat-latest":{"id":"gpt-5-chat-latest","name":"OpenAI GPT-5 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":false,"knowledge":"2024-09","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":272000,"output":16384},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-chat-latest"},"grok-4-fast-non-reasoning":{"id":"grok-4-fast-non-reasoning","name":"xAI Grok 4 Fast Non-Reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"llama-3.1-8b-instruct-turbo":{"id":"llama-3.1-8b-instruct-turbo","name":"Meta Llama 3.1 8B Instruct Turbo","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.02,"output":0.03},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"grok-3-mini":{"id":"grok-3-mini","name":"xAI Grok 3 Mini","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2024-06-01","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":131072},"cost":{"input":0.3,"output":0.5,"cache_read":0.075}},"claude-4.5-sonnet":{"id":"claude-4.5-sonnet","name":"Anthropic: Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"OpenAI GPT-4o-mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Anthropic: Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"temperature":true,"knowledge":"2025-08","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"sonar-deep-research":{"id":"sonar-deep-research","name":"Perplexity Sonar Deep Research","description":"Sonar search model for autonomous research and citation-backed long-form reports","family":"sonar","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-02-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":127000,"output":4096},"cost":{"input":2,"output":8},"canonical_model_id":"perplexity/sonar-deep-research"}}},"upstage":{"id":"upstage","env":["UPSTAGE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.upstage.ai/v1/solar","name":"Upstage","doc":"https://developers.upstage.ai/docs/apis/chat","models":{"solar-pro4":{"id":"solar-pro4","name":"Solar Pro 4","description":"Upstage's flagship model, specialized for agentic use","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"upstage/solar-pro4"},"solar-pro2":{"id":"solar-pro2","name":"solar-pro2","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"output":8192},"cost":{"input":0.25,"output":0.25},"canonical_model_id":"upstage/solar-pro2"},"solar-mini":{"id":"solar-mini","name":"solar-mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"solar-mini","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2024-06-12","last_updated":"2025-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":4096},"cost":{"input":0.15,"output":0.15}},"solar-mini4":{"id":"solar-mini4","name":"Solar Mini 4","description":"Upstage's compact, cost-efficient model for agentic use","family":"solar-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.1,"output":0.4,"cache_read":0.01},"canonical_model_id":"upstage/solar-mini4"},"solar-pro3":{"id":"solar-pro3","name":"solar-pro3","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2026-01-26","last_updated":"2026-03-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.25,"output":0.25},"canonical_model_id":"upstage/solar-pro3"}}},"inferx":{"id":"inferx","env":["INFERX_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://model.inferx.net/endpoints/v1","name":"InferX","doc":"https://model.inferx.net/endpoints","models":{"Qwen3-Coder-Next-FP8-no-thinking":{"id":"Qwen3-Coder-Next-FP8-no-thinking","name":"Qwen3-Coder-Next-FP8-no-thinking","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":260000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-coder-next"},"mimo-v25":{"id":"mimo-v25","name":"mimo-v25","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":100000},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"Qwen3-Coder-Next-FP8":{"id":"Qwen3-Coder-Next-FP8","name":"Qwen3 Coder Next FP8","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-coder-next"},"Qwen3.6-35B-A3B-FP8":{"id":"Qwen3.6-35B-A3B-FP8","name":"Qwen3.6 35B A3B FP8","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"Qwen3.6-27B-FP8":{"id":"Qwen3.6-27B-FP8","name":"Qwen3.6 27B FP8","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-27b"},"Ornith-1.0-35B-FP8":{"id":"Ornith-1.0-35B-FP8","name":"Ornith-1.0-35B-FP8","description":"Large coding-reasoning model for agentic software tasks and RL search","family":"ornith","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-06-25","last_updated":"2026-06-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":100000},"cost":{"input":0,"output":0},"canonical_model_id":"deepreinforce/ornith-1.0-35b"},"Devstral-2-123B-Instruct-2512-int4-AutoRound":{"id":"Devstral-2-123B-Instruct-2512-int4-AutoRound","name":"Devstral-2-123B-Instruct-2512-int4-AutoRound","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"mistral/devstral-2512"},"Agents-A1":{"id":"Agents-A1","name":"Agents-A1","description":"35B MoE agentic model built for long-horizon search, engineering, and scientific reasoning tasks","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"release_date":"2026-06-26","last_updated":"2026-06-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":100000},"cost":{"input":0,"output":0}},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"deepseek-v4-flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":100000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"gemma-4-31B-it-fp8":{"id":"gemma-4-31B-it-fp8","name":"Gemma 4 31B IT FP8","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"Qwen3.6-35B-A3B-fp8-no-thinking":{"id":"Qwen3.6-35B-A3B-fp8-no-thinking","name":"Qwen3.6-35B-A3B-fp8-no-thinking","description":"Qwen3.6-35B-A3B-fp8 disable thinking","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"Qwen3-Embedding-8B":{"id":"Qwen3-Embedding-8B","type":"embedding","name":"Qwen3-Embedding-8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-8b"}}},"lynkr":{"id":"lynkr","env":["LYNKR_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"http://127.0.0.1:8081/v1","name":"Lynkr","doc":"https://github.com/Fast-Editor/Lynkr","models":{"lynkr-auto":{"id":"lynkr-auto","name":"Lynkr Auto (complexity routing)","description":"Virtual model: Lynkr scores each request on complexity and routes it to the tier model the user configured (local Ollama/llama.cpp for simple requests, configured cloud providers for complex ones).","family":"auto","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-12-03","last_updated":"2026-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0}}}},"alibaba-cn":{"id":"alibaba-cn","env":["DASHSCOPE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://dashscope.aliyuncs.com/compatible-mode/v1","name":"Alibaba (China)","doc":"https://www.alibabacloud.com/help/en/model-studio/models","models":{"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.276,"output":1.651,"cache_read":0.0276,"cache_write":0.345,"tiers":[{"input":1.101,"output":6.602,"cache_read":0.1101,"cache_write":1.37625,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.101,"output":6.602,"cache_read":0.1101,"cache_write":1.37625}}},"qwen3-coder-30b-a3b-instruct":{"id":"qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.216,"output":0.861,"tiers":[{"input":0.323,"output":1.291,"tier":{"type":"context","size":32000}},{"input":0.538,"output":2.151,"tier":{"type":"context","size":128000}}]}},"deepseek-v3-2-exp":{"id":"deepseek-v3-2-exp","name":"DeepSeek V3.2 Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":65536},"status":"deprecated","cost":{"input":0.287,"output":0.431}},"deepseek-r1-0528":{"id":"deepseek-r1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.574,"output":2.294}},"deepseek-r1-distill-qwen-7b":{"id":"deepseek-r1-distill-qwen-7b","name":"DeepSeek R1 Distill Qwen 7B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"status":"deprecated","cost":{"input":0.072,"output":0.144}},"deepseek-r1-distill-qwen-32b":{"id":"deepseek-r1-distill-qwen-32b","name":"DeepSeek R1 Distill Qwen 32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"status":"deprecated","cost":{"input":0.287,"output":0.861}},"qwen-vl-plus":{"id":"qwen-vl-plus","name":"Qwen-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-08-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.115,"output":0.287}},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.1,"output":3.851,"cache_read":0.275,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"deepseek-r1-distill-qwen-14b":{"id":"deepseek-r1-distill-qwen-14b","name":"DeepSeek R1 Distill Qwen 14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"status":"deprecated","cost":{"input":0.144,"output":0.431}},"kimi-k2.6":{"id":"kimi-k2.6","name":"Moonshot Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.929,"output":3.858,"cache_read":0.1858,"cache_write":1.16125}},"tongyi-intent-detect-v3":{"id":"tongyi-intent-detect-v3","name":"Tongyi Intent Detect V3","description":"General-purpose chat model for instruction following, writing, and analysis","family":"yi","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1024},"cost":{"input":0.058,"output":0.144}},"deepseek-v3-1":{"id":"deepseek-v3-1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":65536},"status":"deprecated","cost":{"input":0.574,"output":1.721}},"qwen3.8-omni-flash":{"id":"qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.113,"output":0.382,"cache_read":0.014},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen-plus-character":{"id":"qwen-plus-character","name":"Qwen Plus Character","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":4096},"cost":{"input":0.115,"output":0.287}},"qwen3-coder-480b-a35b-instruct":{"id":"qwen3-coder-480b-a35b-instruct","name":"Qwen3-Coder 480B-A35B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.861,"output":3.441,"tiers":[{"input":1.291,"output":5.161,"tier":{"type":"context","size":32000}},{"input":2.151,"output":8.602,"tier":{"type":"context","size":128000}}]}},"moonshot-kimi-k2-instruct":{"id":"moonshot-kimi-k2-instruct","name":"Moonshot Kimi K2 Instruct","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.574,"output":2.294}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2}},"qwen2-5-omni-7b":{"id":"qwen2-5-omni-7b","name":"Qwen2.5-Omni 7B","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-12","last_updated":"2024-12","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":true,"limit":{"context":32768,"output":2048},"status":"deprecated","cost":{"input":0.087,"output":0.345,"input_audio":5.448}},"qwen-max":{"id":"qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.345,"output":1.377}},"qwen3-coder-plus":{"id":"qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2026-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.574,"output":2.296,"tiers":[{"input":0.861,"output":3.444,"tier":{"type":"context","size":32000}},{"input":1.435,"output":5.74,"tier":{"type":"context","size":128000}},{"input":2.87,"output":28.7,"tier":{"type":"context","size":256000}}]}},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.827,"output":14.133,"cache_read":0.283},"canonical_model_id":"moonshotai/kimi-k3"},"qwen3-14b":{"id":"qwen3-14b","name":"Qwen3 14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":38912}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.144,"output":0.574,"reasoning":1.434}},"deepseek-r1-distill-qwen-1-5b":{"id":"deepseek-r1-distill-qwen-1-5b","name":"DeepSeek R1 Distill Qwen 1.5B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"cost":{"input":0,"output":0}},"qwen3-omni-flash-realtime":{"id":"qwen3-omni-flash-realtime","type":"realtime","name":"Qwen3-Omni Flash Realtime","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":65536,"output":16384},"status":"deprecated","provider":{"api":"wss://dashscope.aliyuncs.com/api-ws/v1/realtime"},"cost":{"input":0.23,"output":0.918,"input_audio":3.584,"output_audio":7.168}},"qwen3.6-max-preview":{"id":"qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-20","last_updated":"2026-04-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":245800,"output":65536},"status":"deprecated","cost":{"input":1.32,"output":7.9,"cache_read":0.132}},"deepseek-r1":{"id":"deepseek-r1","name":"DeepSeek R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.574,"output":2.294}},"qwen3.5-flash":{"id":"qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-23","last_updated":"2026-09-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.029,"output":0.287,"reasoning":0.287,"tiers":[{"input":0.115,"output":1.147,"reasoning":1.147,"tier":{"type":"context","size":128000}},{"input":0.172,"output":1.72,"reasoning":1.72,"tier":{"type":"context","size":256000}}]}},"deepseek-r1-distill-llama-8b":{"id":"deepseek-r1-distill-llama-8b","name":"DeepSeek R1 Distill Llama 8B","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"status":"deprecated","cost":{"input":0,"output":0}},"qwen-plus":{"id":"qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.115,"output":0.287,"reasoning":1.147,"cache_read":0.023,"cache_write":0.144,"tiers":[{"input":0.345,"output":2.868,"reasoning":3.441,"cache_read":0.069,"cache_write":0.43125,"tier":{"type":"context","size":128000}},{"input":0.689,"output":6.881,"reasoning":9.175,"cache_read":0.1378,"cache_write":0.86125,"tier":{"type":"context","size":256000}}]}},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11875,"output":0.40073,"cache_read":0.014844,"cache_write":0.185547},"canonical_model_id":"alibaba/qwen3.8-flash"},"glm-5.1":{"id":"glm-5.1","name":"GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-14","last_updated":"2026-04-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":128000},"cost":{"input":0.825,"output":3.301,"cache_read":0.165,"cache_write":1.03125,"tiers":[{"input":1.1,"output":3.851,"cache_read":0.22,"cache_write":1.375,"tier":{"type":"context","size":32000}}]}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Moonshot Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.574,"output":3.011,"cache_read":0.1148,"cache_write":0.7175}},"qwen-doc-turbo":{"id":"qwen-doc-turbo","name":"Qwen Doc Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.087,"output":0.144}},"qwen3-next-80b-a3b-thinking":{"id":"qwen3-next-80b-a3b-thinking","name":"Qwen3-Next 80B-A3B (Thinking)","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.144,"output":1.434}},"qwen3-omni-flash":{"id":"qwen3-omni-flash","name":"Qwen3-Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":65536,"output":16384},"cost":{"input":0.258,"output":0.989,"input_audio":2.265,"output_audio":8.974}},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.172,"output":1.032,"reasoning":1.032,"tiers":[{"input":0.43,"output":2.58,"reasoning":2.58,"tier":{"type":"context","size":128000}}]}},"qwen-mt-plus":{"id":"qwen-mt-plus","name":"Qwen-MT Plus","description":"Translation model for multilingual conversion, localization, and cross-language workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-01","last_updated":"2025-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"cost":{"input":0.259,"output":0.775}},"qwen3-vl-30b-a3b":{"id":"qwen3-vl-30b-a3b","name":"Qwen3-VL 30B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.108,"output":0.431,"reasoning":1.076}},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.29754,"output":1.19015,"cache_read":0.01488},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen-long":{"id":"qwen-long","name":"Qwen Long","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-25","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":10000000,"output":8192},"cost":{"input":0.072,"output":0.287}},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.65,"output":3.301},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-v3":{"id":"deepseek-v3","name":"DeepSeek V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-12-01","last_updated":"2024-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"output":8192},"status":"deprecated","cost":{"input":0.287,"output":1.147}},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.1,"output":3.851,"cache_read":0.275,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"qwen-math-plus":{"id":"qwen-math-plus","name":"Qwen Math Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-08-16","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":3072},"status":"deprecated","cost":{"input":0.574,"output":1.721}},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.276,"output":1.101,"cache_read":0.0552,"cache_write":0.345,"tiers":[{"input":0.826,"output":3.301,"cache_read":0.1652,"cache_write":1.0325,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.826,"output":3.301,"cache_read":0.1652,"cache_write":1.0325}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.65,"output":4.951,"cache_read":0.33,"cache_write":2.0625},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen3-asr-flash":{"id":"qwen3-asr-flash","type":"transcription","name":"Qwen3-ASR Flash","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-04","release_date":"2025-09-08","last_updated":"2025-09-08","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":53248,"output":4096}},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen3.6-flash":{"id":"qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":131072}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.165,"output":0.99,"cache_read":0.0165,"cache_write":0.20625,"tiers":[{"input":0.66,"output":3.961,"cache_read":0.066,"cache_write":0.825,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.66,"output":3.961,"cache_read":0.066,"cache_write":0.825}},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen3.7-flash":{"id":"qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":131072},"cost":{"input":0.02962,"output":0.1185,"cache_read":0.005924,"cache_write":0.03703,"tiers":[{"input":0.08887,"output":0.35549,"cache_read":0.017774,"cache_write":0.11109,"tier":{"type":"context","size":32000}},{"input":0.17774,"output":0.71098,"cache_read":0.035548,"cache_write":0.22218,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen3-max":{"id":"qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-23","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.359,"output":1.434,"reasoning":1.434,"tiers":[{"input":0.574,"output":2.294,"reasoning":2.294,"tier":{"type":"context","size":32000}},{"input":1.004,"output":4.014,"reasoning":4.014,"tier":{"type":"context","size":128000}}]}},"qwen-mt-turbo":{"id":"qwen-mt-turbo","name":"Qwen-MT Turbo","description":"Translation model for multilingual conversion, localization, and cross-language workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-01","last_updated":"2025-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":8192},"status":"deprecated","cost":{"input":0.101,"output":0.28}},"qwen-omni-turbo":{"id":"qwen-omni-turbo","name":"Qwen-Omni Turbo","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-19","last_updated":"2025-03-26","modalities":{"input":["text","image","audio","video"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32768,"output":2048},"status":"deprecated","cost":{"input":0.058,"output":0.23,"input_audio":3.584,"output_audio":7.168}},"kimi-k2-thinking":{"id":"kimi-k2-thinking","name":"Moonshot Kimi K2 Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":0.574,"output":2.294}},"qwen-turbo":{"id":"qwen-turbo","name":"Qwen Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":38912}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":16384},"status":"deprecated","cost":{"input":0.044,"output":0.087,"reasoning":0.431}},"qwen3-vl-235b-a22b":{"id":"qwen3-vl-235b-a22b","name":"Qwen3-VL 235B-A22B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.286705,"output":1.14682,"reasoning":2.867051}},"deepseek-r1-distill-llama-70b":{"id":"deepseek-r1-distill-llama-70b","name":"DeepSeek R1 Distill Llama 70B","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":16384},"cost":{"input":0.287,"output":0.861}},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-09-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.115,"output":0.688,"reasoning":0.688,"tiers":[{"input":0.287,"output":1.72,"reasoning":1.72,"tier":{"type":"context","size":128000}},{"input":0.573,"output":3.44,"reasoning":3.44,"tier":{"type":"context","size":256000}}]}},"qwq-plus":{"id":"qwq-plus","name":"QwQ Plus","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-05","last_updated":"2025-03-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.23,"output":0.574}},"qwen-flash":{"id":"qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.022,"output":0.216,"cache_read":0.0044,"cache_write":0.0275,"tiers":[{"input":0.087,"output":0.861,"cache_read":0.0174,"cache_write":0.10875,"tier":{"type":"context","size":128000}},{"input":0.173,"output":1.721,"cache_read":0.0346,"cache_write":0.21625,"tier":{"type":"context","size":256000}}]}},"qwen3-next-80b-a3b-instruct":{"id":"qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.144,"output":0.574}},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":38912}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.287,"output":1.147,"reasoning":2.868}},"qwen3-8b":{"id":"qwen3-8b","name":"Qwen3 8B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":38912}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.072,"output":0.287,"reasoning":0.717}},"qwen-omni-turbo-realtime":{"id":"qwen-omni-turbo-realtime","type":"realtime","name":"Qwen-Omni Turbo Realtime","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-05-08","last_updated":"2025-05-08","modalities":{"input":["text","image","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":32768,"output":2048},"status":"deprecated","provider":{"api":"wss://dashscope.aliyuncs.com/api-ws/v1/realtime"},"cost":{"input":0.23,"output":0.918,"input_audio":3.584,"output_audio":7.168}},"qwen3-235b-a22b":{"id":"qwen3-235b-a22b","name":"Qwen3 235B-A22B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":38912}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04","last_updated":"2025-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0.287,"output":1.147,"reasoning":2.868}},"qwen3-vl-plus":{"id":"qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.143353,"output":1.433525,"cache_read":0.028671,"cache_write":0.179191,"tiers":[{"input":0.215,"output":2.15,"cache_read":0.043,"cache_write":0.26875,"tier":{"type":"context","size":32000}},{"input":0.43,"output":4.301,"cache_read":0.086,"cache_write":0.5375,"tier":{"type":"context","size":128000}}]}},"qwen-vl-max":{"id":"qwen-vl-max","name":"Qwen-VL Max","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-08","last_updated":"2025-08-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.23,"output":0.574}},"qwen-math-turbo":{"id":"qwen-math-turbo","name":"Qwen Math Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":3072},"status":"deprecated","cost":{"input":0.287,"output":0.861}},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.77744,"output":5.33231,"cache_read":0.22218,"cache_write":2.22179},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen-deep-research":{"id":"qwen-deep-research","name":"Qwen Deep Research","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01","last_updated":"2024-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":7.742,"output":23.367}},"qwen3-coder-flash":{"id":"qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.144,"output":0.574,"cache_read":0.0288,"cache_write":0.18,"tiers":[{"input":0.216,"output":0.861,"cache_read":0.0432,"cache_write":0.27,"tier":{"type":"context","size":32000}},{"input":0.359,"output":1.434,"cache_read":0.0718,"cache_write":0.44875,"tier":{"type":"context","size":128000}},{"input":0.717,"output":3.584,"cache_read":0.1434,"cache_write":0.89625,"tier":{"type":"context","size":256000}}]}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-11","last_updated":"2026-02-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":16384},"cost":{"input":0.573,"output":2.58,"tiers":[{"input":0.86,"output":3.154,"tier":{"type":"context","size":32000}}]}},"qwen-vl-ocr":{"id":"qwen-vl-ocr","name":"Qwen-VL OCR","description":"OCR model for extracting structured text from documents and screenshots","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-04","release_date":"2024-10-28","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":34096,"output":4096},"cost":{"input":0.043,"output":0.072}},"qvq-max":{"id":"qvq-max","name":"QVQ Max","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"qvq","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-25","last_updated":"2025-03-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":1.147,"output":4.588}},"MiniMax/MiniMax-M2.7":{"id":"MiniMax/MiniMax-M2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375}},"siliconflow/deepseek-r1-0528":{"id":"siliconflow/deepseek-r1-0528","name":"siliconflow/deepseek-r1-0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":32768},"cost":{"input":0.5,"output":2.18}},"siliconflow/deepseek-v3.1-terminus":{"id":"siliconflow/deepseek-v3.1-terminus","name":"siliconflow/deepseek-v3.1-terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":65536},"cost":{"input":0.27,"output":1}},"siliconflow/deepseek-v3.2":{"id":"siliconflow/deepseek-v3.2","name":"siliconflow/deepseek-v3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-03","last_updated":"2025-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":65536},"cost":{"input":0.27,"output":0.42}},"siliconflow/deepseek-v3-0324":{"id":"siliconflow/deepseek-v3-0324","name":"siliconflow/deepseek-v3-0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163840,"output":163840},"cost":{"input":0.25,"output":1}},"kimi/kimi-k2.5":{"id":"kimi/kimi-k2.5","name":"kimi/kimi-k2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.1}}}},"io-net":{"id":"io-net","env":["IOINTELLIGENCE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.intelligence.io.solutions/api/v1","name":"IO.NET","doc":"https://io.net/docs/guides/intelligence/io-intelligence","models":{"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.523667,"output":2.205333,"cache_read":0.261834},"canonical_model_id":"deepseek/deepseek-r1-0528"},"mistralai/Devstral-Small-2505":{"id":"mistralai/Devstral-Small-2505","name":"Devstral Small 2505","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-05-01","last_updated":"2025-05-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.05,"output":0.22,"cache_read":0.025,"cache_write":0.1}},"mistralai/Magistral-Small-2506":{"id":"mistralai/Magistral-Small-2506","name":"Magistral Small 2506","description":"Mistral reasoning model for transparent analysis, math, and complex decisions","family":"magistral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.5,"output":1.5,"cache_read":0.25,"cache_write":1},"canonical_model_id":"mistral/magistral-small-2506"},"mistralai/Mistral-Nemo-Instruct-2407":{"id":"mistralai/Mistral-Nemo-Instruct-2407","name":"Mistral Nemo Instruct 2407","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-05","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.0514,"output":0.082,"cache_read":0.0257},"canonical_model_id":"mistral/mistral-nemo"},"mistralai/Mistral-Large-Instruct-2411":{"id":"mistralai/Mistral-Large-Instruct-2411","name":"Mistral Large Instruct 2411","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-11-18","last_updated":"2024-11-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":2,"output":6,"cache_read":1,"cache_write":4},"canonical_model_id":"mistral/mistral-large-2411"},"moonshotai/Kimi-K2-Instruct-0905":{"id":"moonshotai/Kimi-K2-Instruct-0905","name":"Kimi K2 Instruct","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":4096},"cost":{"input":0.57,"output":2.3,"cache_read":0.285},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/Kimi-K2-Thinking":{"id":"moonshotai/Kimi-K2-Thinking","name":"Kimi K2 Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":4096},"cost":{"input":0.6,"output":2.5,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT-OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":4096},"cost":{"input":0.055,"output":0.194,"cache_read":0.0275},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT-OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.188,"output":0.7,"cache_read":0.094},"canonical_model_id":"openai/gpt-oss-120b"},"meta-llama/Llama-3.2-90B-Vision-Instruct":{"id":"meta-llama/Llama-3.2-90B-Vision-Instruct","name":"Llama 3.2 90B Vision Instruct","description":"Open Llama multimodal model for image understanding and text reasoning","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"status":"deprecated","cost":{"input":0.35,"output":0.4,"cache_read":0.175,"cache_write":0.7}},"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8":{"id":"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8","name":"Llama 4 Maverick 17B 128E Instruct","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":430000,"output":4096},"cost":{"input":0.26875,"output":0.82625,"cache_read":0.134375},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama 3.3 70B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0.5466,"output":1.0226,"cache_read":0.2733},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar":{"id":"Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-ar","name":"Qwen 3 Coder 480B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":106000,"output":4096},"cost":{"input":0.46125,"output":2.29375,"cache_read":0.230625},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen 3 235B Thinking","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4096},"status":"deprecated","cost":{"input":0.11,"output":0.6,"cache_read":0.055,"cache_write":0.22},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen 3 Next 80B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4096},"cost":{"input":0.11875,"output":1.2625,"cache_read":0.059375},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"Qwen/Qwen2.5-VL-32B-Instruct":{"id":"Qwen/Qwen2.5-VL-32B-Instruct","name":"Qwen 2.5 VL 32B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2024-11-01","last_updated":"2024-11-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"status":"deprecated","cost":{"input":0.05,"output":0.22,"cache_read":0.025,"cache_write":0.1}},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM 4.6","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":4096},"cost":{"input":0.52,"output":2.0375,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-4.6"}}},"neosmith":{"id":"neosmith","env":["NEOSMITH_API_KEY"],"npm":"@ai-sdk/openai","api":"https://router.neosmith.ai/v1","name":"NeoSmith","doc":"https://neosmith.ai/docs","models":{"neosmith.intelligent-basic":{"id":"neosmith.intelligent-basic","name":"NeoSmith Basic","description":"Cost-capped tier. Intelligent routing with a Claude Sonnet ceiling — Opus is never invoked.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-26","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.17,"output":4.37,"cache_read":0.22,"cache_write":0}},"neosmith.intelligent-pro":{"id":"neosmith.intelligent-pro","name":"NeoSmith Pro","description":"Default production tier. Intelligent NeoSmith routing with a Claude Opus ceiling on escalation.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-26","last_updated":"2026-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.81,"output":8.39,"cache_read":0.3,"cache_write":0}},"neosmith.intelligent-maestro":{"id":"neosmith.intelligent-maestro","name":"NeoSmith Maestro","description":"Highest-accuracy coding tier. Hard, self-contained problems run NeoSmith's premium multi-model solver; everything else gets the strongest intelligence tier.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.4,"output":12,"cache_read":0.35,"cache_write":0}},"neosmith.neolite":{"id":"neosmith.neolite","name":"NeoSmith NeoLite","description":"Sealed single-model budget tier. 512K context, text and images, tool use, and no escalation of any kind.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-20","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":512000,"output":64000},"cost":{"input":0.6,"output":2.4,"cache_read":0.08,"cache_write":0}}}},"meta":{"id":"meta","env":["META_MODEL_API_KEY"],"npm":"@ai-sdk/openai","api":"https://api.meta.ai/v1","name":"Meta","doc":"https://dev.meta.ai/docs","models":{"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"muse-spark-1.1":{"id":"muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"muse-wonder-1.0":{"id":"muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"muse-spark-1.2-contributor":{"id":"muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.2"},"muse-ember-1.0":{"id":"muse-ember-1.0","name":"Muse Ember","description":"Muse Ember is Meta's smallest and most efficient reasoning model, built for the work agents repeat all day: tool calls, coding subtasks, routing, extraction, and long-document parsing. It pairs with Muse Wonder or Muse Spark, which plan while Muse Ember handles the volume.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":524288},"cost":{"input":0.1,"output":0.5,"cache_read":0.004,"tiers":[{"input":0.3,"output":1.5,"cache_read":0.012,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.3,"output":1.5,"cache_read":0.012}},"canonical_model_id":"meta/muse-ember-1.0"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"muse-spark-1.3-contributor":{"id":"muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.3"}}},"deepinfra":{"id":"deepinfra","env":["DEEPINFRA_API_KEY"],"npm":"@ai-sdk/deepinfra","name":"Deep Infra","doc":"https://deepinfra.com/models","models":{"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"anthropic/claude-fable-5"},"XiaomiMiMo/MiMo-V2.5":{"id":"XiaomiMiMo/MiMo-V2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.5"},"XiaomiMiMo/MiMo-V2.5-Pro":{"id":"XiaomiMiMo/MiMo-V2.5-Pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16384},"status":"deprecated","cost":{"input":1,"output":3,"cache_read":0.2},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"XiaomiMiMo/MiMo-V2.6-Pro":{"id":"XiaomiMiMo/MiMo-V2.6-Pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.43,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"XiaomiMiMo/MiMo-V2.6-Flash":{"id":"XiaomiMiMo/MiMo-V2.6-Flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.07,"output":0.34},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.08,"output":0.16},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemma-4-E4B-it":{"id":"google/gemma-4-E4B-it","name":"Gemma 4 E4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.02,"output":0.1},"canonical_model_id":"google/gemma-4-E4B-it"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.15},"canonical_model_id":"google/gemma-3-12b-it"},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-06","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"status":"deprecated","cost":{"input":0.15,"output":1.15,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"status":"deprecated","cost":{"input":0.25,"output":1,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.28,"output":1.1,"cache_read":0.056},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":64000},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16384},"cost":{"input":0.09,"output":0.18,"cache_read":0.018,"cache_write":0.1125},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":8192},"cost":{"input":0.25,"output":0.95,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.06,"output":0.18,"cache_read":0.015},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp":{"id":"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"DeepSeek-V3","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":8192},"cost":{"input":0.32,"output":0.89},"canonical_model_id":"deepseek/deepseek-v3"},"deepseek-ai/DeepSeek-V3-0324":{"id":"deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324","description":"March 2025 checkpoint of DeepSeek-V3 with improved reasoning and coding","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"status":"deprecated","cost":{"input":0.24,"output":0.9,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16384},"cost":{"input":1.3,"output":2.6,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":0.6,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek-R1-0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":64000},"cost":{"input":0.5,"output":2.15,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.3,"output":2.6,"cache_read":0.1},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"tencent/Hy4-preview":{"id":"tencent/Hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"tencent/Hy3":{"id":"tencent/Hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":128000},"status":"deprecated","cost":{"input":0.13,"output":0.53,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"mistralai/Mistral-Small-24B-Instruct-2501":{"id":"mistralai/Mistral-Small-24B-Instruct-2501","name":"Mistral Small 3","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.05,"output":0.08},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.85,"output":14.25,"cache_read":0.285,"cache_write":3.5625},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K3.1-Pro":{"id":"moonshotai/Kimi-K3.1-Pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.68,"output":3.4,"cache_read":0.136,"cache_write":0.85},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.75,"output":3.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.03,"output":0.14},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.037,"output":0.17},"canonical_model_id":"openai/gpt-oss-120b"},"ByteDance/Seed-2.0-mini":{"id":"ByteDance/Seed-2.0-mini","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.1,"output":0.4,"cache_read":0.02,"tiers":[{"input":0.2,"output":0.8,"cache_read":0.2,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"ByteDance/Seed-2.0-pro":{"id":"ByteDance/Seed-2.0-pro","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.5,"output":3,"cache_read":0.1,"tiers":[{"input":1,"output":6,"cache_read":0.2,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"ByteDance/Seed-2.0-code":{"id":"ByteDance/Seed-2.0-code","name":"Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":0.5,"output":3,"cache_read":0.1,"tiers":[{"input":1,"output":6,"cache_read":0.2,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"status":"deprecated","cost":{"input":0.95,"output":4.05,"cache_read":0.16},"canonical_model_id":"thinkingmachines/inkling"},"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8":{"id":"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8","name":"Llama 4 Maverick 17B FP8","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16384},"status":"deprecated","cost":{"input":0.2,"output":0.8},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/Llama-Guard-4-12B":{"id":"meta-llama/Llama-Guard-4-12B","name":"Llama Guard 4 12B","description":"Multimodal Llama 4-based safety classifier for moderating prompts and responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.18,"output":0.18},"canonical_model_id":"meta/llama-guard-4-12b"},"meta-llama/Llama-4-Scout-17B-16E-Instruct":{"id":"meta-llama/Llama-4-Scout-17B-16E-Instruct","name":"Llama 4 Scout 17B","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"output":16384},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"meta-llama/Llama-3.3-70B-Instruct-Turbo":{"id":"meta-llama/Llama-3.3-70B-Instruct-Turbo","name":"Llama 3.3 70B Turbo","description":"Compact Llama instruction model for fast chat and local deployment","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.1,"output":0.32},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen 3.5 397B A17B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.45,"output":3,"cache_read":0.22},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.08,"output":0.28},"canonical_model_id":"alibaba/qwen3-32b"},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.26,"output":2.6},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen/Qwen3-VL-235B-A22B-Instruct":{"id":"Qwen/Qwen3-VL-235B-A22B-Instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.88,"cache_read":0.11},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.32,"output":3.2},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.09,"output":1.1},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"Qwen/Qwen3-Max":{"id":"Qwen/Qwen3-Max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"status":"deprecated","cost":{"input":1.2,"output":6,"cache_read":0.24,"tiers":[{"input":2.4,"output":12,"cache_read":0.48,"tier":{"type":"context","size":32000}},{"input":3,"output":15,"cache_read":0.6,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max"},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.29,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"Qwen/Qwen3.8-2.4T-A95B":{"id":"Qwen/Qwen3.8-2.4T-A95B","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"status":"deprecated","cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"Qwen/Qwen3.8-Flash":{"id":"Qwen/Qwen3.8-Flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.113,"output":0.382,"cache_read":0.0141},"canonical_model_id":"alibaba/qwen3.8-flash"},"Qwen/Qwen3.7-Max":{"id":"Qwen/Qwen3.7-Max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"tiers":[{"input":5,"output":15,"cache_read":1,"tier":{"type":"context","size":32000}},{"input":6.25,"output":18.5,"cache_read":1.25,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.7-max"},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1,"output":0.15},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen3-30B-A3B":{"id":"Qwen/Qwen3-30B-A3B","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"Qwen/Qwen3.8-Max":{"id":"Qwen/Qwen3.8-Max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":131072},"cost":{"input":1.65,"output":4.951,"cache_read":0.206},"canonical_model_id":"alibaba/qwen3.8-max"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":2.5,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.09,"output":0.55},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen 3.5 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.14,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo","name":"Qwen3 Coder 480B A35B Instruct Turbo","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":66536},"cost":{"input":0.3,"output":1,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.1,"output":0.95,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"cost":{"input":0.75,"output":2.4,"cache_read":0.14,"cache_write":0.9375},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-4.7-Flash":{"id":"zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":0.06,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.9,"output":4,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.5,"output":2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-4.6"},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"cost":{"input":0.4,"output":1.75,"cache_read":0.08},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":0.6,"output":2.08,"cache_read":0.12},"canonical_model_id":"zhipuai/glm-5"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":1.05,"output":3.5,"cache_read":0.205},"canonical_model_id":"zhipuai/glm-5.1"},"nvidia/Nemotron-3-Nano-30B-A3B":{"id":"nvidia/Nemotron-3-Nano-30B-A3B","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.05,"output":0.2,"cache_read":0.025},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning":{"id":"nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning","name":"Nemotron 3 Nano Omni 30B A3B Reasoning","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.2,"output":0.8},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"nvidia/Llama-3.3-Nemotron-Super-49B-v1.5":{"id":"nvidia/Llama-3.3-Nemotron-Super-49B-v1.5","name":"Llama 3.3 Nemotron Super 49B v1.5","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"status":"deprecated","cost":{"input":0.4,"output":0.4},"canonical_model_id":"nvidia/llama-3.3-nemotron-super-49b-v1.5"},"stepfun-ai/Step-5-Preview":{"id":"stepfun-ai/Step-5-Preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1000000},"status":"deprecated","cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"stepfun-ai/Step-3.7-Flash":{"id":"stepfun-ai/Step-3.7-Flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"status":"deprecated","cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"}}},"azure":{"id":"azure","env":["AZURE_RESOURCE_NAME","AZURE_API_KEY"],"npm":"@ai-sdk/azure","name":"Azure","doc":"https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"Grok 4.1 Fast (Non-Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-06-27","last_updated":"2025-06-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"gpt-3.5-turbo-1106":{"id":"gpt-3.5-turbo-1106","name":"GPT-3.5 Turbo 1106","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":1,"output":2}},"text-embedding-ada-002":{"id":"text-embedding-ada-002","type":"embedding","name":"text-embedding-ada-002","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2022-12-15","last_updated":"2022-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.1,"output":0}},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"cohere-embed-v-4-0":{"id":"cohere-embed-v-4-0","type":"embedding","name":"Embed v4","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":1536},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.12,"output":0}},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"codex-mini":{"id":"codex-mini","name":"Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-05-16","last_updated":"2025-05-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.5,"output":6,"cache_read":0.375}},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"gpt-4-turbo-vision":{"id":"gpt-4-turbo-vision","name":"GPT-4 Turbo Vision","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":10,"output":30}},"gpt-3.5-turbo-instruct":{"id":"gpt-3.5-turbo-instruct","name":"GPT-3.5 Turbo Instruct","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2023-09-21","last_updated":"2023-09-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4096,"output":4096},"status":"deprecated","cost":{"input":1.5,"output":2}},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-24","last_updated":"2025-08-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":3.5,"output":28,"cache_read":0.35},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"o1":{"id":"o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":15,"output":60,"cache_read":7.5}},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-01-14","last_updated":"2026-01-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"model-router":{"id":"model-router","name":"Model Router","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"model-router","attachment":true,"reasoning":false,"tool_call":true,"release_date":"2025-05-19","last_updated":"2025-11-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":16384},"provider":{"npm":"@ai-sdk/azure","shape":"completions"},"cost":{"input":0.14,"output":0}},"phi-4-mini":{"id":"phi-4-mini","name":"Phi-4-mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"phi","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.075,"output":0.3}},"mistral-medium-2505":{"id":"mistral-medium-2505","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.4,"output":2}},"grok-4-20-reasoning":{"id":"grok-4-20-reasoning","name":"Grok 4.20 (Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-04-08","last_updated":"2026-04-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262000,"output":8192},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6}},"mistral-small-2503":{"id":"mistral-small-2503","name":"Mistral Small 3.1","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2025-03-01","last_updated":"2025-03-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"provider":{"shape":"completions"},"cost":{"input":0.1,"output":0.3}},"gpt-image-2.5-flare":{"id":"gpt-image-2.5-flare","type":"image","name":"GPT Image 2.5 Flare","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-flare"},"text-embedding-3-large":{"id":"text-embedding-3-large","type":"embedding","name":"text-embedding-3-large","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":3072},"cost":{"input":0.13,"output":0}},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-chat-latest":{"id":"gpt-chat-latest","name":"GPT Chat Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-05-05","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"beta","cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5-instant"},"cohere-command-a":{"id":"cohere-command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"provider":{"shape":"completions"},"cost":{"input":2.5,"output":10}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":8,"output":40,"cache_read":0.8,"cache_write":10},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"status":"beta","provider":{"shape":"completions"},"canonical_model_id":"xai/grok-4.7"},"llama-4-scout-17b-16e-instruct":{"id":"llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B 16E Instruct","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.78}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"gpt-image-2":{"id":"gpt-image-2","type":"image","name":"GPT-Image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2"},"phi-4-multimodal":{"id":"phi-4-multimodal","name":"Phi-4-multimodal","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"phi","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.08,"output":0.32,"input_audio":4}},"text-embedding-3-small":{"id":"text-embedding-3-small","type":"embedding","name":"text-embedding-3-small","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.02,"output":0}},"o3-mini":{"id":"o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek-V4.1-Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek-V4-Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":1.74,"output":3.48},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-5-pro":{"id":"gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"phi-4":{"id":"phi-4","name":"Phi-4","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"gpt-image-1.5":{"id":"gpt-image-1.5","type":"image","name":"GPT-Image-1.5","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-25","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":32,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1.5"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175}},"claude-mythos-5":{"id":"claude-mythos-5","name":"Claude Mythos 5","description":"Restricted Claude model for advanced cybersecurity and biology research workflows","family":"claude-mythos","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-mythos-5"},"phi-4-reasoning":{"id":"phi-4-reasoning","name":"Phi-4-reasoning","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"beta","provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"Grok 4.1 Fast (Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-06-27","last_updated":"2025-06-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"input":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.2,"output":0.5,"cache_read":0.05}},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":2.5,"output":20,"cache_read":0.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025}},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-14","last_updated":"2025-11-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025}},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek-V4-Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.19,"output":0.51},"canonical_model_id":"deepseek/deepseek-v4-flash"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"provider":{"shape":"completions"},"cost":{"input":0.71,"output":0.71}},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"grok-4-20-non-reasoning":{"id":"grok-4-20-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-04-08","last_updated":"2026-04-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262000,"output":8192},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"ministral-3b":{"id":"ministral-3b","name":"Ministral 3B","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-03","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"provider":{"shape":"completions"},"cost":{"input":0.04,"output":0.04}},"cohere-embed-v3-english":{"id":"cohere-embed-v3-english","type":"embedding","name":"Embed v3 English","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-07","last_updated":"2023-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":1024},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.1,"output":0}},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"phi-4-reasoning-plus":{"id":"phi-4-reasoning-plus","name":"Phi-4-reasoning-plus","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.125,"output":0.5}},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gpt-image-2.5-sunburst":{"id":"gpt-image-2.5-sunburst","type":"image","name":"GPT Image 2.5 Sunburst","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":30,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-2.5-sunburst"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-07-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}}},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":10,"output":30},"canonical_model_id":"openai/gpt-4-turbo"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"status":"beta","provider":{"shape":"completions"},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"phi-4-mini-reasoning":{"id":"phi-4-mini-reasoning","name":"Phi-4-mini-reasoning","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"phi","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2023-10","release_date":"2024-12-11","last_updated":"2024-12-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"provider":{"shape":"completions"},"cost":{"input":0.075,"output":0.3}},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-31","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5-codex":{"id":"gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125}},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.58,"output":1.68}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":4,"output":24,"cache_read":0.4,"cache_write":5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"cohere-embed-v3-multilingual":{"id":"cohere-embed-v3-multilingual","type":"embedding","name":"Embed v3 Multilingual","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"cohere-embed","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2023-11-07","last_updated":"2023-11-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512,"output":1024},"provider":{"npm":"@ai-sdk/openai-compatible","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"},"cost":{"input":0.1,"output":0}},"gpt-3.5-turbo-0125":{"id":"gpt-3.5-turbo-0125","name":"GPT-3.5 Turbo 0125","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2021-08","release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16384,"output":4096},"status":"deprecated","provider":{"shape":"completions"},"cost":{"input":0.5,"output":1.5}},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75}},"codestral-2501":{"id":"codestral-2501","name":"Codestral 25.01","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-03","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"provider":{"shape":"completions"},"cost":{"input":0.3,"output":0.9}},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"gpt-image-1":{"id":"gpt-image-1","type":"image","name":"GPT-Image-1","description":"OpenAI image model for production generation, edits, and brand-safe visual workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-04-24","last_updated":"2025-04-24","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":5,"output":40,"cache_read":1.25},"canonical_model_id":"openai/gpt-image-1"},"deepseek-v3.2-speciale":{"id":"deepseek-v3.2-speciale","name":"DeepSeek-V3.2-Speciale","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"provider":{"shape":"completions"},"cost":{"input":0.58,"output":1.68}},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"llama-4-maverick-17b-128e-instruct-fp8":{"id":"llama-4-maverick-17b-128e-instruct-fp8","name":"Llama 4 Maverick 17B 128E Instruct FP8","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":16384},"provider":{"shape":"completions"},"cost":{"input":0.25,"output":1}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25}}}},"echo":{"id":"echo","env":["ECHO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://echo.tracerml.ai/v1","name":"Echo","doc":"https://echo.tracerml.ai/docs/api","models":{"echo":{"id":"echo","name":"Echo","description":"Adaptive model for coding, reasoning, and tool-driven agent workflows through one OpenAI-compatible endpoint","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-08-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"status":"beta","cost":{"input":10,"output":50}}}},"ambient":{"id":"ambient","env":["AMBIENT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.ambient.xyz/v1","name":"Ambient","doc":"https://ambient.xyz","models":{"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.32,"output":3.2,"cache_read":0.16,"cache_write":0},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3-30b-a3b-instruct-2507":{"id":"qwen/qwen3-30b-a3b-instruct-2507","name":"Qwen3 30B-A3B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.09,"output":0.3,"cache_read":0.09,"cache_write":0},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0.32,"output":3.2,"cache_read":0.16,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.15,"output":1,"cache_read":0.15,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131702},"cost":{"input":0.23,"output":0.96,"cache_read":0.05,"cache_write":0},"canonical_model_id":"minimax/MiniMax-M3"},"ambient/small":{"id":"ambient/small","name":"Ambient Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":101072,"output":101072},"cost":{"input":0.001,"output":0.001,"cache_read":0,"cache_write":0}},"ambient/large":{"id":"ambient/large","name":"Ambient Large","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":202752},"cost":{"input":0.6,"output":2,"cache_read":0.15,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":202752},"cost":{"input":0.6,"output":2,"cache_read":0.15,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.2-FP8":{"id":"zai-org/GLM-5.2-FP8","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":202752},"status":"deprecated","cost":{"input":1.2,"output":4.2,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"unsloth/qwen3.8-27b-gguf":{"id":"unsloth/qwen3.8-27b-gguf","name":"qwen3.8-27b-4q","description":"Tool-capable chat model for instruction following and agentic application workflows","family":"unsloth","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":101072,"output":101072},"cost":{"input":0.001,"output":0.001,"cache_read":0,"cache_write":0}}}},"scx-ai":{"id":"scx-ai","env":["SCX_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.scx.ai/v1","name":"SCX.ai","doc":"https://platform.scx.ai/docs","models":{"GLM-5.2":{"id":"GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.55,"output":1.784,"cache_read":0.111},"canonical_model_id":"zhipuai/glm-5.2"},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":196608},"cost":{"input":0.48,"output":1.79,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M2.7"},"Qwen3.8-Max":{"id":"Qwen3.8-Max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":983616,"output":131072},"cost":{"input":1.815,"output":5.4461,"cache_read":0.17,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.17,"output":0.55},"canonical_model_id":"openai/gpt-oss-120b"}}},"agentrouter":{"id":"agentrouter","env":["AGENTROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://agentrouter.org/v1","name":"AgentRouter","doc":"https://agentrouter.org/docs/opencode.html","models":{"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://agentrouter.org/v1"},"canonical_model_id":"openai/gpt-5.6-sol"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"canonical_model_id":"zhipuai/glm-5.3"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-v4-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://agentrouter.org/v1"},"canonical_model_id":"anthropic/claude-opus-5"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://agentrouter.org/v1"},"canonical_model_id":"anthropic/claude-opus-4-8"}}},"cortecs":{"id":"cortecs","env":["CORTECS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.cortecs.ai/v1","name":"Cortecs","doc":"https://api.cortecs.ai/v1/models","models":{"gpt-oss-safeguard-120b":{"id":"gpt-oss-safeguard-120b","name":"GPT OSS Safeguard 120B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.179,"output":0.697},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"qwen3-coder-30b-a3b-instruct":{"id":"qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.179,"output":0.697,"cache_read":0.014},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"mistral-large-4-0":{"id":"mistral-large-4-0","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":262144},"cost":{"input":0.765,"output":2.351,"cache_read":0.079},"canonical_model_id":"mistral/mistral-large-4"},"claude-opus4-5":{"id":"claude-opus4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5.313,"output":26.568,"cache_read":0.531,"cache_write":6.645},"canonical_model_id":"anthropic/claude-opus-4-5"},"pixtral-large-2502":{"id":"pixtral-large-2502","name":"Pixtral Large (25.02)","description":"Pixtral Large (25.02) is a 124B open-weight multimodal model built on Mistral Large 2, offering advanced image understanding and strong performance across text and code tasks.","family":"pixtral","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-04-08","last_updated":"2025-04-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":1.993,"output":5.978},"canonical_model_id":"mistral/pixtral-large-2502"},"claude-4-6-sonnet":{"id":"claude-4-6-sonnet","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3.196,"output":15.94,"cache_read":0.32,"cache_write":3.999},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"qwen2.5-vl-72b-instruct":{"id":"qwen2.5-vl-72b-instruct","name":"qwen2.5-vl-72b-instruct","description":"Qwen2.5-VL is a powerful vision-language model with advanced capabilities in visual understanding, long video reasoning, and structured output generation.","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-04","release_date":"2025-01-26","last_updated":"2025-01-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"cost":{"input":1.014,"output":1.014},"canonical_model_id":"alibaba/qwen2-5-vl-72b-instruct"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.299,"output":2.491,"cache_read":0.029,"cache_write":0.097},"canonical_model_id":"google/gemini-2.5-flash"},"codestral-2508":{"id":"codestral-2508","name":"Codestral 25.08","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.368,"output":1.103,"cache_read":0.037},"canonical_model_id":"mistral/codestral-2508"},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.111,"output":0.434,"cache_read":0.056},"canonical_model_id":"openai/gpt-4.1-nano"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.825,"output":4.125,"cache_read":0.082,"cache_write":0.084},"canonical_model_id":"google/gemini-3.8-flash"},"voxtral-small-2507":{"id":"voxtral-small-2507","name":"voxtral-small-2507","description":"Voxtral Small is a multimodal model with audio input, combining advanced speech capabilities with strong text performance for transcription, translation, and audio understanding.","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"cost":{"input":0.123,"output":0.368,"cache_read":0.012},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1000000},"cost":{"input":0.9,"output":3.24,"cache_read":0.189},"canonical_model_id":"zhipuai/glm-5.2"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.229,"output":11.146,"cache_read":0.111},"canonical_model_id":"google/gemini-4-carbon"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.434,"output":1.704,"cache_read":0.134},"canonical_model_id":"openai/gpt-4.1-mini"},"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":500000},"cost":{"input":2.042,"output":10.209,"cache_read":0.204},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.475,"output":2.97,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.6"},"nova-pro-v1":{"id":"nova-pro-v1","name":"Nova Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.918,"output":3.671},"canonical_model_id":"amazon/nova-pro-v1"},"mistral-medium-3.5":{"id":"mistral-medium-3.5","name":"mistral-medium-3.5","description":"Mistral Medium 3.5 is a frontier multimodal 128B model combining reasoning, coding, and instruction-following with strong agentic performance and efficient deployment.","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1.532,"output":7.843,"cache_read":0.154},"canonical_model_id":"mistral/mistral-medium-3-5"},"mixtral-8x7B-instruct-v0.1":{"id":"mixtral-8x7B-instruct-v0.1","name":"Mixtral 8x7B Instruct v0.1","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mistral","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2023-12-11","last_updated":"2023-12-11","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"cost":{"input":0.488,"output":0.758},"canonical_model_id":"mistral/mixtral-8x7b-instruct-v0.1"},"gemma-3-27b-it":{"id":"gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Gemma 3 is a family of lightweight, multimodal models from Google, supporting text and image inputs, multilingual capabilities, and a 131K context window.","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":110000},"cost":{"input":0.099,"output":0.299},"canonical_model_id":"google/gemma-3-27b-it"},"minimax-m2.1":{"id":"minimax-m2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196000,"output":196000},"cost":{"input":0.359,"output":1.435},"canonical_model_id":"minimax/MiniMax-M2.1"},"mistral-small-2503":{"id":"mistral-small-2503","name":"mistral-small-2503","description":"Combines advanced text and vision capabilities with 24 billion parameters, supporting multilingual tasks and long contexts up to 131k tokens, making it versatile for various applications without sacrificing performance.","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-06","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.111,"output":0.334},"canonical_model_id":"mistral/mistral-small-3-1-24b-instruct-2503"},"claude-opus-5.5":{"id":"claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4.399,"output":21.998,"cache_read":0.219,"cache_write":5.5},"canonical_model_id":"anthropic/claude-opus-5-5"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.375,"output":10.96,"cache_read":0.156},"canonical_model_id":"openai/gpt-5"},"qwen3guard-gen-8b":{"id":"qwen3guard-gen-8b","name":"qwen3guard-gen-8b","description":"Qwen3Guard-Gen-8B is a large-scale multilingual safety moderation model designed for high-accuracy prompt and response classification.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-02-04","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":32000},"cost":{"input":0,"output":0}},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.495,"output":9.964,"cache_read":0.242,"cache_write":0.434},"canonical_model_id":"google/gemini-2.5-pro"},"claude-4-5-sonnet":{"id":"claude-4-5-sonnet","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":2.989,"output":14.945,"cache_read":0.326,"cache_write":4.078},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"nemotron-nano-v2-12b":{"id":"nemotron-nano-v2-12b","name":"nemotron-nano-v2-12b","description":"NVIDIA Nemotron Nano v2 12B is a 12-billion-parameter multimodal reasoning model designed for advanced video understanding, document intelligence, and visual reasoning, built with a hybrid Transformer-Mamba architecture for high efficiency and low latency.","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-10-28","last_updated":"2025-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.24,"output":0.707},"canonical_model_id":"nvidia/nemotron-nano-12b-v2-vl"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":14.999},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4.399,"output":21.998,"cache_read":0.44,"cache_write":5.5},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.649,"output":9.899,"cache_read":0.165,"cache_write":1},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.2,"output":11,"cache_read":0.219,"cache_write":2.749},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1.176,"output":5.882,"cache_read":0.059,"cache_write":1.47},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2.192,"output":8.769,"cache_read":0.546},"canonical_model_id":"openai/gpt-4.1"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.038},"canonical_model_id":"google/gemini-3.6-flash"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.12,"output":0.6,"cache_read":0.012,"cache_write":0.15},"canonical_model_id":"openai/gpt-6-luna"},"mistral-large-2512":{"id":"mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.613,"output":1.838,"cache_read":0.061},"canonical_model_id":"mistral/mistral-large-2512"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":500000},"cost":{"input":0.1,"output":0.4,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3.8-27b"},"ministral-3b-2512":{"id":"ministral-3b-2512","name":"Ministral 3 3B 2512","description":"Ministral 3 3B is a compact, efficient multimodal model with strong language, vision capabilities, and ideal for custom fine-tuning.","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.123,"output":0.123,"cache_read":0.012},"canonical_model_id":"mistral/ministral-3b-2512"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":2,"output":3.999,"cache_read":0.5},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"ministral-8b-2512":{"id":"ministral-8b-2512","name":"Ministral 3 8B 2512","description":"Ministral 3 8B is a balanced, efficient multimodal model offering strong text and vision capabilities, optimized for edge and local deployment.","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.179,"output":0.179,"cache_read":0.017},"canonical_model_id":"mistral/ministral-8b-2512"},"mistral-small-3.2-24b-instruct-2506":{"id":"mistral-small-3.2-24b-instruct-2506","name":"mistral-small-3.2-24b-instruct-2506","description":"Mistral-Small-3.2-24B-Instruct-2506 is a 24B parameter instruction-tuned model with enhanced long-context support (128k) and state-of-the-art vision understanding.","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.1,"output":0.312},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"qwen3-30b-a3b-instruct-2507":{"id":"qwen3-30b-a3b-instruct-2507","name":"qwen3-30b-a3b-instruct-2507","description":"Qwen3-30B-A3B-Instruct-2507 is an advanced Mixture-of-Experts model optimized for reasoning, coding, and multilingual instruction following.","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.099,"output":0.299},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen3-235b-a22b-instruct-2507":{"id":"qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B-A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.199,"output":0.598,"cache_read":0.018},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.045,"output":0.167},"canonical_model_id":"openai/gpt-oss-20b"},"qwen3.5-397b-a17b":{"id":"qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.668,"output":4.01},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"minimax-m2.5":{"id":"minimax-m2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196000,"output":196000},"cost":{"input":0.348,"output":1.39,"cache_read":0.075},"canonical_model_id":"minimax/MiniMax-M2.5"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.111,"output":0.167},"canonical_model_id":"alibaba/qwen3.5-9b"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.075},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"mistral-small-2603":{"id":"mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.156,"output":0.625,"cache_read":0.016},"canonical_model_id":"mistral/mistral-small-2603"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.272,"output":1.631,"cache_read":0.025,"cache_write":0.082},"canonical_model_id":"google/gemini-3.1-flash-lite"},"minimax-m2":{"id":"minimax-m2","name":"MiniMax-M2","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":400000,"output":196000},"cost":{"input":0.349,"output":1.405},"canonical_model_id":"minimax/MiniMax-M2"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.7,"output":3.4,"cache_read":0.15},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.4,"output":11.999,"cache_read":0.24,"cache_write":3},"canonical_model_id":"openai/gpt-6-sol"},"qwen3guard-gen-0.6b":{"id":"qwen3guard-gen-0.6b","name":"qwen3guard-gen-0.6b","description":"Qwen3Guard-Gen-0.6B is a lightweight multilingual safety moderation model that classifies prompts and responses into safe, controversial, or unsafe categories.","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-02-04","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":32000},"cost":{"input":0,"output":0}},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":2.25,"output":11.249,"cache_read":0.113},"canonical_model_id":"google/gemini-4-argon"},"qwen3.8-2.4t-a95b":{"id":"qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":2.5,"output":6,"cache_read":0.625},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"claude-opus4-6":{"id":"claude-opus4-6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.313,"output":26.561,"cache_read":0.531,"cache_write":6.645},"canonical_model_id":"anthropic/claude-opus-4-6"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.511,"output":2.045,"cache_read":0.154},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":500000},"cost":{"input":0.153,"output":0.613,"cache_read":0.016},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"nova-lite-v1":{"id":"nova-lite-v1","name":"Nova Lite 1.0","description":"Nova Lite is a fast, low-cost multimodal foundation model capable of reasoning over text, images, and video in 200+ languages.","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":10000},"cost":{"input":0.069,"output":0.275},"canonical_model_id":"amazon/nova-lite-v1"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":500000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":12.272,"output":61.359,"cache_read":1.228,"cache_write":15.34},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.656,"output":3.3,"cache_read":0.18},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.375,"output":10.96,"cache_read":0.156},"canonical_model_id":"openai/gpt-5.1"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.279,"output":2.192,"cache_read":0.056},"canonical_model_id":"openai/gpt-5-mini"},"llama-3.3-70b-instruct":{"id":"llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.724,"output":0.724},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.1,"output":0.35,"cache_read":0.018},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.498,"cache_read":0.55,"cache_write":6.874},"canonical_model_id":"anthropic/claude-opus-5"},"hermes-4-405b":{"id":"hermes-4-405b","name":"Hermes 4 405B","description":"Hermes 4 405B is a frontier hybrid-mode reasoning model built on Llama 3.1, optimized for advanced logic, math, coding, and structured output generation.","family":"hermes","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-08-31","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.996,"output":2.989},"canonical_model_id":"nousresearch/hermes-4-405b"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.219,"output":1.32,"cache_read":0.022,"cache_write":0.275},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.33,"output":2.749,"cache_read":0.033,"cache_write":0.082},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.223,"output":0.39},"canonical_model_id":"google/gemma-4-31b-it"},"claude-sonnet-5.5":{"id":"claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2.25,"output":11.249,"cache_read":0.225,"cache_write":2.813},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.4,"output":11.999,"cache_read":0.12,"cache_write":3},"canonical_model_id":"openai/gpt-6.1-sol"},"nvidia-nemotron-3-nano-30b-a3b":{"id":"nvidia-nemotron-3-nano-30b-a3b","name":"nvidia-nemotron-3-nano-30b-a3b","description":"Nemotron-Nano-3-30B-A3B is a compact Mixture-of-Experts model optimized for efficient reasoning, chat, and coding, with strong multilingual support and long-context RAG and agent workflows.","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.06,"output":0.24},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"claude-opus4-8":{"id":"claude-opus4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.437,"output":27.186,"cache_read":0.544,"cache_write":6.797},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-haiku-5.5":{"id":"claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.113,"output":0.563,"cache_read":0.011,"cache_write":0.14},"canonical_model_id":"anthropic/claude-haiku-5-5"},"qwen3.6-27b":{"id":"qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.446,"output":3.008},"canonical_model_id":"alibaba/qwen3.6-27b"},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.06,"output":0.439,"cache_read":0.019},"canonical_model_id":"openai/gpt-5-nano"},"devstral-2512":{"id":"devstral-2512","name":"Devstral 2","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.478,"output":2.392,"cache_read":0.045},"canonical_model_id":"mistral/devstral-2512"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2.898,"output":15.453,"cache_read":0.242},"canonical_model_id":"openai/gpt-5.4"},"qwen3-vl-235b-a22b":{"id":"qwen3-vl-235b-a22b","name":"qwen3-vl-235b-a22b","description":"Qwen3 VL 235B A22B is a 235B-parameter MoE vision-language flagship model (≈22B active) designed for frontier-level multimodal understanding across text, images, documents, and long videos.","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.617,"output":3.119,"cache_read":0.052},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":32768},"cost":{"input":0.279,"output":1.671},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"nova-micro-v1":{"id":"nova-micro-v1","name":"Nova Micro 1.0","description":"Nova Micro is a multilingual text-to-text foundation model with strong reasoning capabilities and broad language coverage across 200+ languages.","family":"nova-micro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":10000},"cost":{"input":0.04,"output":0.159},"canonical_model_id":"amazon/nova-micro-v1"},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":81920},"cost":{"input":0.111,"output":0.557},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"qwen3-coder-next":{"id":"qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.167,"output":0.891},"canonical_model_id":"alibaba/qwen3-coder-next"},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":2.659,"output":10.635,"cache_read":1.33},"canonical_model_id":"openai/gpt-4o"},"claude-opus4-7":{"id":"claude-opus4-7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.437,"output":27.186,"cache_read":0.544,"cache_write":6.797},"canonical_model_id":"anthropic/claude-opus-4-7"},"kolibri-1":{"id":"kolibri-1","name":"kolibri-1","description":"Kolibri-1 is Aleph Alpha’s open-weight English-German MoE language model, designed for enterprise use with efficient inference and advanced reasoning.","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-18","release_date":"2026-10-03","last_updated":"2026-10-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.167,"output":0.613,"cache_read":0.084},"canonical_model_id":"aleph-alpha/kolibri-1"},"qwen3-32b":{"id":"qwen3-32b","name":"Qwen3 32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":0.179,"output":0.697},"canonical_model_id":"alibaba/qwen3-32b"},"deepseek-v3.2":{"id":"deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":65536},"cost":{"input":0.5,"output":1.499,"cache_read":0.15},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.082,"output":0.413,"cache_read":0.06},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.089,"output":0.446,"cache_read":0.01},"canonical_model_id":"openai/gpt-oss-120b"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.2,"output":13.199,"cache_read":0.219,"cache_write":2.749},"canonical_model_id":"openai/gpt-5.6-terra"},"nova-2-lite":{"id":"nova-2-lite","name":"Nova 2 Lite","description":"Nova 2 Lite is an advanced multimodal reasoning model that combines efficiency and performance, delivering reliable AI for agentic workflows and enterprise applications.","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.373,"output":3.144},"canonical_model_id":"amazon/nova-2-lite"},"mistral-large-2402":{"id":"mistral-large-2402","name":"mistral-large-2402","description":"Mistral Large (24.02) is Mistral AI’s most advanced language model, built for complex multilingual reasoning, code generation, and deep text understanding.","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-05-26","last_updated":"2025-05-26","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8192},"cost":{"input":4.284,"output":12.952}},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.203,"output":0.609,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":0.159,"output":0.638,"cache_read":0.081},"canonical_model_id":"openai/gpt-4o-mini"},"ministral-14b-2512":{"id":"ministral-14b-2512","name":"Ministral 3 14B 2512","description":"Ministral 3 14B is a frontier-level 14B multimodal model optimized for local deployment, delivering state-of-the-art text and vision reasoning with a 256K context window and strong agentic capabilities.","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.24,"output":0.24,"cache_read":0.022},"canonical_model_id":"mistral/ministral-14b-2512"},"mistral-7b-instruct-v0.2":{"id":"mistral-7b-instruct-v0.2","name":"mistral-7b-instruct-v0.2","description":"Mistral 7B Instruct is a compact, 7B parameter model optimized for fast and efficient text and code generation with a 32K token context window.","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-05-26","last_updated":"2025-05-26","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8192},"cost":{"input":0.159,"output":0.219}},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.038},"canonical_model_id":"google/gemini-3.7-flash"},"glm-4.7-flash":{"id":"glm-4.7-flash","name":"GLM-4.7-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":203000,"output":203000},"cost":{"input":0.08,"output":0.478},"canonical_model_id":"zhipuai/glm-4.7-flash"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":0.996,"output":4.982,"cache_read":0.099,"cache_write":1.186},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"stepfun":{"id":"stepfun","env":["STEPFUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.stepfun.com/v1","name":"StepFun (China)","doc":"https://platform.stepfun.com/docs/zh/overview/concept","models":{"step-tts-2":{"id":"step-tts-2","type":"speech","name":"Step TTS 2","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"step","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-01","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai"}},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"cost":{"input":1.04613,"output":2.98895,"cache_read":0.10461},"canonical_model_id":"stepfun/step-5-preview"},"step-3.5-flash-2603":{"id":"step-3.5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.10461,"output":0.31384,"cache_read":0.02092},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"stepaudio-2.5-asr":{"id":"stepaudio-2.5-asr","type":"transcription","name":"StepAudio 2.5 ASR","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"step","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-24","last_updated":"2026-07-02","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai"}},"stepaudio-2.5-tts":{"id":"stepaudio-2.5-tts","type":"speech","name":"StepAudio 2.5 TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"step","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-16","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai"}},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.20175,"output":1.21052,"cache_read":0.04035},"canonical_model_id":"stepfun/step-3.7-flash"},"step-3.5-flash":{"id":"step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.10461,"output":0.31384,"cache_read":0.02092},"canonical_model_id":"stepfun/step-3.5-flash"}}},"daoxe":{"id":"daoxe","env":["DAOXE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://daoxe.com/v1","name":"DaoXE","doc":"https://daoxe.com/pricing","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.5"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":4,"output":16,"cache_read":0.8},"canonical_model_id":"moonshotai/kimi-k2.5"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3.1-pro-preview"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":5},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"}}},"lmstudio":{"id":"lmstudio","env":["LMSTUDIO_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"http://127.0.0.1:1234/v1","name":"LMStudio","doc":"https://lmstudio.ai/models","models":{"qwen/qwen3-30b-a3b-2507":{"id":"qwen/qwen3-30b-a3b-2507","name":"Qwen3 30B A3B 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3-coder-30b":{"id":"qwen/qwen3-coder-30b","name":"Qwen3 Coder 30B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-oss-20b"}}},"zenmux":{"id":"zenmux","env":["ZENMUX_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://zenmux.ai/api/v1","name":"ZenMux","doc":"https://docs.zenmux.ai","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"baidu/ernie-5.0-thinking-preview":{"id":"baidu/ernie-5.0-thinking-preview","name":"ERNIE 5.0","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-01-22","last_updated":"2026-01-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":64000},"cost":{"input":0.84,"output":3.37,"tiers":[{"input":1.41,"output":5.62,"tier":{"type":"context","size":32000}}]}},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.2-fast-non-reasoning":{"id":"x-ai/grok-4.2-fast-non-reasoning","name":"Grok 4.2 Fast Non Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":4,"output":12,"cache_read":0.2,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"x-ai/grok-voice-stt-1.0":{"id":"x-ai/grok-voice-stt-1.0","type":"transcription","name":"Grok Voice STT 1.0","description":"Speech-to-text model with word-level timestamps, speaker diarization, multichannel audio, and streaming","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":15000,"output":15000},"canonical_model_id":"xai/grok-voice-transcribe-2.0"},"x-ai/grok-4.2-fast":{"id":"x-ai/grok-4.2-fast","name":"Grok 4.2 Fast","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":2,"output":6,"cache_read":0.2,"tiers":[{"input":4,"output":12,"cache_read":0.2,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"x-ai/grok-imagine-image-2.0":{"id":"x-ai/grok-imagine-image-2.0","type":"image","name":"Grok Imagine Image 2.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":66000,"output":0},"canonical_model_id":"xai/grok-imagine-image-2.0"},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"x-ai/grok-voice-tts-1.0":{"id":"x-ai/grok-voice-tts-1.0","type":"speech","name":"Grok Voice TTS 1.0","description":"Convert text into spoken audio with a single API call. The API supports a rich set of expressive voices, inline speech tags for fine-grained delivery control, and output formats from high-fidelity MP3 to telephony-optimized μ-law.","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":15000,"output":15000},"canonical_model_id":"xai/grok-tts"},"deepseek/deepseek-v3.2-exp":{"id":"deepseek/deepseek-v3.2-exp","name":"DeepSeek-V3.2-Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":163000,"output":64000},"status":"deprecated","cost":{"input":0.22,"output":0.33}},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.075,"output":0.3,"cache_read":0.0015},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8000},"cost":{"input":0.293,"output":0.4395,"cache_read":0.0293},"canonical_model_id":"deepseek/deepseek-v3.2"},"inclusionai/ring-2.6-1t":{"id":"inclusionai/ring-2.6-1t","name":"inclusionAI: Ring-2.6-1T","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-12-31","release_date":"2026-05-07","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":65000},"cost":{"input":0.1318155,"output":1.0984625,"cache_read":0.0263631}},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"output":65535},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"output":65535},"cost":{"input":1.25,"output":10,"cache_read":0.13,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"output":65535},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"output":65535},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048000,"output":65535},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":1,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6-Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.5,"output":3,"cache_read":0.1,"cache_write":0.625,"tiers":[{"input":2,"output":6,"cache_read":0.4,"cache_write":2.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.4,"cache_write":2.5}},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen3-coder-plus":{"id":"qwen/qwen3-coder-plus","name":"Qwen3-Coder-Plus","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"alibaba/qwen3-coder-plus"},"qwen/qwen3.5-flash":{"id":"qwen/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1020000,"output":1020000},"cost":{"input":0.1,"output":0.4,"cache_read":0.02,"cache_write":0.125},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24,"cache_write":1.5}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":1.25,"output":3.75,"cache_read":0.25,"cache_write":1.5625},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3-max":{"id":"qwen/qwen3-max","name":"Qwen3-Max-Thinking","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":1.2,"output":6},"canonical_model_id":"alibaba/qwen3-max"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":2.4,"cache_read":0.08,"cache_write":0.5,"tiers":[{"input":0.5,"output":3,"cache_read":0.1,"cache_write":0.625,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.5,"output":3,"cache_read":0.1,"cache_write":0.625}},"canonical_model_id":"alibaba/qwen3.5-plus"},"bytedance/doubao-seed-2.0-code":{"id":"bytedance/doubao-seed-2.0-code","name":"Doubao Seed 2.0 Code","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.45,"output":2.24,"cache_read":0.09,"tiers":[{"input":0.67,"output":3.36,"cache_read":0.14,"tier":{"type":"context","size":32000}},{"input":1.34,"output":6.71,"cache_read":0.27,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"bytedance/doubao-seed-2.0-lite":{"id":"bytedance/doubao-seed-2.0-lite","name":"Doubao-Seed-2.0-lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.09,"output":0.51,"cache_read":0.02,"tiers":[{"input":0.13,"output":0.76,"cache_read":0.03,"tier":{"type":"context","size":32000}},{"input":0.25,"output":1.51,"cache_read":0.05,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"bytedance/doubao-seed-code":{"id":"bytedance/doubao-seed-code","name":"Doubao-Seed-Code","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2025-11-11","last_updated":"2025-11-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.17,"output":1.12,"cache_read":0.034,"tiers":[{"input":0.2,"output":1.69,"cache_read":0.034,"tier":{"type":"context","size":32000}},{"input":0.39,"output":2.25,"cache_read":0.034,"tier":{"type":"context","size":128000}}]}},"bytedance/doubao-seed-2.0-mini":{"id":"bytedance/doubao-seed-2.0-mini","name":"Doubao-Seed-2.0-mini","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.03,"output":0.28,"cache_read":0.01,"tiers":[{"input":0.06,"output":0.56,"cache_read":0.02,"tier":{"type":"context","size":32000}},{"input":0.12,"output":1.12,"cache_read":0.03,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"bytedance/doubao-seed-2.0-pro":{"id":"bytedance/doubao-seed-2.0-pro","name":"Doubao-Seed-2.0-pro","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.45,"output":2.24,"cache_read":0.09,"tiers":[{"input":0.67,"output":3.36,"cache_read":0.14,"tier":{"type":"context","size":32000}},{"input":1.34,"output":6.71,"cache_read":0.27,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"bytedance/doubao-seed-1.8":{"id":"bytedance/doubao-seed-1.8","name":"Doubao-Seed-1.8","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2025-12-28","last_updated":"2025-12-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.11,"output":0.28,"cache_read":0.023,"tiers":[{"input":0.17,"output":2.27,"cache_read":0.023,"tier":{"type":"context","size":32000}},{"input":0.34,"output":3.41,"cache_read":0.023,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-1-8"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262140,"output":262140},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2.7-code-highspeed":{"id":"moonshotai/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code HighSpeed","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2-Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1-Codex-Mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":100000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/chat-latest":{"id":"openai/chat-latest","name":"Chat Latest (GPT-5.5 Instant)","description":"Compact GPT model for low-latency assistance and high-volume workloads","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12-01","release_date":"2026-05-05","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5-instant"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-5-codex":{"id":"openai/gpt-5-codex","name":"GPT-5 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://zenmux.ai/api/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-codex"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"volcengine/doubao-seed-2.0-code":{"id":"volcengine/doubao-seed-2.0-code","name":"Doubao Seed 2.0 Code","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0.9,"output":4.48},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"volcengine/doubao-seed-2.0-lite":{"id":"volcengine/doubao-seed-2.0-lite","name":"Doubao-Seed-2.0-lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-02-14","release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.09,"output":0.51,"cache_read":0.02,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"volcengine/doubao-seed-code":{"id":"volcengine/doubao-seed-code","name":"Doubao-Seed-Code","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2025-11-11","last_updated":"2025-11-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.17,"output":1.12,"cache_read":0.03}},"volcengine/doubao-seed-2.0-mini":{"id":"volcengine/doubao-seed-2.0-mini","name":"Doubao-Seed-2.0-mini","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-02-14","release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.03,"output":0.28,"cache_read":0.01,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"volcengine/doubao-seed-2.0-pro":{"id":"volcengine/doubao-seed-2.0-pro","name":"Doubao-Seed-2.0-pro","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-02-14","release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.45,"output":2.24,"cache_read":0.09,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"volcengine/doubao-seed-1.8":{"id":"volcengine/doubao-seed-1.8","name":"Doubao-Seed-1.8","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2025-12-28","last_updated":"2025-12-28","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":0.11,"output":0.28,"cache_read":0.02,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-1-8"},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.4,"output":2,"cache_read":0.08,"tiers":[{"input":0.8,"output":4,"cache_read":0.16,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.8,"output":4,"cache_read":0.16}},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":1,"output":3,"cache_read":0.2,"tiers":[{"input":2,"output":6,"cache_read":0.4,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":2,"output":6,"cache_read":0.4}},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204000,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2.5-lightning":{"id":"minimax/minimax-m2.5-lightning","name":"MiniMax M2.5 highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax M2","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"tiers":[{"input":0.6,"output":2.4,"cache_read":0.12,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.6,"output":2.4,"cache_read":0.12}},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax M2.7 highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131070},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.611,"output":2.4439,"cache_read":0.0611,"cache_write":0.3819},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131070},"provider":{"npm":"@ai-sdk/anthropic","api":"https://zenmux.ai/api/anthropic/v1"},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"stepfun/step-3.7-flash":{"id":"stepfun/step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"stepfun/step-3.5-flash":{"id":"stepfun/step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"stepfun/step-3.5-flash"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-4.6v-flash":{"id":"z-ai/glm-4.6v-flash","name":"GLM 4.6V FlashX","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.0218,"output":0.2184,"cache_read":0.0044,"tiers":[{"input":0.0437,"output":0.4367,"cache_read":0.0044,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"z-ai/glm-4.7-flash-free":{"id":"z-ai/glm-4.7-flash-free","name":"GLM 4.7 Flash (Free)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"z-ai/glm-4.6v-flash-free":{"id":"z-ai/glm-4.6v-flash-free","name":"GLM 4.6V Flash (Free)","description":"Lightweight GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0,"output":0,"cache_read":0,"tiers":[{"input":0,"output":0,"cache_read":0,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"z-ai/glm-4.6v":{"id":"z-ai/glm-4.6v","name":"GLM 4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.1456,"output":0.4367,"cache_read":0.0291,"tiers":[{"input":0.2911,"output":0.8734,"cache_read":0.0582,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM 5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.8781,"output":3.5126,"cache_read":0.1903,"tiers":[{"input":1.1709,"output":4.098,"cache_read":0.2927,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-4.5":{"id":"z-ai/glm-4.5","name":"GLM 4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":96000},"cost":{"input":0.2911,"output":1.1645,"cache_read":0.0582,"tiers":[{"input":0.5823,"output":2.3291,"cache_read":0.1165,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM 4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.2911,"output":1.1645,"cache_read":0.0582,"tiers":[{"input":0.5823,"output":2.3291,"cache_read":0.1165,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-image":{"id":"z-ai/glm-image","type":"image","name":"GLM-Image","description":"GLM-Image is an image generation model adopts a hybrid autoregressive + diffusion decoder architecture. In general image generation quality, GLM‑Image aligns with mainstream latent diffusion approaches, but it shows significant advantages in text-rendering and knowledge‑intensive generation scenarios. It performs especially well in tasks requiring precise semantic understanding and complex information expression, while maintaining strong capabilities in high‑fidelity and fine‑grained detail generation. In addition to text‑to‑image generation, GLM‑Image also supports a rich set of image‑to‑image tasks including image editing, style transfer, identity‑preserving generation, and multi‑subject consistency.","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-14","last_updated":"2026-01-14","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":10240,"output":0},"provider":{"api":"https://zenmux.ai/api/vertex-ai"},"canonical_model_id":"zhipuai/glm-image"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.075,"output":0.25,"cache_read":0.015},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM 5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":0.73,"output":3.19,"cache_read":0.174,"tiers":[{"input":1.02,"output":3.77,"cache_read":0.261,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-4.5-air":{"id":"z-ai/glm-4.5-air","name":"GLM 4.5 Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":96000},"cost":{"input":0.1165,"output":0.2911,"cache_read":0.0233,"tiers":[{"input":0.1747,"output":1.1645,"cache_read":0.0349,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM 4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.2911,"output":1.1645,"cache_read":0.0582,"tiers":[{"input":0.5823,"output":2.3291,"cache_read":0.1165,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-5.3-flashx":{"id":"z-ai/glm-5.3-flashx","name":"GLM 5.3 FlashX","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.375,"output":1.25,"cache_read":0.075},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM 5V Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":0.726,"output":3.1946,"cache_read":0.1743,"tiers":[{"input":1.0165,"output":3.7754,"cache_read":0.2614,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-4.7-flashx":{"id":"z-ai/glm-4.7-flashx","name":"GLM 4.7 FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.0728,"output":0.4367,"cache_read":0.0146},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM 5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.58,"output":2.6,"cache_read":0.14,"tiers":[{"input":0.87,"output":3.18,"cache_read":0.22,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5"}}},"siliconflow":{"id":"siliconflow","env":["SILICONFLOW_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.siliconflow.com/v1","name":"SiliconFlow","doc":"https://cloud.siliconflow.com/models","models":{"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.75,"output":1,"cache_read":0.25},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.14,"output":0.4,"cache_read":0.05},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemma-4-12B-it":{"id":"google/gemma-4-12B-it","name":"Gemma 4 12B IT","description":"Compact Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"google/gemma-4-12b-it"},"ByteDance-Seed/Seed-OSS-36B-Instruct":{"id":"ByteDance-Seed/Seed-OSS-36B-Instruct","name":"ByteDance-Seed/Seed-OSS-36B-Instruct","description":"Tool-capable chat model for instruction following and agentic application workflows","family":"seed","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-04","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.21,"output":0.57}},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMaxAI/MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":197000,"output":131000},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"deepseek-ai/DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.27,"output":0.42,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.13,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"deepseek-ai/DeepSeek-V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.27,"output":1},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V3.1-Terminus":{"id":"deepseek-ai/DeepSeek-V3.1-Terminus","name":"deepseek-ai/DeepSeek-V3.1-Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-29","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.27,"output":1}},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp":{"id":"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"deepseek-ai/DeepSeek-V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.25,"output":1},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-V3.2-Exp":{"id":"deepseek-ai/DeepSeek-V3.2-Exp","name":"deepseek-ai/DeepSeek-V3.2-Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-10","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.27,"output":0.41}},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.50162,"output":3.135,"cache_read":0.135},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"deepseek-ai/DeepSeek-R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":164000,"output":164000},"cost":{"input":0.5,"output":2.18},"canonical_model_id":"deepseek/deepseek-r1-0528"},"tencent/Hunyuan-A13B-Instruct":{"id":"tencent/Hunyuan-A13B-Instruct","name":"tencent/Hunyuan-A13B-Instruct","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14,"output":0.57}},"tencent/Hy3":{"id":"tencent/Hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":262144},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262000},"cost":{"input":2.7,"output":13.5,"cache_read":0.27},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.85916,"output":3.8,"cache_read":0.17993},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"moonshotai/Kimi-K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.45,"output":2.25,"cache_read":0.07},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"moonshotai/Kimi-K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.77,"output":3.4,"cache_read":0.14},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"openai/gpt-oss-20b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":8000},"cost":{"input":0.04,"output":0.18},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"openai/gpt-oss-120b","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":8000},"cost":{"input":0.05,"output":0.45},"canonical_model_id":"openai/gpt-oss-120b"},"inclusionAI/Ling-flash-2.0":{"id":"inclusionAI/Ling-flash-2.0","name":"inclusionAI/Ling-flash-2.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-18","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14,"output":0.57}},"Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen/Qwen3-VL-30B-A3B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.29,"output":1},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"Qwen/Qwen2.5-72B-Instruct":{"id":"Qwen/Qwen2.5-72B-Instruct","name":"Qwen/Qwen2.5-72B-Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-18","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":33000,"output":4000},"cost":{"input":0.59,"output":0.59}},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.39,"output":2.34},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen/Qwen3-32B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14,"output":0.57},"canonical_model_id":"alibaba/qwen3-32b"},"Qwen/Qwen3-VL-30B-A3B-Thinking":{"id":"Qwen/Qwen3-VL-30B-A3B-Thinking","name":"Qwen/Qwen3-VL-30B-A3B-Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-11","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.29,"output":1}},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":3.2},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen/Qwen3-Coder-480B-A35B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.25,"output":1},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"Qwen/Qwen3-VL-32B-Thinking":{"id":"Qwen/Qwen3-VL-32B-Thinking","name":"Qwen/Qwen3-VL-32B-Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-21","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.2,"output":1.5}},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.26,"output":2.08},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"Qwen/Qwen3-VL-32B-Instruct":{"id":"Qwen/Qwen3-VL-32B-Instruct","name":"Qwen/Qwen3-VL-32B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-21","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.2,"output":0.6}},"Qwen/Qwen3-VL-8B-Instruct":{"id":"Qwen/Qwen3-VL-8B-Instruct","name":"Qwen/Qwen3-VL-8B-Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-15","last_updated":"2025-11-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.18,"output":0.68}},"Qwen/Qwen3.8-2.4T-A95B":{"id":"Qwen/Qwen3.8-2.4T-A95B","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":131000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen/Qwen3.5-9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.1,"output":0.15},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen2.5-7B-Instruct":{"id":"Qwen/Qwen2.5-7B-Instruct","name":"Qwen/Qwen2.5-7B-Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":33000,"output":4000},"cost":{"input":0.05,"output":0.05},"canonical_model_id":"alibaba/qwen2.5-7b-instruct"},"Qwen/Qwen3-14B":{"id":"Qwen/Qwen3-14B","name":"Qwen/Qwen3-14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-30","last_updated":"2025-11-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.07,"output":0.28}},"Qwen/Qwen3-30B-A3B-Instruct-2507":{"id":"Qwen/Qwen3-30B-A3B-Instruct-2507","name":"Qwen/Qwen3-30B-A3B-Instruct-2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.09,"output":0.3},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen/Qwen3-Coder-30B-A3B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":0.07,"output":0.28},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"Qwen/Qwen3-8B":{"id":"Qwen/Qwen3-8B","name":"Qwen/Qwen3-8B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.06,"output":0.06},"canonical_model_id":"alibaba/qwen3-8b"},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.24,"output":1.8,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.24,"output":1.8,"cache_read":0.15},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"nex-agi/Nex-N2-Pro":{"id":"nex-agi/Nex-N2-Pro","name":"Nex-N2-Pro","description":"Open agentic MoE model (397B total, 17B active) for coding, tool use, and research workflows","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"status":"deprecated","cost":{"input":0.5,"output":2.5,"cache_read":0.25},"canonical_model_id":"nex-agi/nex-n2-pro"},"meituan-longcat/LongCat-2.0":{"id":"meituan-longcat/LongCat-2.0","name":"LongCat-2.0","description":"Meituan LongCat-2.0, a reasoning model with tool calling and a 1M-token context window","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":131072},"cost":{"input":0.75,"output":2.95,"cache_read":0.015},"canonical_model_id":"meituan/longcat-2.0"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":262000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":262000},"cost":{"input":1.302,"output":4.092,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1049000,"output":262000},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"zai-org/GLM-4.5-Air","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-air","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.14,"output":0.86},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"zai-org/GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131072},"cost":{"input":0.95,"output":2.55,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"zai-org/GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":205000,"output":131000},"cost":{"input":1.19,"output":3.74,"cache_read":0.6,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"zai-org/GLM-5V-Turbo":{"id":"zai-org/GLM-5V-Turbo","name":"zai-org/GLM-5V-Turbo","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5v-turbo"},"stepfun-ai/Step-3.5-Flash":{"id":"stepfun-ai/Step-3.5-Flash","name":"stepfun-ai/Step-3.5-Flash","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":66000},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"stepfun/step-3.5-flash"}}},"modular":{"id":"modular","env":["MODULAR_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.modular.com/v1","name":"Modular","doc":"https://docs.modular.com/models","models":{"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.17,"output":1.2,"cache_read":0.02},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.25,"output":0.65,"cache_read":0.08},"canonical_model_id":"google/gemma-4-31b-it"},"MiniMaxAI/MiniMax-M3.1-Flash":{"id":"MiniMaxAI/MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"}}},"infer":{"id":"infer","env":["INFER_API_KEY"],"npm":"@ai-sdk/openai","api":"https://infer.flow7.org/v1","name":"Infer by Flow7","doc":"https://infer.flow7.org/opencode","models":{"infer/gpt-5.6-sol:official":{"id":"infer/gpt-5.6-sol:official","name":"GPT-5.6 Sol (Official API)","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":271999,"output":128000},"provider":{"shape":"responses"},"cost":{"input":2.5,"output":12.5,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"openai/gpt-5.6-sol"},"infer/gpt-6-astra:official":{"id":"infer/gpt-6-astra:official","name":"GPT-6 Astra (Official API)","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":271999,"output":128000},"provider":{"shape":"responses"},"cost":{"input":12.5,"output":62.5,"cache_read":1.25,"cache_write":15.625},"canonical_model_id":"openai/gpt-6-astra"}}},"umans-ai-coding-plan":{"id":"umans-ai-coding-plan","env":["UMANS_AI_CODING_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.code.umans.ai/v1","name":"Umans AI Coding Plan","doc":"https://app.umans.ai/offers/code/docs","models":{"umans-deepseek-v4.1-flash":{"id":"umans-deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"umans-glm-5.3":{"id":"umans-glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3"},"umans-deepseek-v4.1-flash-1017":{"id":"umans-deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"umans-glm-5.3-flash":{"id":"umans-glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"umans-coder":{"id":"umans-coder","name":"Umans Coder","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"umans-flash":{"id":"umans-flash","name":"Umans Flash","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"umans-qwen3.6-35b-a3b":{"id":"umans-qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"umans-kimi-k3":{"id":"umans-kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3"},"umans-deepseek-v4-flash-0731":{"id":"umans-deepseek-v4-flash-0731","name":"DeepSeek V4 Flash","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"}}},"neon":{"id":"neon","env":["NEON_AI_GATEWAY_BASE_URL","NEON_AI_GATEWAY_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"${NEON_AI_GATEWAY_BASE_URL}/v1","name":"Neon","doc":"https://neon.com/docs","models":{"gemini-3-1-flash-lite":{"id":"gemini-3-1-flash-lite","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"gpt-5-6-terra":{"id":"gpt-5-6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"grok-4-6":{"id":"grok-4-6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":524288},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"meta-llama-3-3-70b-instruct":{"id":"meta-llama-3-3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"gemma-3-12b":{"id":"gemma-3-12b","name":"Gemma 3 12B","description":"Google's open-weight Gemma 3 vision-language model for text and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.15,"output":0.5},"canonical_model_id":"google/gemma-3-12b-it"},"glm-5-3-flash":{"id":"glm-5-3-flash","name":"GLM-5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"gpt-5-4":{"id":"gpt-5-4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gpt-5-2":{"id":"gpt-5-2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"glm-5-2":{"id":"glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"gpt-5-4-mini":{"id":"gpt-5-4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"gpt-5-6-luna":{"id":"gpt-5-6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-5-6-sol":{"id":"gpt-5-6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":45,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"openai/gpt-5.6-sol"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"llama-4-maverick":{"id":"llama-4-maverick","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":8192},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"gemini-3-8-flash":{"id":"gemini-3-8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.8-flash"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"gemini-3-6-flash":{"id":"gemini-3-6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.6-flash"},"grok-4-7":{"id":"grok-4-7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2.5,"output":7.5,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"meta-llama-3-1-8b-instruct":{"id":"meta-llama-3-1-8b-instruct","name":"Llama 3.1 8B Instruct","description":"Meta's compact open-weight Llama 3.1 model for fast, low-cost text generation","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.15,"output":0.45},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":25000},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"gpt-5-5":{"id":"gpt-5-5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"google/gemini-4-argon"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gemini-3-7-flash":{"id":"gemini-3-7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.7-flash"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"gpt-6-1-sol":{"id":"gpt-6-1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"deepseek-v4-1-flash":{"id":"deepseek-v4-1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen35-122b-a10b":{"id":"qwen35-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":25000},"cost":{"input":0.22,"output":2.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"glm-5-3":{"id":"glm-5-3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5-3-codex":{"id":"gpt-5-3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"gpt-5-4-nano":{"id":"gpt-5-4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"gemini-3-5-flash-lite":{"id":"gemini-3-5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemini-3-5-flash":{"id":"gemini-3-5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"gpt-5-1":{"id":"gpt-5-1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":0.05,"output":0.4,"cache_read":0.01},"canonical_model_id":"openai/gpt-5-nano"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":127999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-3-flash":{"id":"gemini-3-flash","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"inkling":{"id":"inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"qwen3-next-80b-a3b-instruct":{"id":"qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":10000},"cost":{"input":0.15,"output":1.2},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":25000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"claude-opus-4-1":{"id":"claude-opus-4-1","name":"Claude Opus 4.1 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"gpt-5-5-pro":{"id":"gpt-5-5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"${NEON_AI_GATEWAY_BASE_URL}/openai/v1","shape":"responses"},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3-1-pro":{"id":"gemini-3-1-pro","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"aiand":{"id":"aiand","env":["AIAND_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.aiand.com/v1","name":"ai&","doc":"https://docs.aiand.com/","models":{"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"google/gemma-4-31b-it"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.4,"output":3,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.32,"output":3.2,"cache_read":0.2},"canonical_model_id":"alibaba/qwen3.6-27b"},"deepseek-ai/deepseek-v4-pro":{"id":"deepseek-ai/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1,"output":2.5,"cache_read":0.25},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/deepseek-v4.1-flash-1017":{"id":"deepseek-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":0.6,"cache_read":0.02},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":12.5,"cache_read":0.5},"canonical_model_id":"moonshotai/kimi-k3"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.08},"canonical_model_id":"openai/gpt-oss-120b"},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"zai-org/glm-5.3":{"id":"zai-org/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1,"output":4,"cache_read":0.3},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/glm-5.3-flash":{"id":"zai-org/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1048550,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"motif-technologies/motif-3":{"id":"motif-technologies/motif-3","name":"Motif 3","description":"Motif 3 is a large-scale, decoder-only Mixture-of-Experts (MoE) language model with 314 billion total parameters and 13.2 billion parameters activated per token.","family":"motif","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":2,"cache_read":0.2},"canonical_model_id":"motif-technologies/motif-3"}}},"boundless":{"id":"boundless","env":["BOUNDLESS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inference.boundless.network/v1","name":"Boundless","doc":"https://inference.boundless.network/models","models":{"nemotron3-super":{"id":"nemotron3-super","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.12,"output":0.52,"cache_read":0.06},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.34,"output":2.3,"cache_read":0.17},"canonical_model_id":"zhipuai/glm-5.2"},"claude-opus-5.5":{"id":"claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"anthropic/claude-opus-5-5"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.3,"output":11.4,"cache_read":0.23},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":128000},"status":"deprecated","cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"openai/gpt-5.6-sol"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01},"canonical_model_id":"openai/gpt-6-luna"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":1.04,"output":2.08,"cache_read":0.0352},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.2,"output":1,"cache_read":0.01},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"claude-fable-5.1":{"id":"claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25},"canonical_model_id":"anthropic/claude-fable-5-1"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"openai/gpt-6-sol"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.12,"output":3.52,"cache_read":0.14},"canonical_model_id":"zhipuai/glm-5.3"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.28,"output":1.1,"cache_read":0.056},"canonical_model_id":"minimax/MiniMax-M3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.12,"output":0.4,"cache_read":0.024},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":128000},"status":"deprecated","cost":{"input":5,"output":25,"cache_read":0.5},"canonical_model_id":"anthropic/claude-opus-5"},"qwen3.6":{"id":"qwen3.6","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.04,"output":0.35,"cache_read":0.02},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":128000},"status":"deprecated","cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.6-luna"},"dsv4":{"id":"dsv4","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.04,"output":0.21,"cache_read":0.02},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"}}},"hyper":{"id":"hyper","env":["HYPER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://hyper.charm.land/v1","name":"Charm Hyper","doc":"https://hyper.charm.land","models":{"kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":2.2,"output":11,"cache_read":0.22},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16000},"cost":{"input":3.2664,"output":16.332,"cache_read":0.32664},"canonical_model_id":"moonshotai/kimi-k3"},"prism":{"id":"prism","name":"Prism","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"release_date":"1970-01-01","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.2,"output":11,"cache_read":0.22}},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3.8-27b"},"deepseek-v4-pro-0813":{"id":"deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":1.437216,"output":4.311648,"cache_read":0.047907},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen3.8-2.4t-a95b":{"id":"qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.52432,"output":4.79072,"cache_read":0.283088},"canonical_model_id":"zhipuai/glm-5.3"},"muse-spark-open":{"id":"muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.4,"output":4.65,"cache_read":0.17},"canonical_model_id":"meta/muse-spark-open"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":512000},"cost":{"input":0.32664,"output":1.30656,"cache_read":0.064239},"canonical_model_id":"minimax/MiniMax-M3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.16332,"output":0.5444,"cache_read":0.031575},"canonical_model_id":"zhipuai/glm-5.3-flash"},"prism-core":{"id":"prism-core","name":"Prism Core","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"release_date":"1970-01-01","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.52432,"output":4.79072,"cache_read":0.283088}},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":25600},"cost":{"input":0.098,"output":0.334,"cache_read":0.049},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"inkling":{"id":"inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":1.0888,"output":4.40964,"cache_read":0.185096},"canonical_model_id":"thinkingmachines/inkling"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":13107},"cost":{"input":0.178,"output":0.68,"cache_read":0.089},"canonical_model_id":"openai/gpt-oss-120b"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max Preview","description":"Preview Qwen flagship for million-token multimodal reasoning and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-07-19","last_updated":"2026-07-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max-preview"},"prism-flash":{"id":"prism-flash","name":"Prism Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":true,"reasoning":false,"tool_call":true,"release_date":"1970-01-01","last_updated":"2026-11-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.33,"output":1.31,"cache_read":0.03}},"deepseek-v4.1-flash-1017":{"id":"deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.33,"output":1.31,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"}}},"kimi-code-plan-global":{"id":"kimi-code-plan-global","env":["KIMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.kimi.ai/coding/v1","name":"Kimi For Coding (kimi.ai)","doc":"https://www.kimi.ai/code/docs/en/kimi-code/models.html","models":{"kimi-for-coding-highspeed":{"id":"kimi-for-coding-highspeed","name":"Kimi For Coding HighSpeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"k3.1-pro":{"id":"k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"k3":{"id":"k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3"},"k3-256k":{"id":"k3-256k","name":"Kimi K3-256K","description":"256K-context version of Kimi K3, reducing token consumption for shorter coding sessions","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3"},"k3.1-pro-highspeed":{"id":"k3.1-pro-highspeed","name":"Kimi K3.1 Pro Highspeed","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"kimi-for-coding":{"id":"kimi-for-coding","name":"kimi-for-coding","description":"Kimi coding model with more efficient thinking and up to 1M context, available through Kimi Code","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.8-preview"}}},"qvac":{"id":"qvac","env":["QVAC_API_KEY"],"npm":"@qvac/ai-sdk-provider","name":"QVAC","doc":"https://www.npmjs.com/package/@qvac/ai-sdk-provider","models":{"qwen3.5-0.8b":{"id":"qwen3.5-0.8b","name":"Qwen3.5 0.8B","description":"Qwen instruction model for multilingual chat and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-0.8b"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-oss-20b"},"qwen3.5-9b":{"id":"qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen3.6-27b":{"id":"qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-oss-120b"},"qwen3.5-4b":{"id":"qwen3.5-4b","name":"Qwen3.5 4B","description":"Qwen instruction model for multilingual chat and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-4b"},"qwen3.5-2b":{"id":"qwen3.5-2b","name":"Qwen3.5 2B","description":"Qwen instruction model for multilingual chat and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.5-2b"},"gemma4-31b":{"id":"gemma4-31b","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"}}},"openrouter":{"id":"openrouter","env":["OPENROUTER_API_KEY"],"npm":"@openrouter/ai-sdk-provider","api":"https://openrouter.ai/api/v1","name":"OpenRouter","doc":"https://openrouter.ai/models","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":10,"output":37.5,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude Opus 4.1 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"writer/palmyra-x5":{"id":"writer/palmyra-x5","name":"Palmyra X5","description":"General-purpose chat model for instruction following, writing, and analysis","family":"palmyra","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1040000,"output":8192},"cost":{"input":0.6,"output":6},"canonical_model_id":"writer/palmyra-x5"},"aion-labs/aion-3.0":{"id":"aion-labs/aion-3.0","name":"Aion-3.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75},"canonical_model_id":"aion-labs/aion-3.0"},"aion-labs/aion-3.5-mini":{"id":"aion-labs/aion-3.5-mini","name":"Aion 3.5 Mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18}},"aion-labs/aion-2.0":{"id":"aion-labs/aion-2.0","name":"Aion-2.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-21","last_updated":"2025-12-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.8,"output":1.6,"cache_read":0.2},"canonical_model_id":"aion-labs/aion-2.0"},"aion-labs/aion-3.0-mini":{"id":"aion-labs/aion-3.0-mini","name":"Aion-3.0-Mini","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-05-14","last_updated":"2026-05-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.7,"output":1.4,"cache_read":0.18},"canonical_model_id":"aion-labs/aion-3.0-mini"},"aion-labs/aion-rp-llama-3.1-8b":{"id":"aion-labs/aion-rp-llama-3.1-8b","name":"Aion-RP 1.0 (8B)","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12-31","release_date":"2025-02-04","last_updated":"2025-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.8,"output":1.6},"canonical_model_id":"aion-labs/aion-rp-llama-3.1-8b"},"aion-labs/aion-3.5":{"id":"aion-labs/aion-3.5","name":"Aion 3.5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"cost":{"input":3,"output":6,"cache_read":0.75}},"anthracite-org/magnum-v4-72b":{"id":"anthracite-org/magnum-v4-72b","name":"Magnum v4 72B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":4096},"cost":{"input":2.5,"output":5,"cache_read":2.5},"canonical_model_id":"anthracite-org/magnum-v4-72b"},"baidu/ernie-5.5-flash-preview:free":{"id":"baidu/ernie-5.5-flash-preview:free","name":"ERNIE-5.5-Flash-Preview (free)","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":921600},"cost":{"input":0,"output":0}},"baidu/ernie-light-dt-1.0-intl":{"id":"baidu/ernie-light-dt-1.0-intl","name":"ERNIE-Light-DT-1.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"ernie","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1024000,"output":131072},"cost":{"input":1.13,"output":3.94,"cache_read":0.113}},"amazon/nova-pro-v1":{"id":"amazon/nova-pro-v1","name":"Nova Pro 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.8,"output":3.2},"canonical_model_id":"amazon/nova-pro-v1"},"amazon/nova-premier-v1":{"id":"amazon/nova-premier-v1","name":"Nova Premier 1.0","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10","release_date":"2025-04-30","last_updated":"2025-04-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"status":"deprecated","cost":{"input":2.5,"output":12.5,"cache_read":0.625},"canonical_model_id":"amazon/nova-premier"},"amazon/nova-2-lite-v1":{"id":"amazon/nova-2-lite-v1","name":"Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65535},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"amazon/nova-2-lite-v1"},"amazon/nova-lite-v1":{"id":"amazon/nova-lite-v1","name":"Nova Lite 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-lite","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":5120},"cost":{"input":0.06,"output":0.24},"canonical_model_id":"amazon/nova-lite-v1"},"amazon/nova-micro-v1":{"id":"amazon/nova-micro-v1","name":"Nova Micro 1.0","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-10-31","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":5120},"cost":{"input":0.035,"output":0.14},"canonical_model_id":"amazon/nova-micro-v1"},"meituan/longcat-2.0":{"id":"meituan/longcat-2.0","name":"LongCat-2.0","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"longcat","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048756,"output":262144},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"meituan/longcat-2.0"},"particle-ai/particle-1":{"id":"particle-ai/particle-1","name":"Particle-1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-28","last_updated":"2026-10-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.05,"output":0.5,"cache_read":0.003}},"perplexity/sonar-pro":{"id":"perplexity/sonar-pro","name":"Sonar Pro","description":"Advanced Sonar search model for deeper research and cited synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8000},"cost":{"input":3,"output":15}},"perplexity/sonar":{"id":"perplexity/sonar","name":"Sonar","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-01-27","last_updated":"2025-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":127072,"output":114364},"cost":{"input":1,"output":1}},"perplexity/sonar-reasoning-pro":{"id":"perplexity/sonar-reasoning-pro","name":"Sonar Reasoning Pro","description":"Web-grounded reasoning model for multi-step research and cited answers","family":"sonar-reasoning","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":115200},"cost":{"input":2,"output":8}},"perplexity/sonar-deep-research":{"id":"perplexity/sonar-deep-research","name":"Sonar Deep Research","description":"Sonar search model for current answers, retrieval, and citation-backed chat","family":"sonar-deep-research","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-03-07","last_updated":"2025-03-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":115200},"cost":{"input":2,"output":8,"reasoning":3}},"perplexity/sonar-pro-search":{"id":"perplexity/sonar-pro-search","name":"Sonar Pro Search","description":"Advanced Sonar search model for deeper research and cited synthesis","family":"sonar-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-10-30","last_updated":"2025-10-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8000},"cost":{"input":3,"output":15}},"rekaai/reka-flash-3":{"id":"rekaai/reka-flash-3","name":"Reka Flash 3","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"reka","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":58982},"cost":{"input":0.1,"output":0.2},"canonical_model_id":"rekaai/reka-flash-3"},"rekaai/reka-edge":{"id":"rekaai/reka-edge","name":"Reka Edge","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"reka","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":14745},"cost":{"input":0.1,"output":0.1},"canonical_model_id":"rekaai/reka-edge"},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":900000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.20":{"id":"x-ai/grok-4.20","name":"Grok 4.20","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1800000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":230400},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"x-ai/grok-4.20-multi-agent":{"id":"x-ai/grok-4.20-multi-agent","name":"Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":1800000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.5,"output":2.15,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek-chat-v3-0324":{"id":"deepseek/deepseek-chat-v3-0324","name":"DeepSeek V3 0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":115200},"cost":{"input":0.29,"output":1.14,"cache_read":0.11},"canonical_model_id":"deepseek/deepseek-chat-v3-0324"},"deepseek/deepseek-v3.2-exp":{"id":"deepseek/deepseek-v3.2-exp","name":"DeepSeek V3.2 Exp","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.27,"output":0.41}},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.111,"output":4.44,"cache_read":0.097},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.022,"output":0.4,"cache_read":0.004},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.95526,"output":1.91052,"cache_read":0.079605},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v3.1-terminus":{"id":"deepseek/deepseek-v3.1-terminus","name":"DeepSeek V3.1 Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-22","last_updated":"2025-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.27,"output":1}},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943717},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0.32,"output":0.89},"canonical_model_id":"deepseek/deepseek-chat"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.09,"output":0.18,"cache_read":0.018},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-chat-v3.1":{"id":"deepseek/deepseek-chat-v3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.25,"output":0.95,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-chat-v3.1"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":147456},"cost":{"input":0.26,"output":0.38,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0434,"output":0.3,"cache_read":0.035},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"inclusionai/ling-3.0-flash-vl":{"id":"inclusionai/ling-3.0-flash-vl","name":"Ling 3.0 Flash VL","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.06,"output":0.18,"cache_read":0.012},"canonical_model_id":"inclusionai/ling-3.0-flash-vl"},"inclusionai/ling-3.0-tiny":{"id":"inclusionai/ling-3.0-tiny","name":"Ling 3.0 Tiny","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":250000},"cost":{"input":0.015,"output":0.045,"cache_read":0.003}},"inclusionai/ling-3.0-flash":{"id":"inclusionai/ling-3.0-flash","name":"Ling 3.0 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-23","last_updated":"2026-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.021,"output":0.063,"cache_read":0.0042},"canonical_model_id":"inclusionai/ling-3.0-flash"},"inclusionai/ling-3.1-flash":{"id":"inclusionai/ling-3.1-flash","name":"Ling 3.1 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0.045,"output":0.135,"cache_read":0.009},"canonical_model_id":"inclusionai/ling-3.1-flash"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"status":"deprecated","cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.1-flash-lite-image":{"id":"google/gemini-3.1-flash-lite-image","type":"image","name":"Nano Banana 2 Lite","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.1-flash-image-preview":{"id":"google/gemini-3.1-flash-image-preview","type":"image","name":"Nano Banana 2 Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875,"input_audio":2},"canonical_model_id":"google/gemini-4-carbon"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.08,"output":0.35,"cache_read":0.04},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-2-27b-it":{"id":"google/gemma-2-27b-it","name":"Gemma 2 27B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-07-13","last_updated":"2024-07-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"cost":{"input":0.65,"output":0.65},"canonical_model_id":"google/gemma-2-27b-it"},"google/lyria-3-pro-preview":{"id":"google/lyria-3-pro-preview","name":"Lyria 3 Pro Preview","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-pro-preview"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1.25,"output":10,"reasoning":10,"cache_read":0.125,"cache_write":0.375,"input_audio":1.25,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"reasoning":9,"cache_read":0.15,"cache_write":0.083333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemma-4-31b-it:free":{"id":"google/gemma-4-31b-it:free","name":"Gemma 4 31B (free)","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3.1-flash-image":{"id":"google/gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"status":"deprecated","cost":{"input":0.1,"output":0.4,"reasoning":0.4,"cache_read":0.01,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Gemini multimodal model for text, image, audio, video, and document tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-2.5-pro-preview":{"id":"google/gemini-2.5-pro-preview","name":"Gemini 2.5 Pro Preview 06-05","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["pdf","image","text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"reasoning":10,"cache_read":0.125,"cache_write":0.375,"input_audio":1.25,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro-preview"},"google/gemini-3.1-flash-lite-preview":{"id":"google/gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"reasoning":1.5,"cache_read":0.025,"cache_write":0.083333,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"google/gemini-3-pro-image-preview":{"id":"google/gemini-3-pro-image-preview","type":"image","name":"Nano Banana Pro Preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2},"canonical_model_id":"google/gemini-3-pro-image-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"reasoning":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.2,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"reasoning":3,"cache_read":0.05,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-2.5-flash-image":{"id":"google/gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083333,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":128000},"cost":{"input":0.08,"output":0.1,"cache_read":0.046},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-omni-1.2-flash":{"id":"google/gemini-omni-1.2-flash","type":"video","name":"Gemini Omni 1.2 Flash","description":"Omni-modal model for text, vision, audio, and multimodal agent tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image","video"],"output":["text","video"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-1.2-flash"},"google/gemini-3-pro-image":{"id":"google/gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":2,"output":12,"reasoning":12,"cache_read":0.2,"cache_write":0.375,"input_audio":2},"canonical_model_id":"google/gemini-3-pro-image"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.05,"output":0.15},"canonical_model_id":"google/gemma-3-12b-it"},"google/gemini-omni-1.1-flash":{"id":"google/gemini-omni-1.1-flash","type":"video","name":"Gemini Omni 1.1 Flash","description":"Omni-modal model for text, vision, audio, and multimodal agent tasks","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text","video"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1.5,"output":9},"canonical_model_id":"google/gemini-omni-1.1-flash"},"google/lyria-3-clip-preview":{"id":"google/lyria-3-clip-preview","name":"Lyria 3 Clip Preview","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"lyria","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-25","last_updated":"2026-03-25","modalities":{"input":["text","image"],"output":["text","audio"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"google/lyria-3-clip-preview"},"google/gemma-4-26b-a4b-it:free":{"id":"google/gemma-4-26b-a4b-it:free","name":"Gemma 4 26B A4B (free)","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"google/gemini-nano-banana-2.1":{"id":"google/gemini-nano-banana-2.1","type":"image","name":"Nano Banana 2.1","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["image","text"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":58982},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"google/gemini-nano-banana-2.1"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.325,"output":1.95,"cache_write":0.40625,"tiers":[{"input":1.3,"output":3.9,"cache_write":1.625,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.3,"output":3.9,"cache_write":1.625}},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen-2.5-72b-instruct":{"id":"qwen/qwen-2.5-72b-instruct","name":"Qwen2.5 72B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.36,"output":0.4}},"qwen/qwen3-coder-30b-a3b-instruct":{"id":"qwen/qwen3-coder-30b-a3b-instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"qwen/qwen3-30b-a3b":{"id":"qwen/qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.21,"output":1.9,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen2.5-vl-72b-instruct":{"id":"qwen/qwen2.5-vl-72b-instruct","name":"Qwen2.5-VL 72B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-01-26","last_updated":"2025-01-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":115200},"cost":{"input":0.8,"output":1,"cache_read":0.4},"canonical_model_id":"alibaba/qwen2-5-vl-72b-instruct"},"qwen/qwen3-235b-a22b-thinking-2507":{"id":"qwen/qwen3-235b-a22b-thinking-2507","name":"Qwen3 235B-A22B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.45,"output":3.5},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"qwen/qwen3.8-omni-flash":{"id":"qwen/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen/qwen3-vl-8b-instruct":{"id":"qwen/qwen3-vl-8b-instruct","name":"Qwen3 VL 8B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.25,"output":0.75,"cache_read":0.12}},"qwen/qwen3-coder":{"id":"qwen/qwen3-coder","name":"Qwen3 Coder 480B A35B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":1,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"qwen/qwen3-14b":{"id":"qwen/qwen3-14b","name":"Qwen3 14B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":36864},"cost":{"input":0.1,"output":0.22}},"qwen/qwen3-vl-30b-a3b-thinking":{"id":"qwen/qwen3-vl-30b-a3b-thinking","name":"Qwen3 VL 30B A3B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.29,"output":1}},"qwen/qwen3-vl-30b-a3b-instruct":{"id":"qwen/qwen3-vl-30b-a3b-instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048575,"output":235929},"cost":{"input":0.15,"output":1.875,"cache_read":0.0375},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.26,"output":0.78,"cache_read":0.052,"cache_write":0.325,"tiers":[{"input":0.78,"output":2.34,"cache_read":0.156,"cache_write":0.975,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.78,"output":2.34,"cache_read":0.156,"cache_write":0.975}},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3-30b-a3b-instruct-2507":{"id":"qwen/qwen3-30b-a3b-instruct-2507","name":"Qwen3 30B-A3B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.1,"output":0.3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"qwen/qwen3.5-flash-02-23":{"id":"qwen/qwen3.5-flash-02-23","name":"Qwen3.5-Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-25","last_updated":"2026-02-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.065,"output":0.26}},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":64000},"cost":{"input":0.6,"output":3.6,"cache_read":0.12},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":40960},"status":"deprecated","cost":{"input":0.049,"output":0.072,"cache_read":0.044},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3.8-max-prime":{"id":"qwen/qwen3.8-max-prime","name":"Qwen 3.8 Max Prime","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.8-max","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":4,"output":12,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.8-max-prime"},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3-235b-a22b-2507":{"id":"qwen/qwen3-235b-a22b-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":117964},"cost":{"input":0.14,"output":0.8,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.14,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.32,"output":1.28,"cache_read":0.064,"cache_write":0.4,"tiers":[{"input":0.96,"output":3.84,"cache_read":0.192,"cache_write":1.2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.96,"output":3.84,"cache_read":0.192,"cache_write":1.2}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.475,"output":4.425,"cache_read":0.295,"cache_write":1.84375},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1875,"output":1.125,"cache_write":0.234375,"tiers":[{"input":0.75,"output":3,"cache_write":0.9375,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.75,"output":3,"cache_write":0.9375}},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":65536},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"cache_write":0.125,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"cache_write":0.25,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen3.5-plus-02-15":{"id":"qwen/qwen3.5-plus-02-15","name":"Qwen3.5 Plus 2026-02-15","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.26,"output":1.56,"tiers":[{"input":0.325,"output":1.95,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.325,"output":1.95}}},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.32,"output":3.2},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.1,"output":0.9,"cache_read":0.025},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.12,"output":0.8,"cache_read":0.07},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen3-next-80b-a3b-instruct":{"id":"qwen/qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.09,"output":1.1},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen/qwen3-32b":{"id":"qwen/qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.08,"output":0.28},"canonical_model_id":"alibaba/qwen3-32b"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.26,"output":2.6},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.195,"output":0.975,"cache_read":0.039,"cache_write":0.24375,"tiers":[{"input":0.325,"output":1.625,"cache_read":0.065,"cache_write":0.40625,"tier":{"type":"context","size":32000}},{"input":0.52,"output":2.6,"cache_read":0.104,"cache_write":0.65,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-coder-flash"},"qwen/qwen3.5-plus-20260420":{"id":"qwen/qwen3.5-plus-20260420","name":"Qwen3.5 Plus 2026-04-20","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.5","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.8,"cache_write":0.375,"tiers":[{"input":0.375,"output":2.25,"cache_write":0.46875,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.375,"output":2.25,"cache_write":0.46875}}},"qwen/qwen-2.5-coder-32b-instruct":{"id":"qwen/qwen-2.5-coder-32b-instruct","name":"Qwen2.5-Coder-32B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.66,"output":1},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.26,"output":2.08},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"~deepseek/deepseek-pro-latest":{"id":"~deepseek/deepseek-pro-latest","name":"DeepSeek Pro Latest","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-14","last_updated":"2026-09-14","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":393216},"cost":{"input":0.0999,"output":8,"cache_read":0.0999}},"~deepseek/deepseek-flash-latest":{"id":"~deepseek/deepseek-flash-latest","name":"DeepSeek Flash Latest","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-14","last_updated":"2026-09-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.022,"output":0.4,"cache_read":0.004}},"~deepseek/deepseek-v4-flash-latest":{"id":"~deepseek/deepseek-v4-flash-latest","name":"DeepSeek V4 Flash Latest","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-01","last_updated":"2026-08-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0434,"output":0.3,"cache_read":0.035}},"bytedance/ui-tars-1.5-7b":{"id":"bytedance/ui-tars-1.5-7b","name":"UI-TARS 7B ","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":2048},"cost":{"input":0.1,"output":0.2,"cache_read":0.1}},"~moonshotai/kimi-latest":{"id":"~moonshotai/kimi-latest","name":"Kimi Latest","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1824,"output":11.0055,"cache_read":0.18}},"kt/midm-k-3.0-pro":{"id":"kt/midm-k-3.0-pro","name":"Mi:dm K 3.0 Pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":261795,"output":235615},"cost":{"input":0.2,"output":0.8,"cache_read":0.04}},"nousresearch/hermes-4-405b":{"id":"nousresearch/hermes-4-405b","name":"Hermes 4 405B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"hermes","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":1,"output":3,"cache_read":0.2},"canonical_model_id":"nousresearch/hermes-4-405b"},"~unbiased/pareto-latest":{"id":"~unbiased/pareto-latest","name":"Pareto Latest","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"~google/gemini-pro-latest":{"id":"~google/gemini-pro-latest","name":"Gemini Pro Latest","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["audio","pdf","image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":2,"output":10,"reasoning":10,"cache_read":0.1,"cache_write":0.1875,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}}},"~google/gemini-flash-latest":{"id":"~google/gemini-flash-latest","name":"Gemini Flash Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"reasoning":3.75,"cache_read":0.075,"cache_write":0.041667,"input_audio":0.75}},"thedrummer/unslopnemo-12b":{"id":"thedrummer/unslopnemo-12b","name":"UnslopNemo 12B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-11-08","last_updated":"2024-11-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":819200},"cost":{"input":0.4,"output":0.4},"canonical_model_id":"thedrummer/unslopnemo-12b"},"thedrummer/cydonia-24b-v4.1":{"id":"thedrummer/cydonia-24b-v4.1","name":"Cydonia 24B V4.1","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-09-27","last_updated":"2025-09-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.3,"output":0.5,"cache_read":0.15},"canonical_model_id":"thedrummer/cydonia-24b-v4.1"},"thedrummer/skyfall-36b-v2":{"id":"thedrummer/skyfall-36b-v2","name":"Skyfall 36B V2","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2025-03-10","last_updated":"2025-03-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":29491},"cost":{"input":0.55,"output":0.8,"cache_read":0.25},"canonical_model_id":"thedrummer/skyfall-36b-v2"},"tencent/hy-mt2-7b":{"id":"tencent/hy-mt2-7b","name":"Hy-MT2-7B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.074,"output":0.295},"canonical_model_id":"tencent/hy-mt2-7b"},"tencent/hy-mt2-30b-a3b":{"id":"tencent/hy-mt2-30b-a3b","name":"Hy-MT2-30B-A3B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.074,"output":0.295},"canonical_model_id":"tencent/hy-mt2-30b-a3b"},"tencent/hunyuan-a13b-instruct":{"id":"tencent/hunyuan-a13b-instruct","name":"Hunyuan A13B Instruct","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"hunyuan","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-07-08","last_updated":"2025-07-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.14,"output":0.57}},"tencent/hy4":{"id":"tencent/hy4","name":"Hy4","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"cost":{"input":0.417,"output":1.2505,"cache_read":0.021},"canonical_model_id":"tencent/hy4"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":128000},"cost":{"input":0.132,"output":0.528,"cache_read":0.033},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"tencent/hy-mt2-1.8b":{"id":"tencent/hy-mt2-1.8b","name":"Hy-MT2-1.8B","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":4096},"cost":{"input":0.044,"output":0.177},"canonical_model_id":"tencent/hy-mt2-1.8b"},"tencent/hy3-preview":{"id":"tencent/hy3-preview","name":"Hy3 preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.18,"output":0.6,"cache_read":0.06},"canonical_model_id":"tencent/hy3-preview"},"mistralai/voxtral-small-24b-2507":{"id":"mistralai/voxtral-small-24b-2507","name":"Voxtral Small 24B 2507","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":26214},"cost":{"input":0.1,"output":0.3,"cache_read":0.01},"canonical_model_id":"mistral/voxtral-small-24b-2507"},"mistralai/mistral-large-4-0":{"id":"mistralai/mistral-large-4-0","name":"Mistral Large 4","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":262144},"cost":{"input":0.7,"output":2.1,"cache_read":0.07},"canonical_model_id":"mistral/mistral-large-4"},"mistralai/codestral-2508":{"id":"mistralai/codestral-2508","name":"Codestral 25.08","description":"Mistral coding model for code completion, generation, and developer workflows","family":"codestral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-30","last_updated":"2025-07-30","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":204800},"cost":{"input":0.3,"output":0.9,"cache_read":0.03},"canonical_model_id":"mistral/codestral-2508"},"mistralai/mistral-small-3.1-24b-instruct":{"id":"mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":102400},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"mistral/mistral-small-3.1-24b-instruct"},"mistralai/mixtral-8x22b-instruct":{"id":"mistralai/mixtral-8x22b-instruct","name":"Mixtral 8x22B Instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-01-31","release_date":"2024-04-17","last_updated":"2024-04-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":52428},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mixtral-8x22b-instruct"},"mistralai/mistral-medium-3-5":{"id":"mistralai/mistral-medium-3-5","name":"Mistral Medium 3.5","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":209715},"cost":{"input":1.5,"output":7.5},"canonical_model_id":"mistral/mistral-medium-3-5"},"mistralai/mistral-large-2512":{"id":"mistralai/mistral-large-2512","name":"Mistral Large 3","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistralai/ministral-3b-2512":{"id":"mistralai/ministral-3b-2512","name":"Ministral 3 3B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":0.1,"output":0.1,"cache_read":0.01},"canonical_model_id":"mistral/ministral-3b-2512"},"mistralai/ministral-8b-2512":{"id":"mistralai/ministral-8b-2512","name":"Ministral 3 8B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.15,"output":0.15,"cache_read":0.015},"canonical_model_id":"mistral/ministral-8b-2512"},"mistralai/mistral-large-2407":{"id":"mistralai/mistral-large-2407","name":"Mistral Large 2407","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-03-31","release_date":"2024-07-24","last_updated":"2024-07-24","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":104857},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large-2407"},"mistralai/mistral-small-24b-instruct-2501":{"id":"mistralai/mistral-small-24b-instruct-2501","name":"Mistral Small 3","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-01-30","last_updated":"2025-01-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":16384},"cost":{"input":0.05,"output":0.08},"canonical_model_id":"mistral/mistral-small-24b-instruct-2501"},"mistralai/mistral-small-3.2-24b-instruct":{"id":"mistralai/mistral-small-3.2-24b-instruct","name":"Mistral Small 3.2 24B","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-31","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":26214},"cost":{"input":0.1,"output":0.3,"cache_read":0.01},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"mistralai/mistral-medium-3.1":{"id":"mistralai/mistral-medium-3.1","name":"Mistral Medium 3.1","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-30","release_date":"2025-08-12","last_updated":"2025-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-3.1"},"mistralai/mistral-small-2603":{"id":"mistralai/mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/mistral-nemo":{"id":"mistralai/mistral-nemo","name":"Mistral Nemo","description":"Efficient Mistral-NVIDIA open model for multilingual chat and local deployment","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.029,"output":0.03},"canonical_model_id":"mistral/mistral-nemo"},"mistralai/devstral-2512":{"id":"mistralai/devstral-2512","name":"Devstral 2","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/devstral-2512"},"mistralai/mistral-saba":{"id":"mistralai/mistral-saba","name":"Saba","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-02-17","last_updated":"2025-02-17","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":26214},"cost":{"input":0.2,"output":0.6,"cache_read":0.02},"canonical_model_id":"mistral/mistral-saba"},"mistralai/mistral-large":{"id":"mistralai/mistral-large","name":"Mistral Large","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11-30","release_date":"2024-02-26","last_updated":"2024-02-26","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":102400},"cost":{"input":2,"output":6,"cache_read":0.2},"canonical_model_id":"mistral/mistral-large"},"mistralai/mistral-medium-3":{"id":"mistralai/mistral-medium-3","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":104857},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-3"},"mistralai/ministral-14b-2512":{"id":"mistralai/ministral-14b-2512","name":"Ministral 3 14B 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":209715},"cost":{"input":0.2,"output":0.2,"cache_read":0.02},"canonical_model_id":"mistral/ministral-14b-2512"},"microsoft/phi-4":{"id":"microsoft/phi-4","name":"Phi 4","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"phi","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-06-30","release_date":"2025-01-10","last_updated":"2025-01-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":14745},"cost":{"input":0.07,"output":0.14}},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.2375,"output":8.4085,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.65,"output":3.41,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 Instruct 0905","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.192,"output":16,"cache_read":0.182},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.532,"output":3.325,"cache_read":0.209},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/kimi-k2":{"id":"moonshotai/kimi-k2","name":"Kimi K2 0711","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-12-31","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.6,"output":3.5,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2-thinking":{"id":"moonshotai/kimi-k2-thinking","name":"Kimi K2 Thinking","description":"Thinking Kimi model for slower research passes, planning, and hard technical questions","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":98304},"cost":{"input":0.6,"output":2.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"perceptron/perceptron-mk1":{"id":"perceptron/perceptron-mk1","name":"Perceptron Mk1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-05-12","last_updated":"2026-05-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":0.15,"output":1.5},"canonical_model_id":"perceptron/perceptron-mk1"},"perceptron/perceptron-mk1.5":{"id":"perceptron/perceptron-mk1.5","name":"Perceptron Mk1.5","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-25","last_updated":"2026-09-25","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":36864,"output":8192},"cost":{"input":0.15,"output":1.5}},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":942818},"cost":{"input":0.1,"output":0.4,"cache_read":0.03},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-6-sol-pro":{"id":"openai/gpt-6-sol-pro","name":"GPT-6 Sol Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}}},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.075,"output":0.3,"cache_read":0.0375},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-5-image":{"id":"openai/gpt-5-image","type":"image","name":"GPT-5 Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2024-10-01","release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["image","text","pdf"],"output":["image","text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":10,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-5-image"},"openai/gpt-5.6-terra-pro":{"id":"openai/gpt-5.6-terra-pro","name":"GPT-5.6 Terra Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-chat-latest":{"id":"openai/gpt-chat-latest","name":"GPT Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-05-05","last_updated":"2026-05-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5}},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna-pro":{"id":"openai/gpt-6-luna-pro","name":"GPT-6 Luna Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}}},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-3.5-turbo-16k":{"id":"openai/gpt-3.5-turbo-16k","name":"GPT-3.5 Turbo 16k","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2021-09-30","release_date":"2023-08-28","last_updated":"2023-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"cost":{"input":3,"output":4}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.03,"output":0.13,"cache_read":0.03},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-6-astra-pro":{"id":"openai/gpt-6-astra-pro","name":"GPT-6 Astra Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}}},"openai/gpt-audio":{"id":"openai/gpt-audio","type":"chat","name":"GPT-Audio","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"input_audio":32,"output_audio":64},"canonical_model_id":"openai/gpt-audio"},"openai/gpt-4":{"id":"openai/gpt-4","name":"GPT-4","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":4096},"cost":{"input":30,"output":60},"canonical_model_id":"openai/gpt-4"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-6.1-sol-pro":{"id":"openai/gpt-6.1-sol-pro","name":"GPT-6.1 Sol Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}}},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-4o-mini-2024-07-18":{"id":"openai/gpt-4o-mini-2024-07-18","name":"GPT-4o-mini (2024-07-18)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-4o-2024-05-13":{"id":"openai/gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":5,"output":15},"canonical_model_id":"openai/gpt-4o-2024-05-13"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["image","text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna-pro":{"id":"openai/gpt-5.6-luna-pro","name":"GPT-5.6 Luna Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-6.1-terra-pro":{"id":"openai/gpt-6.1-terra-pro","name":"GPT-6.1 Terra Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}}},"openai/gpt-audio-mini":{"id":"openai/gpt-audio-mini","type":"chat","name":"GPT-Audio Mini","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","audio"],"output":["text","audio"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.6,"output":2.4,"input_audio":0.6,"output_audio":2.4},"canonical_model_id":"openai/gpt-audio-mini"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-image-2":{"id":"openai/gpt-5.4-image-2","type":"image","name":"GPT-5.4 Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":false,"structured_output":true,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["image","text","pdf"],"output":["image","text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":8,"output":15,"cache_read":2},"canonical_model_id":"openai/gpt-5.4-image-2"},"openai/o3-pro":{"id":"openai/o3-pro","name":"o3-pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","pdf","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-3.5-turbo-0613":{"id":"openai/gpt-3.5-turbo-0613","name":"GPT-3.5 Turbo (older v0613)","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2021-09-30","release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":4095,"output":3685},"cost":{"input":1,"output":2}},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":65536},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5-image-mini":{"id":"openai/gpt-5-image-mini","type":"image","name":"GPT-5 Image Mini","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-10-16","last_updated":"2025-10-16","modalities":{"input":["pdf","image","text"],"output":["image","text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":2.5,"output":2,"cache_read":0.25},"canonical_model_id":"openai/gpt-5-image-mini"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"openai/gpt-5.6-sol-pro":{"id":"openai/gpt-5.6-sol-pro","name":"GPT-5.6 Sol Pro","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"elorian/glimpse":{"id":"elorian/glimpse","name":"Glimpse","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":256000},"cost":{"input":0.6,"output":3,"cache_read":0.06}},"cognitivecomputations/dolphin-mistral-24b-venice-edition":{"id":"cognitivecomputations/dolphin-mistral-24b-venice-edition","name":"Uncensored","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04-30","release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.2,"output":0.9},"canonical_model_id":"cognitivecomputations/dolphin-mistral-24b-venice-edition"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-r-plus-08-2024"},"cohere/command-r7b-12-2024":{"id":"cohere/command-r7b-12-2024","name":"Command R7B","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-12-2024"},"cohere/command-a-plus":{"id":"cohere/command-a-plus","name":"Command A+","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04-01","release_date":"2026-05-20","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":192000,"output":64000},"cost":{"input":0.3,"output":1.5,"cache_read":0.15},"canonical_model_id":"cohere/command-a-plus-05-2026"},"cohere/command-r-08-2024":{"id":"cohere/command-r-08-2024","name":"Command R","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"cohere/command-r-08-2024"},"cohere/command-a":{"id":"cohere/command-a","name":"Command A","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-31","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a"},"cohere/north-mini-code:free":{"id":"cohere/north-mini-code:free","name":"North Mini Code (free)","description":"Cohere coding model for practical software engineering and agentic edits","family":"north","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09-23","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0,"output":0},"canonical_model_id":"cohere/north-mini-code-1-0"},"ricursiveai/ripple-65b-preview":{"id":"ricursiveai/ripple-65b-preview","name":"Ripple 65B Preview","description":"Preview model for early access evaluation, prototyping, and compatibility testing","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.2,"output":0.6,"cache_read":0.05}},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":131072},"cost":{"input":0.435,"output":0.87,"cache_read":0.0036},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-pro-ultraspeed":{"id":"xiaomi/mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","description":"MiMo pro model for strong multimodal reasoning and agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":4.35,"output":8.7,"cache_read":0.036},"canonical_model_id":"xiaomi/mimo-v2.6-pro-ultraspeed"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo flash model for fast multimodal assistance and agent workflows","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1050000,"output":131072},"cost":{"input":0.14,"output":0.28,"cache_read":0.0028},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"xiaomi/mimo-v2.5":{"id":"xiaomi/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"status":"deprecated","cost":{"input":0.4,"output":2,"cache_read":0.08},"canonical_model_id":"xiaomi/mimo-v2.5"},"xiaomi/mimo-v2.5-pro":{"id":"xiaomi/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":235929},"status":"deprecated","cost":{"input":0.48,"output":1.8,"cache_read":0.096},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"ibm-granite/granite-4.2-8b":{"id":"ibm-granite/granite-4.2-8b","name":"Granite 4.2 8B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"granite","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-25","last_updated":"2026-08-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.06,"output":0.15,"cache_read":0.015},"canonical_model_id":"ibm/granite-4.2-8b"},"mancer/weaver":{"id":"mancer/weaver","name":"Weaver (alpha)","description":"General-purpose chat model for instruction following, writing, and analysis","family":"alpha","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-08-02","last_updated":"2023-08-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8000,"output":6000},"cost":{"input":0.3,"output":0.5,"cache_read":0.3},"canonical_model_id":"mancer/weaver"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.27,"output":1.08,"cache_read":0.027},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"MiniMax multimodal coding model for long-context reasoning and agent tasks","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":176947},"cost":{"input":0.21,"output":0.84,"cache_read":0.042},"canonical_model_id":"minimax/MiniMax-M2.7"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":262144},"cost":{"input":0.45,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling-2-small:free":{"id":"thinkingmachines/inkling-2-small:free","name":"Inkling 2 Small (free)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-11-05","last_updated":"2026-11-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"thinkingmachines/inkling-2-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":471859},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"reflection/beam-1.0-501b-a23b":{"id":"reflection/beam-1.0-501b-a23b","name":"Beam 1.0 501B A23B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"beam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-06-30","release_date":"2026-10-05","last_updated":"2026-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.3,"output":1,"cache_read":0.04},"canonical_model_id":"reflection/beam-1.0-501b-a23b"},"upstage/solar-pro4":{"id":"upstage/solar-pro4","name":"Solar Pro 4","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.03},"canonical_model_id":"upstage/solar-pro4"},"upstage/solar-mini4":{"id":"upstage/solar-mini4","name":"Solar Mini 4","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"solar-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.05,"output":0.2,"cache_read":0.005},"canonical_model_id":"upstage/solar-mini4"},"prism-ml/ternary-bonsai-2-27b":{"id":"prism-ml/ternary-bonsai-2-27b","name":"Ternary Bonsai 2 27B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.075,"output":0.5,"cache_read":0.0375}},"prism-ml/ternary-bonsai-2-9b":{"id":"prism-ml/ternary-bonsai-2-9b","name":"Ternary Bonsai 2 9B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-16","last_updated":"2026-10-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.08,"output":0.13,"cache_read":0.04}},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-wonder":{"id":"meta/muse-wonder","name":"Muse Wonder","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":4,"output":20,"cache_read":0.2}},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-08-21","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":262144},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/muse-ember":{"id":"meta/muse-ember","name":"Muse Ember","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.5,"cache_read":0.004,"cache_write":0.125}},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.3,"output":1.2,"cache_read":0.04},"canonical_model_id":"meta/muse-glimmer-30b"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.3-contributor":{"id":"meta/muse-spark-1.3-contributor","name":"Muse Spark 1.3 Contributor","description":"Open Llama multimodal model for image understanding and text reasoning","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.1,"output":0.2,"cache_read":0.002}},"~openai/gpt-terra-latest":{"id":"~openai/gpt-terra-latest","name":"GPT Terra Latest","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}}},"~openai/gpt-mini-latest":{"id":"~openai/gpt-mini-latest","name":"GPT Mini Latest","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075}},"~openai/gpt-sol-latest":{"id":"~openai/gpt-sol-latest","name":"GPT Sol Latest","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}}},"~openai/gpt-luna-latest":{"id":"~openai/gpt-luna-latest","name":"GPT Luna Latest","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}}},"~openai/gpt-astra-latest":{"id":"~openai/gpt-astra-latest","name":"GPT Astra Latest","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["pdf","image","text"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}}},"stepfun/step-5-preview":{"id":"stepfun/step-5-preview","name":"Step 5 Preview","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":64000},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/step-3.7-flash":{"id":"stepfun/step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":256000,"output":230400},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"stepfun/step-3.5-flash":{"id":"stepfun/step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"stepfun/step-3.5-flash"},"fireworks/ember-1":{"id":"fireworks/ember-1","name":"Ember-1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"fireworks/ember-1"},"recursive/flint-v1.0:free":{"id":"recursive/flint-v1.0:free","name":"Flint (free)","description":"Free provider route for experiments, demos, and cost-sensitive chat workloads","family":"flint","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-21","last_updated":"2026-10-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0,"output":0}},"undi95/remm-slerp-l2-13b":{"id":"undi95/remm-slerp-l2-13b","name":"ReMM SLERP 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-06-30","release_date":"2023-07-22","last_updated":"2023-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":6144,"output":5529},"cost":{"input":0.3,"output":0.5,"cache_read":0.2},"canonical_model_id":"undi95/remm-slerp-l2-13b"},"openrouter/pareto-code":{"id":"openrouter/pareto-code","name":"Pareto Code Router","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":200000}},"openrouter/free":{"id":"openrouter/free","name":"Free Models Router","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-01","last_updated":"2026-02-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":200000,"output":8000},"cost":{"input":0,"output":0}},"openrouter/fusion":{"id":"openrouter/fusion","name":"Fusion","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000}},"openrouter/auto":{"id":"openrouter/auto","name":"Auto Router","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2023-11-08","last_updated":"2023-11-08","modalities":{"input":["text","image","audio","pdf","video"],"output":["text","image"]},"open_weights":false,"limit":{"context":2000000,"output":2000000}},"openrouter/bodybuilder":{"id":"openrouter/bodybuilder","name":"Body Builder (beta)","description":"Preview model for early access evaluation, prototyping, and compatibility testing","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-12-05","last_updated":"2025-12-05","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000}},"~z-ai/glm-latest":{"id":"~z-ai/glm-latest","name":"GLM Latest","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-19","last_updated":"2026-08-19","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0699,"output":1.4,"cache_read":0.0689}},"~z-ai/glm-flash-latest":{"id":"~z-ai/glm-flash-latest","name":"GLM Flash Latest","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.0399,"output":0.0784,"cache_read":0.03}},"dots-studio/dots-3-note-preview:free":{"id":"dots-studio/dots-3-note-preview:free","name":"Dots3-Note Preview (free)","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":460800},"status":"deprecated","cost":{"input":0,"output":0}},"unbiased/pareto-26.10-preview":{"id":"unbiased/pareto-26.10-preview","name":"Pareto 26.10 Preview","description":"Preview model for early access evaluation, prototyping, and compatibility testing","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"unbiased/pareto-26.10":{"id":"unbiased/pareto-26.10","name":"Pareto 26.10","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.8,"output":3.2,"cache_read":0.03}},"unbiased/pareto-26.9":{"id":"unbiased/pareto-26.9","name":"Pareto 26.9","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.25}},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.007,"output":6.8,"cache_read":0.006},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-4.6v":{"id":"z-ai/glm-4.6v","name":"GLM-4.6V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9,"cache_read":0.055},"canonical_model_id":"zhipuai/glm-4.6v"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5.3-flashx-legal":{"id":"z-ai/glm-5.3-flashx-legal","name":"GLM 5.3 FlashX Legal","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"z-ai/glm-4.5":{"id":"z-ai/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"status":"deprecated","cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.0699,"output":1.4,"cache_read":0.0689},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.0399,"output":0.0784,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-4.5-air":{"id":"z-ai/glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.5,"output":2,"cache_read":0.1},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-4.5v":{"id":"z-ai/glm-4.5v","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6,"output":1.8,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.5v"},"z-ai/glm-5.3-flashx":{"id":"z-ai/glm-5.3-flashx","name":"GLM 5.3 FlashX","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-18","last_updated":"2026-09-18","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075}},"z-ai/glm-5.3-prime":{"id":"z-ai/glm-5.3-prime","name":"GLM 5.3 Prime","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-23","last_updated":"2026-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.8,"output":8.8,"cache_read":0.56}},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["image","text","video"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"z-ai/glm-4.7-flash":{"id":"z-ai/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_details"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":117964},"cost":{"input":0.0605,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"meta-llama/llama-3.2-3b-instruct":{"id":"meta-llama/llama-3.2-3b-instruct","name":"Llama 3.2 3B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.05,"output":0.33},"canonical_model_id":"meta/llama-3.2-3b-instruct"},"meta-llama/llama-guard-4-12b":{"id":"meta-llama/llama-guard-4-12b","name":"Llama Guard 4 12B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0.18,"output":0.18},"canonical_model_id":"meta/llama-guard-4-12b"},"meta-llama/llama-4-maverick":{"id":"meta-llama/llama-4-maverick","name":"Llama 4 Maverick","description":"Open multimodal Llama model for strong reasoning and fast responses","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":32768},"cost":{"input":0.35,"output":1,"cache_read":0.17},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/llama-3.1-8b-instruct":{"id":"meta-llama/llama-3.1-8b-instruct","name":"Llama-3.1-8B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.02,"output":0.04},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/llama-3.1-70b-instruct":{"id":"meta-llama/llama-3.1-70b-instruct","name":"Llama-3.1-70B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"meta-llama/llama-3.3-70b-instruct":{"id":"meta-llama/llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":115200},"cost":{"input":0.71,"output":0.71,"cache_read":0.71},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"meta-llama/llama-4-scout":{"id":"meta-llama/llama-4-scout","name":"Llama 4 Scout","description":"Open multimodal Llama model for long-context analysis and efficient agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"output":16384},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"meta-llama/llama-3.2-1b-instruct":{"id":"meta-llama/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":60000,"output":54000},"cost":{"input":0.027,"output":0.201},"canonical_model_id":"meta/llama-3.2-1b-instruct"},"liquid/lfm-3-1.7b":{"id":"liquid/lfm-3-1.7b","name":"LFM3-1.7B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.08,"output":0.2,"cache_read":0.02}},"liquid/lfm-2.5-24b-a2b":{"id":"liquid/lfm-2.5-24b-a2b","name":"LFM2.5-24B-A2B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.05,"output":0.7,"cache_read":0.025}},"liquid/lfm-2.5-2.6b":{"id":"liquid/lfm-2.5-2.6b","name":"LFM2.5-2.6B","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.35,"output":0.5,"cache_read":0.04}},"liquid/lfm-3-1.7b:free":{"id":"liquid/lfm-3-1.7b:free","name":"LFM3-1.7B (free)","description":"Free provider route for experiments, demos, and cost-sensitive chat workloads","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-06","last_updated":"2026-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0,"output":0}},"liquid/lfm-2.5-2.6b:free":{"id":"liquid/lfm-2.5-2.6b:free","name":"LFM2.5-2.6B (free)","description":"Free provider route for experiments, demos, and cost-sensitive chat workloads","family":"liquid","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":8192},"cost":{"input":0,"output":0}},"nex-agi/nex-n2.5-pro":{"id":"nex-agi/nex-n2.5-pro","name":"Nex-N2.5-Pro","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.075,"output":0.25,"cache_read":0.015}},"nex-agi/nex-n2.5-mini":{"id":"nex-agi/nex-n2.5-mini","name":"Nex-N2.5-Mini","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.025,"output":0.1,"cache_read":0.0025}},"nex-agi/nex-n2.6":{"id":"nex-agi/nex-n2.6","name":"Nex-N2.6","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"agi","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.12,"output":0.4,"cache_read":0.024}},"moondream/moondream3-preview":{"id":"moondream/moondream3-preview","name":"Moondream 3 Preview","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"moondream/moondream3.1-9b-a2b":{"id":"moondream/moondream3.1-9b-a2b","name":"Moondream 3.1","description":"Multimodal reasoning model for visual analysis, planning, and tool use","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":4096},"cost":{"input":0.3,"output":2.5}},"~x-ai/grok-latest":{"id":"~x-ai/grok-latest","name":"Grok Latest","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":450000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":0,"tiers":[{"input":4,"output":12,"cache_read":1,"cache_write":0,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1,"cache_write":0}}},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free":{"id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free","name":"Nemotron 3 Nano Omni (free)","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":182520},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.06,"output":0.24,"cache_read":0.012},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/nemotron-3.5-super-vl":{"id":"nvidia/nemotron-3.5-super-vl","name":"Nemotron 3.5 Super VL","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":943718},"cost":{"input":0.15,"output":0.47,"cache_read":0.02},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-super-vl:free":{"id":"nvidia/nemotron-3.5-super-vl:free","name":"Nemotron 3.5 Super VL (free)","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/nemotron-3.5-lightning":{"id":"nvidia/nemotron-3.5-lightning","name":"Nemotron 3.5 Lightning 30B A3B","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.07,"output":0.2,"cache_read":0.04},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3.5-lightning:free":{"id":"nvidia/nemotron-3.5-lightning:free","name":"Nemotron 3.5 Lightning (free)","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3-ultra-550b-a55b:free":{"id":"nvidia/nemotron-3-ultra-550b-a55b:free","name":"Nemotron 3 Ultra (free)","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.075,"output":0.4},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"nvidia/nemotron-3.5-content-safety":{"id":"nvidia/nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":117964},"cost":{"input":0.2,"output":0.2},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"~anthropic/claude-sonnet-latest":{"id":"~anthropic/claude-sonnet-latest","name":"Claude Sonnet Latest","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5}},"~anthropic/claude-fable-latest":{"id":"~anthropic/claude-fable-latest","name":"Claude Fable Latest","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10}},"~anthropic/claude-opus-latest":{"id":"~anthropic/claude-opus-latest","name":"Claude Opus Latest","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5}},"~anthropic/claude-haiku-latest":{"id":"~anthropic/claude-haiku-latest","name":"Claude Haiku Latest","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]}},"morph/morph-v3-large":{"id":"morph/morph-v3-large","name":"Morph V3 Large","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.9,"output":1.9},"canonical_model_id":"morph/morph-v3-large"},"morph/morph-v3-fast":{"id":"morph/morph-v3-fast","name":"Morph V3 Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.8,"output":1.2},"canonical_model_id":"morph/morph-v3-fast"},"gryphe/mythomax-l2-13b":{"id":"gryphe/mythomax-l2-13b","name":"MythoMax L2 13B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2023-08-10","last_updated":"2023-08-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":3686},"cost":{"input":0.08,"output":0.11},"canonical_model_id":"gryphe/mythomax-l2-13b"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra-v2":{"id":"sakana/fugu-ultra-v2","name":"Fugu Ultra v2","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-08-28","release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra-v2"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"sakana/sakana-namazu":{"id":"sakana/sakana-namazu","name":"Sakana Namazu","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"sakana-namazu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.95,"output":4,"cache_read":0.15},"canonical_model_id":"sakana/sakana-namazu"},"scaledown/extract":{"id":"scaledown/extract","name":"Extract","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":900000},"cost":{"input":0.04,"output":0}},"scaledown/summarize":{"id":"scaledown/summarize","name":"Summarize","description":"Multimodal model for analyzing text, images, documents, and rich media","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":4000},"cost":{"input":0.04,"output":0}},"sao10k/l3-lunaris-8b":{"id":"sao10k/l3-lunaris-8b","name":"Llama 3 8B Lunaris","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-13","last_updated":"2024-08-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":7372},"cost":{"input":0.04,"output":0.05},"canonical_model_id":"sao10k/l3-lunaris-8b"},"sao10k/l3.1-euryale-70b":{"id":"sao10k/l3.1-euryale-70b","name":"Llama 3.1 Euryale 70B v2.2","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2023-12-31","release_date":"2024-08-28","last_updated":"2024-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.85,"output":0.85},"canonical_model_id":"sao10k/l3.1-euryale-70b"},"bytedance-seed/seed-2.0-mini":{"id":"bytedance-seed/seed-2.0-mini","name":"Seed 2.0 Mini","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.1,"output":0.4,"tiers":[{"input":0.2,"output":0.8,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"bytedance-seed/seed-2.0-lite":{"id":"bytedance-seed/seed-2.0-lite","name":"Seed 2.0 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.25,"output":2,"tiers":[{"input":0.5,"output":4,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"bytedance-seed/seed-2-1-turbo":{"id":"bytedance-seed/seed-2-1-turbo","name":"Seed 2.1 Turbo","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":235929},"cost":{"input":0.5,"output":2.5},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"relace/relace-search":{"id":"relace/relace-search","name":"Relace Search","description":"Tool-capable chat model for instruction following and agentic application workflows","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":1,"output":3},"canonical_model_id":"relace/relace-search"},"relace/relace-apply-3":{"id":"relace/relace-apply-3","name":"Relace Apply 3","description":"General-purpose chat model for instruction following, writing, and analysis","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-09-26","last_updated":"2025-09-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.85,"output":1.25},"canonical_model_id":"relace/relace-apply-3"},"motif-technologies/motif-3":{"id":"motif-technologies/motif-3","name":"Motif 3","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"motif","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-11-02","last_updated":"2026-11-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.3,"output":1.2,"cache_read":0.06}},"inference-net/schematron-v2-turbo":{"id":"inference-net/schematron-v2-turbo","name":"Schematron V2 Turbo","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.03,"output":0.15,"cache_read":0.03},"canonical_model_id":"inference-net/schematron-v2-turbo"},"inference-net/schematron-v2-small":{"id":"inference-net/schematron-v2-small","name":"Schematron V2 Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.05,"output":0.23,"cache_read":0.05},"canonical_model_id":"inference-net/schematron-v2-small"}}},"volcengine-coding-plan":{"id":"volcengine-coding-plan","env":["ARK_CODING_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://ark.cn-beijing.volces.com/api/coding/v3","name":"Volcengine Ark Coding Plan","doc":"https://www.volcengine.com/docs/82379/1928261","models":{"doubao-seed-2.0-lite":{"id":"doubao-seed-2.0-lite","name":"Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k3"},"doubao-seed-2.1-turbo":{"id":"doubao-seed-2.1-turbo","name":"Seed 2.1 Turbo","description":"Faster ByteDance Seed 2.1 model for multimodal reasoning and latency-sensitive agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-pro"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M3"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"doubao-seed-evolving":{"id":"doubao-seed-evolving","name":"Seed Evolving","description":"Rolling ByteDance Seed model for rapidly updated reasoning, coding, and agent capabilities","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"bytedance-seed/seed-evolving"}}},"drun":{"id":"drun","env":["DRUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://chat.d.run/v1","name":"D.Run (China)","doc":"https://www.d.run","models":{"public/deepseek-r1":{"id":"public/deepseek-r1","name":"DeepSeek R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32000},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"deepseek/deepseek-r1"},"public/deepseek-v3":{"id":"public/deepseek-v3","name":"DeepSeek V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.28,"output":1.1},"canonical_model_id":"deepseek/deepseek-v3"},"public/minimax-m25":{"id":"public/minimax-m25","name":"MiniMax M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_details"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.29,"output":1.16},"canonical_model_id":"minimax/MiniMax-M2.5"}}},"submodel":{"id":"submodel","env":["SUBMODEL_INSTAGEN_ACCESS_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://llm.submodel.ai/v1","name":"submodel","doc":"https://submodel.gitbook.io","models":{"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":75000,"output":163840},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V3-0324":{"id":"deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":75000,"output":163840},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek R1 0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":75000,"output":163840},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"deepseek/deepseek-r1-0528"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"openai/gpt-oss-120b"},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3 235B A22B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.2,"output":0.6},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.2,"output":0.3},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8","name":"Qwen3 Coder 480B A35B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"zai-org/GLM-4.5-FP8":{"id":"zai-org/GLM-4.5-FP8","name":"GLM 4.5 FP8","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"zhipuai/glm-4.5"},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"GLM 4.5 Air","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-air","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"zhipuai/glm-4.5-air"}}},"sambanova":{"id":"sambanova","env":["SAMBANOVA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.sambanova.ai/v1","name":"SambaNova","doc":"https://docs.sambanova.ai/cloud/docs/get-started/supported-models","models":{"DeepSeek-V3.2":{"id":"DeepSeek-V3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":7168},"cost":{"input":3,"output":4.5},"canonical_model_id":"deepseek/deepseek-v3.2"},"gemma-4-31B-it":{"id":"gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.38,"output":1.15},"canonical_model_id":"google/gemma-4-31b-it"},"DeepSeek-V3.1":{"id":"DeepSeek-V3.1","name":"DeepSeek-V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":7168},"cost":{"input":3,"output":4.5},"canonical_model_id":"deepseek/deepseek-v3.1"},"Meta-Llama-3.3-70B-Instruct":{"id":"Meta-Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":3072},"cost":{"input":0.6,"output":1.2},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.6,"output":2.4,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.22,"output":0.59},"canonical_model_id":"openai/gpt-oss-120b"}}},"ainetcafe":{"id":"ainetcafe","env":["AINETCAFE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://microquickjs.com/v1","name":"ainetcafe","doc":"https://ainetcafe.com/k3/guides/","models":{"Kimi-K3":{"id":"Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":2.1,"output":10.5,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"}}},"moark":{"id":"moark","env":["MOARK_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://moark.com/v1","name":"Moark","doc":"https://moark.com/docs/openapi/v1#tag/%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90","models":{"DeepSeek-V4-Flash":{"id":"DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.5,"output":0.5},"canonical_model_id":"deepseek/deepseek-v4-flash"},"MiniMax-M2.1":{"id":"MiniMax-M2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.29,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.1"},"Qwen3.6-Flash":{"id":"Qwen3.6-Flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.18,"output":1.03},"canonical_model_id":"alibaba/qwen3.6-flash"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15},"canonical_model_id":"moonshotai/kimi-k3"},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.29,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.7"},"GLM-5.3":{"id":"GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.2,"output":4.18},"canonical_model_id":"zhipuai/glm-5.3"},"Kimi-K2.6":{"id":"Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.98,"output":4},"canonical_model_id":"moonshotai/kimi-k2.6"},"GLM-4.7":{"id":"GLM-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"status":"deprecated","cost":{"input":0.42,"output":2.2},"canonical_model_id":"zhipuai/glm-4.7"},"DeepSeek-V4-Pro":{"id":"DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.8,"output":3.6},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.3},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"}}},"inception":{"id":"inception","env":["INCEPTION_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.inceptionlabs.ai/v1/","name":"Inception","doc":"https://docs.inceptionlabs.ai/get-started/models","models":{"mercury-2":{"id":"mercury-2","name":"Mercury 2","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01-01","release_date":"2026-02-24","last_updated":"2026-02-24","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":50000},"cost":{"input":0.25,"output":0.75,"cache_read":0.025},"canonical_model_id":"inception/mercury-2"},"mercury-2.5":{"id":"mercury-2.5","name":"Mercury 2.5","description":"Mercury 2.5 is the fastest reasoning LLM, and the latest diffusion LLM (dLLM) from Inception","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-11-01","release_date":"2026-09-08","last_updated":"2026-09-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":260000,"output":65536},"cost":{"input":0.2,"output":0.75,"cache_read":0.02},"canonical_model_id":"inception/mercury-2.5"},"mercury-edit-2":{"id":"mercury-edit-2","name":"Mercury Edit 2","description":"Code editing dLLM for autocomplete (FIM) and next-edit suggestions","family":"mercury","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-30","last_updated":"2026-03-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8192},"cost":{"input":0.25,"output":0.75,"cache_read":0.025},"canonical_model_id":"inception/mercury-edit-2"},"mercury-3":{"id":"mercury-3","name":"Mercury 3","description":"Inception's diffusion reasoning model for chat, multi-step problem solving, and tool use","family":"mercury","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-16","last_updated":"2026-10-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.1,"output":0.35,"cache_read":0.01},"canonical_model_id":"inception/mercury-3"}}},"xiaomi-token-plan-ams":{"id":"xiaomi-token-plan-ams","env":["XIAOMI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://token-plan-ams.xiaomimimo.com/v1","name":"Xiaomi Token Plan (Europe)","doc":"https://platform.xiaomimimo.com/#/docs","models":{"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"mimo-v2.5-tts":{"id":"mimo-v2.5-tts","type":"speech","name":"MiMo-V2.5-TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts"},"mimo-v2.5-tts-voicedesign":{"id":"mimo-v2.5-tts-voicedesign","type":"speech","name":"MiMo-V2.5-TTS-VoiceDesign","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voicedesign"},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"mimo-v2.5-tts-voiceclone":{"id":"mimo-v2.5-tts-voiceclone","type":"speech","name":"MiMo-V2.5-TTS-VoiceClone","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"mimo","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5-tts-voiceclone"}}},"berget":{"id":"berget","env":["BERGET_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.berget.ai/v1","name":"Berget.AI","doc":"https://api.berget.ai","models":{"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B Instruct","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["audio","image","text","video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.280375,"output":0.56075},"canonical_model_id":"google/gemma-4-31b-it"},"mistralai/Mistral-Small-3.2-24B-Instruct-2506":{"id":"mistralai/Mistral-Small-3.2-24B-Instruct-2506","name":"Mistral Small 3.2 24B Instruct 2506","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-06-20","last_updated":"2025-06-20","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":8192},"cost":{"input":0.33645,"output":0.33645},"canonical_model_id":"mistral/mistral-small-3.2-24b-instruct"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":327680,"output":32768},"cost":{"input":3.3645,"output":16.8225,"cache_read":1.00935},"canonical_model_id":"moonshotai/kimi-k3"},"Qwen/Qwen3.8-27B-FP8":{"id":"Qwen/Qwen3.8-27B-FP8","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.46,"output":3.48},"canonical_model_id":"alibaba/qwen3.8-27b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":16384},"cost":{"input":0.29,"output":0.58},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":32768},"status":"deprecated","cost":{"input":1.54,"output":4.84},"canonical_model_id":"zhipuai/glm-5.2"}}},"github-copilot":{"id":"github-copilot","env":["GITHUB_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://api.githubcopilot.com","name":"GitHub Copilot","doc":"https://docs.github.com/en/copilot","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":936000,"output":64000},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"gemini-4-carbon":{"id":"gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-carbon"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":372000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.5"},"mai-code-1.1-flash":{"id":"mai-code-1.1-flash","name":"MAI-Code-1.1-Flash","description":"Microsoft coding model with native vision support, optimized for fast and efficient software development","family":"mai","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":128000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"microsoft/mai-code-1.1-flash"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"claude-opus-4.7":{"id":"claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":168000,"output":32000},"status":"deprecated","experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-opus-4.8":{"id":"claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":168000,"output":64000},"experimental":{"modes":{"fast":{"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"claude-opus-5.5":{"id":"claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-haiku-4.5":{"id":"claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":32000}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":136000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]},{"type":"budget_tokens","min":256,"max":24000}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":128000,"output":64000},"status":"deprecated","cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]},{"type":"budget_tokens","min":256,"max":32000}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":936000,"output":64000},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.6-flash"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":372000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"claude-fable-5.2":{"id":"claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"claude-fable-5.1":{"id":"claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-sonnet-4.6":{"id":"claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024,"max":32000}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"input":168000,"output":32000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"kimi-k2.7-code":{"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":224000,"output":32000},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":264000,"input":128000,"output":64000},"status":"deprecated","cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":936000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"claude-sonnet-5.5":{"id":"claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"claude-haiku-5.5":{"id":"claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.githubcopilot.com/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"input":372000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":936000,"output":64000},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"}}},"xpersona":{"id":"xpersona","env":["XPERSONA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://www.xpersona.co/v1","name":"Xpersona","doc":"https://www.xpersona.co/docs","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":1.5,"output":12,"reasoning":12,"cache_read":0.15},"canonical_model_id":"openai/gpt-5.5"},"xpersona-gpt-5.5":{"id":"xpersona-gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-12-30","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":3,"output":18,"reasoning":18,"cache_read":0.3},"canonical_model_id":"openai/gpt-5.5"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":0.375,"output":4,"reasoning":4,"cache_read":0.0375},"canonical_model_id":"openai/gpt-5.4-mini"},"xpersona-frieren-coder":{"id":"xpersona-frieren-coder","name":"Xpersona Frieren 1","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-30","release_date":"2026-05-01","last_updated":"2026-05-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":384000},"cost":{"input":1.5,"output":6,"reasoning":6,"cache_read":0.15}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":372000,"output":128000},"cost":{"input":1.5,"output":12,"reasoning":12,"cache_read":0.15},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.55,"output":12.2,"reasoning":12.2,"cache_read":0.155},"canonical_model_id":"google/gemini-3.5-flash"},"gpt-5.6":{"id":"gpt-5.6","name":"GPT-5.6","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":372000,"output":128000},"cost":{"input":1.5,"output":12,"reasoning":12,"cache_read":0.15},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":18.5,"reasoning":18.5,"cache_read":0.3},"canonical_model_id":"anthropic/claude-fable-5"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.75,"output":6,"reasoning":6,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":1.5,"output":9.25,"reasoning":9.25,"cache_read":0.15},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":372000,"output":128000},"cost":{"input":1.5,"output":2,"reasoning":2,"cache_read":0.15},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":0.9,"output":5.55,"reasoning":5.55,"cache_read":0.09},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":0.6,"output":3.7,"reasoning":3.7,"cache_read":0.06},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"oci":{"id":"oci","env":["OCI_GENAI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/openai/v1","name":"OCI Generative AI","doc":"https://docs.oracle.com/en-us/iaas/Content/generative-ai/pretrained-models.htm","models":{"xai.grok-4.20-non-reasoning":{"id":"xai.grok-4.20-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"openai.gpt-oss-120b":{"id":"openai.gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"meta.llama-4-scout-17b-16e-instruct":{"id":"meta.llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B Instruct","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":192000,"output":16384},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"xai.grok-4.6":{"id":"xai.grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"xai.grok-4.3":{"id":"xai.grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"meta.llama-4-maverick-17b-128e-instruct-fp8":{"id":"meta.llama-4-maverick-17b-128e-instruct-fp8","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":16384},"cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"openai.gpt-oss-20b":{"id":"openai.gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.07,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"meta.llama-3.3-70b-instruct":{"id":"meta.llama-3.3-70b-instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.72,"output":0.72},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"xai.grok-4.20-reasoning":{"id":"xai.grok-4.20-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"}}},"opper":{"id":"opper","env":["OPPER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.opper.ai/v3/compat","name":"Opper","doc":"https://opper.ai/models","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"muse-spark-1.3":{"id":"muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.825,"output":4.125,"cache_read":0.0825},"canonical_model_id":"google/gemini-3.8-flash"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.62708,"output":5.811},"canonical_model_id":"zhipuai/glm-5.2"},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.5"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"sonar-pro":{"id":"sonar-pro","name":"Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8000},"cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15},"canonical_model_id":"moonshotai/kimi-k3"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":45,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2.2,"output":11,"cache_read":0.22,"cache_write":2.75},"canonical_model_id":"anthropic/claude-sonnet-5"},"mistral-large-2512":{"id":"mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-2512"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.5811,"output":3},"canonical_model_id":"alibaba/qwen3.8-27b"},"sonar":{"id":"sonar","name":"Sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.11622,"output":0.488124},"canonical_model_id":"openai/gpt-oss-20b"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"mistral-small-2603":{"id":"mistral-small-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":0.5811,"output":2.44062},"canonical_model_id":"mistral/mistral-small-2603"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":1.78812,"output":3.57624},"canonical_model_id":"deepseek/deepseek-v4-pro"},"sonar-reasoning-pro":{"id":"sonar-reasoning-pro","name":"Sonar Reasoning Pro","description":"Web-grounded Sonar for multi-step research questions that need cited reasoning","family":"sonar-reasoning","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":2,"output":8},"canonical_model_id":"perplexity/sonar-reasoning-pro"},"qwen3.8-2.4t-a95b":{"id":"qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":2.5,"output":6,"cache_read":0.63},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.75,"output":4.6488,"cache_read":0.44},"canonical_model_id":"zhipuai/glm-5.3"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.12,"tiers":[{"input":1.2,"output":4.8,"cache_read":0.24,"tier":{"type":"context","size":524288}}],"context_over_200k":{"input":1.2,"output":4.8,"cache_read":0.24}},"canonical_model_id":"minimax/MiniMax-M3"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180},"canonical_model_id":"openai/gpt-5.5-pro"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.25,"output":0.66},"canonical_model_id":"deepseek/deepseek-v4-flash"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.2,"output":0.5,"cache_read":0.07},"canonical_model_id":"zhipuai/glm-5.3-flash"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8192},"cost":{"input":0.46488,"output":2.44062},"canonical_model_id":"google/gemma-4-31b-it"},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"qwen3.6-35b-a3b":{"id":"qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.248,"output":1.485},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"qwen3-coder-next":{"id":"qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0.5811,"output":2.3244},"canonical_model_id":"alibaba/qwen3-coder-next"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"grok-build-0.1":{"id":"grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":1.1622,"output":4.88124},"canonical_model_id":"openai/gpt-oss-120b"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"minimax-m2.7":{"id":"minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":131072},"cost":{"input":0.69732,"output":2.78928},"canonical_model_id":"minimax/MiniMax-M2.7"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":983616,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125,"tiers":[{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6.6,"output":24.75,"cache_read":0.66,"cache_write":8.25}},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3.3,"output":16.5,"cache_read":0.33,"cache_write":4.125},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":5.5,"output":27.5,"cache_read":0.55,"cache_write":6.875},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1.1,"output":5.5,"cache_read":0.11,"cache_write":1.375},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"liquid":{"id":"liquid","env":["LIQUID_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://router.inference.ai.exchange/v1","name":"Liquid Inference","doc":"https://inference.ai.exchange/docs","models":{"liquid.auto":{"id":"liquid.auto","name":"Liquid Auto","description":"Routes each request to the lowest-priced eligible offer on the Liquid Inference exchange","family":"auto","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-20","last_updated":"2026-10-20","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":10000000,"output":1048576}}}},"fastrouter":{"id":"fastrouter","env":["FASTROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://go.fastrouter.ai/api/v1","name":"FastRouter","doc":"https://fastrouter.ai/models","models":{"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.1":{"id":"anthropic/claude-opus-4.1","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":32000}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":32000}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5}},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4":{"id":"x-ai/grok-4","name":"Grok 4","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.75,"cache_write":15}},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}},"canonical_model_id":"xai/grok-build-0.1"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro"},"google/veo3.1":{"id":"google/veo3.1","type":"video","name":"Veo 3.1","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-15","last_updated":"2026-01","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":400000,"output":0},"canonical_model_id":"google/veo-3.1-generate-preview"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.1-flash-image-preview":{"id":"google/gemini-3.1-flash-image-preview","type":"image","name":"Nano Banana 2 Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text","image","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"google/veo3.1-fast":{"id":"google/veo3.1-fast","type":"video","name":"Veo 3.1 Fast","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-15","last_updated":"2026-01-01","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":400000,"output":0},"canonical_model_id":"google/veo-3.1-fast-generate-preview"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/veo3.1-lite":{"id":"google/veo3.1-lite","type":"video","name":"Veo 3.1 Lite","description":"Video model for prompt-guided generation, editing, and motion workflows","family":"veo","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-31","last_updated":"2026-03-31","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":400000,"output":0},"canonical_model_id":"google/veo-3.1-lite-generate-preview"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3-pro-image-preview":{"id":"google/gemini-3-pro-image-preview","type":"image","name":"Nano Banana Pro Preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12},"canonical_model_id":"google/gemini-3-pro-image-preview"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"google/gemma-4-31b-it"},"bytedance/seedance-2":{"id":"bytedance/seedance-2","type":"video","name":"Seedance 2","description":"ByteDance unified multimodal audio-video model supporting text, image, video and audio references, editing, extension and synchronized stereo sound.","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-12","last_updated":"2026-10-04","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":4096,"output":0},"canonical_model_id":"bytedance-seed/seedance-2.0"},"leonardo-ai/lucid-realism":{"id":"leonardo-ai/lucid-realism","type":"image","name":"Lucid Realism","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"lucid","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-01","last_updated":"2025-06-01","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":4096,"output":0}},"leonardo-ai/lucid-origin":{"id":"leonardo-ai/lucid-origin","type":"image","name":"Lucid Origin","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"lucid","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-06-01","last_updated":"2025-06-01","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":4096,"output":0}},"wanx/wan-v2-6":{"id":"wanx/wan-v2-6","type":"video","name":"Wan 2.6","description":"Video model for text- and image-to-video with audio input and synchronized sound","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-03","last_updated":"2025-12-03","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":400000,"output":0},"canonical_model_id":"alibaba/wan2.6"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.75,"output":3.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-10-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-image-2":{"id":"openai/gpt-image-2","type":"image","name":"GPT Image 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":128000,"output":0},"canonical_model_id":"openai/gpt-image-2"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.25,"cache_read":0.007},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-10-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2024-10-01","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.09,"output":0.36},"canonical_model_id":"openai/gpt-oss-120b"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.05,"output":3.5,"cache_read":0.205},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.08,"cache_read":0.12},"canonical_model_id":"zhipuai/glm-5"},"sarvam/sarvam-105b":{"id":"sarvam/sarvam-105b","name":"Sarvam 105B","description":"Flagship Indian-language reasoning model for enterprise multilingual applications","family":"sarvam","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-18","last_updated":"2026-02-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.04,"output":0.16,"cache_read":0.025},"canonical_model_id":"sarvam/sarvam-105b"}}},"scnet-token-plan":{"id":"scnet-token-plan","env":["SCNET_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.scnet.cn/api/llm/v1","name":"SCNet Token Plan","doc":"https://www.scnet.cn/ac/openapi/doc/2.0/moduleapi/plans/token-plan.html","models":{"Kimi-K3":{"id":"Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k3"},"DeepSeek-V4-Flash":{"id":"DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"GLM-5.3-Flash":{"id":"GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"Kimi-K2.7-Code":{"id":"Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"DeepSeek-V4-Flash-0731":{"id":"DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"GLM-5.2":{"id":"GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.2"},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMax-M2.7":{"id":"MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M2.7"},"Kimi-K2.5":{"id":"Kimi-K2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"GLM-5.3":{"id":"GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.3"},"Kimi-K2.6":{"id":"Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"Qwen3.8-Flash":{"id":"Qwen3.8-Flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-flash"},"Qwen3.8-Max":{"id":"Qwen3.8-Max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-max"},"GLM-5":{"id":"GLM-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5"},"GLM-5.1":{"id":"GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"zhipuai/glm-5.1"},"MiniMax-M3":{"id":"MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"minimax/MiniMax-M3"},"DeepSeek-V4-Pro":{"id":"DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-pro"},"DeepSeek-V4.1-Flash":{"id":"DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"DeepSeek-V4-Pro-0813":{"id":"DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"}}},"hetzner":{"id":"hetzner","env":["HETZNER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.hetzner.com/api/v1","name":"Hetzner","doc":"https://experiments.hetzner.com/docs/inference","models":{"Qwen3.8-27B":{"id":"Qwen3.8-27B","name":"Qwen3.8-27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"beta","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.6-35B-A3B-FP8":{"id":"Qwen/Qwen3.6-35B-A3B-FP8","name":"Qwen3.6 35B A3B FP8","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"beta","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"}}},"sap-ai-core":{"id":"sap-ai-core","env":["AICORE_SERVICE_KEY"],"npm":"@jerome-benoit/sap-ai-provider-v2","name":"SAP AI Core","doc":"https://help.sap.com/docs/sap-ai-core","models":{"amazon--titan-embed-text":{"id":"amazon--titan-embed-text","name":"amazon--titan-embed-text","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-04-30","last_updated":"2024-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":1536},"cost":{"input":0.02,"output":0}},"gpt-5.5":{"id":"gpt-5.5","name":"gpt-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"gemini-embedding":{"id":"gemini-embedding","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":1},"canonical_model_id":"google/gemini-embedding-001"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"gemini-2.5-flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"gpt-4.1-nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.1,"output":0.4},"canonical_model_id":"openai/gpt-4.1-nano"},"gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-3.8-flash"},"amazon--nova-lite":{"id":"amazon--nova-lite","name":"amazon--nova-lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"amazon/nova-2-lite"},"anthropic--claude-4.5-haiku":{"id":"anthropic--claude-4.5-haiku","name":"anthropic--claude-4.5-haiku","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic--claude-3-haiku":{"id":"anthropic--claude-3-haiku","name":"anthropic--claude-3-haiku","description":"Legacy model retained for compatibility with older integrations","family":"claude-haiku","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-08-31","release_date":"2024-03-13","last_updated":"2024-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":4096},"cost":{"input":0.25,"output":1.25,"cache_read":0.03,"cache_write":0.3},"canonical_model_id":"anthropic/claude-3-haiku-20240307"},"gpt-5.2":{"id":"gpt-5.2","name":"gpt-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"gpt-4.1-mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"anthropic--claude-4.6-sonnet":{"id":"anthropic--claude-4.6-sonnet","name":"anthropic--claude-4.6-sonnet","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic--claude-4.5-sonnet":{"id":"anthropic--claude-4.5-sonnet","name":"anthropic--claude-4.5-sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"text-embedding-3-large":{"id":"text-embedding-3-large","type":"embedding","name":"text-embedding-3-large","description":"Most capable OpenAI embedding model for English and non-English text","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":3072},"cost":{"input":0.13,"output":0},"canonical_model_id":"openai/text-embedding-3-large"},"gpt-5":{"id":"gpt-5","name":"gpt-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"nvidia--llama-nemotron-embed-1b":{"id":"nvidia--llama-nemotron-embed-1b","type":"embedding","name":"Llama Nemotron Embed 1B v2","description":"Multilingual text embedding model for retrieval and question answering pipelines","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-16","last_updated":"2025-10-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"canonical_model_id":"nvidia/llama-nemotron-embed-1b-v2"},"mistralai--mistral-medium-instruct":{"id":"mistralai--mistral-medium-instruct","name":"mistralai--mistral-medium-instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"status":"deprecated","cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/mistral-medium-2505"},"mistralai--mistral-medium":{"id":"mistralai--mistral-medium","name":"Mistral Medium 3.5","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"canonical_model_id":"mistral/mistral-medium-2604"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"gemini-2.5-pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"google/gemini-2.5-pro"},"sonar-pro":{"id":"sonar-pro","name":"sonar-pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"cost":{"input":3,"output":15},"canonical_model_id":"perplexity/sonar-pro"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"gpt-5.6-sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"tiers":[{"input":8,"output":30,"cache_read":0.8,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8}},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"gemini-3.5-flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"gpt-4.1":{"id":"gpt-4.1","name":"gpt-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"status":"deprecated","cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-3.6-flash"},"anthropic--claude-4.6-opus":{"id":"anthropic--claude-4.6-opus","name":"anthropic--claude-4.6-opus","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"canonical_model_id":"openai/gpt-6-luna"},"gemini-embedding-2":{"id":"gemini-embedding-2","type":"embedding","name":"Gemini Embedding 2","description":"Multimodal embedding model mapping text, images, video, audio, and PDFs into a unified embedding space","family":"gemini","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-11","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":3072},"canonical_model_id":"google/gemini-embedding-2"},"anthropic--claude-4.7-opus":{"id":"anthropic--claude-4.7-opus","name":"anthropic--claude-4.7-opus","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"sonar":{"id":"sonar","name":"sonar","description":"Fast web-grounded Sonar for current answers, citations, and lightweight retrieval","family":"sonar","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":1,"output":1},"canonical_model_id":"perplexity/sonar"},"amazon--nova-micro":{"id":"amazon--nova-micro","name":"amazon--nova-micro","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"nova-micro","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8192},"cost":{"input":0.035,"output":0.14},"canonical_model_id":"amazon/nova-micro"},"anthropic--claude-4-opus":{"id":"anthropic--claude-4-opus","name":"anthropic--claude-4-opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-20250514"},"text-embedding-3-small":{"id":"text-embedding-3-small","type":"embedding","name":"text-embedding-3-small","description":"Small, efficient OpenAI text embedding model","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-01-25","last_updated":"2024-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8191,"output":1536},"cost":{"input":0.02,"output":0},"canonical_model_id":"openai/text-embedding-3-small"},"anthropic--claude-4-sonnet":{"id":"anthropic--claude-4-sonnet","name":"anthropic--claude-4-sonnet","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"cohere--command-a-reasoning":{"id":"cohere--command-a-reasoning","name":"cohere--command-a-reasoning","description":"Cohere reasoning model for multilingual enterprise agents, tools, and complex workflows","family":"command-a","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]},{"type":"budget_tokens","min":1}],"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"status":"deprecated","cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-reasoning-08-2025"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"gemini-3.1-flash-lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"gemini-2.5-flash-lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"canonical_model_id":"openai/gpt-6-astra"},"mistralai--mistral-small":{"id":"mistralai--mistral-small","name":"mistralai--mistral-small","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"status":"deprecated","cost":{"input":0.15,"output":0.6},"canonical_model_id":"mistral/mistral-small-2603"},"gpt-5-mini":{"id":"gpt-5-mini","name":"gpt-5-mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"amazon--nova-pro":{"id":"amazon--nova-pro","name":"amazon--nova-pro","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"nova-pro","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-12-03","last_updated":"2024-12-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":300000,"output":8192},"cost":{"input":0.8,"output":3.2},"canonical_model_id":"amazon/nova-pro"},"anthropic--claude-4.8-opus":{"id":"anthropic--claude-4.8-opus","name":"anthropic--claude-4.8-opus","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"gpt-5.6-luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04}},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"canonical_model_id":"openai/gpt-6.1-sol"},"anthropic--claude-4.5-opus":{"id":"anthropic--claude-4.5-opus","name":"anthropic--claude-4.5-opus","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"gpt-5-nano":{"id":"gpt-5-nano","name":"gpt-5-nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"gpt-5.4":{"id":"gpt-5.4","name":"gpt-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"gpt-5.6-terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"openai/gpt-5.6-terra"},"nvidia--llama-3.2-nv-embedqa-1b":{"id":"nvidia--llama-3.2-nv-embedqa-1b","name":"nvidia--llama-3.2-nv-embedqa-1b","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":4096},"status":"deprecated"},"sonar-deep-research":{"id":"sonar-deep-research","name":"sonar-deep-research","description":"Sonar search model for autonomous research and citation-backed long-form reports","family":"sonar","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-02-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"cost":{"input":2,"output":8,"reasoning":3},"canonical_model_id":"perplexity/sonar-deep-research"},"sap-abap-1":{"id":"sap-abap-1","name":"sap-abap-1","description":"SAP-hosted model for ABAP code generation and enterprise development tasks","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-11-26","last_updated":"2025-11-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":4096},"status":"deprecated"}}},"umans-ai":{"id":"umans-ai","env":["UMANS_AI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.code.umans.ai/v1","name":"Umans AI","doc":"https://app.umans.ai/offers/code/docs/orgs","models":{"umans-deepseek-v4.1-flash":{"id":"umans-deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0.15,"output":0.6,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"umans-glm-5.3":{"id":"umans-glm-5.3","name":"GLM 5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"umans-deepseek-v4.1-flash-1017":{"id":"umans-deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0.15,"output":0.6,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"umans-glm-5.3-flash":{"id":"umans-glm-5.3-flash","name":"GLM 5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"umans-coder":{"id":"umans-coder","name":"Umans Coder","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131071},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"umans-flash":{"id":"umans-flash","name":"Umans Flash","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15,"output":1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"umans-kimi-k3":{"id":"umans-kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"umans-deepseek-v4-flash-0731":{"id":"umans-deepseek-v4-flash-0731","name":"DeepSeek V4 Flash","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393215},"cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"}}},"lilac":{"id":"lilac","env":["LILAC_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.getlilac.com/v1","name":"Lilac","doc":"https://docs.getlilac.com/inference/models","models":{"minimaxai/minimax-m3":{"id":"minimaxai/minimax-m3","name":"MiniMax M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"status":"deprecated","cost":{"input":0.28,"output":1.1,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M3"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262100,"output":262100},"status":"deprecated","cost":{"input":0.11,"output":0.35},"canonical_model_id":"google/gemma-4-31b-it"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.7,"output":3.5,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k2.6"},"zai-org/glm-5.2":{"id":"zai-org/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":524288},"status":"deprecated","cost":{"input":0.9,"output":3,"cache_read":0.27},"canonical_model_id":"zhipuai/glm-5.2"}}},"commandcode":{"id":"commandcode","env":["CMD_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.commandcode.ai/provider/v1","name":"CommandCode","doc":"https://commandcode.ai/docs/provider","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":0},"canonical_model_id":"openai/gpt-5.5"},"claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075,"cache_write":0},"canonical_model_id":"openai/gpt-5.4-mini"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25,"tiers":[{"input":10,"output":45,"cache_read":1,"cache_write":12.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1,"cache_write":12.5}},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"gpt-6-luna":{"id":"gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"gpt-6-sol":{"id":"gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":2,"output":8,"cache_read":0.5,"cache_write":0},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"gpt-6-astra":{"id":"gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":0},"canonical_model_id":"openai/gpt-5.4"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"mistral/mistral-large-4":{"id":"mistral/mistral-large-4","name":"Mistral Large 4","description":"Mistral's 1T-parameter multimodal MoE for reasoning, coding, and agentic work","family":"mistral-large","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-06","last_updated":"2026-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":262144},"cost":{"input":1.36,"output":4.18,"cache_read":0.14},"canonical_model_id":"mistral/mistral-large-4"},"deepseek/deepseek-v4-flash-fast":{"id":"deepseek/deepseek-v4-flash-fast","name":"DeepSeek V4 Flash Fast","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4.1-flash-fast":{"id":"deepseek/deepseek-v4.1-flash-fast","name":"DeepSeek V4.1 Flash Fast","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.16,"output":0.58,"cache_read":0.016},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4-flash"},"inclusionai/ling-3.1-flash:free":{"id":"inclusionai/ling-3.1-flash:free","name":"Ling 3.1 Flash","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"inclusionai/ling-3.1-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15,"cache_write":0.08334},"canonical_model_id":"google/gemini-3.7-flash"},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"tencent/hy3-paid":{"id":"tencent/hy3-paid","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0.14,"output":0.58,"cache_read":0.035},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":64000},"cost":{"input":0.834,"output":2.501,"cache_read":0.042},"canonical_model_id":"tencent/hy4-preview"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.7-Code-Highspeed":{"id":"moonshotai/Kimi-K2.7-Code-Highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":1000000},"cost":{"input":0.5,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"meta/muse-spark-1.3":{"id":"meta/muse-spark-1.3","name":"Muse Spark 1.3","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.3"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-wonder-1.0":{"id":"meta/muse-wonder-1.0","name":"Muse Wonder","description":"Muse Wonder is a frontier multimodal reasoning model from Meta for personal and professional agents, long-horizon coding, and computer use. It combines Active Memory, which carries relevant context across conversations, with Active Focus, which keeps it working through blockers toward a goal.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-12","last_updated":"2026-10-12","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":4,"output":20,"cache_read":0.2},"canonical_model_id":"meta/muse-wonder-1.0"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Muse Spark 1.2 (Contributor)","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"meta/muse-spark-1.3-contributor":{"id":"meta/muse-spark-1.3-contributor","name":"Muse Spark 1.3 (Contributor)","description":"Muse Spark 1.3 is a multimodal reasoning model from Meta for long-running agentic, multi-agent, and coding workflows. It improves long-horizon agent collaboration, instruction following, and coding efficiency relative to Muse Spark 1.2.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.3"},"stepfun/Step-3.5-Flash":{"id":"stepfun/Step-3.5-Flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.09,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash"},"stepfun/Step-5-Preview":{"id":"stepfun/Step-5-Preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":1000000},"cost":{"input":1,"output":2.7,"cache_read":0.05},"canonical_model_id":"stepfun/step-5-preview"},"stepfun/Step-3.7-Flash":{"id":"stepfun/Step-3.7-Flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5.3-flashx":{"id":"z-ai/glm-5.3-flashx","name":"GLM-5.3-FlashX","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.37,"output":1.25,"cache_read":0.075},"canonical_model_id":"zhipuai/glm-5.3-flash"},"Qwen/Qwen3.8-Max-0902":{"id":"Qwen/Qwen3.8-Max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"Qwen/Qwen3.8-Flash":{"id":"Qwen/Qwen3.8-Flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.16,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"Qwen/Qwen3.8-Max":{"id":"Qwen/Qwen3.8-Max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.4,"output":3,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3.8-Omni-Flash":{"id":"Qwen/Qwen3.8-Omni-Flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.2-Fast":{"id":"zai-org/GLM-5.2-Fast","name":"GLM-5.2-Fast","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":10.25,"cache_read":0.5},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"}}},"orcarouter":{"id":"orcarouter","env":["ORCAROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.orcarouter.ai/v1","name":"OrcaRouter","doc":"https://docs.orcarouter.ai","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":10},"canonical_model_id":"anthropic/claude-opus-5"},"deepseek/deepseek-v4-flash-free":{"id":"deepseek/deepseek-v4-flash-free","name":"DeepSeek V4 Flash (free)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-reasoner":{"id":"deepseek/deepseek-reasoner","name":"DeepSeek Reasoner","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.242,"output":0.726,"cache_read":0.0077},"canonical_model_id":"deepseek/deepseek-reasoner"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.66,"output":1.98,"cache_read":0.022},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-chat"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"grok/grok-4.5":{"id":"grok/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"grok/grok-4.3":{"id":"grok/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"grok/grok-4.6":{"id":"grok/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"google/gemini-flash-lite-latest":{"id":"google/gemini-flash-lite-latest","name":"Gemini Flash-Lite Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-flash-lite-latest"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.08333,"input_audio":3},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"google/gemini-flash-latest"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":4,"output":18,"cache_read":0.4},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemini-robotics-er-1.6-preview":{"id":"google/gemini-robotics-er-1.6-preview","name":"Gemini Robotics-ER 1.6 Preview","description":"Vision-language model for embodied reasoning: spatial understanding, task planning, and physical-world agentic robotics","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-14","last_updated":"2026-04-14","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":65536},"cost":{"input":1,"output":5},"canonical_model_id":"google/gemini-robotics-er-1.6-preview"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"input_audio":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-3.1-flash-lite-preview":{"id":"google/gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.13,"output":0.38,"cache_read":0.02},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.06,"output":0.33,"cache_read":0.0075},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.276,"output":1.651,"cache_read":0.0276,"cache_write":0.345,"tiers":[{"input":1.101,"output":6.602,"cache_read":0.1101,"cache_write":1.37625,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.101,"output":6.602,"cache_read":0.1101,"cache_write":1.37625}},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.4,"output":1.6},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen3-vl-235b-a22b-thinking":{"id":"qwen/qwen3-vl-235b-a22b-thinking","name":"Qwen3 VL 235B A22B Thinking","description":"Qwen vision-language thinking model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":40960},"cost":{"input":0.4,"output":4},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-thinking"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.33,"output":2.4},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.5-flash":{"id":"qwen/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":81920}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.172,"output":1.032,"tiers":[{"input":0.43,"output":2.58,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.057,"output":0.459,"tiers":[{"input":0.229,"output":1.835,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.35,"output":1.42,"cache_read":0.071,"tiers":[{"input":1.06,"output":4.25,"cache_read":0.21,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.06,"output":4.25,"cache_read":0.21}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.25,"output":3.75,"cache_read":0.25,"cache_write":1.563},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"tiers":[{"input":1,"output":4,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1,"output":4}},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":131072},"cost":{"input":0.03,"output":0.13,"cache_read":0.006,"cache_write":0.038,"tiers":[{"input":0.1,"output":0.4,"cache_read":0.02,"tier":{"type":"context","size":32000}},{"input":0.2,"output":0.8,"cache_read":0.04,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen3-max":{"id":"qwen/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.359,"output":1.434,"tiers":[{"input":0.574,"output":2.294,"tier":{"type":"context","size":32000}},{"input":1.004,"output":4.014,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3-max"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.248,"output":1.485},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2.4,"tiers":[{"input":0.5,"output":3,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.5,"output":3}},"canonical_model_id":"alibaba/qwen3.5-plus"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.086,"output":0.688,"tiers":[{"input":0.258,"output":2.064,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.115,"output":0.917,"tiers":[{"input":0.287,"output":2.294,"tier":{"type":"context","size":128000}}]},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"tencent/hy3-free":{"id":"tencent/hy3-free","name":"Hy3 (free)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"tencent/hy3"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0.18,"output":0.59,"cache_read":0.059},"canonical_model_id":"tencent/hy3"},"openai/gpt-5.2-pro":{"id":"openai/gpt-5.2-pro","name":"GPT-5.2 Pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":21,"output":168},"canonical_model_id":"openai/gpt-5.2-pro"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex":{"id":"openai/gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-5.1-chat-latest":{"id":"openai/gpt-5.1-chat-latest","name":"GPT-5.1 Chat","description":"Chat-tuned GPT-5.1 for polished assistants, writing, and product conversations","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"openai/gpt-4":{"id":"openai/gpt-4","name":"GPT-4","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":30,"output":60},"canonical_model_id":"openai/gpt-4"},"openai/gpt-5-pro":{"id":"openai/gpt-5-pro","name":"GPT-5 Pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":15,"output":120},"canonical_model_id":"openai/gpt-5-pro"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-4o-2024-05-13":{"id":"openai/gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":5,"output":15},"canonical_model_id":"openai/gpt-4o-2024-05-13"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":100000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-3.5-turbo":{"id":"openai/gpt-3.5-turbo","name":"GPT-3.5-turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"cost":{"input":0.5,"output":1.5,"cache_read":0},"canonical_model_id":"openai/gpt-3.5-turbo"},"openai/gpt-4-turbo":{"id":"openai/gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":10,"output":30},"canonical_model_id":"openai/gpt-4-turbo"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-5.2-chat-latest":{"id":"openai/gpt-5.2-chat-latest","name":"GPT-5.2 Chat","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-chat-latest"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"status":"deprecated","cost":{"input":0.03,"output":0.17},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5-chat-latest":{"id":"openai/gpt-5-chat-latest","name":"GPT-5 Chat (latest)","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":100000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-chat-latest"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"minimax/minimax-m2.5-highspeed":{"id":"minimax/minimax-m2.5-highspeed","name":"MiniMax-M2.5-highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"meta/muse-spark-1.1":{"id":"meta/muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"meta/muse-spark-1.2":{"id":"meta/muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"kimi/kimi-k2.6":{"id":"kimi/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"kimi/kimi-k3":{"id":"kimi/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"kimi/kimi-k2.5":{"id":"kimi/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.6,"output":3,"cache_read":0.1,"cache_write":0},"canonical_model_id":"moonshotai/kimi-k2.5"},"kimi/kimi-k2.7-code":{"id":"kimi/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"z-ai/glm-5.3-flash-free":{"id":"z-ai/glm-5.3-flash-free","name":"GLM-5.3-Flash (free)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-4.5":{"id":"z-ai/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.26,"output":3.96,"cache_read":0.234},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-4.5-air":{"id":"z-ai/glm-4.5-air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-air"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"},"orcarouter/free":{"id":"orcarouter/free","name":"OrcaRouter Free","description":"Built-in router over the free tier that scores each request's difficulty and sends light work to the smaller free model and harder work to the stronger one. Priced at zero and never falls back to a paid model.","family":"auto","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":0,"output":0}},"orcarouter/fusion":{"id":"orcarouter/fusion","name":"OrcaRouter Fusion","description":"Curated fan-out router that runs Claude Opus 4.8, GPT-5.5 and Gemini 3.1 Pro in parallel on hard requests, then has a Claude Opus 4.8 judge return the strongest single answer verbatim. Easy requests fall through to a cheaper default and bill as one call.","family":"model-router","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000}},"orcarouter/auto":{"id":"orcarouter/auto","name":"OrcaRouter Auto","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-01-01","last_updated":"2026-05-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0,"output":0}},"orcarouter/fusion-flash":{"id":"orcarouter/fusion-flash","name":"OrcaRouter Fusion Flash","description":"Budget Fusion panel that runs Gemini 3.5 Flash, MiniMax M2.7 and GLM 5.1 in parallel on hard requests, then has a Claude Opus 4.8 judge return the strongest single answer verbatim. Cost-sensitive fan-out over a 200K window.","family":"model-router","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000}},"orcarouter/fusion-mini":{"id":"orcarouter/fusion-mini","name":"OrcaRouter Fusion Mini","description":"Leaner two-model Fusion panel that runs Claude Opus 4.8 and GPT-5.5 in parallel on hard requests, then has a Claude Opus 4.8 judge return the strongest single answer verbatim. Easy requests fall through to a cheaper default and bill as one call.","family":"model-router","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000}}}},"cloudflare-workers-ai":{"id":"cloudflare-workers-ai","env":["CLOUDFLARE_ACCOUNT_ID","CLOUDFLARE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1","name":"Cloudflare Workers AI","doc":"https://developers.cloudflare.com/workers-ai/models/","models":{"@cf/aisingapore/gemma-sea-lion-v4-27b-it":{"id":"@cf/aisingapore/gemma-sea-lion-v4-27b-it","name":"Gemma Sea Lion V4 27B It","description":"Gemma 3 27B tuned by AI Singapore for Southeast Asian languages and instruction following","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"aisingapore/gemma-sea-lion-v4-27b-it"},"@cf/google/gemma-4-26b-a4b-it":{"id":"@cf/google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0.1,"output":0.3,"cache_read":0.05},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"@cf/qwen/qwen3.8-27b":{"id":"@cf/qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.45,"output":3.2,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"@cf/qwen/qwen2.5-coder-32b-instruct":{"id":"@cf/qwen/qwen2.5-coder-32b-instruct","name":"Qwen2.5 Coder 32B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"cost":{"input":0.66,"output":1},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"@cf/qwen/qwq-32b":{"id":"@cf/qwen/qwq-32b","name":"Qwq 32B","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-05","last_updated":"2025-03-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":24000,"output":24000},"status":"deprecated","cost":{"input":0.66,"output":1},"canonical_model_id":"alibaba/qwq-32b"},"@cf/qwen/qwen3-30b-a3b-fp8":{"id":"@cf/qwen/qwen3-30b-a3b-fp8","name":"Qwen3 30B A3b fp8","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.0509,"output":0.335},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b":{"id":"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b","name":"Deepseek R1 Distill Qwen 32B","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":80000,"output":80000},"status":"deprecated","cost":{"input":0.497,"output":4.881},"canonical_model_id":"deepseek/deepseek-r1"},"@cf/deepseek-ai/deepseek-v4-pro-0813":{"id":"@cf/deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"status":"deprecated","cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"@cf/deepseek-ai/deepseek-v4-flash-0731":{"id":"@cf/deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"status":"deprecated","cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"@cf/deepseek-ai/deepseek-v4.1-flash-1017":{"id":"@cf/deepseek-ai/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"@cf/mistralai/mistral-small-3.1-24b-instruct":{"id":"@cf/mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B Instruct","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-03-17","last_updated":"2025-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.351,"output":0.555},"canonical_model_id":"mistral/mistral-small-3-1-24b-instruct-2503"},"@cf/moonshotai/kimi-k2.6":{"id":"@cf/moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"@cf/moonshotai/kimi-k2.7-code":{"id":"@cf/moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"@cf/openai/gpt-oss-20b":{"id":"@cf/openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.2,"output":0.3},"canonical_model_id":"openai/gpt-oss-20b"},"@cf/openai/gpt-oss-120b":{"id":"@cf/openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.35,"output":0.75},"canonical_model_id":"openai/gpt-oss-120b"},"@cf/ibm-granite/granite-4.0-h-micro":{"id":"@cf/ibm-granite/granite-4.0-h-micro","name":"Granite 4.0 H Micro","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"granite","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-02","last_updated":"2025-10-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":131000},"cost":{"input":0.017,"output":0.112},"canonical_model_id":"ibm/granite-4-h-micro"},"@cf/meta/llama-3.2-3b-instruct":{"id":"@cf/meta/llama-3.2-3b-instruct","name":"Llama 3.2 3B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":80000,"output":80000},"status":"deprecated","cost":{"input":0.0509,"output":0.335},"canonical_model_id":"meta/llama-3.2-3b"},"@cf/meta/llama-4-scout-17b-16e-instruct":{"id":"@cf/meta/llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B 16E Instruct","description":"Open Llama with long-context vision for efficient multimodal agents","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131000,"output":16384},"cost":{"input":0.27,"output":0.85},"canonical_model_id":"meta/llama-4-scout-17b-instruct"},"@cf/meta/llama-3.1-8b-instruct-fp8":{"id":"@cf/meta/llama-3.1-8b-instruct-fp8","name":"Llama 3.1 8B Instruct fp8","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"status":"deprecated","cost":{"input":0.152,"output":0.287},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"@cf/meta/llama-guard-3-8b":{"id":"@cf/meta/llama-guard-3-8b","name":"Llama Guard 3 8B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.484,"output":0.03},"canonical_model_id":"meta/llama-guard-3-8b"},"@cf/meta/llama-3.2-11b-vision-instruct":{"id":"@cf/meta/llama-3.2-11b-vision-instruct","name":"Llama 3.2 11B Vision Instruct","description":"Open Llama multimodal model for image understanding and text reasoning","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":0.0485,"output":0.676},"canonical_model_id":"meta/llama-3.2-11b-vision-instruct"},"@cf/meta/llama-3.3-70b-instruct-fp8-fast":{"id":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","name":"Llama 3.3 70B Instruct fp8 Fast","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":24000,"output":24000},"cost":{"input":0.293,"output":2.253},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"@cf/meta/llama-3.2-1b-instruct":{"id":"@cf/meta/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":60000,"output":60000},"status":"deprecated","cost":{"input":0.027,"output":0.201},"canonical_model_id":"meta/llama-3.2-1b"},"@cf/zai-org/glm-5.2":{"id":"@cf/zai-org/glm-5.2","name":"Glm 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"@cf/zai-org/glm-5.3":{"id":"@cf/zai-org/glm-5.3","name":"Glm 5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"@cf/zai-org/glm-5.3-flash":{"id":"@cf/zai-org/glm-5.3-flash","name":"Glm 5.3 Flash","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"status":"deprecated","cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"@cf/zai-org/glm-4.7-flash":{"id":"@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.0605,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"@cf/nvidia/nemotron-3-120b-a12b":{"id":"@cf/nvidia/nemotron-3-120b-a12b","name":"Nemotron 3 Super 120B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"status":"deprecated","cost":{"input":0.5,"output":1.5},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"}}},"merge-gateway":{"id":"merge-gateway","env":["MERGE_GATEWAY_API_KEY"],"npm":"merge-gateway-ai-sdk-provider","api":"https://api-gateway.merge.dev/v1/ai-sdk","name":"Merge Gateway","doc":"https://docs.merge.dev/merge-gateway","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5-2":{"id":"anthropic/claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-sonnet-4-5-20250929":{"id":"anthropic/claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5 (20250929)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"anthropic/claude-opus-4-1-20250805":{"id":"anthropic/claude-opus-4-1-20250805","name":"Claude Opus 4.1 (20250805)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":31999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-haiku-4-5-20251001":{"id":"anthropic/claude-haiku-4-5-20251001","name":"Claude Haiku 4.5 (20251001)","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-5-20251101":{"id":"anthropic/claude-opus-4-5-20251101","name":"Claude Opus 4.5 (20251101)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024,"max":127999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":128000}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"writer/palmyra-x4":{"id":"writer/palmyra-x4","name":"Palmyra X4","description":"Enterprise language model for workflow automation, coding, data analysis, and tool use","family":"palmyra","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-10-09","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32000},"cost":{"input":2.5,"output":10},"canonical_model_id":"writer/palmyra-x4"},"writer/palmyra-x5":{"id":"writer/palmyra-x5","name":"Palmyra X5","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"palmyra","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.6,"output":6},"canonical_model_id":"writer/palmyra-x5"},"mistral/mistral-medium-2505":{"id":"mistral/mistral-medium-2505","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":128000},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/mistral-medium-2505"},"mistral/mistral-large-2512":{"id":"mistral/mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.5,"output":1.5,"cache_read":0.05},"canonical_model_id":"mistral/mistral-large-2512"},"mistral/devstral-medium-latest":{"id":"mistral/devstral-medium-latest","name":"Devstral 2 (latest)","description":"Mistral coding agent model for repository tasks and software engineering workflows","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/devstral-medium-latest"},"mistral/magistral-medium-latest":{"id":"mistral/magistral-medium-latest","name":"Magistral Medium (latest)","description":"Mistral reasoning model for transparent analysis, math, and complex decisions","family":"magistral-medium","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2025-03-17","last_updated":"2025-03-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2,"output":5},"canonical_model_id":"mistral/magistral-medium-latest"},"mistral/codestral-latest":{"id":"mistral/codestral-latest","name":"Codestral (latest)","description":"Mistral code model for completions, refactors, and developer IDE workflows","family":"codestral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-05-29","last_updated":"2025-01-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":0.3,"output":0.9},"canonical_model_id":"mistral/codestral-latest"},"mistral/devstral-2512":{"id":"mistral/devstral-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.4,"output":2,"cache_read":0.04},"canonical_model_id":"mistral/devstral-2512"},"mistral/pixtral-large-latest":{"id":"mistral/pixtral-large-latest","name":"Pixtral Large (latest)","description":"Mistral's larger vision model for document-heavy image understanding and chat","family":"pixtral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2024-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":128000},"cost":{"input":2,"output":6},"canonical_model_id":"mistral/pixtral-large-latest"},"mistral/mistral-small-latest":{"id":"mistral/mistral-small-latest","name":"Mistral Small (latest)","description":"Efficient Mistral model for fast chat, extraction, and production assistants","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":256000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"mistral/mistral-small-latest"},"mistral/mistral-medium-latest":{"id":"mistral/mistral-medium-latest","name":"Mistral Medium (latest)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.4,"output":2},"canonical_model_id":"mistral/mistral-medium-latest"},"mistral/mistral-large-latest":{"id":"mistral/mistral-large-latest","name":"Mistral Large (latest)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"mistral/mistral-large-latest"},"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1 (0528)","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":32768},"cost":{"input":1.35,"output":5.4,"cache_read":0.945},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek-v4-pro-0423":{"id":"deepseek/deepseek-v4-pro-0423","name":"DeepSeek V4 Pro 0423","description":"DeepSeek V4 Pro initial snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":393216},"cost":{"input":1.65,"output":3.3},"canonical_model_id":"deepseek/deepseek-v4-pro-0423"},"deepseek/deepseek-v3.1":{"id":"deepseek/deepseek-v3.1","name":"DeepSeek V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.56,"output":1.68,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek/deepseek-v4-flash-0423":{"id":"deepseek/deepseek-v4-flash-0423","name":"DeepSeek V4 Flash 0423","description":"Initial DeepSeek V4 Flash snapshot for economical reasoning, coding, and million-token agent workloads","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.139,"output":0.278},"canonical_model_id":"deepseek/deepseek-v4-flash-0423"},"deepseek/deepseek-v4-flash-0731-fast":{"id":"deepseek/deepseek-v4-flash-0731-fast","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.28,"output":0.56,"cache_read":0.07},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.003625},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-r1":{"id":"deepseek/deepseek-r1","name":"DeepSeek R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":40960},"cost":{"input":1.35,"output":5.4},"canonical_model_id":"deepseek/deepseek-r1"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v3":{"id":"deepseek/deepseek-v3","name":"DeepSeek V3","description":"Open DeepSeek MoE chat model for coding, math, and general reasoning","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":81920},"cost":{"input":0.27,"output":1.1},"canonical_model_id":"deepseek/deepseek-v3"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006,"cache_write":0.1125},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.28,"output":0.4,"cache_read":0.13},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.13,"output":0.26,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15,"output":0.6,"cache_read":0.003},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google/gemini-flash-lite-latest":{"id":"google/gemini-flash-lite-latest","name":"Gemini Flash-Lite Latest","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-flash-lite-latest"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-4-carbon":{"id":"google/gemini-4-carbon","name":"Gemini 4 Carbon","description":"Google's most capable reasoning model for complex software engineering, deep math and science, high factual accuracy, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-11-10","last_updated":"2026-11-10","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-carbon"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Largest open Gemma 3 instruction model for multilingual text generation and visual understanding","family":"gemma","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.08,"output":0.45,"cache_read":0.04},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25}},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-flash-latest":{"id":"google/gemini-flash-latest","name":"Gemini Flash Latest","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"input_audio":1.5},"canonical_model_id":"google/gemini-flash-latest"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":7.5,"cache_read":0.15},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-embedding-001":{"id":"google/gemini-embedding-001","type":"embedding","name":"Gemini Embedding 001","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-05","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":2048,"output":4096},"cost":{"input":0.15,"output":0},"canonical_model_id":"google/gemini-embedding-001"},"google/gemini-embedding-2":{"id":"google/gemini-embedding-2","type":"embedding","name":"Gemini Embedding 2","description":"Multimodal embedding model mapping text, images, video, audio, and PDFs into a unified embedding space","family":"gemini","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-11","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0.2,"output":0},"canonical_model_id":"google/gemini-embedding-2"},"google/gemini-2.5-computer-use-preview-10-2025":{"id":"google/gemini-2.5-computer-use-preview-10-2025","name":"Gemini 2.5 Computer Use Preview (10-2025)","description":"Specialized Gemini 2.5 model for browser-control agents that automate UI tasks","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-10-07","last_updated":"2025-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":64000},"cost":{"input":1.25,"output":10},"canonical_model_id":"google/gemini-2.5-computer-use-preview-10-2025"},"google/gemini-3.1-flash-image":{"id":"google/gemini-3.1-flash-image","type":"image","name":"Gemini 3.1 Flash Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"google/gemini-3.1-pro-preview-customtools":{"id":"google/gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview-customtools"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.04,"output":0.08},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash-Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash-Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B It","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-2.5-flash-image":{"id":"google/gemini-2.5-flash-image","type":"image","name":"Gemini 2.5 Flash Image","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":2.5},"canonical_model_id":"google/gemini-2.5-flash-image"},"google/gemma-4-26b-a4b-it":{"id":"google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.13,"output":0.4},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemini-3-pro-image":{"id":"google/gemini-3-pro-image","type":"image","name":"Gemini 3 Pro Image","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":65536},"cost":{"input":2,"output":12},"canonical_model_id":"google/gemini-3-pro-image"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.09,"output":0.29},"canonical_model_id":"google/gemma-3-12b-it"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.276,"output":1.651,"cache_read":0.0552,"cache_write":0.345},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen3-30b-a3b":{"id":"qwen/qwen3-30b-a3b","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.108,"output":1.076,"cache_read":0.0216},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"qwen/qwen3-vl-235b-a22b-instruct":{"id":"qwen/qwen3-vl-235b-a22b-instruct","name":"Qwen3-VL 235B A22B Instruct","description":"Qwen vision-language instruct model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.21,"output":1.9,"cache_read":0.105},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"qwen/qwen3-vl-235b-a22b-thinking":{"id":"qwen/qwen3-vl-235b-a22b-thinking","name":"Qwen3-VL 235B A22B Thinking","description":"Qwen vision-language thinking model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.287,"output":2.867,"cache_read":0.0574},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-thinking"},"qwen/qwen3-coder-480b-a35b-instruct":{"id":"qwen/qwen3-coder-480b-a35b-instruct","name":"Qwen3 Coder 480B A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.22,"output":1.8},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"qwen/qwen3-coder-plus":{"id":"qwen/qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.574,"output":2.294,"cache_read":0.1148,"cache_write":0.7175},"canonical_model_id":"alibaba/qwen3-coder-plus"},"qwen/qwen3-vl-30b-a3b-instruct":{"id":"qwen/qwen3-vl-30b-a3b-instruct","name":"Qwen3-VL 30B-A3B Instruct","description":"Open vision-language MoE model for image and video understanding, documents, and visual agents","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6,"cache_read":0.0216},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.6-max-preview":{"id":"qwen/qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":1.31,"output":7.88},"canonical_model_id":"alibaba/qwen3.6-max-preview"},"qwen/qwen3.5-flash":{"id":"qwen/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.029,"output":0.287,"cache_read":0.0058,"cache_write":0.03625},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.115,"output":0.287,"cache_read":0.023,"cache_write":0.14375},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":977000,"output":128000},"cost":{"input":0.15,"output":0.47,"cache_read":0.016},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3-235b-a22b-instruct-2507":{"id":"qwen/qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1,"output":0.6,"cache_read":0.0574},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3-next-80b-a3b-thinking":{"id":"qwen/qwen3-next-80b-a3b-thinking","name":"Qwen3-Next 80B-A3B (Thinking)","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":1.2},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.172,"output":1.032,"cache_read":0.0344},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.5-9b":{"id":"qwen/qwen3.5-9b","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.09,"output":0.13},"canonical_model_id":"alibaba/qwen3.5-9b"},"qwen/qwen3-vl-flash":{"id":"qwen/qwen3-vl-flash","name":"Qwen3-VL Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.022,"output":0.215,"cache_read":0.0044,"cache_write":0.0275},"canonical_model_id":"alibaba/qwen3-vl-flash"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":1010000},"cost":{"input":2.5,"output":6.25,"cache_read":0.5},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.057,"output":0.459,"cache_read":0.020357},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":1.6},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3-max-preview":{"id":"qwen/qwen3-max-preview","name":"Qwen3 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-05","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"cost":{"input":1.08,"output":4.8},"canonical_model_id":"alibaba/qwen3-max-preview"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.825,"output":2.4755,"cache_read":0.165,"cache_write":1.03125},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.165,"output":0.99,"cache_read":0.033,"cache_write":0.20625},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3-max":{"id":"qwen/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.359,"output":1.434,"cache_read":0.0718,"cache_write":0.44875},"canonical_model_id":"alibaba/qwen3-max"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.4126,"output":2.4754},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.6-35b-a3b":{"id":"qwen/qwen3.6-35b-a3b","name":"Qwen3.6 35B A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.248,"output":1.485,"cache_read":0.0496},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.115,"output":0.688,"cache_read":0.023,"cache_write":0.14375},"canonical_model_id":"alibaba/qwen3.5-plus"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.15,"output":0.8,"cache_read":0.075},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen-flash":{"id":"qwen/qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.022,"output":0.216,"cache_read":0.0044,"cache_write":0.0275},"canonical_model_id":"alibaba/qwen-flash"},"qwen/qwen3-next-80b-a3b-instruct":{"id":"qwen/qwen3-next-80b-a3b-instruct","name":"Qwen3-Next 80B-A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1,"output":1.1,"cache_read":0.05},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen/qwen3-32b":{"id":"qwen/qwen3-32b","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"alibaba/qwen3-32b"},"qwen/qwen3-235b-a22b":{"id":"qwen/qwen3-235b-a22b","name":"Qwen3 235B A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.287,"output":1.147,"cache_read":0.0574},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"qwen/qwen3-vl-plus":{"id":"qwen/qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.143,"output":1.434,"cache_read":0.0286,"cache_write":0.17875},"canonical_model_id":"alibaba/qwen3-vl-plus"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.086,"output":0.688,"cache_read":0.0172},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3.5-4b":{"id":"qwen/qwen3.5-4b","name":"Qwen3.5 4B","description":"Small Qwen3.5 multimodal model for low-cost chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-02","last_updated":"2026-03-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.04,"output":0.07},"canonical_model_id":"alibaba/qwen3.5-4b"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":250000},"cost":{"input":0.144,"output":0.574,"cache_read":0.0288,"cache_write":0.18},"canonical_model_id":"alibaba/qwen3-coder-flash"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.115,"output":0.917,"cache_read":0.023},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"bytedance/dola-seed-2.0-pro":{"id":"bytedance/dola-seed-2.0-pro","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.63,"output":3.79},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"bytedance/dola-seed-2.0-lite":{"id":"bytedance/dola-seed-2.0-lite","name":"Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.31,"output":2.5},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"bytedance/dola-seed-2.0-code":{"id":"bytedance/dola-seed-2.0-code","name":"Seed 2.0 Code","description":"Coding model for repository understanding, refactors, and agentic engineering tasks","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.4,"output":2.4},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"bytedance/dola-seed-2.0-code-preview":{"id":"bytedance/dola-seed-2.0-code-preview","name":"Dola Seed 2.0 Code (preview)","description":"Preview coding model for repository understanding, refactors, and engineering tasks","family":"seed","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-03-28","last_updated":"2026-03-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":32768},"cost":{"input":0.5,"output":3}},"bytedance/dola-seed-2.0-mini":{"id":"bytedance/dola-seed-2.0-mini","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"zai/glm-5.2":{"id":"zai/glm-5.2","name":"GLM 5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":50000}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.05,"output":3.3,"cache_read":0.195},"canonical_model_id":"zhipuai/glm-5.2"},"zai/glm-5.1":{"id":"zai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":0},"canonical_model_id":"zhipuai/glm-5.1"},"zai/glm-4.5":{"id":"zai/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5"},"zai/glm-4.7":{"id":"zai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7"},"zai/glm-5.3":{"id":"zai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.7,"output":2.2,"cache_read":0.13},"canonical_model_id":"zhipuai/glm-5.3"},"zai/glm-5.3-flash":{"id":"zai/glm-5.3-flash","name":"GLM-5.3 Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai/glm-5-turbo":{"id":"zai/glm-5-turbo","name":"GLM-5 Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24,"cache_write":0},"canonical_model_id":"zhipuai/glm-5-turbo"},"zai/glm-4.5-air":{"id":"zai/glm-4.5-air","name":"GLM-4.5 Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":98304},"cost":{"input":0.2,"output":1.1,"cache_read":0.03,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai/glm-4.6":{"id":"zai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.6"},"zai/glm-4.5v":{"id":"zai/glm-4.5v","name":"Glm 4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.6,"output":1.8,"cache_read":0.11,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.5v"},"zai/glm-4.7-flashx":{"id":"zai/glm-4.7-flashx","name":"GLM-4.7 FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0.07,"output":0.4,"cache_read":0.01,"cache_write":0},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"zai/glm-5":{"id":"zai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2,"cache_write":0},"canonical_model_id":"zhipuai/glm-5"},"zai/glm-4.7-flash":{"id":"zai/glm-4.7-flash","name":"GLM 4.7 Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.07,"output":0.4},"canonical_model_id":"zhipuai/glm-4.7-flash"},"openai/gpt-oss-safeguard-120b":{"id":"openai/gpt-oss-safeguard-120b","name":"GPT OSS Safeguard 120B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-safeguard-120b"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":12.5,"output":75,"cache_read":1.25},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.3-chat-latest":{"id":"openai/gpt-5.3-chat-latest","name":"GPT-5.3 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-chat-latest"},"openai/gpt-4.1-nano":{"id":"openai/gpt-4.1-nano","name":"GPT-4.1 Nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"openai/o1":{"id":"openai/o1","name":"o1","description":"O-series reasoning model for hard analysis, math, coding, and planning","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2023-09","release_date":"2024-12-05","last_updated":"2024-12-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":15,"output":60,"cache_read":7.5},"canonical_model_id":"openai/o1"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 Mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4 Mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.275},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 Mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":1.5,"output":9,"cache_read":0.15},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-oss-safeguard-20b":{"id":"openai/gpt-oss-safeguard-20b","name":"GPT OSS Safeguard 20B","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-10-29","last_updated":"2025-10-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0.07,"output":0.2,"cache_read":0,"cache_write":0},"canonical_model_id":"openai/gpt-oss-safeguard-20b"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"openai/gpt-4o-2024-11-20":{"id":"openai/gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT-OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.04,"output":0.15,"cache_read":0.02},"canonical_model_id":"openai/gpt-oss-20b"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3 Mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"openai/gpt-5.1-chat-latest":{"id":"openai/gpt-5.1-chat-latest","name":"GPT-5.1 Chat Latest","description":"Chat-tuned GPT-5.1 for polished assistants, writing, and product conversations","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"openai/whisper-1":{"id":"openai/whisper-1","type":"transcription","name":"Whisper","description":"General-purpose speech recognition model for transcription and translation","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2023-03-01","last_updated":"2023-03-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":448000,"output":4096},"provider":{"npm":"@ai-sdk/openai","api":"https://api-gateway.merge.dev/v1"},"canonical_model_id":"openai/whisper-1"},"openai/gpt-audio":{"id":"openai/gpt-audio","type":"chat","name":"GPT Audio","description":"Audio model for speech input and output with the Chat Completions API","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-08-28","last_updated":"2025-08-28","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10},"canonical_model_id":"openai/gpt-audio"},"openai/gpt-4":{"id":"openai/gpt-4","name":"GPT-4","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2023-11","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":30,"output":60},"canonical_model_id":"openai/gpt-4"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5-search-api":{"id":"openai/gpt-5-search-api","type":"chat","name":"GPT-5 Search API","description":"GPT-5 model trained for web search in the Chat Completions API","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2025-10-14","last_updated":"2025-10-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5-search-api"},"openai/gpt-4o-2024-05-13":{"id":"openai/gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-05-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":5,"output":15},"canonical_model_id":"openai/gpt-4o-2024-05-13"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-audio-mini":{"id":"openai/gpt-audio-mini","type":"chat","name":"GPT Audio Mini","description":"Cost-efficient audio model for speech input and output with the Chat Completions API","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-10-01","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.6,"output":2.4},"canonical_model_id":"openai/gpt-audio-mini"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-3.5-turbo":{"id":"openai/gpt-3.5-turbo","name":"GPT-3.5 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2021-09-01","release_date":"2023-03-01","last_updated":"2023-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":16385,"output":4096},"cost":{"input":0.5,"output":1.5},"canonical_model_id":"openai/gpt-3.5-turbo"},"openai/gpt-4-turbo":{"id":"openai/gpt-4-turbo","name":"GPT-4 Turbo","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2023-11-06","last_updated":"2024-04-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"cost":{"input":10,"output":30},"canonical_model_id":"openai/gpt-4-turbo"},"openai/gpt-4o-2024-08-06":{"id":"openai/gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-08-06","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o-2024-08-06"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 Nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-5.2-chat-latest":{"id":"openai/gpt-5.2-chat-latest","name":"GPT-5.2 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-chat-latest"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT-OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.05,"output":0.25},"canonical_model_id":"openai/gpt-oss-120b"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-5-chat-latest":{"id":"openai/gpt-5-chat-latest","name":"GPT-5 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":false,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-chat-latest"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o Mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+ 08-2024","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-r-plus-08-2024"},"cohere/command-r7b-12-2024":{"id":"cohere/command-r7b-12-2024","name":"Command R7B 12-2024","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-12-13","last_updated":"2024-12-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.0375,"output":0.15},"canonical_model_id":"cohere/command-r7b-12-2024"},"cohere/command-r-08-2024":{"id":"cohere/command-r-08-2024","name":"Command R 08-2024","description":"Cohere retrieval model for long-context chat and enterprise RAG workflows","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"cohere/command-r-08-2024"},"cohere/command-a-03-2025":{"id":"cohere/command-a-03-2025","name":"Command A 03-2025","description":"Cohere command model for multilingual enterprise agents, tools, and chat","family":"command-a","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2025-03-13","last_updated":"2025-03-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":8000},"cost":{"input":2.5,"output":10},"canonical_model_id":"cohere/command-a-03-2025"},"moonshot/kimi-k3.1-pro":{"id":"moonshot/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshot/kimi-k2.6":{"id":"moonshot/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot/kimi-k2.5":{"id":"moonshot/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":262144}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshot/kimi-k2.7-code":{"id":"moonshot/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshot/kimi-k2.7-code-highspeed":{"id":"moonshot/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":32768}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.5-highspeed":{"id":"minimax/minimax-m2.5-highspeed","name":"MiniMax M2.5 Highspeed","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.6,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3.1-flash":{"id":"minimax/minimax-m3.1-flash","name":"MiniMax M3.1 Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1,"max":128000}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax M2.7 Highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":8192},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048000,"output":32000},"cost":{"input":1,"output":4.05,"cache_read":0.17},"canonical_model_id":"thinkingmachines/inkling"},"meta/llama-3.1-8b-instruct":{"id":"meta/llama-3.1-8b-instruct","name":"Llama 3.1 8B","description":"Compact open Llama model for lightweight chat, drafting, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":2048},"cost":{"input":0.22,"output":0.22},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta/muse-spark-open":{"id":"meta/muse-spark-open","name":"Muse Spark Open","description":"Muse Spark Open is an 816B total / 42B active open-weight multimodal reasoning model from Meta for coding and long-horizon agentic work, with 1M-token context.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-open"},"meta/llama-3.1-70b-instruct":{"id":"meta/llama-3.1-70b-instruct","name":"Llama 3.1 70B","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":2048},"cost":{"input":0.99,"output":0.99},"canonical_model_id":"meta/llama-3.1-70b-instruct"},"meta/llama-3.3-70b-instruct":{"id":"meta/llama-3.3-70b-instruct","name":"Llama 3.3 70B Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.22,"output":0.5,"cache_read":0.11},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"nvidia/nemotron-3.5-lightning-30b-a3b":{"id":"nvidia/nemotron-3.5-lightning-30b-a3b","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-3-nano-30b-a3b":{"id":"nvidia/nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":32000},"cost":{"input":0.05,"output":0.2},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"nvidia/nemotron-nano-9b-v2":{"id":"nvidia/nemotron-nano-9b-v2","name":"Nemotron Nano 9B","description":"Compact Nemotron model for efficient reasoning and deployable AI agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2024-09","release_date":"2025-08-18","last_updated":"2025-08-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0.06,"output":0.23},"canonical_model_id":"nvidia/nemotron-nano-9b-v2"},"xai/grok-4.20-0309-non-reasoning":{"id":"xai/grok-4.20-0309-non-reasoning","name":"Grok 4.20 Non-Reasoning","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.20-0309-non-reasoning"},"xai/grok-4.5":{"id":"xai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.5"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.3"},"xai/grok-4.20-0309-reasoning":{"id":"xai/grok-4.20-0309-reasoning","name":"Grok 4.20","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"xai/grok-4.7":{"id":"xai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":2,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"xai/grok-4.6":{"id":"xai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"xai/grok-build-0.1":{"id":"xai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2},"canonical_model_id":"xai/grok-build-0.1"},"sakana/fugu-max":{"id":"sakana/fugu-max","name":"Fugu Max","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-09-11","last_updated":"2026-09-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"sakana/fugu-max"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"sakana/sakana-namazu":{"id":"sakana/sakana-namazu","name":"Sakana Namazu","description":"Japanese-specialized reasoning model based on Kimi K2.6 and tuned for Japanese language, culture, and business workflows","family":"sakana-namazu","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.95,"output":4,"cache_read":0.15},"canonical_model_id":"sakana/sakana-namazu"}}},"privatemode-ai":{"id":"privatemode-ai","env":["PRIVATEMODE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"http://localhost:8080/v1","name":"Privatemode AI","doc":"https://docs.privatemode.ai/api/overview","models":{"whisper-large-v3":{"id":"whisper-large-v3","type":"transcription","name":"Whisper large-v3","description":"Open Whisper checkpoint for robust multilingual transcription and captioning","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":4096},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.01618,"output":0},"canonical_model_id":"openai/whisper-large-v3"},"kimi-k2.6":{"id":"kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":262144},"status":"deprecated","cost":{"input":1.791,"output":8.9436,"cache_read":0.1733},"canonical_model_id":"moonshotai/kimi-k2.6"},"qwen3-embedding-4b":{"id":"qwen3-embedding-4b","type":"embedding","name":"Qwen3-Embedding 4B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2025-06","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":2560},"cost":{"input":0.1502,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-4b"},"glm-latest":{"id":"glm-latest","name":"GLM (latest)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.791,"output":6.6326,"cache_read":0.1733},"canonical_model_id":"zhipuai/glm-5.3"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.791,"output":6.6326,"cache_read":0.1733},"canonical_model_id":"zhipuai/glm-5.3"},"kimi-latest":{"id":"kimi-latest","name":"Kimi (latest)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":262144},"status":"deprecated","cost":{"input":1.791,"output":8.9436,"cache_read":0.1733},"canonical_model_id":"moonshotai/kimi-k2.6"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.2311,"output":0.7511,"cache_read":0.0578},"canonical_model_id":"zhipuai/glm-5.3-flash"},"glm-flash-latest":{"id":"glm-flash-latest","name":"GLM Flash (latest)","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.2311,"output":0.7511,"cache_read":0.0578},"canonical_model_id":"zhipuai/glm-5.3-flash"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"gpt-oss-120b","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"cost":{"input":0.2311,"output":0.7511,"cache_read":0.0462},"canonical_model_id":"openai/gpt-oss-120b"},"voxtral-mini-3b":{"id":"voxtral-mini-3b","type":"transcription","name":"Voxtral Mini 3B","description":"Speech-to-text model for audio transcription, translation, and audio understanding","family":"voxtral","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"provider":{"npm":"@ai-sdk/openai"},"cost":{"input":0.00462,"output":0},"canonical_model_id":"mistral/voxtral-mini-3b-2507"},"deepseek-ocr-2":{"id":"deepseek-ocr-2","name":"DeepSeek OCR 2","description":"High-accuracy OCR model for extracting text from documents, screenshots, receipts, and natural scenes","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"status":"beta","cost":{"input":0.8897,"output":1.4675,"cache_read":0.0924},"canonical_model_id":"deepseek/deepseek-ocr-2"}}},"anyapi":{"id":"anyapi","env":["ANYAPI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.anyapi.ai/v1","name":"AnyAPI","doc":"https://docs.anyapi.ai","models":{"anthropic/claude-opus-4-6":{"id":"anthropic/claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":127999}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-sonnet-4-5":{"id":"anthropic/claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024,"max":63999}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"canonical_model_id":"anthropic/claude-haiku-4-5"},"perplexity/sonar-pro":{"id":"perplexity/sonar-pro","name":"Sonar Pro","description":"Deeper Sonar search model with broader retrieval and stronger synthesis","family":"sonar-pro","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":8192},"canonical_model_id":"perplexity/sonar-pro"},"perplexity/sonar-reasoning-pro":{"id":"perplexity/sonar-reasoning-pro","name":"Sonar Reasoning Pro","description":"Web-grounded Sonar for multi-step research questions that need cited reasoning","family":"sonar-reasoning","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-09-01","release_date":"2024-01-01","last_updated":"2025-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"canonical_model_id":"perplexity/sonar-reasoning-pro"},"deepseek/deepseek-r1":{"id":"deepseek/deepseek-r1","name":"DeepSeek Reasoner","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-reasoner"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-chat":{"id":"deepseek/deepseek-chat","name":"DeepSeek Chat","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-12-01","last_updated":"2026-02-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-chat"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-v4-flash"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3-pro-preview":{"id":"google/gemini-3-pro-preview","name":"Gemini 3 Pro Preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-3-pro-preview"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"canonical_model_id":"google/gemini-3-flash-preview"},"mistralai/mistral-large-2512":{"id":"mistralai/mistral-large-2512","name":"Mistral Large 3","description":"Mistral's largest general model for enterprise agents, coding, and multilingual reasoning","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-11","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"canonical_model_id":"mistral/mistral-large-2512"},"mistralai/devstral-2512":{"id":"mistralai/devstral-2512","name":"Devstral 2","description":"Mistral's coding-agent model for repository work, terminal tasks, and software fixes","family":"devstral","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-09","last_updated":"2025-12-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","canonical_model_id":"mistral/devstral-2512"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/o4-mini":{"id":"openai/o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"canonical_model_id":"openai/o4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"canonical_model_id":"openai/gpt-4.1"},"openai/o3":{"id":"openai/o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"canonical_model_id":"openai/o3"},"openai/o3-mini":{"id":"openai/o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"canonical_model_id":"openai/o3-mini"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":5,"output":30,"cache_read":0.5},"provider":{"body":{"service_tier":"priority"}}}}},"canonical_model_id":"openai/gpt-5.4"},"cohere/command-r-plus-08-2024":{"id":"cohere/command-r-plus-08-2024","name":"Command R+","description":"Cohere's RAG workhorse for long-context enterprise search and tool use","family":"command-r","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06-01","release_date":"2024-08-30","last_updated":"2024-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4000},"canonical_model_id":"cohere/command-r-plus-08-2024"},"xai/grok-4.3":{"id":"xai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"canonical_model_id":"xai/grok-4.3"}}},"nvidia":{"id":"nvidia","env":["NVIDIA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://integrate.api.nvidia.com/v1","name":"Nvidia","doc":"https://docs.api.nvidia.com/nim/","models":{"minimaxai/minimax-m3.1-flash":{"id":"minimaxai/minimax-m3.1-flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"google/google-paligemma":{"id":"google/google-paligemma","name":"paligemma","description":"Vision-language model for answering questions about images and text","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2024-05-14","last_updated":"2024-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0}},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open multimodal Gemma instruction model for efficient text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-3-4b-it"},"google/diffusiongemma-26b-a4b-it":{"id":"google/diffusiongemma-26b-a4b-it","name":"DiffusionGemma 26B A4B IT","description":"Gemma 4 based discrete text diffusion model for fast chat, reasoning, and tool use","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-09","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":250000,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/diffusiongemma-26b-a4b-it"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma-4-31B-IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open multimodal Gemma instruction model for multilingual text generation and image understanding","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-3-12b-it"},"qwen/qwen-image":{"id":"qwen/qwen-image","type":"image","name":"Qwen Image","description":"Text-to-image foundation model with multilingual text rendering","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0}},"qwen/qwen-image-edit":{"id":"qwen/qwen-image-edit","type":"image","name":"Qwen Image Edit","description":"Image editing model with multilingual text editing and subject consistency","family":"qwen","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"release_date":"2025-08-19","last_updated":"2025-08-19","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0}},"deepseek-ai/deepseek-v4.1-flash":{"id":"deepseek-ai/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"poolside/laguna-xs-2.1":{"id":"poolside/laguna-xs-2.1","name":"Laguna XS 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-02","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"poolside/laguna-xs-2.1"},"mistralai/magistral-small-2506":{"id":"mistralai/magistral-small-2506","name":"Magistral Small 2506","description":"Open Mistral reasoning model for transparent step-by-step problem solving","family":"magistral","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"input":32768,"output":32768},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"mistral/magistral-small-2506"},"mistralai/mistral-medium-3-instruct":{"id":"mistralai/mistral-medium-3-instruct","name":"Mistral Medium 3","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-medium","attachment":true,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-07","last_updated":"2025-05-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"input":131072,"output":32768},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"mistral/mistral-medium-3"},"mistralai/mistral-7b-instruct-v0.3":{"id":"mistralai/mistral-7b-instruct-v0.3","name":"Mistral-7B-Instruct-v0.3","description":"Open 7B Mistral instruction model with function calling","family":"mistral","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-05-22","last_updated":"2024-05-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"mistral/mistral-7b-instruct-v0.3"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"moonshotai/kimi-k3"},"openai/whisper-large-v3":{"id":"openai/whisper-large-v3","type":"transcription","name":"Whisper Large v3","description":"Open Whisper checkpoint for robust multilingual transcription and captioning","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2023-09","release_date":"2023-11-06","last_updated":"2023-11-06","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"openai/whisper-large-v3"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"openai/gpt-oss-20b"},"black-forest-labs/flux_1-schnell":{"id":"black-forest-labs/flux_1-schnell","type":"image","name":"FLUX.1-schnell","description":"Fast few-step FLUX.1 text-to-image model under Apache 2.0","family":"flux","attachment":false,"reasoning":false,"tool_call":false,"structured_output":false,"temperature":false,"knowledge":"2024-07","release_date":"2024-08-01","last_updated":"2024-08-01","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0},"provider":{"api":"https://ai.api.nvidia.com/v1/genai/black-forest-labs/flux.1-schnell"},"cost":{"input":0,"output":0},"canonical_model_id":"black-forest-labs/flux-1-schnell"},"black-forest-labs/flux_2-klein-4b":{"id":"black-forest-labs/flux_2-klein-4b","type":"image","name":"FLUX.2 Klein 4B","description":"Fast 4B open-weight image generation and editing model","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2025-06","release_date":"2026-01-15","last_updated":"2026-01-15","modalities":{"input":["text","image"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0},"provider":{"api":"https://ai.api.nvidia.com/v1/genai/black-forest-labs/flux.2-klein-4b"},"cost":{"input":0,"output":0},"canonical_model_id":"black-forest-labs/flux-2-klein-4b"},"black-forest-labs/flux.1-dev":{"id":"black-forest-labs/flux.1-dev","type":"image","name":"FLUX.1-dev","description":"Open-weight FLUX.1 text-to-image model for high-quality guidance-distilled generation","family":"flux","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-08","release_date":"2024-08-01","last_updated":"2024-08-01","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0},"provider":{"api":"https://ai.api.nvidia.com/v1/genai/black-forest-labs/flux.1-dev"},"cost":{"input":0,"output":0},"canonical_model_id":"black-forest-labs/flux-1-dev"},"black-forest-labs/flux_1-kontext-dev":{"id":"black-forest-labs/flux_1-kontext-dev","type":"image","name":"FLUX.1-Kontext-dev","description":"Open-weight FLUX.1 Kontext model for instruction-based image editing","family":"flux","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-29","last_updated":"2025-05-29","modalities":{"input":["text","image"],"output":["image"]},"open_weights":true,"limit":{"context":0,"output":0},"provider":{"api":"https://ai.api.nvidia.com/v1/genai/black-forest-labs/flux.1-kontext-dev"},"cost":{"input":0,"output":0},"canonical_model_id":"black-forest-labs/flux-1-kontext-dev"},"meta/llama-3.2-90b-vision-instruct":{"id":"meta/llama-3.2-90b-vision-instruct","name":"Llama-3.2-90B-Vision-Instruct","description":"Large open multimodal Llama model for image reasoning, document QA, and captioning","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"meta/llama-3.2-90b-vision-instruct"},"meta/llama-guard-4-12b":{"id":"meta/llama-guard-4-12b","name":"Llama Guard 4 12B","description":"Multimodal Llama 4-based safety classifier for moderating prompts and responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":16384},"cost":{"input":0,"output":0},"canonical_model_id":"meta/llama-guard-4-12b"},"meta/llama-3.2-11b-vision-instruct":{"id":"meta/llama-3.2-11b-vision-instruct","name":"Llama 3.2 11b Vision Instruct","description":"Open multimodal Llama model for image understanding, captioning, and visual QA","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"meta/llama-3.2-11b-vision-instruct"},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"meta/muse-glimmer-30b"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"nvidia/cosmos-reason2-8b":{"id":"nvidia/cosmos-reason2-8b","name":"Cosmos Reason2 8B","description":"Vision language model for physical-world understanding with structured reasoning on video and images","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":0,"output":0}},"nvidia/rerank-qa-mistral-4b":{"id":"nvidia/rerank-qa-mistral-4b","type":"reranking","name":"rerank-qa-mistral-4b","description":"Reranking model for improving retrieval quality in search and recommendation systems","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-03-17","last_updated":"2025-01-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","provider":{"api":"https://ai.api.nvidia.com/v1/retrieval/nvidia/reranking"},"cost":{"input":0,"output":0}},"nvidia/magpie-tts-zeroshot":{"id":"nvidia/magpie-tts-zeroshot","type":"speech","name":"magpie-tts-zeroshot","description":"Expressive text-to-speech that clones a voice from a short audio sample","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-05-22","last_updated":"2025-06-12","modalities":{"input":["text","audio"],"output":["audio"]},"open_weights":true,"limit":{"context":0,"output":4096},"cost":{"input":0,"output":0}},"nvidia/llama-3.1-nemotron-70b-instruct":{"id":"nvidia/llama-3.1-nemotron-70b-instruct","name":"Llama 3.1 Nemotron 70B Instruct","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","family":"nemotron","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-04-15","last_updated":"2025-04-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"nvidia/llama-3.1-nemotron-70b-instruct"},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","medium","high"]},{"type":"budget_tokens","min":-1,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"nvidia/studiovoice":{"id":"nvidia/studiovoice","name":"studiovoice","description":"Enhances noisy or reverberant speech recordings to studio-quality speech","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-10-03","last_updated":"2025-06-13","modalities":{"input":["audio"],"output":["audio"]},"open_weights":true,"limit":{"context":0,"output":0},"cost":{"input":0,"output":0}},"nvidia/nemotron-3.5-lightning-30b-a3b":{"id":"nvidia/nemotron-3.5-lightning-30b-a3b","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/nemotron-voicechat":{"id":"nvidia/nemotron-voicechat","name":"nemotron-voicechat","description":"Nemotron multimodal model for visual reasoning and agentic AI workflows","family":"nemotron","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-voicechat"},"nvidia/sparsedrive":{"id":"nvidia/sparsedrive","name":"sparsedrive","description":"End-to-end autonomous driving stack for perception, prediction, and planning","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-03-18","last_updated":"2025-07-20","modalities":{"input":["video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0}},"nvidia/cosmos-transfer2_5-2b":{"id":"nvidia/cosmos-transfer2_5-2b","type":"video","name":"cosmos-transfer2.5-2b","description":"Generates physics-aware video world states from text and spatial control videos","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":true,"limit":{"context":0,"output":4096},"cost":{"input":0,"output":0}},"nvidia/bevformer":{"id":"nvidia/bevformer","name":"bevformer","description":"Multi-frame bird's-eye-view 3D perception transformer for autonomous driving","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-03-18","last_updated":"2025-07-20","modalities":{"input":["video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0}},"nvidia/llama-3.1-nemotron-ultra-253b-v1":{"id":"nvidia/llama-3.1-nemotron-ultra-253b-v1","name":"Llama 3.1 Nemotron Ultra 253B","description":"Flagship Nemotron model for high-throughput reasoning and complex agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2025-04-07","last_updated":"2025-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"nvidia/llama-3.1-nemotron-ultra-253b"},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning":{"id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning","name":"Nemotron 3 Nano Omni","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":-1,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"nvidia/llama-nemotron-embed-vl-1b-v2":{"id":"nvidia/llama-nemotron-embed-vl-1b-v2","type":"embedding","name":"llama-nemotron-embed-vl-1b-v2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"nemotron","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":2048},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/llama-nemotron-embed-vl-1b-v2"},"nvidia/nemotron-3.5-super-vl-120b-a12b":{"id":"nvidia/nemotron-3.5-super-vl-120b-a12b","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"},"nvidia/synthetic-video-detector":{"id":"nvidia/synthetic-video-detector","name":"synthetic-video-detector","description":"Detects AI-generated (synthetic) video","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["video"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":4096},"cost":{"input":0,"output":0}},"nvidia/active-speaker-detection":{"id":"nvidia/active-speaker-detection","name":"Active Speaker Detection","description":"Detects and tracks which person is speaking across video frames","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["video"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":4096},"cost":{"input":0,"output":0}},"nvidia/riva-translate-4b-instruct-v1.1":{"id":"nvidia/riva-translate-4b-instruct-v1.1","name":"riva-translate-4b-instruct-v1_1","description":"Translation model for multilingual conversion, localization, and cross-language workflows","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-12","last_updated":"2025-12-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0,"output":0}},"nvidia/llama-nemotron-rerank-vl-1b-v2":{"id":"nvidia/llama-nemotron-rerank-vl-1b-v2","type":"reranking","name":"llama-nemotron-rerank-vl-1b-v2","description":"Reranking model for improving retrieval quality in search and recommendation systems","family":"nemotron","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":10240,"output":4096},"provider":{"api":"https://ai.api.nvidia.com/v1/retrieval/nvidia/llama-nemotron-rerank-vl-1b-v2/reranking"},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/llama-nemotron-rerank-vl-1b-v2"},"nvidia/usdcode":{"id":"nvidia/usdcode","name":"usdcode","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-01-01","last_updated":"2026-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0,"output":0}},"nvidia/streampetr":{"id":"nvidia/streampetr","name":"streampetr","description":"Temporal 3D object detection model for autonomous driving","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["video"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0}},"nvidia/nemotron-3.5-content-safety":{"id":"nvidia/nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"},"nvidia/llama-3.1-nemotron-safety-guard-8b-v3":{"id":"nvidia/llama-3.1-nemotron-safety-guard-8b-v3","name":"llama-3.1-nemotron-safety-guard-8b-v3","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2025-10-28","last_updated":"2025-10-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/llama-3.1-nemotron-safety-guard-8b-v3"},"nvidia/usdvalidate":{"id":"nvidia/usdvalidate","name":"usdvalidate","description":"Nemotron model for efficient reasoning, coding, and specialized AI agents","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-07-24","last_updated":"2025-01-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":0,"output":4096},"status":"deprecated","cost":{"input":0,"output":0}},"stepfun-ai/step-5-preview":{"id":"stepfun-ai/step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":false,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"input":1048576,"output":1048576},"cost":{"input":0,"output":0},"canonical_model_id":"stepfun/step-5-preview"}}},"stepfun-ai":{"id":"stepfun-ai","env":["STEPFUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.stepfun.ai/v1","name":"StepFun (Global)","doc":"https://platform.stepfun.ai/docs/en/overview/concept","models":{"step-tts-2":{"id":"step-tts-2","type":"speech","name":"Step TTS 2","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"step","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-03-01","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai"}},"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"input":1024000,"output":65536},"cost":{"input":1,"output":2.7,"cache_read":0.1},"canonical_model_id":"stepfun/step-5-preview"},"step-3.5-flash-2603":{"id":"step-3.5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.1,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"stepaudio-2.5-asr":{"id":"stepaudio-2.5-asr","type":"transcription","name":"StepAudio 2.5 ASR","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"step","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-24","last_updated":"2026-07-02","modalities":{"input":["audio"],"output":["text"]},"open_weights":false,"limit":{"context":0,"output":0}},"stepaudio-2.5-tts":{"id":"stepaudio-2.5-tts","type":"speech","name":"StepAudio 2.5 TTS","description":"Speech generation model for controllable voice, narration, and audio delivery","family":"step","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-16","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":0,"output":0},"provider":{"npm":"@ai-sdk/openai"}},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.2,"output":1.15,"cache_read":0.04},"canonical_model_id":"stepfun/step-3.7-flash"},"step-3.5-flash":{"id":"step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.1,"output":0.3,"cache_read":0.02},"canonical_model_id":"stepfun/step-3.5-flash"}}},"nova":{"id":"nova","env":["NOVA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.nova.amazon.com/v1","name":"Nova","doc":"https://nova.amazon.com/dev/documentation","models":{"nova-2-pro-v1":{"id":"nova-2-pro-v1","name":"Nova 2 Pro","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-03","last_updated":"2026-01-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"reasoning":0}},"nova-2-lite-v1":{"id":"nova-2-lite-v1","name":"Nova 2 Lite","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"nova","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-10","release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"reasoning":0},"canonical_model_id":"amazon/nova-2-lite-v1"}}},"ofox":{"id":"ofox","env":["OFOX_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.ofox.ai/v1","name":"Ofox","doc":"https://ofox.ai/docs","models":{"anthropic/claude-opus-4.6":{"id":"anthropic/claude-opus-4.6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"anthropic/claude-opus-4.7":{"id":"anthropic/claude-opus-4.7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-opus-4.8":{"id":"anthropic/claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-4.5":{"id":"anthropic/claude-opus-4.5","name":"Claude Opus 4.5 (latest)","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-5"},"anthropic/claude-opus-5.5":{"id":"anthropic/claude-opus-5.5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-4.5":{"id":"anthropic/claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-sonnet-4.5":{"id":"anthropic/claude-sonnet-4.5","name":"Claude Sonnet 4.5 (latest)","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-5"},"anthropic/claude-fable-5.2":{"id":"anthropic/claude-fable-5.2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5.1":{"id":"anthropic/claude-fable-5.1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-4.6":{"id":"anthropic/claude-sonnet-4.6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-sonnet-5.5":{"id":"anthropic/claude-sonnet-5.5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-haiku-5.5":{"id":"anthropic/claude-haiku-5.5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"provider":{"npm":"@ai-sdk/anthropic","api":"https://api.ofox.ai/anthropic/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":65536},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":65536},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.1-fast":{"id":"x-ai/grok-4.1-fast","name":"Grok 4.1 Fast","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast"},"x-ai/grok-4.20":{"id":"x-ai/grok-4.20","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"cost":{"input":4,"output":12,"cache_read":0.4},"canonical_model_id":"xai/grok-4.20-0309-reasoning"},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":65536},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"deepseek/deepseek-v4-pro-0423":{"id":"deepseek/deepseek-v4-pro-0423","name":"DeepSeek V4 Pro 0423","description":"DeepSeek V4 Pro initial snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.74,"output":3.48,"cache_read":0.145},"canonical_model_id":"deepseek/deepseek-v4-pro-0423"},"deepseek/deepseek-v4-flash-0423":{"id":"deepseek/deepseek-v4-flash-0423","name":"DeepSeek V4 Flash 0423","description":"Initial DeepSeek V4 Flash snapshot for economical reasoning, coding, and million-token agent workloads","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.19,"output":0.51,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0423"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek/deepseek-v3.2":{"id":"deepseek/deepseek-v3.2","name":"DeepSeek V3.2","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes, sparse attention, and tool-use","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.29,"output":0.43,"cache_read":0.06},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.44,"output":1.32,"cache_read":0.014},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"google/gemini-2.5-flash":{"id":"google/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":1,"input_audio":1},"canonical_model_id":"google/gemini-2.5-flash"},"google/gemini-3.8-flash":{"id":"google/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.0415,"input_audio":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"google/gemini-2.5-pro":{"id":"google/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"cache_write":4.5,"input_audio":1.25},"canonical_model_id":"google/gemini-2.5-pro"},"google/gemini-3.5-flash":{"id":"google/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":0.083,"input_audio":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"google/gemini-3.6-flash":{"id":"google/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.0415,"input_audio":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"google/gemini-3.1-pro-preview":{"id":"google/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":4.5,"input_audio":2},"canonical_model_id":"google/gemini-3.1-pro-preview"},"google/gemini-3.1-flash-lite":{"id":"google/gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":1,"input_audio":0.5},"canonical_model_id":"google/gemini-3.1-flash-lite"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":512,"max":24576}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":1,"input_audio":0.3},"canonical_model_id":"google/gemini-2.5-flash-lite"},"google/gemini-4-argon":{"id":"google/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":2,"output":10,"cache_read":0.1,"input_audio":2},"canonical_model_id":"google/gemini-4-argon"},"google/gemini-3.5-flash-lite":{"id":"google/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.083,"input_audio":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"google/gemini-3-flash-preview":{"id":"google/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":1,"input_audio":1},"canonical_model_id":"google/gemini-3-flash-preview"},"google/gemini-3.7-flash":{"id":"google/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"provider":{"npm":"@ai-sdk/google","api":"https://api.ofox.ai/gemini/v1beta"},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.0415,"input_audio":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen-max":{"id":"qwen/qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":8000},"cost":{"input":0.35,"output":1.38,"cache_read":0.069},"canonical_model_id":"alibaba/qwen-max"},"qwen/qwen3-coder-plus":{"id":"qwen/qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":1.8,"output":9,"cache_read":0.2,"cache_write":1},"canonical_model_id":"alibaba/qwen3-coder-plus"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1131072,"output":131072},"cost":{"input":0.5,"output":1.71,"cache_read":0.043,"cache_write":0.63},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.6-max-preview":{"id":"qwen/qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"cost":{"input":2.15,"output":12.86,"cache_read":0.2,"cache_write":1.17},"canonical_model_id":"alibaba/qwen3.6-max-preview"},"qwen/qwen3.5-flash":{"id":"qwen/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"alibaba/qwen3.5-flash"},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":0.12,"output":0.29,"cache_read":0.023},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11,"output":0.39,"cache_read":0.011,"cache_write":0.14},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.55,"output":3.5,"cache_read":0.55},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.8-max-0902":{"id":"qwen/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.71,"output":5.14,"cache_read":0.17,"cache_write":2.14},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"qwen/qwen3.5-35b-a3b":{"id":"qwen/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.29,"output":1.83,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1064000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1064000,"output":64000},"cost":{"input":1.71,"output":5.14,"cache_read":0.17,"cache_write":2.14},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.31},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3-max":{"id":"qwen/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":64000},"cost":{"input":0.36,"output":1.43,"cache_read":0.072},"canonical_model_id":"alibaba/qwen3-max"},"qwen/qwen-turbo":{"id":"qwen/qwen-turbo","name":"Qwen Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16000},"cost":{"input":0.043,"output":0.09,"cache_read":0.0086},"canonical_model_id":"alibaba/qwen-turbo"},"qwen/qwen3.6-27b":{"id":"qwen/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.43,"output":2.57},"canonical_model_id":"alibaba/qwen3.6-27b"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.4},"canonical_model_id":"alibaba/qwen3.5-plus"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.2,"output":1.5},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen-flash":{"id":"qwen/qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":0.022,"output":0.22,"cache_read":0.0043,"cache_write":0.027},"canonical_model_id":"alibaba/qwen-flash"},"qwen/qwen-vl-max":{"id":"qwen/qwen-vl-max","name":"Qwen-VL Max","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-08","last_updated":"2025-08-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":8000},"cost":{"input":0.23,"output":0.58,"cache_read":0.023},"canonical_model_id":"alibaba/qwen-vl-max"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.71,"output":5.14,"cache_read":0.17,"cache_write":2.14},"canonical_model_id":"alibaba/qwen3.8-max"},"qwen/qwen3.5-27b":{"id":"qwen/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.29,"output":2.05,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-27b"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.5,"output":2.5,"cache_read":0.06,"cache_write":0.27},"canonical_model_id":"alibaba/qwen3-coder-flash"},"qwen/qwen3.5-122b-a10b":{"id":"qwen/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.29,"output":2.29,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"bailian/qwen3.6-plus":{"id":"bailian/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.625},"canonical_model_id":"alibaba/qwen3.6-plus"},"bailian/qwen-max":{"id":"bailian/qwen-max","name":"Qwen Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-03","last_updated":"2025-01-25","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":8192},"cost":{"input":0.35,"output":1.38,"cache_read":0.069},"canonical_model_id":"alibaba/qwen-max"},"bailian/qwen3-coder-plus":{"id":"bailian/qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.8,"output":9,"cache_read":0.2,"cache_write":1},"canonical_model_id":"alibaba/qwen3-coder-plus"},"bailian/qwen3.8-27b":{"id":"bailian/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1131072,"output":131072},"cost":{"input":0.45,"output":3.2,"cache_read":0.05,"cache_write":0.5625},"canonical_model_id":"alibaba/qwen3.8-27b"},"bailian/qwen3.6-max-preview":{"id":"bailian/qwen3.6-max-preview","name":"Qwen3.6 Max Preview","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":2.15,"output":12.86,"cache_read":0.2,"cache_write":1.17},"canonical_model_id":"alibaba/qwen3.6-max-preview"},"bailian/qwen3.5-flash":{"id":"bailian/qwen3.5-flash","name":"Qwen3.5 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.125},"canonical_model_id":"alibaba/qwen3.5-flash"},"bailian/qwen-plus":{"id":"bailian/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.12,"output":0.29,"cache_read":0.023},"canonical_model_id":"alibaba/qwen-plus"},"bailian/qwen3.8-flash":{"id":"bailian/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.47,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"bailian/qwen3.5-397b-a17b":{"id":"bailian/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.55,"output":3.5,"cache_read":0.55},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"bailian/qwen3.8-max-0902":{"id":"bailian/qwen3.8-max-0902","name":"Qwen3.8 Max 0902","description":"2026-09-02 upgraded snapshot of Qwen3.8 Max with stronger coding, collaborative agents, and multimodal document understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max-0902"},"bailian/qwen3.5-35b-a3b":{"id":"bailian/qwen3.5-35b-a3b","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.29,"output":1.83,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"bailian/qwen3.7-plus":{"id":"bailian/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08,"cache_write":0.5},"canonical_model_id":"alibaba/qwen3.7-plus"},"bailian/qwen3.7-max":{"id":"bailian/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.5,"output":7.5,"cache_read":0.5,"cache_write":3.125},"canonical_model_id":"alibaba/qwen3.7-max"},"bailian/qwen3.6-flash":{"id":"bailian/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":0.31},"canonical_model_id":"alibaba/qwen3.6-flash"},"bailian/qwen3-max":{"id":"bailian/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.36,"output":1.43,"cache_read":0.072},"canonical_model_id":"alibaba/qwen3-max"},"bailian/qwen-turbo":{"id":"bailian/qwen-turbo","name":"Qwen Turbo","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-11-01","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.05,"output":0.09,"cache_read":0.0086},"canonical_model_id":"alibaba/qwen-turbo"},"bailian/qwen3.6-27b":{"id":"bailian/qwen3.6-27b","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.6-27b"},"bailian/qwen3.5-plus":{"id":"bailian/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2.4,"cache_read":0.04,"cache_write":0.4},"canonical_model_id":"alibaba/qwen3.5-plus"},"bailian/qwen3-coder-next":{"id":"bailian/qwen3-coder-next","name":"Qwen3 Coder Next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.2,"output":1.5},"canonical_model_id":"alibaba/qwen3-coder-next"},"bailian/qwen-flash":{"id":"bailian/qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.022,"output":0.22,"cache_read":0.0043,"cache_write":0.027},"canonical_model_id":"alibaba/qwen-flash"},"bailian/qwen-vl-max":{"id":"bailian/qwen-vl-max","name":"Qwen-VL Max","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-04-08","last_updated":"2025-08-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.23,"output":0.58,"cache_read":0.046},"canonical_model_id":"alibaba/qwen-vl-max"},"bailian/qwen3.8-max":{"id":"bailian/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens","min":0,"max":262144}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25,"cache_write":2.5},"canonical_model_id":"alibaba/qwen3.8-max"},"bailian/qwen3.5-27b":{"id":"bailian/qwen3.5-27b","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.29,"output":2.05,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-27b"},"bailian/qwen3-coder-flash":{"id":"bailian/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":2.5,"cache_read":0.06,"cache_write":0.27},"canonical_model_id":"alibaba/qwen3-coder-flash"},"bailian/qwen3.5-122b-a10b":{"id":"bailian/qwen3.5-122b-a10b","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":64000},"cost":{"input":0.29,"output":2.29,"cache_read":0.29},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"moonshotai/kimi-k3.1-pro":{"id":"moonshotai/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2,"output":11,"cache_read":0.2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/kimi-k2.7-code-highspeed":{"id":"moonshotai/kimi-k2.7-code-highspeed","name":"Kimi K2.7 Code Highspeed","description":"Lower-latency Kimi Code variant for interactive edits and coding-agent loops","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.9,"output":8,"cache_read":0.38},"canonical_model_id":"moonshotai/kimi-k2.7-code-highspeed"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.2":{"id":"openai/gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.18},"canonical_model_id":"openai/gpt-5.2"},"openai/gpt-4.1-mini":{"id":"openai/gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"openai/gpt-5.2-codex":{"id":"openai/gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.18},"canonical_model_id":"openai/gpt-5.2-codex"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5":{"id":"openai/gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5"},"openai/gpt-5.1-codex-max":{"id":"openai/gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1-codex-max"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":3.125,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"cache_write":6.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5,"cache_write":6.25}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-4.1":{"id":"openai/gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-5.3-codex":{"id":"openai/gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.75,"output":14,"cache_read":0.18},"canonical_model_id":"openai/gpt-5.3-codex"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.1":{"id":"openai/gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":1.25,"output":10,"cache_read":0.13},"canonical_model_id":"openai/gpt-5.1"},"openai/gpt-5-mini":{"id":"openai/gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32768},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5-mini"},"openai/gpt-5.1-codex-mini":{"id":"openai/gpt-5.1-codex-mini","name":"GPT-5.1 Codex mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.25,"output":2,"cache_read":0.03},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4-pro":{"id":"openai/gpt-5.4-pro","name":"GPT-5.4 Pro","description":"More exact GPT-5.4 tier for demanding professional reasoning and agent tasks","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":false,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.4-pro"},"openai/gpt-5-nano":{"id":"openai/gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.05,"output":0.4,"cache_read":0.01},"canonical_model_id":"openai/gpt-5-nano"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2.5,"output":15,"cache_read":0.25,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-4o":{"id":"openai/gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"provider":{"npm":"@ai-sdk/openai","api":"https://api.ofox.ai/v1"},"cost":{"input":0.15,"output":0.6,"cache_read":0.075},"canonical_model_id":"openai/gpt-4o-mini"},"volcengine/doubao-seed-2.0-code":{"id":"volcengine/doubao-seed-2.0-code","name":"Seed 2.0 Code","description":"ByteDance Seed coding model for multimodal software engineering and long-running agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.67,"output":3.36,"cache_read":0.14,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-code"},"volcengine/doubao-seed-2.0-lite":{"id":"volcengine/doubao-seed-2.0-lite","name":"Seed 2.0 Lite","description":"Cost-efficient ByteDance Seed 2.0 model for production chat, analysis, and structured generation","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.13,"output":0.76,"cache_read":0.03,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-lite"},"volcengine/doubao-seed-character":{"id":"volcengine/doubao-seed-character","name":"Seed Character","description":"ByteDance Seed model optimized for character-driven dialogue and consistent conversational behavior","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.177,"output":0.884,"cache_read":0.024,"cache_write":0.0025},"canonical_model_id":"bytedance-seed/seed-character"},"volcengine/doubao-seed-2.1-turbo":{"id":"volcengine/doubao-seed-2.1-turbo","name":"Seed 2.1 Turbo","description":"Faster ByteDance Seed 2.1 model for multimodal reasoning and latency-sensitive agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.3536,"output":1.7696,"cache_read":0.068,"cache_write":0.0019},"canonical_model_id":"bytedance-seed/seed-2.1-turbo"},"volcengine/doubao-seed-2.0-mini":{"id":"volcengine/doubao-seed-2.0-mini","name":"Seed 2.0 Mini","description":"Lightweight ByteDance Seed 2.0 model for low-latency multimodal reasoning and high-volume tasks","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32000},"cost":{"input":0.06,"output":0.56,"cache_read":0.02,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-mini"},"volcengine/doubao-seed-2.0-pro":{"id":"volcengine/doubao-seed-2.0-pro","name":"Seed 2.0 Pro","description":"Flagship ByteDance Seed 2.0 model for complex multimodal reasoning and long-horizon agent workflows","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-02-14","last_updated":"2026-02-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.67,"output":3.36,"cache_read":0.14,"cache_write":0.0024},"canonical_model_id":"bytedance-seed/seed-2.0-pro"},"volcengine/doubao-seed-evolving":{"id":"volcengine/doubao-seed-evolving","name":"Seed Evolving","description":"Rolling ByteDance Seed model for rapidly updated reasoning, coding, and agent capabilities","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.884,"output":4.42,"cache_read":0.177,"cache_write":0.0025},"canonical_model_id":"bytedance-seed/seed-evolving"},"volcengine/doubao-seed-2.1-pro":{"id":"volcengine/doubao-seed-2.1-pro","name":"Seed 2.1 Pro","description":"Flagship ByteDance Seed 2.1 model for complex multimodal reasoning, coding, and agents","family":"seed","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-23","last_updated":"2026-06-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":0.7072,"output":3.536,"cache_read":0.1416,"cache_write":0.002},"canonical_model_id":"bytedance-seed/seed-2.1-pro"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"MiniMax-M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.1-lightning":{"id":"minimax/minimax-m2.1-lightning","name":"MiniMax-M2.1 Lightning","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.1"},"minimax/minimax-m2.5":{"id":"minimax/minimax-m2.5","name":"MiniMax-M2.5","description":"Prior MiniMax coding model for agent workflows, office edits, and automation","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5"},"minimax/minimax-m2.5-lightning":{"id":"minimax/minimax-m2.5-lightning","name":"MiniMax-M2.5 Lightning","description":"High-speed MiniMax model for low-latency coding and agent workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-02-13","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":2.4,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.5-highspeed"},"minimax/minimax-m2":{"id":"minimax/minimax-m2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.6,"output":2.4,"cache_read":0.12},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7-highspeed":{"id":"minimax/minimax-m2.7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.4,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06,"cache_write":0.375},"canonical_model_id":"minimax/MiniMax-M2.7"},"minimax/m2-her":{"id":"minimax/m2-her","name":"MiniMax-M2 Her","description":"MiniMax M2 variant tuned for conversational and character-driven agent interactions","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-01-23","last_updated":"2026-01-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"output":2048},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2-Her"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.4,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-4.6":{"id":"z-ai/glm-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.6"},"z-ai/glm-5.3-flashx":{"id":"z-ai/glm-5.3-flashx","name":"GLM-5.3-FlashX","description":"High-speed GLM-5.3-Flash serving option for coding and agent workflows","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5v-turbo":{"id":"z-ai/glm-5v-turbo","name":"GLM-5V-Turbo","description":"Fast GLM vision model for screenshots, documents, and multimodal agent tasks","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-01","last_updated":"2026-04-01","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":131072},"cost":{"input":1.2,"output":4,"cache_read":0.24},"canonical_model_id":"zhipuai/glm-5v-turbo"},"z-ai/glm-4.7-flashx":{"id":"z-ai/glm-4.7-flashx","name":"GLM-4.7-FlashX","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.072,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flashx"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"}}},"abacus":{"id":"abacus","env":["ABACUS_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://routellm.abacus.ai/v1","name":"Abacus","doc":"https://abacus.ai/help/api","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"Grok 4.1 Fast (Non-Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-11-17","last_updated":"2025-11-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":16384},"status":"deprecated","cost":{"input":0.2,"output":0.5}},"claude-sonnet-4-20250514":{"id":"claude-sonnet-4-20250514","name":"Claude Sonnet 4","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"qwen-2.5-coder-32b":{"id":"qwen-2.5-coder-32b","name":"Qwen 2.5 Coder 32B","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.79,"output":0.79},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"gpt-5.3-chat-latest":{"id":"gpt-5.3-chat-latest","name":"GPT-5.3 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.3-chat-latest"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","description":"Tiny GPT-4.1 option for classification, routing, and very high-volume tasks","family":"gpt-nano","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.1,"output":0.4,"cache_read":0.025},"canonical_model_id":"openai/gpt-4.1-nano"},"gemini-3.1-flash-image-preview":{"id":"gemini-3.1-flash-image-preview","type":"image","name":"Nano Banana 2 Preview","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-26","last_updated":"2026-02-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"status":"deprecated","cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image-preview"},"mimo-v2-pro":{"id":"mimo-v2-pro","name":"MiMo-V2-Pro","description":"Earlier MiMo Pro model for multimodal agents, reasoning, and code tasks","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1,"output":3,"cache_read":0.2},"canonical_model_id":"xiaomi/mimo-v2-pro"},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2"},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":32768},"cost":{"input":2,"output":6,"cache_read":0.3},"canonical_model_id":"xai/grok-4.5"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":0.4,"output":1.6,"cache_read":0.1},"canonical_model_id":"openai/gpt-4.1-mini"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4},"canonical_model_id":"openai/o4-mini"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5"},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1-codex-max"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1-codex"},"muse-spark-1.1":{"id":"muse-spark-1.1","name":"Muse Spark 1.1","description":"Muse Spark is a natively multimodal reasoning model with support for tool-use, visual chain of thought, and multi-agent orchestration.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-08","last_updated":"2026-07-09","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32000},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.1"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"google/gemini-2.5-pro"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4},"canonical_model_id":"openai/gpt-5.6-sol"},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15},"canonical_model_id":"google/gemini-3.5-flash"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":10},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/gpt-4.1"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":2,"output":8,"cache_read":0.5},"canonical_model_id":"openai/o3"},"gpt-4o-2024-11-20":{"id":"gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2024-11-20","last_updated":"2024-11-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"status":"deprecated","cost":{"input":2.5,"output":10},"canonical_model_id":"openai/gpt-4o-2024-11-20"},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.6-flash"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0.6,"output":3},"canonical_model_id":"moonshotai/kimi-k2.5"},"gemini-3.1-flash-image":{"id":"gemini-3.1-flash-image","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":1048576,"output":32768},"status":"deprecated","cost":{"input":0.5,"output":3},"canonical_model_id":"google/gemini-3.1-flash-image"},"o3-mini":{"id":"o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.1,"output":4.4,"cache_read":0.55},"canonical_model_id":"openai/o3-mini"},"gpt-5.1-chat-latest":{"id":"gpt-5.1-chat-latest","name":"GPT-5.1 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10},"canonical_model_id":"openai/gpt-5.1-chat-latest"},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3.1-pro-preview"},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.25,"output":1.5,"cache_read":0.025},"canonical_model_id":"google/gemini-3.1-flash-lite"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"claude-opus-4-1-20250805":{"id":"claude-opus-4-1-20250805","name":"Claude Opus 4.1","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50},"canonical_model_id":"anthropic/claude-fable-5"},"qwen3.7-max":{"id":"qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2.5,"output":7.5},"canonical_model_id":"alibaba/qwen3.7-max"},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5.1"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"llama-3.3-70b-versatile":{"id":"llama-3.3-70b-versatile","name":"Llama 3.3 70B Versatile","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32768},"status":"deprecated","cost":{"input":0.59,"output":0.79},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.25,"output":2,"cache_read":0.025},"canonical_model_id":"openai/gpt-5-mini"},"claude-opus-4-20250514":{"id":"claude-opus-4-20250514","name":"Claude Opus 4","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":15,"output":75},"canonical_model_id":"anthropic/claude-opus-4-20250514"},"gemini-3.1-flash-lite-preview":{"id":"gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-03-03","last_updated":"2026-03-03","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.25,"output":1.5,"cache_read":0.025,"cache_write":1},"canonical_model_id":"google/gemini-3.1-flash-lite-preview"},"gpt-5.3-codex-xhigh":{"id":"gpt-5.3-codex-xhigh","name":"GPT-5.3 Codex XHigh","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.3-codex"},"gemini-3-pro-image-preview":{"id":"gemini-3-pro-image-preview","type":"image","name":"Nano Banana Pro Preview","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-20","last_updated":"2025-11-20","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"status":"deprecated","cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-image-preview"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-5"},"qwen3-max":{"id":"qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":16384},"status":"deprecated","cost":{"input":1.2,"output":6},"canonical_model_id":"alibaba/qwen3-max"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.6-luna"},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03},"canonical_model_id":"google/gemini-3.5-flash-lite"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.05,"output":0.4,"cache_read":0.005},"canonical_model_id":"openai/gpt-5-nano"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25},"canonical_model_id":"openai/gpt-5.4"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-2.5-flash-image":{"id":"gemini-2.5-flash-image","type":"image","name":"Nano Banana","description":"Nano Banana image model for fast generation, edits, and character-consistent assets","family":"gemini-flash","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-26","last_updated":"2025-08-26","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":32768,"output":32768},"cost":{"input":0.3,"output":30},"canonical_model_id":"google/gemini-2.5-flash-image"},"o3-pro":{"id":"o3-pro","name":"o3-pro","description":"High-effort o3 tier for difficult technical reasoning and careful answers","family":"o-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-06-10","last_updated":"2025-06-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":20,"output":80},"canonical_model_id":"openai/o3-pro"},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"grok-4-0709":{"id":"grok-4-0709","name":"Grok 4","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-07-09","last_updated":"2025-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":16384},"status":"deprecated","cost":{"input":3,"output":15}},"gemini-3-pro-image":{"id":"gemini-3-pro-image","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3-pro-image"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":32768},"cost":{"input":2,"output":6,"cache_read":0.5},"canonical_model_id":"xai/grok-4.6"},"grok-code-fast-1":{"id":"grok-code-fast-1","name":"Grok Code Fast 1","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":16384},"status":"deprecated","cost":{"input":0.2,"output":1.5},"canonical_model_id":"xai/grok-code-fast-1"},"gpt-5.2-chat-latest":{"id":"gpt-5.2-chat-latest","name":"GPT-5.2 Chat Latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"output":128000},"status":"deprecated","cost":{"input":1.75,"output":14},"canonical_model_id":"openai/gpt-5.2-chat-latest"},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"Omni-era GPT for multimodal chat, practical coding, and general assistants","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5-codex":{"id":"gpt-5-codex","name":"GPT-5-Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.25,"output":10,"cache_read":0.125},"canonical_model_id":"openai/gpt-5-codex"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"openai/gpt-5.6-terra"},"qwen3.8-max":{"id":"qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2,"output":6,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-max"},"grok-4-fast-non-reasoning":{"id":"grok-4-fast-non-reasoning","name":"Grok 4 Fast (Non-Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":16384},"status":"deprecated","cost":{"input":0.2,"output":0.5},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"route-llm":{"id":"route-llm","name":"RouteLLM","description":"RouteLLM routes prompts to an appropriate Abacus-backed text-generation model","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-01-01","last_updated":"2026-07-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":64000},"cost":{"input":2,"output":10,"cache_read":0.1}},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-4o-mini"},"kimi-k2-turbo-preview":{"id":"kimi-k2-turbo-preview","name":"Kimi K2 Turbo Preview","description":"Fast Kimi model for responsive chat, coding help, and agent loops","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-08","last_updated":"2025-07-08","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"status":"deprecated","cost":{"input":0.15,"output":8}},"claude-3-7-sonnet-20250219":{"id":"claude-3-7-sonnet-20250219","name":"Claude Sonnet 3.7","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-10-31","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-3-7-sonnet-20250219"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3,"output":15},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"muse-spark-1.2":{"id":"muse-spark-1.2","name":"Muse Spark 1.2","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":1.25,"output":4.25,"cache_read":0.15},"canonical_model_id":"meta/muse-spark-1.2"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25},"canonical_model_id":"anthropic/claude-opus-4-7"},"gemini-3.7-flash":{"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075},"canonical_model_id":"google/gemini-3.7-flash"},"deepseek/deepseek-v3.1":{"id":"deepseek/deepseek-v3.1","name":"DeepSeek V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.55,"output":1.66},"canonical_model_id":"deepseek/deepseek-v3.1"},"google/gemma-4-31b-it":{"id":"google/gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M3"},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.27,"output":0.4},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32768},"status":"deprecated","cost":{"input":0.14,"output":0.28,"cache_read":0.03},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V3.1-Terminus":{"id":"deepseek-ai/DeepSeek-V3.1-Terminus","name":"DeepSeek V3.1 Terminus","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-06-01","last_updated":"2025-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.27,"output":1}},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":32768},"status":"deprecated","cost":{"input":1.74,"output":3.48,"cache_read":0.15},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"DeepSeek R1","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":3,"output":7},"canonical_model_id":"deepseek/deepseek-r1"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.19},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":16384},"cost":{"input":0.037,"output":0.17},"canonical_model_id":"openai/gpt-oss-120b"},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":3.74,"output":9.36,"cache_read":0.748},"canonical_model_id":"thinkingmachines/inkling"},"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8":{"id":"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8","name":"Llama 4 Maverick 17B Instruct","description":"Open multimodal Llama for strong reasoning with efficient everyday serving","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-04-05","last_updated":"2025-04-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":8192},"status":"deprecated","cost":{"input":0.14,"output":0.59},"canonical_model_id":"meta/llama-4-maverick-17b-instruct"},"meta-llama/Meta-Llama-3.1-8B-Instruct":{"id":"meta-llama/Meta-Llama-3.1-8B-Instruct","name":"Llama 3.1 8B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":0.02,"output":0.05},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo":{"id":"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo","name":"Llama 3.1 405B Instruct Turbo","description":"Compact Llama instruction model for fast chat and local deployment","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":4096},"status":"deprecated","cost":{"input":3.5,"output":3.5}},"meta-llama/Meta-Llama-3.3-70B-Instruct":{"id":"meta-llama/Meta-Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"status":"deprecated","cost":{"input":0.59,"output":0.79},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen2.5-72B-Instruct":{"id":"Qwen/Qwen2.5-72B-Instruct","name":"Qwen 2.5 72B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2024-09-19","last_updated":"2024-09-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"status":"deprecated","cost":{"input":0.11,"output":0.38}},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.08,"output":0.28},"canonical_model_id":"alibaba/qwen3-32b"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"cost":{"input":0.32,"output":3.2},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen3-Coder 480B-A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.38,"output":1.55},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"Qwen/QwQ-32B":{"id":"Qwen/QwQ-32B","name":"QwQ 32B","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-03-05","last_updated":"2025-03-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":32768},"status":"deprecated","cost":{"input":0.4,"output":0.4},"canonical_model_id":"alibaba/qwq-32b"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B A22B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":8192},"status":"deprecated","cost":{"input":0.13,"output":0.6},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"zhipuai/glm-4.6"},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1,"output":3.2},"canonical_model_id":"zhipuai/glm-5"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":1.38,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"zai-org/GLM-4.5":{"id":"zai-org/GLM-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":96000},"status":"deprecated","cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.5"}}},"alibaba-coding-plan":{"id":"alibaba-coding-plan","env":["ALIBABA_CODING_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://coding-intl.dashscope.aliyuncs.com/v1","name":"Alibaba Coding Plan","doc":"https://www.alibabacloud.com/help/en/model-studio/coding-plan","models":{"qwen3-max-2026-01-23":{"id":"qwen3-max-2026-01-23","name":"Qwen3 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-23","last_updated":"2026-01-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"input":196601,"output":24576},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3-coder-plus":{"id":"qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3-coder-next":{"id":"qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-11","last_updated":"2026-02-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":16384},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}}}},"sarvam":{"id":"sarvam","env":["SARVAM_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.sarvam.ai/v1","name":"Sarvam AI","doc":"https://docs.sarvam.ai/api-reference-docs/getting-started/models","models":{"sarvam-105b":{"id":"sarvam-105b","name":"Sarvam-105B","description":"Flagship Indian-language reasoning model for enterprise multilingual applications","family":"sarvam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-18","last_updated":"2026-02-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.15790269,"output":0.63161075,"cache_read":0.05263423},"canonical_model_id":"sarvam/sarvam-105b"},"sarvam-30b":{"id":"sarvam-30b","name":"Sarvam-30B","description":"Efficient Indian-language reasoning model for chat, coding, and multilingual work","family":"sarvam","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-18","last_updated":"2026-02-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"status":"deprecated","canonical_model_id":"sarvam/sarvam-30b"}}},"arcee":{"id":"arcee","env":["ARCEE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.arcee.ai/api/v1","name":"Arcee","doc":"https://docs.arcee.ai","models":{"trinity-large-thinking":{"id":"trinity-large-thinking","name":"Trinity Large Thinking","description":"Reasoning-optimized 398B MoE agent model with extended thinking for long-horizon and multi-turn tool use","family":"trinity","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-01","last_updated":"2026-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":80000},"status":"beta","cost":{"input":0.25,"output":0.8,"cache_read":0.06},"canonical_model_id":"arcee-ai/trinity-large-thinking"},"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"beta","cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4-flash-latest":{"id":"deepseek/deepseek-v4-flash-latest","name":"DeepSeek V4 Flash Latest","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"beta","cost":{"input":0.14,"output":0.28,"cache_read":0.028},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"beta","cost":{"input":0.22,"output":0.66,"cache_read":0.007},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":512000,"output":384000},"status":"deprecated","cost":{"input":1.74,"output":3.48,"cache_read":0.2},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4.1-flash-1017":{"id":"deepseek/deepseek-v4.1-flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"beta","cost":{"input":0.3,"output":1.2,"cache_read":0.006},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"beta","cost":{"input":3,"output":15,"cache_read":0.3},"canonical_model_id":"moonshotai/kimi-k3"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0.5,"output":1.2,"cache_read":0.1},"canonical_model_id":"thinkingmachines/inkling-small"},"zai-org/glm-5.2":{"id":"zai-org/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"status":"beta","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/glm-5.3":{"id":"zai-org/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"beta","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/glm-5.3-flash":{"id":"zai-org/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"beta","cost":{"input":0.15,"output":0.5,"cache_read":0.03},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"morph":{"id":"morph","env":["MORPH_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.morphllm.com/v1","name":"Morph","doc":"https://docs.morphllm.com/api-reference/introduction","models":{"morph-kimik3-fast":{"id":"morph-kimik3-fast","name":"Kimi K3 Fast","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":6,"output":22.5,"cache_read":0.6},"canonical_model_id":"moonshotai/kimi-k3"},"morph-dsv41flash-1017":{"id":"morph-dsv41flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"October 17 update of DeepSeek V4.1 Flash with improved reasoning, coding, agentic tasks, and visual understanding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.12,"output":0.8,"cache_read":0.008},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"morph-kimik3":{"id":"morph-kimik3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.5,"output":14,"cache_read":0.29},"canonical_model_id":"moonshotai/kimi-k3"},"morph-dsv4flash":{"id":"morph-dsv4flash","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.141953125,"output":0.399625,"cache_read":0.0359375},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"morph-glm52-744b":{"id":"morph-glm52-744b","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.19,"output":6,"cache_read":0.1955},"canonical_model_id":"zhipuai/glm-5.2"},"morph-v3-large":{"id":"morph-v3-large","name":"Morph V3 Large","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.9,"output":1.9},"canonical_model_id":"morph/morph-v3-large"},"morph-glm53flash":{"id":"morph-glm53flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.2,"output":0.7,"cache_read":0.04},"canonical_model_id":"zhipuai/glm-5.3-flash"},"morph-kimik31":{"id":"morph-kimik31","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2.5,"output":14,"cache_read":0.29},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"morph-glm53-744b":{"id":"morph-glm53-744b","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1.19,"output":6,"cache_read":0.1955},"canonical_model_id":"zhipuai/glm-5.3"},"auto":{"id":"auto","name":"Auto","description":"Automatic model router for matching prompts to suitable backends and budgets","family":"auto","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-06-01","last_updated":"2024-06-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":32000,"output":32000},"cost":{"input":0.85,"output":1.55}},"morph-dsv41flash":{"id":"morph-dsv41flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":0.12,"output":0.8,"cache_read":0.008},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"morph-v3-fast":{"id":"morph-v3-fast","name":"Morph V3 Fast","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"morph","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-07-07","last_updated":"2025-07-07","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":131072},"cost":{"input":0.8,"output":1.2},"canonical_model_id":"morph/morph-v3-fast"}}},"xai":{"id":"xai","env":["XAI_API_KEY"],"npm":"@ai-sdk/xai","name":"xAI","doc":"https://docs.x.ai/docs/models","models":{"grok-4.20-0309-non-reasoning":{"id":"grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"tiers":[{"input":4,"output":12,"cache_read":0.6,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6}},"canonical_model_id":"xai/grok-4.5"},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","description":"xAI's Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"grok-4.20-0309-reasoning":{"id":"grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","description":"Reasoning Grok for document-heavy analysis and long-horizon tool use","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"grok-imagine-video":{"id":"grok-imagine-video","type":"video","name":"Grok Imagine Video","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-28","last_updated":"2026-01-28","modalities":{"input":["text","image","video"],"output":["video"]},"open_weights":false,"limit":{"context":1024,"output":0}},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.7"},"grok-imagine-image":{"id":"grok-imagine-image","type":"image","name":"Grok Imagine Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-28","last_updated":"2026-01-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":16000,"output":0},"canonical_model_id":"xai/grok-imagine-image"},"grok-imagine-video-1.5-lite":{"id":"grok-imagine-video-1.5-lite","type":"video","name":"Grok Imagine Video 1.5 Lite","description":"Cost-efficient video model for text-to-video and image-to-video generation","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-10-01","last_updated":"2026-10-01","modalities":{"input":["text","image"],"output":["video"]},"open_weights":false,"limit":{"context":1024,"output":0},"canonical_model_id":"xai/grok-imagine-video-1.5-lite"},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"tiers":[{"input":4,"output":12,"cache_read":1,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1}},"canonical_model_id":"xai/grok-4.6"},"grok-build-0.1":{"id":"grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"tiers":[{"input":2,"output":4,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4}}},"grok-4.20-multi-agent-0309":{"id":"grok-4.20-multi-agent-0309","name":"Grok 4.20 Multi-Agent","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-03-09","last_updated":"2026-03-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":30000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4}}},"grok-imagine-video-1.5":{"id":"grok-imagine-video-1.5","type":"video","name":"Grok Imagine Video 1.5","description":"Video model for text-to-video, image-to-video, and reference-to-video generation with optional voice references","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-05-30","last_updated":"2026-05-30","modalities":{"input":["text","image","audio"],"output":["video"]},"open_weights":false,"limit":{"context":1024,"output":0},"canonical_model_id":"xai/grok-imagine-video-1.5"}}},"openreason":{"id":"openreason","env":["OPENREASON_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.openreason.app/v1","name":"OpenReason","doc":"https://openreason.app/docs","models":{"deepseek-ai/deepseek-v4-flash-0731":{"id":"deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.1371,"output":0.2743},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.0022,"output":4.22},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1055,"output":0.422},"canonical_model_id":"openai/gpt-oss-120b"}}},"model-oracle-ai":{"id":"model-oracle-ai","env":["MODEL_ORACLE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.modeloracle.com/api/v1","name":"Model Oracle AI","doc":"https://modeloracle.com/setup/","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"canonical_model_id":"openai/gpt-5.5"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"canonical_model_id":"zhipuai/glm-5.2"},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","description":"Affordable GPT-4.1 lane for fast coding help and structured extraction","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"canonical_model_id":"openai/gpt-4.1-mini"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"canonical_model_id":"openai/o4-mini"},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5.4-mini"},"claude-opus-4.8":{"id":"claude-opus-4.8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"canonical_model_id":"anthropic/claude-opus-4-8"},"gpt-5":{"id":"gpt-5","name":"GPT-5","description":"Original GPT-5 workhorse for reasoning, coding, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5"},"claude-haiku-4.5":{"id":"claude-haiku-4.5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"canonical_model_id":"anthropic/claude-haiku-4-5"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"canonical_model_id":"anthropic/claude-sonnet-5"},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","description":"Long-lived GPT workhorse for coding, instruction following, and production apps","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-04-14","last_updated":"2025-04-14","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1047576,"output":32768},"canonical_model_id":"openai/gpt-4.1"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"canonical_model_id":"deepseek/deepseek-v4-pro"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"canonical_model_id":"anthropic/claude-fable-5"},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"canonical_model_id":"openai/gpt-5.4"},"auto":{"id":"auto","name":"Auto","description":"Model Oracle AI decision engine that selects and routes among configured coding-agent models","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-29","last_updated":"2026-07-07","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000}},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"canonical_model_id":"openai/gpt-5.4-nano"}}},"sakana":{"id":"sakana","env":["SAKANA_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.sakana.ai/v1","name":"Sakana AI","doc":"https://console.sakana.ai/models","models":{"fugu-ultra":{"id":"fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"provider":{"shape":"responses"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"fugu-ultra-20260615":{"id":"fugu-ultra-20260615","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"provider":{"shape":"responses"},"cost":{"input":5,"output":30,"cache_read":0.5,"tiers":[{"input":10,"output":45,"cache_read":1,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1}},"canonical_model_id":"sakana/fugu-ultra"},"fugu":{"id":"fugu","name":"Fugu","description":"Multi-agent model for routing expert agents across complex analytical tasks","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"provider":{"shape":"responses"},"canonical_model_id":"sakana/fugu"},"sakana-namazu":{"id":"sakana-namazu","name":"Sakana Namazu","description":"Japanese-specialized reasoning model based on Kimi K2.6 and tuned for Japanese language, culture, and business workflows","family":"sakana-namazu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":65536},"cost":{"input":0.95,"output":4,"cache_read":0.15},"canonical_model_id":"sakana/sakana-namazu"}}},"wallaby":{"id":"wallaby","env":["WALLABY_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.wallabytoken.com/v1","name":"Wallaby","doc":"https://wallabytoken.com/docs","models":{"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":2.7,"output":13.5,"cache_read":0.27},"canonical_model_id":"moonshotai/kimi-k3"}}},"nan":{"id":"nan","env":["NAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.nan.builders/v1","name":"NaN","doc":"https://nan.builders/docs/models","models":{"glm5.3":{"id":"glm5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3"},"gemma4":{"id":"gemma4","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"qwen-image-2.1":{"id":"qwen-image-2.1","type":"image","name":"Qwen-Image-2.1","description":"Unified text-to-image generation and image editing model with native RGBA transparency and reference-image editing","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-09-14","last_updated":"2026-09-21","modalities":{"input":["text"],"output":["image"]},"open_weights":true,"limit":{"context":8192,"output":0},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen-image-2.1"},"qwen3.8-flash":{"id":"qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.8-flash"},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm5.3-flash":{"id":"glm5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3-flash"},"qwen3.6":{"id":"qwen3.6","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0,"output":0},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"}}},"huggingface":{"id":"huggingface","env":["HF_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://router.huggingface.co/v1","name":"Hugging Face","doc":"https://huggingface.co/docs/inference-providers","models":{"XiaomiMiMo/MiMo-V2.5":{"id":"XiaomiMiMo/MiMo-V2.5","name":"MiMo-V2.5","description":"MiMo model for long-context reasoning, perception, and agentic tasks","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.4,"output":2},"canonical_model_id":"xiaomi/mimo-v2.5"},"XiaomiMiMo/MiMo-V2.5-Pro":{"id":"XiaomiMiMo/MiMo-V2.5-Pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1,"output":3},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.14,"output":0.4},"canonical_model_id":"google/gemma-4-31b-it"},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.13,"output":0.4},"canonical_model_id":"google/gemma-4-26b-a4b-it"},"google/gemma-3-27b-it":{"id":"google/gemma-3-27b-it","name":"Gemma 3 27B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.08,"output":0.16},"canonical_model_id":"google/gemma-3-27b-it"},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.1},"canonical_model_id":"google/gemma-3-4b-it"},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08","release_date":"2025-03-12","last_updated":"2025-03-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.05,"output":0.15},"canonical_model_id":"google/gemma-3-12b-it"},"MiniMaxAI/MiniMax-M1-80k":{"id":"MiniMaxAI/MiniMax-M1-80k","name":"MiniMax M1 80K","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":80000},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"minimax/minimax-m1-80k"},"MiniMaxAI/MiniMax-M2.1":{"id":"MiniMaxAI/MiniMax-M2.1","name":"MiniMax-M2.1","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-10","release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.1"},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M3"},"MiniMaxAI/MiniMax-M3.1-Flash":{"id":"MiniMaxAI/MiniMax-M3.1-Flash","name":"MiniMax-M3.1-Flash","description":"Frontier multimodal coding model with 1M context window and tunable thinking depth","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-19","last_updated":"2026-10-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":512000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"minimax/MiniMax-M3.1-Flash"},"MiniMaxAI/MiniMax-M2":{"id":"MiniMaxAI/MiniMax-M2","name":"MiniMax-M2","description":"Efficient open MiniMax model built for coding agents and tool-heavy workflows","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-10-27","last_updated":"2025-10-27","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2"},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek-V3.2","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-12-01","last_updated":"2025-12-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":65536},"cost":{"input":0.28,"output":0.4},"canonical_model_id":"deepseek/deepseek-v3.2"},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.14,"output":0.28},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek-V3.1","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.27,"output":1},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-10-17","last_updated":"2026-10-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"deepseek/deepseek-v4.1-flash-1017"},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.14,"output":0.28},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp":{"id":"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp","name":"DeepSeek V4 Flash Vision Exp","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.44,"output":1.32},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"DeepSeek-V3","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-12-26","last_updated":"2024-12-26","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":8192},"cost":{"input":0.4,"output":1.3},"canonical_model_id":"deepseek/deepseek-v3"},"deepseek-ai/DeepSeek-V3-0324":{"id":"deepseek-ai/DeepSeek-V3-0324","name":"DeepSeek V3 0324","description":"DeepSeek chat model for instruction following, coding, and analysis","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.27,"output":1.12},"canonical_model_id":"deepseek/deepseek-v3-0324"},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.435,"output":0.87,"cache_read":0.003625},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","description":"Fast DeepSeek model for efficient chat, coding help, and agent loops","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek-R1-0528","description":"DeepSeek reasoning model for multi-step analysis, math, coding, and tools","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":3,"output":5},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.32,"output":3.96},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"DeepSeek-R1","description":"Classic open reasoning model for transparent math, coding, and deliberate problem solving","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-07","release_date":"2025-01-20","last_updated":"2025-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":64000,"output":32768},"cost":{"input":0.7,"output":2.5},"canonical_model_id":"deepseek/deepseek-r1"},"tencent/Hy4-preview":{"id":"tencent/Hy4-preview","name":"Hy4 preview","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":64000},"cost":{"input":0.834,"output":2.501},"canonical_model_id":"tencent/hy4-preview"},"tencent/Hy3":{"id":"tencent/Hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":128000},"cost":{"input":0.14,"output":0.58},"canonical_model_id":"tencent/hy3"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":3,"output":15},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"Kimi-K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi-K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshotai/Kimi-K2-Instruct":{"id":"moonshotai/Kimi-K2-Instruct","name":"Kimi-K2-Instruct","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":1,"output":3},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"moonshotai/Kimi-K2-Instruct-0905":{"id":"moonshotai/Kimi-K2-Instruct-0905","name":"Kimi-K2-Instruct-0905","description":"Kimi model for long-context chat, coding, and agentic reasoning","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":1,"output":3},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/Kimi-K2-Thinking":{"id":"moonshotai/Kimi-K2-Thinking","name":"Kimi-K2-Thinking","description":"Kimi reasoning model for long-horizon research, planning, and tool use","family":"kimi-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2024-08","release_date":"2025-11-06","last_updated":"2025-11-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":2.5,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2-thinking"},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.1,"output":0.5},"canonical_model_id":"openai/gpt-oss-20b"},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.25,"output":0.69},"canonical_model_id":"openai/gpt-oss-120b"},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","description":"Efficient model for low-latency assistance, extraction, and routine automation","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":1048576},"cost":{"input":0.5,"output":1.2},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":1,"output":4.05},"canonical_model_id":"thinkingmachines/inkling"},"meta-llama/Llama-3.1-8B-Instruct":{"id":"meta-llama/Llama-3.1-8B-Instruct","name":"Llama-3.1-8B-Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.06,"output":0.06},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta-llama/Llama-Guard-4-12B":{"id":"meta-llama/Llama-Guard-4-12B","name":"Llama Guard 4 12B","description":"Multimodal Llama 4-based safety classifier for moderating prompts and responses","family":"llama","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.18,"output":0.18},"canonical_model_id":"meta/llama-guard-4-12b"},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","description":"Popular open Llama workhorse for multilingual chat, coding, and self-hosting","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-12-06","last_updated":"2024-12-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":4096},"cost":{"input":0.59,"output":0.79},"canonical_model_id":"meta/llama-3.3-70b-instruct"},"Qwen/Qwen3-VL-30B-A3B-Instruct":{"id":"Qwen/Qwen3-VL-30B-A3B-Instruct","name":"Qwen3 VL 30B A3B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-10-04","last_updated":"2025-10-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.2,"output":0.7},"canonical_model_id":"alibaba/qwen3-vl-30b-a3b-instruct"},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3-235B-A22B-Thinking-2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":81920},"cost":{"input":0.3,"output":3},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"Qwen/Qwen3-235B-A22B":{"id":"Qwen/Qwen3-235B-A22B","name":"Qwen3 235B-A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5-397B-A17B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.29,"output":0.59},"canonical_model_id":"alibaba/qwen3-32b"},"Qwen/Qwen2.5-Coder-32B-Instruct":{"id":"Qwen/Qwen2.5-Coder-32B-Instruct","name":"Qwen2.5-Coder-32B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2024-11-12","last_updated":"2024-11-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.06,"output":0.2},"canonical_model_id":"alibaba/qwen2.5-coder-32b-instruct"},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen3.5 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.3,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-27b"},"Qwen/Qwen3-VL-235B-A22B-Instruct":{"id":"Qwen/Qwen3-VL-235B-A22B-Instruct","name":"Qwen3 VL 235B A22B Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":1.5},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-instruct"},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.47,"output":3.19},"canonical_model_id":"alibaba/qwen3.6-27b"},"Qwen/Qwen3-Coder-Next":{"id":"Qwen/Qwen3-Coder-Next","name":"Qwen3-Coder-Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.2,"output":1.5},"canonical_model_id":"alibaba/qwen3-coder-next"},"Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next-80B-A3B-Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.25,"output":1},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen3-Coder-480B-A35B-Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":2,"output":2},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"Qwen/Qwen3-Embedding-4B":{"id":"Qwen/Qwen3-Embedding-4B","type":"embedding","name":"Qwen 3 Embedding 4B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-12","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"provider":{"api":"https://router.huggingface.co/deepinfra/v1/openai"},"cost":{"input":0.01,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-4b"},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.4,"output":3.2},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"Qwen/Qwen3.8-2.4T-A95B":{"id":"Qwen/Qwen3.8-2.4T-A95B","name":"Qwen3.8 2.4T A95B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":2.5,"output":6.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.17,"output":0.25},"canonical_model_id":"alibaba/qwen3.5-9b"},"Qwen/Qwen3-30B-A3B":{"id":"Qwen/Qwen3-30B-A3B","name":"Qwen3 30B A3B","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":16384},"cost":{"input":0.12,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"Qwen/Qwen3.8-27B":{"id":"Qwen/Qwen3.8-27B","name":"Qwen3.8 27B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.4,"output":3},"canonical_model_id":"alibaba/qwen3.8-27b"},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":16384},"cost":{"input":0.855,"output":2.565},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen3-Coder 30B-A3B Instruct","description":"Smaller Qwen coder for efficient local agents and repo-level fixes","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.07,"output":0.26},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"Qwen/Qwen3-8B":{"id":"Qwen/Qwen3-8B","name":"Qwen3 8B","description":"Dense 8B Qwen3 model with switchable thinking for chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-04-29","last_updated":"2025-04-29","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":32768},"cost":{"input":0.07,"output":0.18},"canonical_model_id":"alibaba/qwen3-8b"},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen3.5 35B-A3B","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.25,"output":2},"canonical_model_id":"alibaba/qwen3.5-35b-a3b"},"Qwen/Qwen3-Embedding-8B":{"id":"Qwen/Qwen3-Embedding-8B","type":"embedding","name":"Qwen 3 Embedding 8B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-12","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32768,"output":0},"provider":{"api":"https://router.huggingface.co/deepinfra/v1/openai"},"cost":{"input":0.01,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-8b"},"Qwen/Qwen3-VL-235B-A22B-Thinking":{"id":"Qwen/Qwen3-VL-235B-A22B-Thinking","name":"Qwen3 VL 235B A22B Thinking","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.98,"output":3.95},"canonical_model_id":"alibaba/qwen3-vl-235b-a22b-thinking"},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.15,"output":0.95},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM-5.3-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.15,"output":0.5},"canonical_model_id":"zhipuai/glm-5.3-flash"},"zai-org/GLM-4.6V-Flash":{"id":"zai-org/GLM-4.6V-Flash","name":"GLM-4.6V-Flash","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12-08","last_updated":"2025-12-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.3,"output":0.9},"canonical_model_id":"zhipuai/glm-4.6v-flash"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":1.4,"output":4.4},"canonical_model_id":"zhipuai/glm-5.2"},"zai-org/GLM-4.7-Flash":{"id":"zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash","description":"Efficient GLM model for fast reasoning, coding, and agent workflows","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM-5.3","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.4,"output":4.4},"canonical_model_id":"zhipuai/glm-5.3"},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"GLM-4.5-Air","description":"Lighter GLM-4.5 variant for fast coding assistance and cheaper agents","family":"glm-air","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.13,"output":0.85},"canonical_model_id":"zhipuai/glm-4.5-air"},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","description":"Late GLM-4 workhorse for coding agents, reasoning, and structured tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-30","last_updated":"2025-09-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"zhipuai/glm-4.6"},"zai-org/AutoGLM-Phone-9B-Multilingual":{"id":"zai-org/AutoGLM-Phone-9B-Multilingual","name":"AutoGLM Phone 9B Multilingual","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-12-10","last_updated":"2025-12-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.035,"output":0.138},"canonical_model_id":"zhipuai/autoglm-phone-9b-multilingual"},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2,"cache_read":0.11},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/GLM-4.5V":{"id":"zai-org/GLM-4.5V","name":"GLM-4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6,"output":1.8},"canonical_model_id":"zhipuai/glm-4.5v"},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5"},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":1,"output":3.2,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.1"},"stepfun-ai/Step-3.5-Flash":{"id":"stepfun-ai/Step-3.5-Flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"stepfun/step-3.5-flash"},"stepfun-ai/Step-3.7-Flash":{"id":"stepfun-ai/Step-3.7-Flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":256000},"cost":{"input":0.2,"output":1.15},"canonical_model_id":"stepfun/step-3.7-flash"}}},"kenari":{"id":"kenari","env":["KENARI_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://kenari.id/v1","name":"Kenari","doc":"https://kenari.id/docs","models":{"gemini-3-1-flash-lite":{"id":"gemini-3-1-flash-lite","name":"Gemini 3.1 Flash Lite","description":"Low-latency Gemini model for high-volume multimodal and agent workloads","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-07","last_updated":"2026-05-07","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.28571429,"output":1.71428571,"cache_read":0.02857143,"cache_write":0.08571429},"canonical_model_id":"google/gemini-3.1-flash-lite"},"gpt-5-6-terra":{"id":"gpt-5-6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"status":"deprecated","cost":{"input":2.4,"output":14.28571429},"canonical_model_id":"openai/gpt-5.6-terra"},"grok-4-6":{"id":"grok-4-6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2.28571429,"output":6.85714286,"cache_read":0.34285714},"canonical_model_id":"xai/grok-4.6"},"nemotron-3-ultra-550b-a55b":{"id":"nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","description":"Largest Nemotron 3 model for maximum open-weight reasoning and agent accuracy","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-06-04","last_updated":"2026-06-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.68571429,"output":4.28571429,"cache_read":0.06857143},"canonical_model_id":"nvidia/nemotron-3-ultra-550b-a55b"},"mistral-large:free":{"id":"mistral-large:free","name":"Mistral Large (Free)","description":"Flagship Mistral model for advanced reasoning, coding, and multilingual work","family":"mistral-large","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-11","release_date":"2024-11-01","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"mistral/mistral-large-latest"},"nano-banana-2-lite":{"id":"nano-banana-2-lite","type":"image","name":"Nano Banana 2 Lite","description":"Fastest, most cost-efficient Gemini image model for high-volume 1K generation and editing","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":4096},"canonical_model_id":"google/gemini-3.1-flash-lite-image"},"nano-banana-2":{"id":"nano-banana-2","type":"image","name":"Nano Banana 2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","video","pdf"],"output":["text","image"]},"open_weights":false,"limit":{"context":131072,"output":32768},"canonical_model_id":"google/gemini-3.1-flash-image"},"grok-imagine-image-2-0":{"id":"grok-imagine-image-2-0","type":"image","name":"Grok Imagine Image 2.0","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-08-07","last_updated":"2026-08-07","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":64000,"output":0},"canonical_model_id":"xai/grok-imagine-image-2.0"},"glm-5-3-flash":{"id":"glm-5-3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.11428571,"output":0.34285714,"cache_read":0.02285714},"canonical_model_id":"zhipuai/glm-5.3-flash"},"hy3:free":{"id":"hy3:free","name":"Hy3 (Free)","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0,"output":0},"canonical_model_id":"tencent/hy3"},"mistral-medium-3-5:free":{"id":"mistral-medium-3-5:free","name":"Mistral Medium 3.5 (Free)","description":"Balanced Mistral model for enterprise assistants, multilingual work, and tools","family":"mistral-medium","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-29","last_updated":"2026-04-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"mistral/mistral-medium-2604"},"nemotron-3-nano-30b-a3b":{"id":"nemotron-3-nano-30b-a3b","name":"Nemotron 3 Nano 30B A3B","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"},"glm-5-2":{"id":"glm-5-2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.28571429,"output":3.42857143,"cache_read":0.05314286},"canonical_model_id":"zhipuai/glm-5.2"},"kimi-k2-7-code:free":{"id":"kimi-k2-7-code:free","name":"Kimi K2.7 Code (Free)","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-5-4-mini":{"id":"gpt-5-4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":0.85714286,"output":5.37142857},"canonical_model_id":"openai/gpt-5.4-mini"},"gpt-5-6-luna":{"id":"gpt-5-6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":0.2,"output":1.14285714,"cache_read":0.02,"cache_write":0.25714286},"canonical_model_id":"openai/gpt-5.6-luna"},"gpt-5-6-sol":{"id":"gpt-5-6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"cost":{"input":2.97142857,"output":17.71428571,"cache_read":1.18857143,"cache_write":3.71428571},"canonical_model_id":"openai/gpt-5.6-sol"},"kimi-k3":{"id":"kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.85714286,"output":8.57142857,"cache_read":0.11428571},"canonical_model_id":"moonshotai/kimi-k3"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.42857143,"output":7.14285714,"cache_read":0.57142857,"cache_write":1.71428571},"canonical_model_id":"anthropic/claude-sonnet-5"},"gemini-3-1-flash-tts":{"id":"gemini-3-1-flash-tts","type":"speech","name":"Gemini 3.1 Flash TTS Preview","description":"Low-latency speech generation with steerable prompts and expressive audio tags","family":"gemini-flash","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-15","last_updated":"2026-04-15","modalities":{"input":["text"],"output":["audio"]},"open_weights":false,"limit":{"context":8192,"output":16384},"provider":{"npm":"@ai-sdk/openai"},"canonical_model_id":"google/gemini-3.1-flash-tts-preview"},"gemini-3-6-flash":{"id":"gemini-3-6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.34285714,"output":1.71428571,"cache_read":0.03428571,"cache_write":0.01714286},"canonical_model_id":"google/gemini-3.6-flash"},"kimi-k2-7-code":{"id":"kimi-k2-7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.57142857,"output":2.85714286,"cache_read":0.11428571},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"gpt-image-2":{"id":"gpt-image-2","type":"image","name":"GPT-Image-2","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"gpt-image","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-04-21","last_updated":"2026-04-21","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":272000,"output":16384},"canonical_model_id":"openai/gpt-image-2"},"grok-4-5":{"id":"grok-4-5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2.28571429,"output":6.85714286,"cache_read":0.34285714},"canonical_model_id":"xai/grok-4.5"},"qwen3-7-plus":{"id":"qwen3-7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.38285714,"output":1.48571429,"cache_read":0.07428571,"cache_write":0.48},"canonical_model_id":"alibaba/qwen3.7-plus"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.036,"output":0.15428571,"cache_read":0.00371429},"canonical_model_id":"openai/gpt-oss-20b"},"grok-build-0-1":{"id":"grok-build-0-1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"status":"deprecated","canonical_model_id":"xai/grok-build-0.1"},"nano-banana-pro":{"id":"nano-banana-pro","type":"image","name":"Nano Banana Pro","description":"Nano Banana Pro for higher-fidelity image generation and design-heavy edits","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text","image"]},"open_weights":false,"limit":{"context":65536,"output":32768},"canonical_model_id":"google/gemini-3-pro-image"},"grok-imagine-image":{"id":"grok-imagine-image","type":"image","name":"Grok Imagine Image","description":"Image model for prompt-driven generation, editing, and visual design workflows","family":"grok","attachment":true,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2026-01-28","last_updated":"2026-01-28","modalities":{"input":["text","image"],"output":["image"]},"open_weights":false,"limit":{"context":16000,"output":0},"canonical_model_id":"xai/grok-imagine-image"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.57142857,"output":1.14285714,"cache_read":0.00571429},"canonical_model_id":"deepseek/deepseek-v4-pro"},"mimo-v2-5":{"id":"mimo-v2-5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.16571429,"output":0.33142857},"canonical_model_id":"xiaomi/mimo-v2.5"},"gpt-5-5":{"id":"gpt-5-5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5.71428571,"output":36,"cache_read":0.57142857},"canonical_model_id":"openai/gpt-5.5"},"minimax-m2-7":{"id":"minimax-m2-7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.36,"output":1.42857143,"cache_read":0.06857143},"canonical_model_id":"minimax/MiniMax-M2.7"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":12,"output":57.14285714,"cache_read":1.2,"cache_write":14.85714286},"canonical_model_id":"anthropic/claude-fable-5"},"gemini-3-7-flash":{"id":"gemini-3-7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.34285714,"output":1.71428571,"cache_read":0.03428571,"cache_write":0.01714286},"canonical_model_id":"google/gemini-3.7-flash"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":512000},"cost":{"input":0.36,"output":1.42857143,"cache_read":0.06857143},"canonical_model_id":"minimax/MiniMax-M3"},"kimi-k2-6":{"id":"kimi-k2-6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.57142857,"output":2.85714286,"cache_read":0.28571429},"canonical_model_id":"moonshotai/kimi-k2.6"},"step-3-7-flash":{"id":"step-3-7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.24,"output":1.37142857,"cache_read":0.048},"canonical_model_id":"stepfun/step-3.7-flash"},"deepseek-v4-flash":{"id":"deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15714286,"output":0.31428571,"cache_read":0.00371429},"canonical_model_id":"deepseek/deepseek-v4-flash"},"deepseek-v4-1-flash":{"id":"deepseek-v4-1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.15714286,"output":0.31428571,"cache_read":0.00371429},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"glm-5-3":{"id":"glm-5-3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0.28571429,"output":3.42857143,"cache_read":0.05314286},"canonical_model_id":"zhipuai/glm-5.3"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.71428571,"output":28.57142857,"cache_read":2.28571429,"cache_write":5.71428571},"canonical_model_id":"anthropic/claude-opus-5"},"deepseek-v4-flash:free":{"id":"deepseek-v4-flash:free","name":"DeepSeek V4 Flash (Free)","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"deepseek/deepseek-v4-flash"},"glm-5-1":{"id":"glm-5-1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"status":"deprecated","canonical_model_id":"zhipuai/glm-5.1"},"gemini-2-5-flash":{"id":"gemini-2-5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","canonical_model_id":"google/gemini-2.5-flash"},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.10285714,"output":0.40571429,"cache_read":0.04114286},"canonical_model_id":"google/gemma-4-31b-it"},"minimax-m2-7-highspeed":{"id":"minimax-m2-7-highspeed","name":"MiniMax-M2.7-highspeed","description":"Low-latency M2.7 variant for interactive coding plans and agent loops","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.59428571,"output":2.4,"cache_read":0.11428571},"canonical_model_id":"minimax/MiniMax-M2.7-highspeed"},"gemini-3-5-flash":{"id":"gemini-3-5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","canonical_model_id":"google/gemini-3.5-flash"},"hy3":{"id":"hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":192000,"output":128000},"cost":{"input":0.15428571,"output":0.62857143,"cache_read":0.01542857},"canonical_model_id":"tencent/hy3"},"step-3-7-flash:free":{"id":"step-3-7-flash:free","name":"Step 3.7 Flash (Free)","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"stepfun/step-3.7-flash"},"glm-4-7-flash:free":{"id":"glm-4-7-flash:free","name":"GLM-4.7-Flash (Free)","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-4.7-flash"},"mimo-v2-5:free":{"id":"mimo-v2-5:free","name":"MiMo-V2.5 (Free)","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"xiaomi/mimo-v2.5"},"kimi-k2-6:free":{"id":"kimi-k2-6:free","name":"Kimi K2.6 (Free)","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"status":"deprecated","cost":{"input":0,"output":0},"canonical_model_id":"moonshotai/kimi-k2.6"},"qwen3-8-max":{"id":"qwen3-8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":2.4,"output":6.85714286,"cache_read":0.29714286,"cache_write":2.97142857},"canonical_model_id":"alibaba/qwen3.8-max"},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.71428571,"output":29.71428571,"cache_read":0.57142857,"cache_write":7.42857143},"canonical_model_id":"anthropic/claude-opus-4-8"},"nemotron-3-super-120b-a12b":{"id":"nemotron-3-super-120b-a12b","name":"Nemotron 3 Super 120B A12B","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.09714286,"output":0.48,"cache_read":0.00971429},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"whisper-large-v3-turbo":{"id":"whisper-large-v3-turbo","type":"transcription","name":"Whisper Large v3 Turbo","description":"Speech transcription model for accurate audio-to-text and captioning workflows","family":"whisper","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2024-10-01","last_updated":"2024-10-01","modalities":{"input":["audio"],"output":["text"]},"open_weights":true,"limit":{"context":448,"output":448},"provider":{"npm":"@ai-sdk/openai"},"canonical_model_id":"openai/whisper-large-v3-turbo"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open GPT reasoning model for self-hosted agents and controllable deployments","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.036,"output":0.2,"cache_read":0.0036},"canonical_model_id":"openai/gpt-oss-120b"},"nemotron-3-super-120b-a12b:free":{"id":"nemotron-3-super-120b-a12b:free","name":"Nemotron 3 Super 120B A12B (Free)","description":"Nemotron middle tier for collaborative agents and high-volume reasoning workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium"]}],"tool_call":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-11","last_updated":"2026-03-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0,"output":0},"canonical_model_id":"nvidia/nemotron-3-super-120b-a12b"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":3.6,"output":17.71428571,"cache_read":0.36,"cache_write":4.45714286},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5.71428571,"output":29.71428571,"cache_read":0.57142857,"cache_write":7.42857143},"canonical_model_id":"anthropic/claude-opus-4-7"},"mimo-v2-5-pro":{"id":"mimo-v2-5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"status":"deprecated","cost":{"input":0.52,"output":1.02857143},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"gemini-2-5-flash-lite":{"id":"gemini-2-5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","canonical_model_id":"google/gemini-2.5-flash-lite"},"gemini-3-1-pro":{"id":"gemini-3-1-pro","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.2,"output":7.14285714,"cache_read":0.12,"cache_write":0.22285714},"canonical_model_id":"google/gemini-3.1-pro-preview"}}},"vultr":{"id":"vultr","env":["VULTR_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.vultrinference.com/v1","name":"Vultr","doc":"https://api.vultrinference.com/","models":{"mimo-v2.6-flash-rl":{"id":"mimo-v2.6-flash-rl","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.25},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.75,"output":3},"canonical_model_id":"zhipuai/glm-5.2"},"glm-5.x-menthol":{"id":"glm-5.x-menthol","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":131072},"cost":{"input":0.4,"output":1.75},"canonical_model_id":"zhipuai/glm-5"},"qwen3.8-27b":{"id":"qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0.15,"output":1},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen3.8-flash-next":{"id":"qwen3.8-flash-next","name":"Qwen3.8 Flash Next","description":"Open-weight experimental preview of the Qwen4 architecture: hybrid-attention MoE (125B total, 6B active) with vision encoder for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-27","last_updated":"2026-08-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.1,"output":0.2},"canonical_model_id":"alibaba/qwen3.8-flash-next"},"nemotron-3-nano-omni-30b-a3b-reasoning":{"id":"nemotron-3-nano-omni-30b-a3b-reasoning","name":"Nemotron 3 Nano Omni 30B A3B Reasoning","description":"Open Nemotron omni model combining reasoning with text, vision, and audio","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-04-28","last_updated":"2026-04-28","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.1,"output":0.25},"canonical_model_id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"},"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"mimo-v2.6-pro-rl":{"id":"mimo-v2.6-pro-rl","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.4,"output":0.8},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.75,"output":3},"canonical_model_id":"zhipuai/glm-5.3"},"minimax-m3":{"id":"minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":524288,"output":512000},"cost":{"input":0.2,"output":0.9},"canonical_model_id":"minimax/MiniMax-M3"},"glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.35},"canonical_model_id":"zhipuai/glm-5.3-flash"},"laguna-s-2.1":{"id":"laguna-s-2.1","name":"Laguna S 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":32768},"status":"deprecated","cost":{"input":0.09,"output":0.18},"canonical_model_id":"poolside/laguna-s-2.1"},"muse-glimmer-30b":{"id":"muse-glimmer-30b","name":"Muse Glimmer 30B","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.25,"output":1},"canonical_model_id":"meta/muse-glimmer-30b"},"deepseek-v4-flash-0731":{"id":"deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","description":"Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-07-31","last_updated":"2026-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":384000},"status":"deprecated","cost":{"input":0.1,"output":0.25},"canonical_model_id":"deepseek/deepseek-v4-flash-0731"},"nemotron-3.5-content-safety":{"id":"nemotron-3.5-content-safety","name":"Nemotron 3.5 Content Safety","description":"Safety model for policy screening, moderation, and risk-aware routing workflows","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"temperature":true,"release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0.05,"output":0.15},"canonical_model_id":"nvidia/nemotron-3.5-content-safety"}}},"ai21":{"id":"ai21","env":["AI21_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.ai21.com/studio/v1","name":"AI21 Labs","doc":"https://docs.ai21.com/docs/jamba-foundation-models","models":{"jamba-mini":{"id":"jamba-mini","name":"Jamba Mini","description":"AI21's efficient, lightweight hybrid SSM-Transformer model for a wide range of tasks","family":"jamba","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-22","release_date":"2026-01-08","last_updated":"2026-01-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":0.2,"output":0.4},"canonical_model_id":"ai21/jamba-mini"},"jamba-large":{"id":"jamba-large","name":"Jamba Large","description":"AI21's hybrid SSM-Transformer long-context model for enterprise agents and grounded generation","family":"jamba","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-08-22","release_date":"2025-07-03","last_updated":"2025-07-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":4096},"cost":{"input":2,"output":8},"canonical_model_id":"ai21/jamba-large"}}},"clarifai":{"id":"clarifai","env":["CLARIFAI_PAT"],"npm":"@ai-sdk/openai-compatible","api":"https://api.clarifai.com/v2/ext/openai/v1","name":"Clarifai","doc":"https://docs.clarifai.com/compute/inference/","models":{"arcee_ai/AFM/models/trinity-mini":{"id":"arcee_ai/AFM/models/trinity-mini","name":"Trinity Mini","description":"Reasoning-tuned 26B MoE model with 3B active parameters for agents, tools, and multi-step workloads","family":"trinity","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2025-12-01","last_updated":"2026-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.045,"output":0.15},"canonical_model_id":"arcee-ai/trinity-mini"},"minimaxai/chat-completion/models/MiniMax-M2_5-high-throughput":{"id":"minimaxai/chat-completion/models/MiniMax-M2_5-high-throughput","name":"MiniMax-M2.5 High Throughput","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2},"canonical_model_id":"minimax/MiniMax-M2.5"},"qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct":{"id":"qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen3 Coder 30B A3B Instruct","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-31","last_updated":"2025-07-31","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.11458,"output":0.74812},"canonical_model_id":"alibaba/qwen3-coder-30b-a3b-instruct"},"qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507":{"id":"qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507","name":"Qwen3 30B A3B Thinking 2507","description":"Qwen reasoning model for deliberate problem solving, math, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-31","last_updated":"2026-02-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.36,"output":1.3}},"qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507":{"id":"qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507","name":"Qwen3 30B A3B Instruct 2507","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.3,"output":0.5},"canonical_model_id":"alibaba/qwen3-30b-a3b-instruct-2507"},"deepseek-ai/deepseek-ocr/models/DeepSeek-OCR":{"id":"deepseek-ai/deepseek-ocr/models/DeepSeek-OCR","name":"DeepSeek OCR","description":"OCR model for extracting structured text from documents and screenshots","family":"deepseek","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-10-20","last_updated":"2026-02-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.2,"output":0.7}},"mistralai/completion/models/Ministral-3-14B-Reasoning-2512":{"id":"mistralai/completion/models/Ministral-3-14B-Reasoning-2512","name":"Ministral 3 14B Reasoning 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-12","release_date":"2025-12-01","last_updated":"2025-12-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":2.5,"output":1.7}},"mistralai/completion/models/Ministral-3-3B-Reasoning-2512":{"id":"mistralai/completion/models/Ministral-3-3B-Reasoning-2512","name":"Ministral 3 3B Reasoning 2512","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"release_date":"2025-12","last_updated":"2026-02-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.039,"output":0.54825}},"moonshotai/chat-completion/models/Kimi-K2_6":{"id":"moonshotai/chat-completion/models/Kimi-K2_6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.95,"output":4},"canonical_model_id":"moonshotai/kimi-k2.6"},"openai/chat-completion/models/gpt-oss-120b-high-throughput":{"id":"openai/chat-completion/models/gpt-oss-120b-high-throughput","name":"GPT OSS 120B High Throughput","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.09,"output":0.36},"canonical_model_id":"openai/gpt-oss-120b"},"openai/chat-completion/models/gpt-oss-20b":{"id":"openai/chat-completion/models/gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.045,"output":0.18},"canonical_model_id":"openai/gpt-oss-20b"},"clarifai/main/models/mm-poly-8b":{"id":"clarifai/main/models/mm-poly-8b","name":"MM Poly 8B","description":"Multimodal model for analyzing text, images, documents, and rich media","family":"mm-poly","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-06","last_updated":"2026-02-25","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":32768,"output":4096},"cost":{"input":0.658,"output":1.11}}}},"stepfun-step-plan":{"id":"stepfun-step-plan","env":["STEPFUN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.stepfun.com/step_plan/v1","name":"StepFun Step Plan (China)","doc":"https://platform.stepfun.com/docs/zh/step-plan/integrations/reasoning-api","models":{"step-5-preview":{"id":"step-5-preview","name":"Step 5 Preview","description":"StepFun's next-generation flagship base model for coding and professional knowledge work, with native text, image, and video input and a 1M-token context window","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-09-16","last_updated":"2026-09-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":65536},"canonical_model_id":"stepfun/step-5-preview"},"step-router-v1":{"id":"step-router-v1","name":"Step Router v1","description":"StepFun routing model that dispatches requests to the appropriate Step model.","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"input":256000,"output":256000}},"step-3.5-flash-2603":{"id":"step-3.5-flash-2603","name":"Step 3.5 Flash 2603","description":"StepFun flash model for efficient multimodal reasoning, coding, and tool use","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.5-flash-2603"},"step-3.7-flash":{"id":"step-3.7-flash","name":"Step 3.7 Flash","description":"Newer StepFun flash model for faster agents, coding, and multimodal prompts","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2026-03-01","release_date":"2026-05-29","last_updated":"2026-05-29","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.7-flash"},"step-3.5-flash":{"id":"step-3.5-flash","name":"Step 3.5 Flash","description":"StepFun flash lane for quick multimodal reasoning and coding assistance","family":"step","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-29","last_updated":"2026-02-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"canonical_model_id":"stepfun/step-3.5-flash"}}},"tokenrouter":{"id":"tokenrouter","env":["TOKENROUTER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.tokenrouter.com/v1","name":"TokenRouter","doc":"https://www.tokenrouter.com/docs/tokenrouter-feature-guide/","models":{"z-ai/glm-5.3-free":{"id":"z-ai/glm-5.3-free","name":"GLM-5.3 (free)","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"cost":{"input":0,"output":0},"canonical_model_id":"zhipuai/glm-5.3"}}},"iteracompute":{"id":"iteracompute","env":["ITERACOMPUTE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.iteracompute.com/v1","name":"IteraCompute","doc":"https://iteracompute.com/docs.html","models":{"deepseek/deepseek-v4-pro-0813":{"id":"deepseek/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","description":"DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-13","last_updated":"2026-08-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.79,"output":2.38,"cache_read":0.026},"canonical_model_id":"deepseek/deepseek-v4-pro-0813"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.17,"output":0.7,"cache_read":0.005},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-flash-0731":{"id":"deepseek/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731 (legacy alias)","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":393216},"cost":{"input":0.17,"output":0.7,"cache_read":0.005},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"qwen/qwen3.8-27b":{"id":"qwen/qwen3.8-27b","name":"Qwen3.8 27B","description":"Dense 27B vision-language model for coding, agent tasks, and image and video understanding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":8192},"cost":{"input":0,"output":0,"cache_read":0},"canonical_model_id":"alibaba/qwen3.8-27b"},"qwen/qwen3.8-2.4t-a95b":{"id":"qwen/qwen3.8-2.4t-a95b","name":"Qwen3.8 2.4T A95B","description":"Open-weight sparse MoE (2.4T total, 95B active), the open-weight twin of Qwen3.8 Max for coding, research, complex reasoning, and agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":1.95,"output":5.7,"cache_read":0.25},"canonical_model_id":"alibaba/qwen3.8-2.4t-a95b"},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":999999},"cost":{"input":2.35,"output":11.76,"cache_read":0.23},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/kimi-k2.7-code":{"id":"moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":235929},"cost":{"input":0.69,"output":3.29,"cache_read":0.15},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":524288},"cost":{"input":0.3,"output":1.19,"cache_read":0.05},"canonical_model_id":"minimax/MiniMax-M3"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.82,"output":2.88,"cache_read":0.2},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.08,"output":0.28,"cache_read":0.023},"canonical_model_id":"zhipuai/glm-5.3-flash"}}},"alibaba-coding-plan-cn":{"id":"alibaba-coding-plan-cn","env":["ALIBABA_CODING_PLAN_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://coding.dashscope.aliyuncs.com/v1","name":"Alibaba Coding Plan (China)","doc":"https://help.aliyun.com/zh/model-studio/coding-plan","models":{"qwen3-max-2026-01-23":{"id":"qwen3-max-2026-01-23","name":"Qwen3 Max","description":"Flagship Qwen model for complex reasoning, coding, and agentic workflows","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-23","last_updated":"2026-01-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":262144,"output":32768},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3.6-plus":{"id":"qwen3.6-plus","name":"Qwen3.6 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"MiniMax-M2.5":{"id":"MiniMax-M2.5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":196608,"output":24576},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3-coder-plus":{"id":"qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":65536},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":202752,"output":16384},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3.7-plus":{"id":"qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen3.5-plus":{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"qwen3-coder-next":{"id":"qwen3-coder-next","name":"Qwen3 Coder Next","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"status":"deprecated","cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}},"glm-5":{"id":"glm-5","name":"GLM-5","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-02-11","last_updated":"2026-02-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":202752,"output":16384},"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0}}}},"llmtr":{"id":"llmtr","env":["LLMTR_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://llmtr.com/v1","name":"LLMTR","doc":"https://llmtr.com/docs","models":{"muse-glimmer-30b-tr":{"id":"muse-glimmer-30b-tr","name":"Muse Glimmer 30B (TR)","description":"Muse Glimmer is a 30-billion-parameter open-weight multimodal model from Meta Superintelligence Labs, distilled from Muse Spark for always-on local agents, tool use, coding, and image understanding.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01-04","release_date":"2026-08-10","last_updated":"2026-08-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":2,"output":5,"cache_read":0.5},"canonical_model_id":"meta/muse-glimmer-30b"},"qwen3-6-35b":{"id":"qwen3-6-35b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":false,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":16384,"output":16384},"cost":{"input":5,"output":10},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"},"magibu-11b-v8":{"id":"magibu-11b-v8","name":"Magibu 11B v8","description":"Turkish-language chat model for instruction following and assistant flows","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-06-05","last_updated":"2026-08-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":8192,"output":8192},"cost":{"input":0.1,"output":0.5}},"gemma-4":{"id":"gemma-4","name":"Gemma 4","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":2,"output":5,"cache_read":0.5},"canonical_model_id":"google/gemma-4-31b-it"},"trendyol-asure-12b":{"id":"trendyol-asure-12b","name":"Trendyol Asure 12B","description":"Turkish-language multimodal instruct model built on Gemma 3 12B for e-commerce text, chat, and image-text tasks","family":"gemma","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-02-19","last_updated":"2026-02-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":40960},"cost":{"input":0.1,"output":0.5,"cache_read":0.025},"canonical_model_id":"trendyol/asure-12b"},"medgemma-4b":{"id":"medgemma-4b","name":"MedGemma 4B","description":"Multimodal medical-domain Gemma variant for text and image analysis","attachment":true,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-04-26","last_updated":"2026-08-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"status":"deprecated","cost":{"input":3,"output":5}},"publicai/apertus-8b-instruct":{"id":"publicai/apertus-8b-instruct","name":"Apertus 8B Instruct","description":"Fully open 8B multilingual LLM supporting 1800+ languages with 65K context. Trained on compliant open data. Apache 2.0, EU AI Act compliant.","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":8192},"cost":{"input":0.1,"output":0.2},"canonical_model_id":"swiss-ai/apertus-8b"},"publicai/apertus-70b-instruct":{"id":"publicai/apertus-70b-instruct","name":"Apertus 70B Instruct","description":"Fully open 70B multilingual LLM supporting 1800+ languages with 65K context. Trained on 15T tokens of compliant open data. Apache 2.0, EU AI Act compliant.","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-09","release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":8192},"cost":{"input":0.82,"output":2.92},"canonical_model_id":"swiss-ai/apertus-70b"},"perplexity/sonar-deep-research":{"id":"perplexity/sonar-deep-research","name":"Sonar Deep Research","description":"Sonar search model for autonomous research and citation-backed long-form reports","family":"sonar","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":false,"knowledge":"2025-01","release_date":"2025-02-01","last_updated":"2025-09-01","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":32768},"cost":{"input":2,"output":8,"reasoning":3},"canonical_model_id":"perplexity/sonar-deep-research"},"mistral/voxtral-small-latest":{"id":"mistral/voxtral-small-latest","name":"Voxtral Small (latest)","description":"Instruct model with native audio input for speech understanding and tool use","family":"voxtral","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2025-07-15","last_updated":"2025-07-15","modalities":{"input":["text","audio"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":32000},"cost":{"input":0.1,"output":0.3},"canonical_model_id":"mistral/voxtral-small-latest"},"google/gemini-2.5-flash-lite":{"id":"google/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.1,"output":0.1},"canonical_model_id":"google/gemini-2.5-flash-lite"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.5,"output":3},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen3-coder-plus":{"id":"qwen/qwen3-coder-plus","name":"Qwen3 Coder Plus","description":"Hosted Qwen coder for software agents, repo edits, and long-context code","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"status":"deprecated","cost":{"input":1,"output":5},"canonical_model_id":"alibaba/qwen3-coder-plus"},"qwen/qwen-plus":{"id":"qwen/qwen-plus","name":"Qwen Plus","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2024-01-25","last_updated":"2025-09-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.4,"output":1.2,"cache_read":0.08},"canonical_model_id":"alibaba/qwen-plus"},"qwen/qwen3.5-397b-a17b":{"id":"qwen/qwen3.5-397b-a17b","name":"Qwen3.5 397B-A17B","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":65536},"cost":{"input":0.6,"output":3.6},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.4,"output":1.6,"cache_read":0.08},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.25,"output":1.5},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3-max":{"id":"qwen/qwen3-max","name":"Qwen3 Max","description":"Flagship Qwen3 model for coding agents, complex reasoning, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":65536},"status":"deprecated","cost":{"input":1.2,"output":6},"canonical_model_id":"alibaba/qwen3-max"},"qwen/qwen3.5-plus":{"id":"qwen/qwen3.5-plus","name":"Qwen3.5 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.4,"output":2.4},"canonical_model_id":"alibaba/qwen3.5-plus"},"qwen/qwen-flash":{"id":"qwen/qwen-flash","name":"Qwen Flash","description":"Efficient Qwen model for fast chat, extraction, and high-volume workloads","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2024-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":32768},"cost":{"input":0.05,"output":0.4,"cache_read":0.01},"canonical_model_id":"alibaba/qwen-flash"},"qwen/qwen3-vl-plus":{"id":"qwen/qwen3-vl-plus","name":"Qwen3-VL Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens"}],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09-23","last_updated":"2025-09-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":32768},"cost":{"input":0.2,"output":1.6,"cache_read":0.04},"canonical_model_id":"alibaba/qwen3-vl-plus"},"qwen/qwen3-coder-flash":{"id":"qwen/qwen3-coder-flash","name":"Qwen3 Coder Flash","description":"Qwen coding model for software agents, repository edits, and code reasoning","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.3,"output":1.5,"cache_read":0.06},"canonical_model_id":"alibaba/qwen3-coder-flash"},"poolside/laguna-xs-2.1":{"id":"poolside/laguna-xs-2.1","name":"Laguna XS 2.1","description":"Agentic coding model from Poolside in the XS size class for local deployment","family":"laguna","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-07-02","last_updated":"2026-07-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":32768},"cost":{"input":0,"output":0},"canonical_model_id":"poolside/laguna-xs-2.1"},"thinkingmachines/inkling-small":{"id":"thinkingmachines/inkling-small","name":"Inkling Small","description":"Multimodal MoE reasoning model (276B total, 12B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-30","last_updated":"2026-07-30","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.58,"output":1.44,"cache_read":0.116},"canonical_model_id":"thinkingmachines/inkling-small"},"thinkingmachines/inkling":{"id":"thinkingmachines/inkling","name":"Inkling","description":"Multimodal MoE reasoning model (975B total, 41B active) for text, image, and audio","family":"ling","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh"]}],"tool_call":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":1.87,"output":4.68,"cache_read":0.374},"canonical_model_id":"thinkingmachines/inkling"},"upstage/solar-pro4":{"id":"upstage/solar-pro4","name":"Solar Pro 4","description":"Upstage's flagship model, specialized for agentic use","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02","release_date":"2026-08-06","last_updated":"2026-08-06","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":524288,"output":131072},"cost":{"input":0.15,"output":0.6,"cache_read":0.03},"canonical_model_id":"upstage/solar-pro4"},"upstage/solar-pro2":{"id":"upstage/solar-pro2","name":"Solar Pro 2","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-03","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":65536,"output":8192},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"upstage/solar-pro2"},"upstage/solar-pro3":{"id":"upstage/solar-pro3","name":"Solar Pro 3","description":"Flagship model for demanding analysis, coding, and production agent workflows","family":"solar-pro","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":true,"knowledge":"2025-07","release_date":"2026-01-26","last_updated":"2026-03-23","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":131072,"output":8192},"cost":{"input":0.15,"output":0.6,"cache_read":0.015},"canonical_model_id":"upstage/solar-pro3"},"meta/muse-spark-1.2-contributor":{"id":"meta/muse-spark-1.2-contributor","name":"Muse Spark 1.2 Contributor","description":"Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1 with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows.","family":"muse","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-05","last_updated":"2026-08-05","modalities":{"input":["text","image","video","pdf","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":131072},"cost":{"input":0.1,"output":0.2,"cache_read":0.002},"canonical_model_id":"meta/muse-spark-1.2"},"mimo/mimo-v2.5":{"id":"mimo/mimo-v2.5","name":"MiMo-V2.5","description":"Open MiMo model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0.14,"output":0.28},"canonical_model_id":"xiaomi/mimo-v2.5"},"mimo/mimo-v2.5-pro":{"id":"mimo/mimo-v2.5-pro","name":"MiMo-V2.5-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2026-04-22","last_updated":"2026-04-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0.435,"output":0.87},"canonical_model_id":"xiaomi/mimo-v2.5-pro"},"sakana/fugu-ultra":{"id":"sakana/fugu-ultra","name":"Fugu Ultra","description":"Quality-first multi-agent model for hard research, analysis, and competitions","family":"fugu","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-06-15","last_updated":"2026-06-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"sakana/fugu-ultra"}}},"inference":{"id":"inference","env":["INFERENCE_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://inference.net/v1","name":"Inference","doc":"https://inference.net/models","models":{"mistral/mistral-nemo-12b-instruct":{"id":"mistral/mistral-nemo-12b-instruct","name":"Mistral Nemo 12B Instruct","description":"Mistral model for multilingual chat, reasoning, and tool-assisted workflows","family":"mistral-nemo","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"status":"deprecated","cost":{"input":0.038,"output":0.1},"canonical_model_id":"mistral/mistral-nemo"},"google/gemma-3":{"id":"google/gemma-3","name":"Google Gemma 3","description":"Open Gemma instruction model for efficient chat and self-hosted deployments","family":"gemma","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":125000,"output":4096},"cost":{"input":0.15,"output":0.3}},"qwen/qwen-2.5-7b-vision-instruct":{"id":"qwen/qwen-2.5-7b-vision-instruct","name":"Qwen 2.5 7B Vision Instruct","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":125000,"output":4096},"status":"deprecated","cost":{"input":0.2,"output":0.2}},"qwen/qwen3-embedding-4b":{"id":"qwen/qwen3-embedding-4b","type":"embedding","name":"Qwen 3 Embedding 4B","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"qwen","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"knowledge":"2024-12","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":32000,"output":2048},"status":"deprecated","cost":{"input":0.01,"output":0},"canonical_model_id":"alibaba/qwen3-embedding-4b"},"meta/llama-3.2-3b-instruct":{"id":"meta/llama-3.2-3b-instruct","name":"Llama 3.2 3B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"cost":{"input":0.02,"output":0.02}},"meta/llama-3.1-8b-instruct":{"id":"meta/llama-3.1-8b-instruct","name":"Llama 3.1 8B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-07-23","last_updated":"2024-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"status":"deprecated","cost":{"input":0.025,"output":0.025},"canonical_model_id":"meta/llama-3.1-8b-instruct"},"meta/llama-3.2-11b-vision-instruct":{"id":"meta/llama-3.2-11b-vision-instruct","name":"Llama 3.2 11B Vision Instruct","description":"Open Llama multimodal model for image understanding and text reasoning","family":"llama","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"status":"deprecated","cost":{"input":0.055,"output":0.055},"canonical_model_id":"meta/llama-3.2-11b-vision-instruct"},"meta/llama-3.2-1b-instruct":{"id":"meta/llama-3.2-1b-instruct","name":"Llama 3.2 1B Instruct","description":"Open Llama instruction model for multilingual chat, reasoning, and coding","family":"llama","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2023-12","release_date":"2024-09-25","last_updated":"2024-09-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":16000,"output":4096},"cost":{"input":0.01,"output":0.01},"canonical_model_id":"meta/llama-3.2-1b-instruct"},"osmosis/osmosis-structure-0.6b":{"id":"osmosis/osmosis-structure-0.6b","name":"Osmosis Structure 0.6B","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"osmosis","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-12","release_date":"2025-01-01","last_updated":"2025-01-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4000,"output":2048},"status":"deprecated","cost":{"input":0.1,"output":0.5}}}},"zenifra":{"id":"zenifra","env":["ZENIFRA_AI_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://ai.zenifra.com/v1","name":"Zenifra","doc":"https://docs.zenifra.com","models":{"alibaba/qwen3.6-35b-a3b":{"id":"alibaba/qwen3.6-35b-a3b","name":"Qwen3.6 35B-A3B","description":"Open multimodal Qwen MoE for local agents that need vision, audio, and code","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"provider":{"shape":"completions"},"cost":{"input":0.19,"output":0.48},"canonical_model_id":"alibaba/qwen3.6-35b-a3b"}}},"pioneer":{"id":"pioneer","env":["PIONEER_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.fastino.ai/v1","name":"Pioneer","doc":"https://agent.pioneer.ai/llms.txt","models":{"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"output":128000},"status":"deprecated","cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":5},"canonical_model_id":"openai/gpt-5.5"},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"openai/gpt-5.6-sol"},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":11,"output":55,"cache_read":1.1,"cache_write":13.75},"canonical_model_id":"anthropic/claude-fable-5"},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":1,"output":6,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"openai/gpt-5.6-luna"},"claude-opus-5-fast":{"id":"claude-opus-5-fast","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"status":"deprecated","cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-opus-5"},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"status":"deprecated","cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":3.125},"canonical_model_id":"openai/gpt-5.6-terra"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"fastino/gliner2.5-base-v1":{"id":"fastino/gliner2.5-base-v1","name":"GLiNER 2.5 Base","description":"English boundary NER and structured extraction with LoRA fine-tuning.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-08-24","last_updated":"2026-08-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliguard-LLMGuardrails-300M":{"id":"fastino/gliguard-LLMGuardrails-300M","name":"GLiGuard LLM Guardrails 300M","description":"LLM safety, PII, and adversarial-attack guardrails; 300M-param encoder.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.15,"output":0.15,"cache_read":0.15,"cache_write":0.15}},"fastino/gliner2-multi-large-v1":{"id":"fastino/gliner2-multi-large-v1","name":"GLiNER2 Multi Large","description":"High-accuracy multilingual NER and span extraction.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-11-30","last_updated":"2025-11-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/GLiNER-2.5-Decide":{"id":"fastino/GLiNER-2.5-Decide","name":"GLiNER-2.5-Decide","description":"Classification-tuned GLiNER2 large. Entities, relations, and JSON extraction still work.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-09-24","last_updated":"2026-09-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliner2-base-v1":{"id":"fastino/gliner2-base-v1","name":"GLiNER2 Base","description":"Named entity recognition; zero-shot span extraction.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":2048,"output":2048},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliguard-PII-multi":{"id":"fastino/gliguard-PII-multi","name":"GLiNER2-Guardrails-PII-Multi","description":"A 300M-parameter multilingual model that runs LLM safety moderation and PII detection in a single forward pass.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.15,"output":0.15,"cache_read":0.15,"cache_write":0.15}},"fastino/gliner2-privacy-filter-PII-multi":{"id":"fastino/gliner2-privacy-filter-PII-multi","name":"GLiNER2 Privacy Filter PII (Multi)","description":"Multilingual PII entity detection across 40+ languages; non-trainable encoder.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-04-30","last_updated":"2026-04-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliner2-large-v1":{"id":"fastino/gliner2-large-v1","name":"GLiNER2 Large","description":"Higher-accuracy NER; broader entity coverage.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliner2-multi-v1":{"id":"fastino/gliner2-multi-v1","name":"GLiNER2 Multi","description":"Multilingual NER for cross-lingual extraction.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2025-11-30","last_updated":"2025-11-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8192,"output":8192},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"fastino/gliner2.5-multi-v1":{"id":"fastino/gliner2.5-multi-v1","name":"GLiNER 2.5 Multi","description":"Multilingual boundary NER and span extraction; non-trainable encoder.","attachment":false,"reasoning":false,"tool_call":false,"temperature":true,"release_date":"2026-08-24","last_updated":"2026-08-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":4096,"output":4096},"cost":{"input":0.03,"output":0,"cache_read":0.03,"cache_write":0.03}},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":0.1,"output":0.2,"cache_read":0.0197,"cache_write":0.1},"canonical_model_id":"deepseek/deepseek-v4-flash"},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshotai/Kimi-K3-Fast":{"id":"moonshotai/Kimi-K3-Fast","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":131072},"status":"deprecated","cost":{"input":4.5,"output":22.5,"cache_read":0.45,"cache_write":4.5},"canonical_model_id":"moonshotai/kimi-k3"},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["high","max"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1040000,"output":128000},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26,"cache_write":1.4},"canonical_model_id":"zhipuai/glm-5.2"},"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16":{"id":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16","name":"Nemotron 3.5 Lightning 30B A3B","description":"Fast NVIDIA Nemotron MoE for reliable agentic tasks across enterprise workloads","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-08-11","last_updated":"2026-08-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":4096},"cost":{"input":0.07,"output":0.2,"cache_read":0.035,"cache_write":0.07},"canonical_model_id":"nvidia/nemotron-3.5-lightning"},"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4":{"id":"nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4","name":"Nemotron 3.5 Super VL 120B A12B","description":"NVIDIA vision-language reasoning model for text, image, and video understanding and agentic tool use","family":"nemotron","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"interleaved":{"field":"reasoning_content"},"temperature":true,"release_date":"2026-10-15","last_updated":"2026-10-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":4096},"cost":{"input":0.08,"output":0.45,"cache_read":0.04,"cache_write":0.08},"canonical_model_id":"nvidia/nemotron-3.5-super-vl-120b-a12b"}}},"crossmodel":{"id":"crossmodel","env":["CROSSMODEL_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.crossmodel.ai/v1","name":"CrossModel","doc":"https://www.crossmodel.ai/docs","models":{"anthropic/claude-sonnet-5-5":{"id":"anthropic/claude-sonnet-5-5","name":"Claude Sonnet 5.5","description":"Fast Claude model for everyday coding, agents, and knowledge work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-28","last_updated":"2026-09-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5-5"},"anthropic/claude-fable-5-1":{"id":"anthropic/claude-fable-5-1","name":"Claude Fable 5.1","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-01","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":0.25,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5-1"},"anthropic/claude-sonnet-5":{"id":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","description":"Everyday Claude agent model for coding, planning, browsing, and general work","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-30","last_updated":"2026-06-30","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5},"canonical_model_id":"anthropic/claude-sonnet-5"},"anthropic/claude-fable-5-2":{"id":"anthropic/claude-fable-5-2","name":"Claude Fable 5.2","description":"Claude model for demanding reasoning and long-horizon agentic work","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-11-09","last_updated":"2026-11-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":8,"output":40,"cache_read":0.2,"cache_write":10},"canonical_model_id":"anthropic/claude-fable-5-2"},"anthropic/claude-fable-5":{"id":"anthropic/claude-fable-5","name":"Claude Fable 5","description":"Claude model for creative writing, analysis, and controlled agent workflows","family":"claude-fable","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-06-09","last_updated":"2026-06-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5},"canonical_model_id":"anthropic/claude-fable-5"},"anthropic/claude-opus-5":{"id":"anthropic/claude-opus-5","name":"Claude Opus 5","description":"Strongest Claude Opus model for coding, agents, and professional work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05","release_date":"2026-07-24","last_updated":"2026-07-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-5"},"anthropic/claude-opus-4-8":{"id":"anthropic/claude-opus-4-8","name":"Claude Opus 4.8","description":"Top Claude Opus tier for the hardest reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01","release_date":"2026-05-28","last_updated":"2026-05-28","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-8"},"anthropic/claude-opus-5-5":{"id":"anthropic/claude-opus-5-5","name":"Claude Opus 5.5","description":"Claude model for long-running agentic coding and knowledge work","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.2,"cache_write":5},"canonical_model_id":"anthropic/claude-opus-5-5"},"anthropic/claude-haiku-5-5":{"id":"anthropic/claude-haiku-5-5","name":"Claude Haiku 5.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06","release_date":"2026-10-07","last_updated":"2026-10-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.5,"output":2.5,"cache_read":0.05,"cache_write":0.625,"tier":{"type":"context","size":100000}}]},"canonical_model_id":"anthropic/claude-haiku-5-5"},"anthropic/claude-sonnet-4-6":{"id":"anthropic/claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Claude workhorse for coding agents, careful analysis, and production cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"anthropic/claude-opus-4-7":{"id":"anthropic/claude-opus-4-7","name":"Claude Opus 4.7","description":"Stronger Opus tier for advanced software work and high-stakes reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"anthropic/claude-haiku-4-5":{"id":"anthropic/claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","description":"Fast Claude lane for lightweight agents, office tasks, and responsive chat","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"},"x-ai/grok-4.5":{"id":"x-ai/grok-4.5","name":"Grok 4.5","description":"xAI's Grok model for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-08","last_updated":"2026-07-08","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.3,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":0.6,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":0.6,"cache_write":4}},"canonical_model_id":"xai/grok-4.5"},"x-ai/grok-4.3":{"id":"x-ai/grok-4.3","name":"Grok 4.3","description":"xAI's default Grok for chat, coding, agentic tools, and lower hallucination risk","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":1000000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2,"cache_write":1.25,"tiers":[{"input":2.5,"output":5,"cache_read":0.4,"cache_write":2.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":5,"cache_read":0.4,"cache_write":2.5}},"canonical_model_id":"xai/grok-4.3"},"x-ai/grok-4.7":{"id":"x-ai/grok-4.7","name":"Grok 4.7","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-05","release_date":"2026-09-21","last_updated":"2026-09-21","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":1,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1,"cache_write":4}},"canonical_model_id":"xai/grok-4.7"},"x-ai/grok-4.6":{"id":"x-ai/grok-4.6","name":"Grok 4.6","description":"xAI's frontier model for long-running agents, coding, knowledge work, and visual projects","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-02-01","release_date":"2026-08-12","last_updated":"2026-08-12","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":500000,"output":500000},"cost":{"input":2,"output":6,"cache_read":0.5,"cache_write":2,"tiers":[{"input":4,"output":12,"cache_read":1,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":12,"cache_read":1,"cache_write":4}},"canonical_model_id":"xai/grok-4.6"},"x-ai/grok-build-0.1":{"id":"x-ai/grok-build-0.1","name":"Grok Build 0.1","description":"Fast Grok coding model tuned for agentic engineering and iterative edits","family":"grok-build","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":256000},"cost":{"input":1,"output":2,"cache_read":0.2,"cache_write":1,"tiers":[{"input":2,"output":4,"cache_read":0.4,"cache_write":2,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2,"output":4,"cache_read":0.4,"cache_write":2}},"canonical_model_id":"xai/grok-build-0.1"},"deepseek/deepseek-v4.1-flash":{"id":"deepseek/deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","description":"DeepSeek V4.1 Flash model for reasoning and agentic coding","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-09-10","last_updated":"2026-09-10","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":0.3,"output":1.2,"cache_read":0.006,"cache_write":0.3},"canonical_model_id":"deepseek/deepseek-v4.1-flash"},"deepseek/deepseek-v4-pro":{"id":"deepseek/deepseek-v4-pro","name":"DeepSeek V4 Pro","description":"Open MoE flagship with million-token context for coding and long agent runs","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"cost":{"input":1.35,"output":4.05,"cache_read":0.045,"cache_write":1.35},"canonical_model_id":"deepseek/deepseek-v4-pro"},"deepseek/deepseek-v4-flash-vision-exp":{"id":"deepseek/deepseek-v4-flash-vision-exp","name":"DeepSeek V4 Flash Vision Exp","description":"Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work","family":"deepseek-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-08-21","last_updated":"2026-09-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.006,"cache_write":0.3},"canonical_model_id":"deepseek/deepseek-v4-flash-vision-exp"},"deepseek/deepseek-v4-flash":{"id":"deepseek/deepseek-v4-flash","name":"DeepSeek V4 Flash","description":"Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work","family":"deepseek-flash","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":384000},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.006,"cache_write":0.3},"canonical_model_id":"deepseek/deepseek-v4-flash"},"qwen/qwen3.6-plus":{"id":"qwen/qwen3.6-plus","name":"Qwen3.6 Plus","description":"Earlier Qwen multimodal workhorse for million-token agent and document tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.32,"output":1.88,"cache_read":0.032,"cache_write":0.4,"tiers":[{"input":1.25,"output":7.5,"cache_read":0.124,"cache_write":1.57,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":1.25,"output":7.5,"cache_read":0.124,"cache_write":1.57}},"canonical_model_id":"alibaba/qwen3.6-plus"},"qwen/qwen3.8-omni-flash":{"id":"qwen/qwen3.8-omni-flash","name":"Qwen3.8 Omni Flash","description":"Qwen omni model for text, vision, audio, and multimodal agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2026-09-17","last_updated":"2026-09-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.13,"output":0.43,"cache_read":0.016,"cache_write":0.13},"canonical_model_id":"alibaba/qwen3.8-omni-flash"},"qwen/qwen3.8-flash":{"id":"qwen/qwen3.8-flash","name":"Qwen3.8 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":0.13,"output":0.43,"cache_read":0.016,"cache_write":0.2},"canonical_model_id":"alibaba/qwen3.8-flash"},"qwen/qwen3.7-plus":{"id":"qwen/qwen3.7-plus","name":"Qwen3.7 Plus","description":"Multimodal Qwen workhorse for long-context agents, visual inputs, and coding","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-06-02","last_updated":"2026-06-02","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":0.32,"output":1.25,"cache_read":0.032,"cache_write":0.4,"tiers":[{"input":0.96,"output":3.75,"cache_read":0.096,"cache_write":1.2,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.96,"output":3.75,"cache_read":0.096,"cache_write":1.2}},"canonical_model_id":"alibaba/qwen3.7-plus"},"qwen/qwen3.7-max":{"id":"qwen/qwen3.7-max","name":"Qwen3.7 Max","description":"Qwen frontier model tuned for agent frameworks, coding assistants, and long tasks","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-05-21","last_updated":"2026-05-21","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":1.88,"output":5.63,"cache_read":0.375,"cache_write":2.35},"canonical_model_id":"alibaba/qwen3.7-max"},"qwen/qwen3.6-flash":{"id":"qwen/qwen3.6-flash","name":"Qwen3.6 Flash","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen3.6","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-27","last_updated":"2026-04-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":65536},"cost":{"input":0.19,"output":1.13,"cache_read":0.019,"cache_write":0.24,"tiers":[{"input":0.75,"output":4.5,"cache_read":0.075,"cache_write":0.94,"tier":{"type":"context","size":256000}}],"context_over_200k":{"input":0.75,"output":4.5,"cache_read":0.075,"cache_write":0.94}},"canonical_model_id":"alibaba/qwen3.6-flash"},"qwen/qwen3.7-flash":{"id":"qwen/qwen3.7-flash","name":"Qwen3.7 Flash","description":"Lightweight multimodal Qwen model for high-throughput text, image, and video tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-15","last_updated":"2026-07-15","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"input":991808,"output":65536},"cost":{"input":0.04,"output":0.13,"cache_read":0.01,"cache_write":0.04,"tiers":[{"input":0.1,"output":0.37,"cache_read":0.02,"cache_write":0.12,"tier":{"type":"context","size":32000}},{"input":0.19,"output":0.74,"cache_read":0.04,"cache_write":0.24,"tier":{"type":"context","size":256000}}]},"canonical_model_id":"alibaba/qwen3.7-flash"},"qwen/qwen3.8-max":{"id":"qwen/qwen3.8-max","name":"Qwen3.8 Max","description":"2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["low","medium","xhigh"]},{"type":"budget_tokens"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-03","last_updated":"2026-08-03","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":131072},"cost":{"input":1.88,"output":5.63,"cache_read":0.23,"cache_write":2.35},"canonical_model_id":"alibaba/qwen3.8-max"},"tencent/hy4":{"id":"tencent/hy4","name":"Hy4","description":"A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-11-04","last_updated":"2026-11-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"input":983010,"output":65536},"cost":{"input":0.96,"output":2.88,"cache_read":0.048,"cache_write":0.96},"canonical_model_id":"tencent/hy4"},"tencent/hy3":{"id":"tencent/hy3","name":"Hy3","description":"Tencent Hy reasoning model for coding, instruction following, and agent tasks","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-07-06","last_updated":"2026-07-06","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"input":192000,"output":131072},"cost":{"input":0.16,"output":0.64,"cache_read":0.04,"cache_write":0.16},"canonical_model_id":"tencent/hy3"},"tencent/hy4-preview":{"id":"tencent/hy4-preview","name":"Hy4 preview","description":"A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities.","family":"Hy","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-08-28","last_updated":"2026-08-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":65536},"cost":{"input":0.96,"output":2.88,"cache_read":0.048,"cache_write":0.96},"canonical_model_id":"tencent/hy4-preview"},"gemini/gemini-2.5-flash":{"id":"gemini/gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.3},"canonical_model_id":"google/gemini-2.5-flash"},"gemini/gemini-3.8-flash":{"id":"gemini/gemini-3.8-flash","name":"Gemini 3.8 Flash","description":"Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-09-02","last_updated":"2026-09-02","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.75},"canonical_model_id":"google/gemini-3.8-flash"},"gemini/gemini-2.5-pro":{"id":"gemini/gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.125,"cache_write":1.25,"tiers":[{"input":2.5,"output":15,"cache_read":0.25,"cache_write":2.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":2.5}},"canonical_model_id":"google/gemini-2.5-pro"},"gemini/gemini-3.5-flash":{"id":"gemini/gemini-3.5-flash","name":"Gemini 3.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-05-19","last_updated":"2026-05-19","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.5,"output":9,"cache_read":0.15,"cache_write":1.5},"canonical_model_id":"google/gemini-3.5-flash"},"gemini/gemini-3.6-flash":{"id":"gemini/gemini-3.6-flash","name":"Gemini 3.6 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.75},"canonical_model_id":"google/gemini-3.6-flash"},"gemini/gemini-3.1-pro-preview":{"id":"gemini/gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Reasoning-first Gemini preview for agentic coding and complex problem solving","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":4,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":4}},"canonical_model_id":"google/gemini-3.1-pro-preview"},"gemini/gemini-2.5-flash-lite":{"id":"gemini/gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1,"output":0.4,"cache_read":0.01,"cache_write":0.1},"canonical_model_id":"google/gemini-2.5-flash-lite"},"gemini/gemini-4-argon":{"id":"gemini/gemini-4-argon","name":"Gemini 4 Argon","description":"Google's flagship reasoning model for complex software engineering, deep math and science, and long-horizon autonomous agents","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-03","release_date":"2026-10-13","last_updated":"2026-10-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2},"canonical_model_id":"google/gemini-4-argon"},"gemini/gemini-3.5-flash-lite":{"id":"gemini/gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-07-21","last_updated":"2026-07-21","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.3},"canonical_model_id":"google/gemini-3.5-flash-lite"},"gemini/gemini-3-flash-preview":{"id":"gemini/gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"},{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05,"cache_write":0.5},"canonical_model_id":"google/gemini-3-flash-preview"},"gemini/gemini-3.7-flash":{"id":"gemini/gemini-3.7-flash","name":"Gemini 3.7 Flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-03","release_date":"2026-08-13","last_updated":"2026-08-13","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.75,"output":3.75,"cache_read":0.075,"cache_write":0.75},"canonical_model_id":"google/gemini-3.7-flash"},"openai/gpt-5.5":{"id":"openai/gpt-5.5","name":"GPT-5.5","description":"Default frontier GPT for coding, computer use, research, and knowledge work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5,"cache_write":5,"tiers":[{"input":10,"output":45,"cache_read":1,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":10,"output":45,"cache_read":1,"cache_write":10}},"canonical_model_id":"openai/gpt-5.5"},"openai/gpt-5.4-mini":{"id":"openai/gpt-5.4-mini","name":"GPT-5.4 mini","description":"Strong small GPT for coding subagents, quick tool use, and high-volume work","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075,"cache_write":0.75},"canonical_model_id":"openai/gpt-5.4-mini"},"openai/gpt-5.6-sol":{"id":"openai/gpt-5.6-sol","name":"GPT-5.6 Sol","description":"Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":4,"output":20,"cache_read":0.4,"cache_write":5,"tiers":[{"input":8,"output":30,"cache_read":0.8,"cache_write":10,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":8,"output":30,"cache_read":0.8,"cache_write":10}},"canonical_model_id":"openai/gpt-5.6-sol"},"openai/gpt-6.1-terra":{"id":"openai/gpt-6.1-terra","name":"GPT-6.1 Terra","description":"Fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-06-01","release_date":"2026-10-26","last_updated":"2026-10-26","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":1,"output":5,"cache_read":0.05,"cache_write":1.25,"tiers":[{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":2,"output":7.5,"cache_read":0.1,"cache_write":2.5}},"canonical_model_id":"openai/gpt-6.1-terra"},"openai/gpt-6-luna":{"id":"openai/gpt-6-luna","name":"GPT-6 Luna","description":"OpenAI's most efficient model for focused, high-volume tasks","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-05-18","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.1,"output":0.5,"cache_read":0.01,"cache_write":0.125,"tiers":[{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.2,"output":0.75,"cache_read":0.02,"cache_write":0.25}},"canonical_model_id":"openai/gpt-6-luna"},"openai/gpt-6-sol":{"id":"openai/gpt-6-sol","name":"GPT-6 Sol","description":"OpenAI model for complex coding and agentic workflows","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-20","release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-6-sol"},"openai/gpt-6-astra":{"id":"openai/gpt-6-astra","name":"GPT-6 Astra","description":"GPT-6 Astra is OpenAI's most capable model for complex reasoning, coding, computer use, research, and document creation.","family":"gpt-astra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-04","last_updated":"2026-09-04","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":10,"output":50,"cache_read":1,"cache_write":12.5,"tiers":[{"input":20,"output":75,"cache_read":2,"cache_write":25,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":20,"output":75,"cache_read":2,"cache_write":25}},"canonical_model_id":"openai/gpt-6-astra"},"openai/gpt-5.5-pro":{"id":"openai/gpt-5.5-pro","name":"GPT-5.5 Pro","description":"Highest-accuracy GPT-5.5 tier for slower, precision-heavy reasoning and coding","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-12-01","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":30,"output":180,"tiers":[{"input":60,"output":270,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":60,"output":270}},"canonical_model_id":"openai/gpt-5.5-pro"},"openai/gpt-5.6-luna":{"id":"openai/gpt-5.6-luna","name":"GPT-5.6 Luna","description":"Cost-efficient GPT-5.6 model for fast, high-volume workloads","family":"gpt-luna","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":0.2,"output":1.2,"cache_read":0.02,"cache_write":0.25,"tiers":[{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":0.4,"output":1.8,"cache_read":0.04,"cache_write":0.5}},"canonical_model_id":"openai/gpt-5.6-luna"},"openai/gpt-6.1-sol":{"id":"openai/gpt-6.1-sol","name":"GPT-6.1 Sol","description":"Near-Astra performance for complex coding, computer use, and professional work at a lower cost.","family":"gpt-sol","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-04-30","release_date":"2026-09-29","last_updated":"2026-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":10,"cache_read":0.1,"cache_write":2.5,"tiers":[{"input":4,"output":15,"cache_read":0.2,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":15,"cache_read":0.2,"cache_write":5}},"canonical_model_id":"openai/gpt-6.1-sol"},"openai/gpt-5.4":{"id":"openai/gpt-5.4","name":"GPT-5.4","description":"Agent-ready GPT for coding and computer-use workflows at a lower cost","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-05","last_updated":"2026-03-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2.5,"output":15,"cache_read":0.25,"cache_write":2.5,"tiers":[{"input":5,"output":22.5,"cache_read":0.5,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":5,"output":22.5,"cache_read":0.5,"cache_write":5}},"canonical_model_id":"openai/gpt-5.4"},"openai/gpt-5.4-nano":{"id":"openai/gpt-5.4-nano","name":"GPT-5.4 nano","description":"Cheapest GPT-5.4 lane for simple routing, extraction, and bulk automation","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02,"cache_write":0.2},"canonical_model_id":"openai/gpt-5.4-nano"},"openai/gpt-5.6-terra":{"id":"openai/gpt-5.6-terra","name":"GPT-5.6 Terra","description":"Balanced GPT-5.6 model for capable, cost-efficient everyday work","family":"gpt-terra","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2026-02-16","release_date":"2026-07-09","last_updated":"2026-07-09","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1050000,"input":922000,"output":128000},"cost":{"input":2,"output":12,"cache_read":0.2,"cache_write":2.5,"tiers":[{"input":4,"output":18,"cache_read":0.4,"cache_write":5,"tier":{"type":"context","size":272000}}],"context_over_200k":{"input":4,"output":18,"cache_read":0.4,"cache_write":5}},"canonical_model_id":"openai/gpt-5.6-terra"},"openai/gpt-4o-mini":{"id":"openai/gpt-4o-mini","name":"GPT-4o mini","description":"Small omni GPT for cheap multimodal assistance and production-scale traffic","family":"gpt-mini","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-07-18","last_updated":"2024-07-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":0.15,"output":0.6,"cache_read":0.075,"cache_write":0.15},"canonical_model_id":"openai/gpt-4o-mini"},"moonshot/kimi-k3.1-pro":{"id":"moonshot/kimi-k3.1-pro","name":"Kimi K3.1 Pro","description":"Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-10-23","last_updated":"2026-10-23","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":2,"output":10,"cache_read":0.2,"cache_write":2},"canonical_model_id":"moonshotai/kimi-k3.1-pro"},"moonshot/kimi-k2.6":{"id":"moonshot/kimi-k2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":1,"output":4.16,"cache_read":0.18,"cache_write":1},"canonical_model_id":"moonshotai/kimi-k2.6"},"moonshot/kimi-k3":{"id":"moonshot/kimi-k3","name":"Kimi K3","description":"Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work","family":"kimi-k3","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":false,"release_date":"2026-07-16","last_updated":"2026-07-16","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":1048576},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3},"canonical_model_id":"moonshotai/kimi-k3"},"moonshot/kimi-k2.7-code":{"id":"moonshot/kimi-k2.7-code","name":"Kimi K2.7 Code","description":"Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-06-12","last_updated":"2026-06-12","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262000,"output":262000},"cost":{"input":1,"output":4.16,"cache_read":0.18,"cache_write":1},"canonical_model_id":"moonshotai/kimi-k2.7-code"},"xiaomi/mimo-v2.6-pro":{"id":"xiaomi/mimo-v2.6-pro","name":"MiMo-V2.6-Pro","description":"Stronger MiMo Pro tier for multimodal reasoning and coding-agent execution","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.47,"output":0.94,"cache_read":0.005,"cache_write":0.47},"canonical_model_id":"xiaomi/mimo-v2.6-pro"},"xiaomi/mimo-v2.6-flash":{"id":"xiaomi/mimo-v2.6-flash","name":"MiMo-V2.6-Flash","description":"MiMo Flash model for multimodal coding agents and long-context automation","family":"mimo","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"temperature":true,"release_date":"2026-09-22","last_updated":"2026-09-22","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":true,"limit":{"context":1048576,"output":131072},"cost":{"input":0.16,"output":0.32,"cache_read":0.004,"cache_write":0.16},"canonical_model_id":"xiaomi/mimo-v2.6-flash"},"minimax/minimax-m3":{"id":"minimax/minimax-m3","name":"MiniMax-M3","description":"MiniMax multimodal model for long-context coding, perception, and agent planning","family":"minimax","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-01","last_updated":"2026-06-01","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1024000,"output":512000},"cost":{"input":0.33,"output":1.32,"cache_read":0.066,"cache_write":0.33,"tiers":[{"input":0.66,"output":2.63,"cache_read":0.132,"cache_write":0.66,"tier":{"type":"context","size":512000}}],"context_over_200k":{"input":0.66,"output":2.63,"cache_read":0.132,"cache_write":0.66}},"canonical_model_id":"minimax/MiniMax-M3"},"minimax/minimax-m2.7":{"id":"minimax/minimax-m2.7","name":"MiniMax-M2.7","description":"Open MiniMax flagship for coding agents, office automation, and complex environments","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.33,"output":1.32,"cache_read":0.066,"cache_write":0.42},"canonical_model_id":"minimax/MiniMax-M2.7"},"z-ai/glm-5.2":{"id":"z-ai/glm-5.2","name":"GLM-5.2","description":"Open flagship GLM for long-horizon coding agents and million-token context work","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-06-13","last_updated":"2026-06-13","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.2,"output":4.4,"cache_read":0.3,"cache_write":1.2},"canonical_model_id":"zhipuai/glm-5.2"},"z-ai/glm-5.1":{"id":"z-ai/glm-5.1","name":"GLM-5.1","description":"Strong GLM coding model for agentic engineering, terminals, and repository generation","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":1,"output":3.8,"cache_read":0.2,"cache_write":1,"tiers":[{"input":1.2,"output":4.4,"cache_read":0.3,"cache_write":1.2,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5.1"},"z-ai/glm-4.7":{"id":"z-ai/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.47,"output":2.16,"cache_read":0.1,"cache_write":0.47,"tiers":[{"input":0.62,"output":2.47,"cache_read":0.13,"cache_write":0.62,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-4.7"},"z-ai/glm-5.3":{"id":"z-ai/glm-5.3","name":"GLM-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-14","last_updated":"2026-08-14","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":1.2,"output":4.4,"cache_read":0.3,"cache_write":1.2},"canonical_model_id":"zhipuai/glm-5.3"},"z-ai/glm-5.3-flash":{"id":"z-ai/glm-5.3-flash","name":"GLM-5.3-Flash","description":"Native multimodal GLM model for efficient coding and long-horizon agent tasks","family":"glm-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","high","max"]}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-08-26","last_updated":"2026-08-26","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":128000},"cost":{"input":0.15,"output":0.5,"cache_read":0.03,"cache_write":0.15},"canonical_model_id":"zhipuai/glm-5.3-flash"},"z-ai/glm-5-turbo":{"id":"z-ai/glm-5-turbo","name":"GLM-5-Turbo","description":"Faster GLM-5 lane for coding agents that need lower latency","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":0.9,"output":3.7,"cache_read":0.18,"cache_write":0.9,"tiers":[{"input":1.1,"output":4.3,"cache_read":0.27,"cache_write":1.1,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5-turbo"},"z-ai/glm-5":{"id":"z-ai/glm-5","name":"GLM-5","description":"General GLM flagship for coding, analysis, and tool-heavy engineering workflows","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.6,"output":3,"cache_read":0.16,"cache_write":0.6,"tiers":[{"input":0.8,"output":3.4,"cache_read":0.2,"cache_write":0.8,"tier":{"type":"context","size":32000}}]},"canonical_model_id":"zhipuai/glm-5"}}},"infomaniak":{"id":"infomaniak","env":["INFOMANIAK_API_KEY","INFOMANIAK_PRODUCT_ID"],"npm":"@ai-sdk/openai-compatible","api":"https://api.infomaniak.com/2/ai/${INFOMANIAK_PRODUCT_ID}/openai/v1","name":"Infomaniak","doc":"https://www.infomaniak.com/en/hosting/ai-services/open-source-models","models":{"mini_lm_l12_v2":{"id":"mini_lm_l12_v2","type":"embedding","name":"All-MiniLM-L12-v2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2021-08-30","last_updated":"2021-08-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128,"input":128,"output":384},"cost":{"input":0,"output":0},"canonical_model_id":"sentence-transformers/all-minilm-l12-v2"},"bge_multilingual_gemma2":{"id":"bge_multilingual_gemma2","type":"embedding","name":"BGE Multilingual Gemma2","description":"Embedding model for semantic search, retrieval, clustering, and ranking pipelines","family":"text-embedding","attachment":false,"reasoning":false,"tool_call":false,"temperature":false,"release_date":"2024-07-25","last_updated":"2026-08-01","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":8000,"input":8000,"output":3584},"cost":{"input":0.08,"output":0}},"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","description":"Largest Gemma 4 instruction model for open, self-hosted chat and reasoning","family":"gemma","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"input":100000,"output":32768},"cost":{"input":0.25,"output":0.5},"canonical_model_id":"google/gemma-4-31b-it"},"mistralai/Mistral-Small-4-119B-2603":{"id":"mistralai/Mistral-Small-4-119B-2603","name":"Mistral Small 4","description":"Fast Mistral production model for chat, extraction, and cost-sensitive agents","family":"mistral-small","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-06","release_date":"2026-03-16","last_updated":"2026-03-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"cost":{"input":0.25,"output":0.93},"canonical_model_id":"mistral/mistral-small-2603"},"mistralai/Ministral-3-14B-Instruct-2512":{"id":"mistralai/Ministral-3-14B-Instruct-2512","name":"Ministral 3 14B Instruct","description":"Compact Mistral model for edge, latency-sensitive, and cost-efficient workloads","family":"ministral","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-02","last_updated":"2025-12-02","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"input":100000,"output":25600},"status":"beta","cost":{"input":0.37,"output":0.5},"canonical_model_id":"mistral/ministral-3-14b-instruct-2512"},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi K2.6","description":"Multimodal Kimi workhorse for agent loops, coding tasks, and visual context","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"input":256000,"output":256000},"status":"beta","cost":{"input":0.74,"output":3.72},"canonical_model_id":"moonshotai/kimi-k2.6"},"swiss-ai/Apertus-v1.5-70B":{"id":"swiss-ai/Apertus-v1.5-70B","name":"Apertus v1.5 70B","description":"Open, ethically-sourced Swiss AI model for multilingual, multimodal chat and instruction following","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"release_date":"2026-07-24","last_updated":"2026-08-01","modalities":{"input":["text","image","audio"],"output":["text"]},"open_weights":true,"limit":{"context":100000,"input":100000,"output":8192},"status":"beta","cost":{"input":0.87,"output":3.1}},"Qwen/Qwen3.5-397B-A17B-FP8":{"id":"Qwen/Qwen3.5-397B-A17B-FP8","name":"Qwen3.5 397B-A17B FP8","description":"Large open Qwen multimodal MoE for visual agents and long technical tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-02-15","last_updated":"2026-02-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65536},"status":"beta","cost":{"input":0.99,"output":4.46},"canonical_model_id":"alibaba/qwen3.5-397b-a17b"},"Qwen/Qwen3.5-122B-A10B-FP8":{"id":"Qwen/Qwen3.5-122B-A10B-FP8","name":"Qwen3.5 122B-A10B FP8","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"structured_output":true,"temperature":true,"release_date":"2026-02-23","last_updated":"2026-02-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"input":200000,"output":65536},"status":"deprecated","cost":{"input":0.5,"output":3.97},"canonical_model_id":"alibaba/qwen3.5-122b-a10b"},"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8":{"id":"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8","name":"Nemotron 3 Nano 30B A3B FP8","description":"Small Nemotron 3 MoE for efficient coding, math, and long-context agents","family":"nemotron","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"interleaved":true,"temperature":true,"knowledge":"2025-06-25","release_date":"2025-12-15","last_updated":"2025-12-15","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"input":1000000,"output":262144},"status":"deprecated","cost":{"input":0.06,"output":0.25},"canonical_model_id":"nvidia/nemotron-3-nano-30b-a3b"}}},"bailing":{"id":"bailing","env":["BAILING_API_TOKEN"],"npm":"@ai-sdk/openai-compatible","api":"https://api.tbox.cn/api/llm/v1","name":"Bailing","doc":"https://alipaytbox.yuque.com/sxs0ba/ling/intro","models":{"Ling-1T":{"id":"Ling-1T","name":"Ling-1T","description":"Open-weight instruction model for adaptable chat and self-hosted production workloads","family":"ling","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-10","last_updated":"2025-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.57,"output":2.29}},"Ring-1T":{"id":"Ring-1T","name":"Ring-1T","description":"Reasoning model for deliberate analysis, multi-step problem solving, and tool use","family":"ring","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"temperature":true,"knowledge":"2024-06","release_date":"2025-10","last_updated":"2025-10","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":32000},"cost":{"input":0.57,"output":2.29}}}},"frogbot":{"id":"frogbot","env":["FROGBOT_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://app.frogbot.ai/api/v1","name":"FrogBot","doc":"https://docs.frogbot.ai","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"Grok 4.1 Fast (Non-Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":0,"max":24576}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.3,"output":2.5,"cache_read":0.075},"canonical_model_id":"google/gemini-2.5-flash"},"grok-4-3":{"id":"grok-4-3","name":"Grok 4.3","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-11","release_date":"2026-04-17","last_updated":"2026-04-17","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":1.25,"output":2.5,"cache_read":0.2},"canonical_model_id":"xai/grok-4.3"},"minimax-m2-5":{"id":"minimax-m2-5","name":"MiniMax-M2.5","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":192000,"output":8192},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.5"},"gpt-5-4-mini":{"id":"gpt-5-4-mini","name":"GPT-5.4 Mini","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.75,"output":4.5,"cache_read":0.075},"canonical_model_id":"openai/gpt-5.4-mini"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":128,"max":32768}],"tool_call":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.25,"output":10,"cache_read":0.31},"canonical_model_id":"google/gemini-2.5-pro"},"kimi-k2.5":{"id":"kimi-k2.5","name":"Kimi-K2.5","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":128000},"status":"deprecated","cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"gpt-oss-20b":{"id":"gpt-oss-20b","name":"GPT OSS 20B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.07,"output":0.2},"canonical_model_id":"openai/gpt-oss-20b"},"deepseek-v4-pro":{"id":"deepseek-v4-pro","name":"DeepSeek v4 Pro","description":"Flagship DeepSeek model for coding, reasoning, and agentic work","family":"deepseek-thinking","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-04-24","last_updated":"2026-04-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":128000,"output":8192},"cost":{"input":1.32,"output":3.96,"cache_read":0.044},"canonical_model_id":"deepseek/deepseek-v4-pro"},"gpt-5-5":{"id":"gpt-5-5","name":"GPT-5.5","description":"Frontier GPT model for professional reasoning, coding, and multimodal work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2026-04-23","last_updated":"2026-04-23","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":272000,"output":128000},"cost":{"input":5,"output":30,"cache_read":0.5},"canonical_model_id":"openai/gpt-5.5"},"zai-glm-5-1":{"id":"zai-glm-5-1","name":"Z.AI GLM-5.1","description":"Flagship GLM model for hybrid reasoning, coding, and agentic engineering","family":"glm","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-10","release_date":"2026-04-07","last_updated":"2026-04-07","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":198000,"output":8192},"status":"deprecated","cost":{"input":1.4,"output":4.4,"cache_read":0.26},"canonical_model_id":"zhipuai/glm-5.1"},"minimax-m2-7":{"id":"minimax-m2-7","name":"MiniMax-M2.7","description":"MiniMax model for chat, coding, office work, and agentic tasks","family":"minimax","attachment":false,"reasoning":false,"tool_call":true,"temperature":true,"knowledge":"2024-09","release_date":"2026-03-18","last_updated":"2026-03-18","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":192000,"output":8192},"status":"deprecated","cost":{"input":0.3,"output":1.2,"cache_read":0.06},"canonical_model_id":"minimax/MiniMax-M2.7"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"Grok 4.1 Fast (Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-11","release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":128000},"cost":{"input":0.2,"output":0.5,"cache_read":0.05},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"kimi-k2-6":{"id":"kimi-k2-6","name":"Kimi-K2.6","description":"Kimi multimodal agent model for visual understanding, coding, and planning","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2026-04-20","last_updated":"2026-04-20","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"limit":{"context":256000,"output":128000},"cost":{"input":0.95,"output":4,"cache_read":0.16},"canonical_model_id":"moonshotai/kimi-k2.6"},"gpt-5-3-codex":{"id":"gpt-5-3-codex","name":"GPT-5.3 Codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-02-05","last_updated":"2026-02-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.3-codex"},"gpt-5-4-nano":{"id":"gpt-5-4-nano","name":"GPT-5.4 Nano","description":"Compact GPT model for low-latency assistance and high-volume workloads","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2026-03-17","last_updated":"2026-03-17","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2,"output":1.25,"cache_read":0.02},"canonical_model_id":"openai/gpt-5.4-nano"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","description":"Fast Gemini model balancing multimodal reasoning, tool use, and cost","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.5,"output":3,"cache_read":0.05},"canonical_model_id":"google/gemini-3-flash-preview"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"gemini-3-1-pro-preview":{"id":"gemini-3-1-pro-preview","name":"Gemini 3.1 Pro Preview","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2026-01","release_date":"2026-02-19","last_updated":"2026-02-19","modalities":{"input":["text","image","video","audio","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"cost":{"input":2,"output":12,"cache_read":0.2},"canonical_model_id":"google/gemini-3.1-pro-preview"},"grok-code-fast-1":{"id":"grok-code-fast-1","name":"Grok 4.1 Fast (Reasoning)","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2023-10","release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":128000},"cost":{"input":0.2,"output":1.5,"cache_read":0.02},"canonical_model_id":"xai/grok-code-fast-1"},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","description":"GPT model for general reasoning, writing, coding, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2023-09","release_date":"2024-05-13","last_updated":"2024-08-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":128000,"output":16384},"cost":{"input":2.5,"output":10,"cache_read":1.25},"canonical_model_id":"openai/gpt-4o"},"gpt-oss-120b":{"id":"gpt-oss-120b","name":"GPT OSS 120B","description":"Open-weight GPT model for self-hosted reasoning and instruction-following workloads","family":"gpt-oss","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-06","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":32768},"cost":{"input":0.15,"output":0.6},"canonical_model_id":"openai/gpt-oss-120b"},"qwen-3-6-plus":{"id":"qwen-3-6-plus","name":"Qwen 3.6 Plus","description":"Qwen vision-language model for visual reasoning, documents, and agent tasks","family":"qwen","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-04-02","last_updated":"2026-04-02","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":64000},"status":"deprecated","cost":{"input":0.5,"output":3,"cache_read":0.1},"canonical_model_id":"alibaba/qwen3.6-plus"},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"canonical_model_id":"anthropic/claude-sonnet-4-6"},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-7"},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5"}}},"jiekou":{"id":"jiekou","env":["JIEKOU_API_KEY"],"npm":"@ai-sdk/openai-compatible","api":"https://api.jiekou.ai/openai","name":"Jiekou.AI","doc":"https://docs.jiekou.ai/docs/support/quickstart?utm_source=github_models.dev","models":{"grok-4-1-fast-non-reasoning":{"id":"grok-4-1-fast-non-reasoning","name":"grok-4-1-fast-non-reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window; non-reasoning variant for low-latency responses","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.19,"output":0.475},"canonical_model_id":"xai/grok-4.1-fast"},"claude-sonnet-4-20250514":{"id":"claude-sonnet-4-20250514","name":"claude-sonnet-4-20250514","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"status":"deprecated","cost":{"input":2.7,"output":13.5},"canonical_model_id":"anthropic/claude-sonnet-4-20250514"},"gpt-5.2-pro":{"id":"gpt-5.2-pro","name":"gpt-5.2-pro","description":"Higher-accuracy GPT-5.2 variant for tougher reasoning and review workflows","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":19.95,"output":159.6},"canonical_model_id":"openai/gpt-5.2-pro"},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"gemini-2.5-flash","description":"Fast Gemini workhorse for multimodal apps where latency and price matter","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.285,"output":2.375,"cache_read":0.0285},"canonical_model_id":"google/gemini-2.5-flash"},"gpt-5.2":{"id":"gpt-5.2","name":"gpt-5.2","description":"Reliable GPT generation for broad coding, writing, and tool-assisted product work","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.6625,"output":13.3,"cache_read":0.1662},"canonical_model_id":"openai/gpt-5.2"},"o4-mini":{"id":"o4-mini","name":"o4-mini","description":"Fast o-series model for compact reasoning, coding, and tool use","family":"o-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"status":"deprecated","cost":{"input":1.1,"output":4.4},"canonical_model_id":"openai/o4-mini"},"gpt-5.2-codex":{"id":"gpt-5.2-codex","name":"gpt-5.2-codex","description":"Code-specialist GPT for repository edits, reviews, and long-running software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-08-31","release_date":"2025-12-11","last_updated":"2025-12-11","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.75,"output":14,"cache_read":0.175},"canonical_model_id":"openai/gpt-5.2-codex"},"grok-4-fast-reasoning":{"id":"grok-4-fast-reasoning","name":"grok-4-fast-reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated","cost":{"input":0.18,"output":0.45},"canonical_model_id":"xai/grok-4-fast-reasoning"},"gpt-5.1-codex-max":{"id":"gpt-5.1-codex-max","name":"gpt-5.1-codex-max","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","xhigh"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"openai/gpt-5.1-codex-max"},"gpt-5.1-codex":{"id":"gpt-5.1-codex","name":"gpt-5.1-codex","description":"Codex GPT for repository edits, code review, and practical software agents","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"openai/gpt-5.1-codex"},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"gemini-2.5-pro","description":"Google's proven reasoning model for coding, math, and multimodal analysis","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"google/gemini-2.5-pro"},"o3":{"id":"o3","name":"o3","description":"Deliberate o-series reasoner for hard math, coding, and multi-step analysis","family":"o","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2025-04-16","last_updated":"2025-04-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":9.5,"output":38,"cache_read":0.475},"canonical_model_id":"openai/o3"},"gemini-2.5-flash-preview-05-20":{"id":"gemini-2.5-flash-preview-05-20","name":"gemini-2.5-flash-preview-05-20","description":"Preview snapshot of Gemini 2.5 Flash with controllable thinking budgets","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-05-20","last_updated":"2025-05-20","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.1425,"output":3.325,"cache_read":0.0285},"canonical_model_id":"google/gemini-2.5-flash-preview-05-20"},"gemini-3-pro-preview":{"id":"gemini-3-pro-preview","name":"gemini-3-pro-preview","description":"Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts","family":"gemini-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-11-18","last_updated":"2025-11-18","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":1.8,"output":10.8},"canonical_model_id":"google/gemini-3-pro-preview"},"o3-mini":{"id":"o3-mini","name":"o3-mini","description":"Smaller o-series reasoner for economical coding, math, and planning tasks","family":"o-mini","attachment":false,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05","release_date":"2024-12-20","last_updated":"2025-01-29","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":100000},"cost":{"input":1.045,"output":4.18,"cache_read":0.5225},"canonical_model_id":"openai/o3-mini"},"gpt-5-pro":{"id":"gpt-5-pro","name":"gpt-5-pro","description":"Higher-accuracy GPT-5 tier for tough analysis, coding reviews, and planning","family":"gpt-pro","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-10-06","last_updated":"2025-10-06","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":272000},"cost":{"input":14.25,"output":114},"canonical_model_id":"openai/gpt-5-pro"},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"claude-sonnet-4-5-20250929","description":"Balanced Claude model for coding, analysis, agent workflows, and cost control","family":"claude-sonnet","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75,"tiers":[{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5,"tier":{"type":"context","size":200000}}],"context_over_200k":{"input":6,"output":22.5,"cache_read":0.6,"cache_write":7.5}},"canonical_model_id":"anthropic/claude-sonnet-4-5-20250929"},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"gemini-2.5-flash-lite","description":"Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"cost":{"input":0.095,"output":0.38,"cache_read":0.0095},"canonical_model_id":"google/gemini-2.5-flash-lite"},"claude-opus-4-1-20250805":{"id":"claude-opus-4-1-20250805","name":"claude-opus-4-1-20250805","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":13.5,"output":67.5},"canonical_model_id":"anthropic/claude-opus-4-1-20250805"},"grok-4-1-fast-reasoning":{"id":"grok-4-1-fast-reasoning","name":"grok-4-1-fast-reasoning","description":"xAI's fast agentic tool-calling model with a 2M context window and built-in reasoning","family":"grok","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-11-19","last_updated":"2025-11-19","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":30000},"cost":{"input":0.19,"output":0.475},"canonical_model_id":"xai/grok-4.1-fast-reasoning"},"gemini-2.5-flash-lite-preview-06-17":{"id":"gemini-2.5-flash-lite-preview-06-17","name":"gemini-2.5-flash-lite-preview-06-17","description":"First preview of Gemini 2.5 Flash-Lite, the low-cost, low-latency 2.5 model","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65535},"status":"deprecated","cost":{"input":0.09,"output":0.36},"canonical_model_id":"google/gemini-2.5-flash-lite-preview-06-17"},"gpt-5.1":{"id":"gpt-5.1","name":"gpt-5.1","description":"Sharper GPT-5 generation for coding, product work, and tool-assisted tasks","family":"gpt","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"openai/gpt-5.1"},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"claude-haiku-4-5-20251001","description":"Fast Claude model for responsive assistance, classification, and lightweight agents","family":"claude-haiku","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":64000},"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"canonical_model_id":"anthropic/claude-haiku-4-5-20251001"},"gpt-5-mini":{"id":"gpt-5-mini","name":"gpt-5-mini","description":"Small GPT-5 for responsive agents, coding help, and everyday automation","family":"gpt-mini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2375,"output":1.9,"cache_read":0.0237},"canonical_model_id":"openai/gpt-5-mini"},"gpt-5.1-codex-mini":{"id":"gpt-5.1-codex-mini","name":"gpt-5.1-codex-mini","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-11-13","last_updated":"2025-11-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.2375,"output":1.9,"cache_read":0.0237},"canonical_model_id":"openai/gpt-5.1-codex-mini"},"claude-opus-4-20250514":{"id":"claude-opus-4-20250514","name":"claude-opus-4-20250514","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":32000},"status":"deprecated","cost":{"input":13.5,"output":67.5},"canonical_model_id":"anthropic/claude-opus-4-20250514"},"gemini-2.5-pro-preview-06-05":{"id":"gemini-2.5-pro-preview-06-05","name":"gemini-2.5-pro-preview-06-05","description":"Advanced Gemini model for complex reasoning, coding, and multimodal analysis","family":"gemini","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01-31","release_date":"2025-06-05","last_updated":"2025-06-05","modalities":{"input":["image","text","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"google/gemini-2.5-pro-preview"},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"claude-opus-4-5-20251101","description":"Flagship Claude model for deep reasoning, coding, and long-horizon agents","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":200000,"output":65536},"cost":{"input":4.75,"output":23.75,"cache_read":0.475,"cache_write":5.9375},"canonical_model_id":"anthropic/claude-opus-4-5-20251101"},"gpt-5-nano":{"id":"gpt-5-nano","name":"gpt-5-nano","description":"Tiny GPT-5 lane for routing, extraction, classification, and bulk jobs","family":"gpt-nano","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["minimal","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-05-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":0.0475,"output":0.38,"cache_read":0.0047},"canonical_model_id":"openai/gpt-5-nano"},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"gemini-3-flash-preview","description":"New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs","family":"gemini-flash","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-12-17","last_updated":"2025-12-17","modalities":{"input":["text","image","video","audio"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"cost":{"input":0.475,"output":2.85,"cache_read":0.0475},"canonical_model_id":"google/gemini-3-flash-preview"},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"claude-opus-4-6","description":"High-end Claude for difficult coding, planning, and slower expert reasoning","family":"claude-opus","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high","max"]},{"type":"budget_tokens","min":1024}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":1000000,"output":128000},"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"canonical_model_id":"anthropic/claude-opus-4-6"},"grok-4-0709":{"id":"grok-4-0709","name":"grok-4-0709","description":"Grok model for agentic tool use, reasoning, coding, and live assistance","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2026-01","last_updated":"2026-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":8192},"cost":{"input":2.85,"output":14.25}},"grok-code-fast-1":{"id":"grok-code-fast-1","name":"grok-code-fast-1","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-02","last_updated":"2025-09-02","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"limit":{"context":256000,"output":10000},"cost":{"input":0.19,"output":1.425,"cache_read":0.019},"canonical_model_id":"xai/grok-code-fast-1"},"gpt-5-codex":{"id":"gpt-5-codex","name":"gpt-5-codex","description":"Coding-optimized GPT model for repository edits, reviews, and agentic software work","family":"gpt-codex","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-09-15","last_updated":"2025-09-15","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"cost":{"input":1.1875,"output":9.5,"cache_read":0.1187},"canonical_model_id":"openai/gpt-5-codex"},"gpt-5-chat-latest":{"id":"gpt-5-chat-latest","name":"gpt-5-chat-latest","description":"Chat-tuned GPT model for conversational assistance, writing, and tool workflows","family":"gpt","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2024-09-30","release_date":"2025-08-07","last_updated":"2025-08-07","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":400000,"input":272000,"output":128000},"status":"deprecated","cost":{"input":1.125,"output":9},"canonical_model_id":"openai/gpt-5-chat-latest"},"grok-4-fast-non-reasoning":{"id":"grok-4-fast-non-reasoning","name":"grok-4-fast-non-reasoning","description":"Fast Grok model for responsive chat, reasoning, and tool-assisted work","family":"grok","attachment":true,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-18","last_updated":"2025-12-18","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"limit":{"context":2000000,"output":2000000},"status":"deprecated","cost":{"input":0.18,"output":0.45},"canonical_model_id":"xai/grok-4-fast-non-reasoning"},"gemini-2.5-flash-lite-preview-09-2025":{"id":"gemini-2.5-flash-lite-preview-09-2025","name":"gemini-2.5-flash-lite-preview-09-2025","description":"September 2025 preview of Gemini 2.5 Flash-Lite with better instruction following and multimodal quality","family":"gemini-flash-lite","attachment":true,"reasoning":true,"reasoning_options":[{"type":"effort","values":["none","low","medium","high"]}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-01","release_date":"2025-09-25","last_updated":"2025-09-25","modalities":{"input":["text","image","audio","video"],"output":["text"]},"open_weights":false,"limit":{"context":1048576,"output":65536},"status":"deprecated","cost":{"input":0.09,"output":0.36},"canonical_model_id":"google/gemini-2.5-flash-lite-preview-09-2025"},"baidu/ernie-4.5-vl-424b-a47b":{"id":"baidu/ernie-4.5-vl-424b-a47b","name":"ERNIE 4.5 VL 424B A47B","description":"Multimodal reasoning model for visual analysis, planning, and tool use","family":"ernie","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-06-30","last_updated":"2025-06-30","modalities":{"input":["image","text"],"output":["text"]},"open_weights":true,"limit":{"context":123000,"output":16000},"cost":{"input":0.42,"output":1.25},"canonical_model_id":"baidu/ernie-4.5-vl-424b-a47b"},"baidu/ernie-4.5-300b-a47b-paddle":{"id":"baidu/ernie-4.5-300b-a47b-paddle","name":"ERNIE 4.5 300B A47B","description":"Open ERNIE text MoE with 300B total and 47B active parameters","family":"ernie","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-06-30","last_updated":"2025-06-30","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":123000,"output":12000},"cost":{"input":0.28,"output":1.1},"canonical_model_id":"baidu/ernie-4.5-300b-a47b"},"minimaxai/minimax-m1-80k":{"id":"minimaxai/minimax-m1-80k","name":"MiniMax M1","description":"Open hybrid-attention MoE reasoning model with a million-token context and an 80K thinking budget","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":false,"temperature":true,"release_date":"2025-06-17","last_updated":"2025-06-17","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":1000000,"output":40000},"cost":{"input":0.55,"output":2.2},"canonical_model_id":"minimax/minimax-m1-80k"},"deepseek/deepseek-r1-0528":{"id":"deepseek/deepseek-r1-0528","name":"DeepSeek R1 0528","description":"May 2025 DeepSeek R1 update with improved mathematics, coding, and reasoning","family":"deepseek-thinking","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-05-28","last_updated":"2025-05-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.7,"output":2.5,"cache_read":0.35},"canonical_model_id":"deepseek/deepseek-r1-0528"},"deepseek/deepseek-v3.1":{"id":"deepseek/deepseek-v3.1","name":"DeepSeek V3.1","description":"Hybrid-reasoning DeepSeek model with thinking and non-thinking modes","family":"deepseek","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-08-21","last_updated":"2025-08-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":32768},"cost":{"input":0.27,"output":1},"canonical_model_id":"deepseek/deepseek-v3.1"},"deepseek/deepseek-v3-0324":{"id":"deepseek/deepseek-v3-0324","name":"DeepSeek V3 0324","description":"March 2025 checkpoint of DeepSeek-V3 with improved reasoning and coding","family":"deepseek","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-03-24","last_updated":"2025-03-24","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":163840,"output":163840},"cost":{"input":0.28,"output":1.14,"cache_read":0.14},"canonical_model_id":"deepseek/deepseek-v3-0324"},"qwen/qwen3-235b-a22b-thinking-2507":{"id":"qwen/qwen3-235b-a22b-thinking-2507","name":"Qwen3 235B A22b Thinking 2507","description":"Updated large open Qwen3 MoE thinking model for reasoning, math, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-25","last_updated":"2025-07-25","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":131072},"cost":{"input":0.3,"output":3},"canonical_model_id":"alibaba/qwen3-235b-a22b-thinking-2507"},"qwen/qwen3-coder-480b-a35b-instruct":{"id":"qwen/qwen3-coder-480b-a35b-instruct","name":"Qwen3 Coder 480B A35B Instruct","description":"Open Qwen coding heavyweight for repository reasoning and agentic engineering","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-22","last_updated":"2025-07-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.38,"output":1.55},"canonical_model_id":"alibaba/qwen3-coder-480b-a35b-instruct"},"qwen/qwen3-235b-a22b-instruct-2507":{"id":"qwen/qwen3-235b-a22b-instruct-2507","name":"Qwen3 235B A22B Instruct 2507","description":"Updated large open Qwen3 MoE instruct model for multilingual chat, coding, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-21","last_updated":"2025-07-21","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":16384},"cost":{"input":0.15,"output":0.8},"canonical_model_id":"alibaba/qwen3-235b-a22b-instruct-2507"},"qwen/qwen3-next-80b-a3b-thinking":{"id":"qwen/qwen3-next-80b-a3b-thinking","name":"Qwen3 Next 80B A3B Thinking","description":"Efficient Qwen thinking model for local reasoning, math, and coding agents","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.15,"output":1.5},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-thinking"},"qwen/qwen3-32b-fp8":{"id":"qwen/qwen3-32b-fp8","name":"Qwen3 32B","description":"Dense open Qwen model for self-hosted chat, reasoning, and coding","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":20000},"cost":{"input":0.1,"output":0.45},"canonical_model_id":"alibaba/qwen3-32b"},"qwen/qwen3-235b-a22b-fp8":{"id":"qwen/qwen3-235b-a22b-fp8","name":"Qwen3 235B A22B","description":"Large open Qwen MoE for multilingual reasoning, coding, and tool use","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"knowledge":"2025-04","release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":20000},"cost":{"input":0.2,"output":0.8},"canonical_model_id":"alibaba/qwen3-235b-a22b"},"qwen/qwen3-coder-next":{"id":"qwen/qwen3-coder-next","name":"qwen/qwen3-coder-next","description":"Open-weight Qwen coding model for agents, repository edits, and multi-turn tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-09","release_date":"2026-02-03","last_updated":"2026-02-03","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":65536},"cost":{"input":0.2,"output":1.5},"canonical_model_id":"alibaba/qwen3-coder-next"},"qwen/qwen3-next-80b-a3b-instruct":{"id":"qwen/qwen3-next-80b-a3b-instruct","name":"Qwen3 Next 80B A3B Instruct","description":"Qwen instruction model for multilingual chat, reasoning, and tool use","family":"qwen","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-09","last_updated":"2025-09","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":65536},"cost":{"input":0.15,"output":1.5},"canonical_model_id":"alibaba/qwen3-next-80b-a3b-instruct"},"qwen/qwen3-30b-a3b-fp8":{"id":"qwen/qwen3-30b-a3b-fp8","name":"Qwen3 30B A3B","description":"Sparse MoE Qwen model with 3B active parameters for efficient chat and reasoning","family":"qwen","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":false,"structured_output":false,"temperature":true,"release_date":"2025-04-28","last_updated":"2025-04-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":40960,"output":20000},"cost":{"input":0.09,"output":0.45},"canonical_model_id":"alibaba/qwen3-30b-a3b"},"xiaomimimo/mimo-v2-flash":{"id":"xiaomimimo/mimo-v2-flash","name":"XiaomiMiMo/MiMo-V2-Flash","description":"MiMo flash model for fast multimodal assistance and agent workflows","family":"mimo","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2024-12-01","release_date":"2025-12-16","last_updated":"2026-02-04","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":131072},"cost":{"input":0.1,"output":0.3,"cache_read":0.02},"canonical_model_id":"xiaomi/mimo-v2-flash"},"moonshotai/kimi-k2-0905":{"id":"moonshotai/kimi-k2-0905","name":"Kimi K2 0905","description":"September 2025 Kimi K2 instruction update with a 256K context and improved agentic coding","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-09-05","last_updated":"2025-09-05","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":100352},"cost":{"input":0.6,"output":2.5},"canonical_model_id":"moonshotai/kimi-k2-0905"},"moonshotai/kimi-k2-instruct":{"id":"moonshotai/kimi-k2-instruct","name":"Kimi K2 Instruct","description":"Non-thinking Kimi K2 MoE instruction model for coding and tool-using agents","family":"kimi-k2","attachment":false,"reasoning":false,"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-07-11","last_updated":"2025-07-11","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":100352},"cost":{"input":0.57,"output":2.3},"canonical_model_id":"moonshotai/kimi-k2-instruct"},"moonshotai/kimi-k2.5":{"id":"moonshotai/kimi-k2.5","name":"Kimi K2.5","description":"Earlier Kimi frontier model for long-context agents, coding, and multimodal work","family":"kimi-k2","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01-27","last_updated":"2026-01-27","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":262144,"output":262144},"cost":{"input":0.6,"output":3,"cache_read":0.1},"canonical_model_id":"moonshotai/kimi-k2.5"},"minimax/minimax-m2.1":{"id":"minimax/minimax-m2.1","name":"Minimax M2.1","description":"Earlier MiniMax agent model for practical coding and productivity tasks","family":"minimax","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"release_date":"2025-12-23","last_updated":"2025-12-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.3,"output":1.2,"cache_read":0.03},"canonical_model_id":"minimax/MiniMax-M2.1"},"zai-org/glm-4.5":{"id":"zai-org/glm-4.5","name":"GLM-4.5","description":"Hybrid-reasoning GLM release that made the 4.5 line broadly useful","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[{"type":"toggle"}],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-28","last_updated":"2025-07-28","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":131072,"output":98304},"cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.5"},"zai-org/glm-4.7":{"id":"zai-org/glm-4.7","name":"GLM-4.7","description":"Mature GLM model for dependable coding, reasoning, and structured agent tasks","family":"glm","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":204800,"output":131072},"cost":{"input":0.6,"output":2.2},"canonical_model_id":"zhipuai/glm-4.7"},"zai-org/glm-4.5v":{"id":"zai-org/glm-4.5v","name":"GLM 4.5V","description":"GLM vision model for visual reasoning, documents, and multimodal agents","family":"glm","attachment":true,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-08-11","last_updated":"2025-08-11","modalities":{"input":["text","image","video"],"output":["text"]},"open_weights":true,"limit":{"context":65536,"output":16384},"cost":{"input":0.6,"output":1.8},"canonical_model_id":"zhipuai/glm-4.5v"},"zai-org/glm-4.7-flash":{"id":"zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","description":"Budget GLM lane for fast coding help, routing, and everyday automation","family":"glm-flash","attachment":false,"reasoning":true,"reasoning_options":[],"tool_call":true,"structured_output":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-01-19","last_updated":"2026-01-19","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"limit":{"context":200000,"output":128000},"cost":{"input":0.07,"output":0.4,"cache_read":0.01},"canonical_model_id":"zhipuai/glm-4.7-flash"}}}} \ No newline at end of file diff --git a/host/js/models.ts b/host/js/models.ts new file mode 100644 index 0000000..cde0805 --- /dev/null +++ b/host/js/models.ts @@ -0,0 +1,58 @@ +/** Configured providers with models.dev metadata and pi-ai API adapters. */ +import {createModels, createProvider} from '@earendil-works/pi-ai/models'; +import {anthropicMessagesApi} from '@earendil-works/pi-ai/api/anthropic-messages.lazy'; +import {openAIResponsesApi} from '@earendil-works/pi-ai/api/openai-responses.lazy'; +import {openAICompletionsApi} from '@earendil-works/pi-ai/api/openai-completions.lazy'; + +export const CONFIG = '/etc/sausage/config.yaml'; +const adapters = {'anthropic-messages': anthropicMessagesApi, 'openai-responses': openAIResponsesApi, + 'openai-chat-completions': openAICompletionsApi}; +export function resolveModel(provider: string, settings: any, entry: any, catalog: any) { + const override = typeof entry === 'string' ? {id:entry} : entry; + const id = override.id; + const known = catalog[settings.catalog ?? provider]?.models?.[id]; + const metadata = {context_window:known?.limit?.context, max_tokens:known?.limit?.output, + reasoning:known?.reasoning, cost:known?.cost, ...override}; + const cost = {...known?.cost, ...override.cost}; + const missing = ['context_window','max_tokens','reasoning'].filter(key=>metadata[key] === undefined); + for (const key of ['input','output','cache_read','cache_write']) if (cost[key] === undefined) missing.push(`cost.${key}`); + if (missing.length) throw new Error(`${CONFIG}: ${provider}/${id} lacks ${missing.join(', ')}`); + const extra = Object.keys(override).filter(key=>!['id','context_window','max_tokens','reasoning','cost'].includes(key)); + const extraCost = Object.keys(override.cost ?? {}).filter(key=>!['input','output','cache_read','cache_write'].includes(key)); + if (extra.length || extraCost.length) throw new Error(`${CONFIG}: invalid overrides for ${provider}/${id}: ${[...extra,...extraCost].join(', ')}`); + return {id, name:known?.name ?? id, provider, api:settings.type === 'openai-chat-completions' ? 'openai-completions' : settings.type, + baseUrl:settings.base_url, contextWindow:metadata.context_window, maxTokens:metadata.max_tokens, + reasoning:metadata.reasoning, input:known?.modalities?.input?.filter((type:string)=>['text','image'].includes(type)) ?? ['text'], + cost:{input:cost.input, output:cost.output, cacheRead:cost.cache_read, cacheWrite:cost.cache_write}}; +} +export async function modelCatalog() { + let updated; + try { + const response = await fetch('https://models.dev/api.json',{signal:AbortSignal.timeout(5000)}); + if (response.ok) updated = await response.json(); + } catch { /* Cached metadata and the packaged snapshot also work offline. */ } + return Deno.core.ops.op_model_catalog(updated ?? null); +} +export async function configuredModels(readProviders:()=>Promise, catalog:any) { + const models:any = createModels(); + let installed = new Set(); + models.refreshConfig = async () => { + const settings = await readProviders(); + const next = new Set(Object.keys(settings)); + for (const name of installed) if (!next.has(name)) models.deleteProvider(name); + for (const [name, value] of Object.entries(settings) as [string,any][]) { + const adapter = adapters[value.type]; + if (!adapter) throw new Error(`${CONFIG}: unknown API type for provider ${name}: ${value.type}`); + const entries = (value.models ?? []).map((entry:any)=>resolveModel(name,value,entry,catalog)); + models.setProvider(createProvider({id:name,name,baseUrl:value.base_url,models:entries,api:adapter(), + auth:{apiKey:{name:`${name} API key`,resolve:async()=>{ + const current = (await readProviders())[name]; + if (!current?.api_key || !current.base_url) throw new Error(`${CONFIG}: set providers.${name}.api_key and base_url before a model request`); + return {auth:{apiKey:current.api_key,baseUrl:current.base_url},source:CONFIG}; + }}}})); + } + installed = next; + }; + await models.refreshConfig(); + return models; +} diff --git a/host/js/p3-test-bundle.js b/host/js/p3-test-bundle.js index 43f3c41..9e6486f 100644 --- a/host/js/p3-test-bundle.js +++ b/host/js/p3-test-bundle.js @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38404,10 +38404,10 @@ testReplay(); if (globalThis.p3Mode !== "unit") { const workerId = (transcript) => Number(/Started subagent (\d+)/.exec(JSON.stringify(transcript.messages))?.[1]); const rules = [ - { id: "standing-branch", role: "standing", match: { kind: "user", text: "launch scenario" }, answer: { tools: [{ name: "branch", args: { repo: "/src/demo", isolated: true, prompt: "begin" } }] } }, - { id: "standing-probe", role: "standing", match: { kind: "user", text: "launch branch" }, answer: { tools: [{ name: "branch", args: { repo: "/src/demo", prompt: "branch probe" } }] } }, + { id: "mainAgent-branch", role: "mainAgent", match: { kind: "user", text: "launch scenario" }, answer: { tools: [{ name: "branch", args: { repo: "/src/demo", isolated: true, prompt: "begin" } }] } }, + { id: "mainAgent-probe", role: "mainAgent", match: { kind: "user", text: "launch branch" }, answer: { tools: [{ name: "branch", args: { repo: "/src/demo", prompt: "branch probe" } }] } }, { id: "coordinator-probe", role: "coordinator", match: { kind: "user", text: "branch probe" }, answer: { text: "branch complete" } }, - { id: "standing-receipt", role: "standing", match: { text: "" }, answer: { text: "Receipt noted." } }, + { id: "mainAgent-receipt", role: "mainAgent", match: { text: "" }, answer: { text: "Receipt noted." } }, { id: "coordinator-echo", role: "coordinator", match: { kind: "user", text: "Receipt noted." }, answer: { text: "Acknowledged." } }, { id: "start-worker", role: "coordinator", match: { kind: "user", text: "begin" }, answer: { tools: [{ name: "subagent", args: { action: "start", agent: "worker", isolate: "worktree", task: "build feature", background: true } }] } }, { id: "start-reviewer", role: "coordinator", match: { kind: "user", text: "worker complete" }, answer: { tools: [{ name: "subagent", args: { action: "start", agent: "reviewer", isolate: "none", task: "review feature", background: true } }] } }, @@ -38427,7 +38427,7 @@ if (globalThis.p3Mode !== "unit") { const harness = await Harness.open(storage, { models, registry, settings: { retry: { enabled: false }, get extensions() { return registry.snapshot().installed(); } } }, BACKGROUND_CONTEXT); - const root = await harness.root(BACKGROUND_CONTEXT, { agent: { model: { provider: "faux", modelId: "faux-1" }, instructions: "P3 role:standing", cwd: "/src/demo" } }); + const root = await harness.root(BACKGROUND_CONTEXT, { agent: { model: { provider: "faux", modelId: "faux-1" }, instructions: "P3 role:mainAgent", cwd: "/src/demo" } }); if (globalThis.p3Mode === "kill-forward") { const install = registry.install.bind(registry); registry.install = (extension) => install(extension.name !== "workspaces" ? extension : { ...extension, tasks: extension.tasks.map((task) => task.definition.name !== "workspaces.lander" ? task : { definition: { ...task.definition, phases: { ...task.definition.phases, land: async (record2, runtime, ctx) => { @@ -38481,12 +38481,12 @@ if (globalThis.p3Mode !== "unit") { if (globalThis.p3Mode === "load-all") { assert((await root.agent(BACKGROUND_CONTEXT)).tools.some((tool) => tool.name === "branch"), "Every extension must load"); } else { - const standing = await harness.conversation(await globalThis.p3Subagents.standing("standing", BACKGROUND_CONTEXT), BACKGROUND_CONTEXT); + const mainAgent = await harness.conversation(await globalThis.p3Subagents.mainAgent("mainAgent", BACKGROUND_CONTEXT), BACKGROUND_CONTEXT); harness.resume(); const probe = globalThis.p3Mode.startsWith("branch"); if (globalThis.p3Mode === "branch" || globalThis.p3Mode.startsWith("kill-")) { - await (await standing.submit({ type: "input", content: probe ? "launch branch" : "launch scenario", requestId: "p3-launch" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); - const entries3 = (await standing.context(BACKGROUND_CONTEXT)).entries; + await (await mainAgent.submit({ type: "input", content: probe ? "launch branch" : "launch scenario", requestId: "p3-launch" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); + const entries3 = (await mainAgent.context(BACKGROUND_CONTEXT)).entries; assert(!JSON.stringify(entries3).includes('"isError":true'), `Branch tool failed: ${JSON.stringify(entries3)}`); } if (globalThis.p3Mode.startsWith("kill-")) await new Promise(() => { @@ -38498,12 +38498,12 @@ if (globalThis.p3Mode !== "unit") { await new Promise((resolve2) => setTimeout(resolve2, 0)); } }; - const replies = async () => (await standing.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "board.reply"); + const replies = async () => (await mainAgent.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "board.reply"); await wait(async () => (await replies()).length > 0, "No branch reply"); const received = await replies(); const coordinator = await harness.conversation(received[0].data.from, BACKGROUND_CONTEXT); assert((await coordinator.agent(BACKGROUND_CONTEXT)).instructions.includes("P3 role:coordinator"), "Branch must use coordinator definition"); - assert((await conversationChains(harness, BACKGROUND_CONTEXT)(coordinator.id)).includes(String(standing.id)), "D63 must include standing"); + assert((await conversationChains(harness, BACKGROUND_CONTEXT)(coordinator.id)).includes(String(mainAgent.id)), "D63 must include mainAgent"); if (!probe) { await wait(async () => Object.keys((await harness.snapshot(globalThis.p3Workspaces.doc, root.id, BACKGROUND_CONTEXT)).results).length === 1, "No landing"); await wait(async () => (await harness.snapshot(globalThis.p3Workspaces.doc, root.id, BACKGROUND_CONTEXT)).queue.length === 0, "Lander did not report"); @@ -38522,9 +38522,9 @@ if (globalThis.p3Mode !== "unit") { assert(!await fs.stat(worker.path).then(() => true, () => false), "Released checkout must not exist"); assert(Object.values(index.results).every((result) => result.outcome === "landed"), `Landing failed: ${JSON.stringify(index)}`); assert((await globalThis.p3Host.eventLog.recent({ events: [{ kind: "event.workspaces.landed" }] })).length === 1, "Expected one landed event"); - const standingEntries = (await standing.context(BACKGROUND_CONTEXT)).entries; + const mainAgentEntries = (await mainAgent.context(BACKGROUND_CONTEXT)).entries; const landed = Object.values(index.results)[0]; - const cards = standingEntries.filter((entry2) => entry2.kind === "board.message" && entry2.data.text.startsWith("[lander] Submission") && entry2.data.text.includes(" landed as ")); + const cards = mainAgentEntries.filter((entry2) => entry2.kind === "board.message" && entry2.data.text.startsWith("[lander] Submission") && entry2.data.text.includes(" landed as ")); assert(cards.length === 1 && cards[0].data.from === coordinator.id && cards[0].data.text.includes(landed.sha), `Expected one landing card through messages: ${JSON.stringify(cards)}`); const repliesNow = await replies(); assert(repliesNow.length === 1 && !repliesNow[0].data.failed && new Set(repliesNow.map((entry2) => entry2.data.id)).size === repliesNow.length, `Duplicate board.reply: ${JSON.stringify(repliesNow)}`); diff --git a/host/js/p3-test.ts b/host/js/p3-test.ts index c7b441f..51da769 100644 --- a/host/js/p3-test.ts +++ b/host/js/p3-test.ts @@ -12,10 +12,10 @@ testReplay(); if (globalThis.p3Mode !== 'unit') { const workerId = (transcript: any) => Number(/Started subagent (\d+)/.exec(JSON.stringify(transcript.messages))?.[1]); const rules: Rule[] = [ - { id: 'standing-branch', role: 'standing', match: { kind: 'user', text: 'launch scenario' }, answer: { tools: [{ name: 'branch', args: { repo: '/src/demo', isolated: true, prompt: 'begin' } }] } }, - { id: 'standing-probe', role: 'standing', match: { kind: 'user', text: 'launch branch' }, answer: { tools: [{ name: 'branch', args: { repo: '/src/demo', prompt: 'branch probe' } }] } }, + { id: 'mainAgent-branch', role: 'mainAgent', match: { kind: 'user', text: 'launch scenario' }, answer: { tools: [{ name: 'branch', args: { repo: '/src/demo', isolated: true, prompt: 'begin' } }] } }, + { id: 'mainAgent-probe', role: 'mainAgent', match: { kind: 'user', text: 'launch branch' }, answer: { tools: [{ name: 'branch', args: { repo: '/src/demo', prompt: 'branch probe' } }] } }, { id: 'coordinator-probe', role: 'coordinator', match: { kind: 'user', text: 'branch probe' }, answer: { text: 'branch complete' } }, - { id: 'standing-receipt', role: 'standing', match: { text: '' }, answer: { text: 'Receipt noted.' } }, + { id: 'mainAgent-receipt', role: 'mainAgent', match: { text: '' }, answer: { text: 'Receipt noted.' } }, { id: 'coordinator-echo', role: 'coordinator', match: { kind: 'user', text: 'Receipt noted.' }, answer: { text: 'Acknowledged.' } }, { id: 'start-worker', role: 'coordinator', match: { kind: 'user', text: 'begin' }, answer: { tools: [{ name: 'subagent', args: { action: 'start', agent: 'worker', isolate: 'worktree', task: 'build feature', background: true } }] } }, { id: 'start-reviewer', role: 'coordinator', match: { kind: 'user', text: 'worker complete' }, answer: { tools: [{ name: 'subagent', args: { action: 'start', agent: 'reviewer', isolate: 'none', task: 'review feature', background: true } }] } }, @@ -32,7 +32,7 @@ if (globalThis.p3Mode !== 'unit') { models.setProvider(scriptedModel(rules, rule => Deno.core.ops.op_output(`scripted rule: ${rule}\n`))); const storage = await openStorage(globalThis.storagePath), registry = createRegistry(); const harness = await Harness.open(storage, { models, registry, settings: { retry: { enabled: false }, get extensions() { return registry.snapshot().installed(); } } }, context); - const root = await harness.root(context, { agent: { model: { provider: 'faux', modelId: 'faux-1' }, instructions: 'P3 role:standing', cwd: '/src/demo' } }); + const root = await harness.root(context, { agent: { model: { provider: 'faux', modelId: 'faux-1' }, instructions: 'P3 role:mainAgent', cwd: '/src/demo' } }); // Stop after the durable lander commit records landed.sha, before its event/report commit. if (globalThis.p3Mode === 'kill-forward') { const install = registry.install.bind(registry); @@ -85,12 +85,12 @@ if (globalThis.p3Mode !== 'unit') { if (globalThis.p3Mode === 'load-all') { assert((await root.agent(context)).tools.some((tool: any) => tool.name === 'branch'), 'Every extension must load'); } else { - const standing = (await harness.conversation(await globalThis.p3Subagents.standing('standing', context), context))!; + const mainAgent = (await harness.conversation(await globalThis.p3Subagents.mainAgent('mainAgent', context), context))!; harness.resume(); const probe = globalThis.p3Mode.startsWith('branch'); if (globalThis.p3Mode === 'branch' || globalThis.p3Mode.startsWith('kill-')) { - await (await standing.submit({ type: 'input', content: probe ? 'launch branch' : 'launch scenario', requestId: 'p3-launch' }, context)).wait(context); - const entries = (await standing.context(context)).entries; + await (await mainAgent.submit({ type: 'input', content: probe ? 'launch branch' : 'launch scenario', requestId: 'p3-launch' }, context)).wait(context); + const entries = (await mainAgent.context(context)).entries; assert(!JSON.stringify(entries).includes('"isError":true'), `Branch tool failed: ${JSON.stringify(entries)}`); } if (globalThis.p3Mode.startsWith('kill-')) await new Promise(() => {}); @@ -101,12 +101,12 @@ if (globalThis.p3Mode !== 'unit') { await new Promise(resolve => setTimeout(resolve, 0)); } }; - const replies = async () => (await standing.context(context)).entries.filter((entry: any) => entry.kind === 'board.reply'); + const replies = async () => (await mainAgent.context(context)).entries.filter((entry: any) => entry.kind === 'board.reply'); await wait(async () => (await replies()).length > 0, 'No branch reply'); const received = await replies(); const coordinator = (await harness.conversation(received[0].data.from, context))!; assert((await coordinator.agent(context)).instructions.includes('P3 role:coordinator'), 'Branch must use coordinator definition'); - assert((await conversationChains(harness, context)(coordinator.id)).includes(String(standing.id)), 'D63 must include standing'); + assert((await conversationChains(harness, context)(coordinator.id)).includes(String(mainAgent.id)), 'D63 must include mainAgent'); if (!probe) { await wait(async () => Object.keys((await harness.snapshot(globalThis.p3Workspaces.doc, root.id, context)).results).length === 1, 'No landing'); await wait(async () => (await harness.snapshot(globalThis.p3Workspaces.doc, root.id, context)).queue.length === 0, 'Lander did not report'); @@ -125,9 +125,9 @@ if (globalThis.p3Mode !== 'unit') { assert(!await fs.stat(worker.path).then(() => true, () => false), 'Released checkout must not exist'); assert(Object.values(index.results).every((result: any) => result.outcome === 'landed'), `Landing failed: ${JSON.stringify(index)}`); assert((await globalThis.p3Host.eventLog.recent({ events: [{ kind: 'event.workspaces.landed' }] })).length === 1, 'Expected one landed event'); - const standingEntries = (await standing.context(context)).entries; + const mainAgentEntries = (await mainAgent.context(context)).entries; const landed = Object.values(index.results)[0] as any; - const cards = standingEntries.filter((entry: any) => entry.kind === 'board.message' && entry.data.text.startsWith('[lander] Submission') && entry.data.text.includes(' landed as ')); + const cards = mainAgentEntries.filter((entry: any) => entry.kind === 'board.message' && entry.data.text.startsWith('[lander] Submission') && entry.data.text.includes(' landed as ')); assert(cards.length === 1 && cards[0].data.from === coordinator.id && cards[0].data.text.includes(landed.sha), `Expected one landing card through messages: ${JSON.stringify(cards)}`); const repliesNow = await replies(); assert(repliesNow.length === 1 && !repliesNow[0].data.failed && new Set(repliesNow.map((entry: any) => entry.data.id)).size === repliesNow.length, `Duplicate board.reply: ${JSON.stringify(repliesNow)}`); diff --git a/host/js/package.json b/host/js/package.json index 8ce27aa..baf5efb 100644 --- a/host/js/package.json +++ b/host/js/package.json @@ -2,7 +2,7 @@ "private": true, "type": "module", "scripts": { - "bundle": "nu apply-patch.nu && esbuild main.ts --bundle --format=esm --platform=browser --outfile=bundle.js && esbuild test.ts --bundle --format=esm --platform=browser --outfile=test-bundle.js && esbuild durable-test.ts --bundle --format=esm --platform=browser --outfile=durable-test-bundle.js && esbuild foundation-test.ts --bundle --format=esm --platform=browser --outfile=foundation-test-bundle.js && esbuild extensions-test.ts --bundle --format=esm --platform=browser --outfile=extensions-test-bundle.js && esbuild events-test.ts --bundle --format=esm --platform=browser --outfile=events-test-bundle.js && esbuild subagents-test.ts --bundle --format=esm --platform=browser --outfile=subagents-test-bundle.js && esbuild core-ext-test.ts --bundle --format=esm --platform=browser --outfile=core-ext-test-bundle.js && esbuild plan-todos-test.ts --bundle --format=esm --platform=browser --outfile=plan-todos-test-bundle.js && esbuild p2-test.ts --bundle --format=esm --platform=browser --outfile=p2-test-bundle.js && esbuild chain-test.ts --bundle --format=esm --platform=browser --outfile=chain-test-bundle.js && esbuild undo-harness-test.ts --bundle --format=esm --platform=browser --outfile=undo-harness-test-bundle.js && esbuild messages-test.ts --bundle --format=esm --platform=browser --outfile=messages-test-bundle.js && esbuild p3-test.ts --bundle --format=esm --platform=browser --outfile=p3-test-bundle.js && esbuild automations-test.ts --bundle --format=esm --platform=browser --outfile=automations-test-bundle.js && esbuild watchdog-test.ts --bundle --format=esm --platform=browser --outfile=watchdog-test-bundle.js && esbuild workspaces-test.ts --bundle --format=esm --platform=browser --outfile=workspaces-test-bundle.js && esbuild goal-questions-test.ts --bundle --format=esm --platform=browser --outfile=goal-questions-test-bundle.js && esbuild dream-test.ts --bundle --format=esm --platform=browser --outfile=dream-test-bundle.js && esbuild p4-test.ts --bundle --format=esm --platform=browser --outfile=p4-test-bundle.js && esbuild harness-api-test.ts --bundle --format=esm --platform=browser --outfile=harness-api-test-bundle.js && esbuild proxy-models-test.ts --bundle --format=esm --platform=browser --outfile=proxy-models-test-bundle.js" + "bundle": "export NODE_PATH=\"$PWD/node_modules\"; nu apply-patch.nu && esbuild main.ts --bundle --format=esm --platform=browser --outfile=bundle.js && esbuild test.ts --bundle --format=esm --platform=browser --outfile=test-bundle.js && esbuild durable-test.ts --bundle --format=esm --platform=browser --outfile=durable-test-bundle.js && esbuild foundation-test.ts --bundle --format=esm --platform=browser --outfile=foundation-test-bundle.js && esbuild extensions-test.ts --bundle --format=esm --platform=browser --outfile=extensions-test-bundle.js && esbuild events-test.ts --bundle --format=esm --platform=browser --outfile=events-test-bundle.js && esbuild subagents-test.ts --bundle --format=esm --platform=browser --outfile=subagents-test-bundle.js && esbuild core-ext-test.ts --bundle --format=esm --platform=browser --outfile=core-ext-test-bundle.js && esbuild plan-todos-test.ts --bundle --format=esm --platform=browser --outfile=plan-todos-test-bundle.js && esbuild p2-test.ts --bundle --format=esm --platform=browser --outfile=p2-test-bundle.js && esbuild chain-test.ts --bundle --format=esm --platform=browser --outfile=chain-test-bundle.js && esbuild undo-harness-test.ts --bundle --format=esm --platform=browser --outfile=undo-harness-test-bundle.js && esbuild messages-test.ts --bundle --format=esm --platform=browser --outfile=messages-test-bundle.js && esbuild p3-test.ts --bundle --format=esm --platform=browser --outfile=p3-test-bundle.js && esbuild automations-test.ts --bundle --format=esm --platform=browser --outfile=automations-test-bundle.js && esbuild watchdog-test.ts --bundle --format=esm --platform=browser --outfile=watchdog-test-bundle.js && esbuild workspaces-test.ts --bundle --format=esm --platform=browser --outfile=workspaces-test-bundle.js && esbuild goal-questions-test.ts --bundle --format=esm --platform=browser --outfile=goal-questions-test-bundle.js && esbuild dream-test.ts --bundle --format=esm --platform=browser --outfile=dream-test-bundle.js && esbuild p4-test.ts --bundle --format=esm --platform=browser --outfile=p4-test-bundle.js && esbuild harness-api-test.ts --bundle --format=esm --platform=browser --outfile=harness-api-test-bundle.js && esbuild provider-models-test.ts --bundle --format=esm --platform=browser --outfile=provider-models-test-bundle.js" }, "dependencies": { "@earendil-works/chord": "1.5.0", diff --git a/host/js/plan-todos-test-bundle.js b/host/js/plan-todos-test-bundle.js index 7b2f962..a2f2cda 100644 --- a/host/js/plan-todos-test-bundle.js +++ b/host/js/plan-todos-test-bundle.js @@ -38336,10 +38336,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38391,7 +38391,7 @@ var todosModule = await import( `${base}/todos/server.ts` ); var { Plan, TaskIndex, Branch, Started: Started2 } = planModule; -var { Todos, Standing, add, mark, noteFor, DONE_LIMIT } = todosModule; +var { Todos, MainAgent, add, mark, noteFor, DONE_LIMIT } = todosModule; var call = async (args, id = root.id, name = "plan") => { const conversation = await harness.conversation(id, BACKGROUND_CONTEXT); await conversation.configure({ model: { provider: "faux", modelId: "faux-1" }, modelTools: { add: [todosModule.default().tools[0]] } }, BACKGROUND_CONTEXT); @@ -38496,19 +38496,19 @@ try { assert(Object.keys((await harness.snapshot(Plan, branch.id, BACKGROUND_CONTEXT)).epics).length === 1, "Fork inherited plan"); equal(JSON.parse(text(await call({ action: "show" }, branch.id))), Plan.definition.initial()); assert((await harness.snapshot(Started2, branch.id, BACKGROUND_CONTEXT)).started, "Branch started"); - const STANDING = 5; + const MAIN_AGENT = 5; const fakeTx = () => { const docs = /* @__PURE__ */ new Map(); return { doc: async ({ definition: def }, id) => { const key = `${def.kind}:${id}`; - if (!docs.has(key)) docs.set(key, def.kind === "standing.standing-agents" ? { "$standing": STANDING } : def.initial()); + if (!docs.has(key)) docs.set(key, def.kind === "main-agent.index" ? { "$main-agent": MAIN_AGENT } : def.initial()); return docs.get(key); } }; }; const list = async (tx) => (await tx.doc(Todos, 1)).items; { const tx = fakeTx(); - equal((await add(tx, " Deploy fleet ", "standing")).text, "Deploy fleet"); + equal((await add(tx, " Deploy fleet ", "mainAgent")).text, "Deploy fleet"); assert((await add(tx, "Rotate the key", "user")).id === 2, "Sequential todo ids"); await rejects(() => add(tx, " ", "user"), "nonempty"); await rejects(() => add(tx, "x", "lander"), "owner"); @@ -38516,7 +38516,7 @@ try { } { const tx = fakeTx(); - for (let i = 0; i < DONE_LIMIT + 2; i++) await add(tx, `t${i}`, "standing"); + for (let i = 0; i < DONE_LIMIT + 2; i++) await add(tx, `t${i}`, "mainAgent"); assert(typeof (await mark(tx, 1, true)).done === "number", "Tick"); assert((await mark(tx, 1, false)).done === void 0, "Reopen"); for (const todo of (await list(tx)).slice(0, -1)) todo.done = todo.id; @@ -38525,9 +38525,9 @@ try { await rejects(() => mark(tx, 999, true), "No to-do 999"); } { - const tx = fakeTx(), content = async () => (await noteFor(tx, STANDING, 0))?.entries[0].model[0].content; + const tx = fakeTx(), content = async () => (await noteFor(tx, MAIN_AGENT, 0))?.entries[0].model[0].content; assert(await content() === void 0, "Empty note"); - await add(tx, "Mine", "standing"); + await add(tx, "Mine", "mainAgent"); await add(tx, "Theirs", "user"); equal(await content(), "Open to-dos (todo tool: done when finished):\nYours:\n- 1: Mine\nThe user's:\n- 2: Theirs"); assert(await content() === void 0, "Unchanged note"); @@ -38539,17 +38539,17 @@ try { { const tx = fakeTx(), extension2 = todosModule.default(), tool2 = extension2.tools[0]; const run2 = (conversationId, args) => tool2.execute(args, { conversationId, commit: (fn) => fn(tx) }, BACKGROUND_CONTEXT); - await rejects(() => run2(9, { action: "list" }), "Only the standing agent"); - equal(await run2(STANDING, { action: "add", text: "Ship it", owner: "user" }), { output: [{ type: "text", text: "Added 1 for user: Ship it" }] }); - equal(await run2(STANDING, { action: "list" }), { output: [{ type: "text", text: "The user's:\n- 1: Ship it" }] }); + await rejects(() => run2(9, { action: "list" }), "Only the main agent"); + equal(await run2(MAIN_AGENT, { action: "add", text: "Ship it", owner: "user" }), { output: [{ type: "text", text: "Added 1 for user: Ship it" }] }); + equal(await run2(MAIN_AGENT, { action: "list" }), { output: [{ type: "text", text: "The user's:\n- 1: Ship it" }] }); const before = (conversationId) => extension2.hooks[0].handlers.beforeInput({}, { tx, conversationId }, BACKGROUND_CONTEXT); - assert(await before(9) === void 0, "Nonstanding note"); - assert(await before(STANDING) !== void 0, "Standing note"); + assert(await before(9) === void 0, "NonmainAgent note"); + assert(await before(MAIN_AGENT) !== void 0, "MainAgent note"); } await harness.commit(async (tx) => { - (await tx.doc(Standing, root.id))["$standing"] = root.id; + (await tx.doc(MainAgent, root.id))["$main-agent"] = root.id; }, BACKGROUND_CONTEXT); - assert(text(await call({ action: "add", text: "Real world", owner: "standing" }, root.id, "todo")).includes("Added 1"), "Loaded todo tool"); + assert(text(await call({ action: "add", text: "Real world", owner: "mainAgent" }, root.id, "todo")).includes("Added 1"), "Loaded todo tool"); assert(text(await call({ action: "list" }, root.id, "todo")).includes("Real world"), "Loaded todo list"); assert((await root.context(BACKGROUND_CONTEXT)).entries.some((entry2) => entry2.kind === "todos.note"), "Real beforeInput note"); await fs.write("/saved", JSON.stringify({ plan: await harness.snapshot(Plan, root.id, BACKGROUND_CONTEXT), index: await harness.snapshot(TaskIndex, root.id, BACKGROUND_CONTEXT), todos: await harness.snapshot(Todos, root.id, BACKGROUND_CONTEXT) })); diff --git a/host/js/plan-todos-test.ts b/host/js/plan-todos-test.ts index 8ab8e56..81e7c1c 100644 --- a/host/js/plan-todos-test.ts +++ b/host/js/plan-todos-test.ts @@ -1,4 +1,4 @@ -/** The six Standing agent plan/todos cases, plus real-loader turns and branch reset. */ +/** The six Main agent plan/todos cases, plus real-loader turns and branch reset. */ import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context'; import { createModels } from '@earendil-works/pi-ai/models'; import { fauxProvider, fauxAssistantMessage, fauxToolCall } from '@earendil-works/pi-ai/providers/faux'; @@ -18,7 +18,7 @@ const base = `file:///run/sausage/extensions/${loader.state().good}/extensions`; const planModule = await import(/* @vite-ignore */ `${base}/plan/server.ts`); const todosModule = await import(/* @vite-ignore */ `${base}/todos/server.ts`); const {Plan,TaskIndex,Branch,Started} = planModule; -const {Todos,Standing,add,mark,noteFor,DONE_LIMIT} = todosModule; +const {Todos,MainAgent,add,mark,noteFor,DONE_LIMIT} = todosModule; const call = async (args:any, id=root.id, name='plan') => { const conversation = await harness.conversation(id,context); await conversation.configure({model:{provider:'faux',modelId:'faux-1'},modelTools:{add:[todosModule.default().tools[0]]}},context); @@ -113,37 +113,37 @@ try { assert((await harness.snapshot(Started,branch.id,context)).started,'Branch started'); // Todos cases 1-4 retain the original small transaction fixture. - const STANDING=5; - const fakeTx=()=>{const docs=new Map();return {doc:async({definition:def}:any,id:number)=>{const key=`${def.kind}:${id}`;if(!docs.has(key))docs.set(key,def.kind==='standing.standing-agents'?{'$standing':STANDING}:def.initial());return docs.get(key);}};}; + const MAIN_AGENT=5; + const fakeTx=()=>{const docs=new Map();return {doc:async({definition:def}:any,id:number)=>{const key=`${def.kind}:${id}`;if(!docs.has(key))docs.set(key,def.kind==='main-agent.index'?{'$main-agent':MAIN_AGENT}:def.initial());return docs.get(key);}};}; const list=async(tx:any)=>(await tx.doc(Todos,1)).items; { - const tx=fakeTx();equal((await add(tx,' Deploy fleet ','standing')).text,'Deploy fleet'); + const tx=fakeTx();equal((await add(tx,' Deploy fleet ','mainAgent')).text,'Deploy fleet'); assert((await add(tx,'Rotate the key','user')).id===2,'Sequential todo ids'); await rejects(()=>add(tx,' ','user'),'nonempty');await rejects(()=>add(tx,'x','lander'),'owner');equal((await list(tx)).map((todo:any)=>todo.id),[1,2]); } { - const tx=fakeTx();for(let i=0;itodo.id),Array.from({length:DONE_LIMIT},(_,i)=>i+3));await rejects(()=>mark(tx,999,true),'No to-do 999'); } { - const tx=fakeTx(), content=async()=>(await noteFor(tx,STANDING,0))?.entries[0].model[0].content; - assert(await content()===undefined,'Empty note');await add(tx,'Mine','standing');await add(tx,'Theirs','user'); + const tx=fakeTx(), content=async()=>(await noteFor(tx,MAIN_AGENT,0))?.entries[0].model[0].content; + assert(await content()===undefined,'Empty note');await add(tx,'Mine','mainAgent');await add(tx,'Theirs','user'); equal(await content(),"Open to-dos (todo tool: done when finished):\nYours:\n- 1: Mine\nThe user's:\n- 2: Theirs");assert(await content()===undefined,'Unchanged note'); await mark(tx,1,true);await mark(tx,2,true);equal(await content(),'No to-dos are open.');assert(await content()===undefined,'Unchanged empty note'); } { const tx=fakeTx(), extension=todosModule.default(), tool=extension.tools[0]; const run=(conversationId:number,args:any)=>tool.execute(args,{conversationId,commit:(fn:any)=>fn(tx)},context); - await rejects(()=>run(9,{action:'list'}),'Only the standing agent');equal(await run(STANDING,{action:'add',text:'Ship it',owner:'user'}),{output:[{type:'text',text:'Added 1 for user: Ship it'}]}); - equal(await run(STANDING,{action:'list'}),{output:[{type:'text',text:"The user's:\n- 1: Ship it"}]}); + await rejects(()=>run(9,{action:'list'}),'Only the main agent');equal(await run(MAIN_AGENT,{action:'add',text:'Ship it',owner:'user'}),{output:[{type:'text',text:'Added 1 for user: Ship it'}]}); + equal(await run(MAIN_AGENT,{action:'list'}),{output:[{type:'text',text:"The user's:\n- 1: Ship it"}]}); const before=(conversationId:number)=>extension.hooks[0].handlers.beforeInput({}, {tx,conversationId},context); - assert(await before(9)===undefined,'Nonstanding note');assert(await before(STANDING)!==undefined,'Standing note'); + assert(await before(9)===undefined,'NonmainAgent note');assert(await before(MAIN_AGENT)!==undefined,'MainAgent note'); } // The real world also calls todo through the loaded factory and places its note. - await harness.commit(async(tx:any)=>{(await tx.doc(Standing,root.id))['$standing']=root.id;},context); - assert(text(await call({action:'add',text:'Real world',owner:'standing'},root.id,'todo')).includes('Added 1'),'Loaded todo tool'); + await harness.commit(async(tx:any)=>{(await tx.doc(MainAgent,root.id))['$main-agent']=root.id;},context); + assert(text(await call({action:'add',text:'Real world',owner:'mainAgent'},root.id,'todo')).includes('Added 1'),'Loaded todo tool'); assert(text(await call({action:'list'},root.id,'todo')).includes('Real world'),'Loaded todo list'); assert((await root.context(context)).entries.some((entry:any)=>entry.kind==='todos.note'),'Real beforeInput note'); await fs.write('/saved',JSON.stringify({plan:await harness.snapshot(Plan,root.id,context),index:await harness.snapshot(TaskIndex,root.id,context),todos:await harness.snapshot(Todos,root.id,context)})); diff --git a/host/js/proxy-models-test-bundle.js b/host/js/provider-models-test-bundle.js similarity index 56% rename from host/js/proxy-models-test-bundle.js rename to host/js/provider-models-test-bundle.js index da4b2bc..27ce82f 100644 --- a/host/js/proxy-models-test-bundle.js +++ b/host/js/provider-models-test-bundle.js @@ -56,8 +56,8 @@ var init_event_stream = __esm({ get length() { return this.incoming.length + this.outgoing.length; } - enqueue(value) { - this.incoming.push(value); + enqueue(value2) { + this.incoming.push(value2); } dequeue() { if (this.outgoing.length === 0) { @@ -79,8 +79,8 @@ var init_event_stream = __esm({ constructor(isComplete, extractResult) { this.isComplete = isComplete; this.extractResult = extractResult; - this.finalResultPromise = new Promise((resolve) => { - this.resolveFinalResult = resolve; + this.finalResultPromise = new Promise((resolve2) => { + this.resolveFinalResult = resolve2; }); } push(event) { @@ -114,7 +114,7 @@ var init_event_stream = __esm({ } else if (this.done) { return; } else { - const result = await new Promise((resolve) => this.waiting.enqueue(resolve)); + const result = await new Promise((resolve2) => this.waiting.enqueue(resolve2)); if (result.done) return; yield result.value; @@ -255,13 +255,13 @@ function getProcessEnv() { function defaultProviderAuthContext() { return { async env(name) { - const value = getProcessEnv()?.[name]; - return typeof value === "string" && value.trim().length > 0 ? value : void 0; + const value2 = getProcessEnv()?.[name]; + return typeof value2 === "string" && value2.trim().length > 0 ? value2 : void 0; }, - async fileExists(path4) { + async fileExists(path5) { try { const fs3 = await importNodeModule("node:fs/promises"); - let resolved = path4; + let resolved = path5; if (resolved.startsWith("~")) { const os2 = await importNodeModule("node:os"); resolved = os2.homedir() + resolved.slice(1); @@ -277,13 +277,13 @@ function defaultProviderAuthContext() { var __rewriteRelativeImportExtension, importNodeModule; var init_context = __esm({ "node_modules/@earendil-works/pi-ai/dist/auth/context.js"() { - __rewriteRelativeImportExtension = function(path4, preserveJsx) { - if (typeof path4 === "string" && /^\.\.?\//.test(path4)) { - return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + __rewriteRelativeImportExtension = function(path5, preserveJsx) { + if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { + return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path4; + return path5; }; importNodeModule = (specifier) => import(__rewriteRelativeImportExtension(specifier)); } @@ -306,7 +306,7 @@ function raceWithAbortSignal(operation, signal) { }); return Promise.reject(abortReason(signal)); } - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject2) => { let settled = false; const cleanup = () => signal.removeEventListener("abort", onAbort); const onAbort = () => { @@ -314,21 +314,21 @@ function raceWithAbortSignal(operation, signal) { return; settled = true; cleanup(); - reject(abortReason(signal)); + reject2(abortReason(signal)); }; signal.addEventListener("abort", onAbort, { once: true }); - void operation.then((value) => { + void operation.then((value2) => { if (settled) return; settled = true; cleanup(); - resolve(value); + resolve2(value2); }, (error) => { if (settled) return; settled = true; cleanup(); - reject(error); + reject2(error); }); if (signal.aborted) onAbort(); @@ -394,12 +394,12 @@ var init_credential_store = __esm({ }); // node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js -function formatThrownValue(value) { - if (value instanceof Error) - return value.message || value.name; - if (typeof value === "string") - return value; - return String(value); +function formatThrownValue(value2) { + if (value2 instanceof Error) + return value2.message || value2.name; + if (typeof value2 === "string") + return value2; + return String(value2); } function appendAssistantMessageDiagnostic(message, diagnostic) { message.diagnostics = [...message.diagnostics ?? [], diagnostic]; @@ -464,7 +464,7 @@ async function resolveProviderAuthWithSignal(provider2, credentials, authContext function overlayEnvAuthContext(base, env) { return { env: async (name) => env[name] || await base.env(name), - fileExists: (path4) => base.fileExists(path4) + fileExists: (path5) => base.fileExists(path5) }; } async function refreshStoredOAuthCredential(credentials, providerId, oauth, needsRefresh, signal) { @@ -550,12 +550,12 @@ var init_models_store = __esm({ entries = /* @__PURE__ */ new Map(); async read(providerId, options) { options?.signal?.throwIfAborted(); - const entry = this.entries.get(providerId); - return entry ? structuredClone(entry) : void 0; + const entry2 = this.entries.get(providerId); + return entry2 ? structuredClone(entry2) : void 0; } - async write(providerId, entry, options) { + async write(providerId, entry2, options) { options?.signal?.throwIfAborted(); - this.entries.set(providerId, structuredClone(entry)); + this.entries.set(providerId, structuredClone(entry2)); } async delete(providerId, options) { options?.signal?.throwIfAborted(); @@ -566,9 +566,9 @@ var init_models_store = __esm({ }); // node_modules/@earendil-works/pi-telemetry/dist/metrics.js -function createTypedMetrics(metrics, schemas) { +function createTypedMetrics(metrics, schemas2) { const definitions = /* @__PURE__ */ new Map(); - for (const schema4 of schemas) { + for (const schema4 of schemas2) { for (const [name, definition] of Object.entries(schema4.metrics ?? {})) definitions.set(name, definition); } @@ -668,10 +668,10 @@ function renderSystemMessageUpdate(message) { const text = contentText(message.content); if (text.length > 0) parts.push(text); - for (const [name, value] of Object.entries(message.sections ?? {})) { - parts.push(value === null ? `Removed system prompt section "${name}".` : `Updated system prompt section "${name}": + for (const [name, value2] of Object.entries(message.sections ?? {})) { + parts.push(value2 === null ? `Removed system prompt section "${name}".` : `Updated system prompt section "${name}": -${value}`); +${value2}`); } return parts.join("\n\n"); } @@ -707,10 +707,10 @@ function observeModelRequest(requestedModel, options, poll) { let finish; let first = true; const toolChars = /* @__PURE__ */ new Map(); - const finished = new Promise((resolve) => { - finish = resolve; + const finished = new Promise((resolve2) => { + finish = resolve2; }); - const run = (activeSpan) => { + const run2 = (activeSpan) => { span = activeSpan; return finished; }; @@ -721,9 +721,9 @@ function observeModelRequest(requestedModel, options, poll) { }; const start = createTypedSpanStarter(options?.telemetry ?? NOOP_TELEMETRY_CONTEXT, [AI_TELEMETRY_SCHEMA]); if (poll) - void start("pi.ai.poll", startAttributes, run); + void start("pi.ai.poll", startAttributes, run2); else - void start("pi.ai.request", startAttributes, run); + void start("pi.ai.request", startAttributes, run2); return { onEvent(event) { if (first) { @@ -965,10 +965,52 @@ function getOpenCodeSessionHeaders(target, sessionId) { function getIdentityHeaders(target, identity) { return { "User-Agent": formatUserAgent(identity), ...getAttributionHeaders(target, identity) }; } -var NVIDIA_NIM_HOST, OPENCODE_HOST; +function isMutableModels(models3) { + return "setProvider" in models3 && "deleteProvider" in models3 && "clearProviders" in models3; +} +function withClientIdentity(models3, identity) { + const withIdentity = (options) => ({ ...options, identity: mergeClientIdentity(identity, options?.identity) }); + const wrapped = { + getProviders: () => models3.getProviders(), + getProvider: (id) => models3.getProvider(id), + getModels: (provider2) => models3.getModels(provider2), + getModel: (provider2, id) => models3.getModel(provider2, id), + getModelsOfType: (type, provider2) => models3.getModelsOfType(type, provider2), + getModelOfType: (type, provider2, id) => models3.getModelOfType(type, provider2, id), + getAllModels: (provider2) => models3.getAllModels(provider2), + refresh: (options) => models3.refresh(options), + checkAuth: (providerId, options) => models3.checkAuth(providerId, options), + getAvailable: (providerId, options) => models3.getAvailable(providerId, options), + getAvailableOfType: (type, providerId, options) => models3.getAvailableOfType(type, providerId, options), + getAllAvailable: (providerId, options) => models3.getAllAvailable(providerId, options), + getAuth: models3.getAuth.bind(models3), + login: (providerId, type, interaction, options) => models3.login(providerId, type, interaction, options), + logout: (providerId, options) => models3.logout(providerId, options), + stream: (model2, context, options) => models3.stream(model2, context, withIdentity(options)), + complete: (model2, context, options) => models3.complete(model2, context, withIdentity(options)), + streamSimple: (model2, context, options) => models3.streamSimple(model2, context, withIdentity(options)), + completeSimple: (model2, context, options) => models3.completeSimple(model2, context, withIdentity(options)), + streamDeferred: (model2, handle, options) => models3.streamDeferred(model2, handle, withIdentity(options)), + fetchDeferred: (model2, handle, options) => models3.fetchDeferred(model2, handle, withIdentity(options)), + cancelDeferred: (model2, handle, options) => models3.cancelDeferred(model2, handle, withIdentity(options)), + generateImages: (model2, context, options) => models3.generateImages(model2, context, withIdentity(options)), + classify: (model2, context, options) => models3.classify(model2, context, withIdentity(options)) + }; + if (!isMutableModels(models3)) + return wrapped; + const mutable = { + ...wrapped, + setProvider: (provider2) => models3.setProvider(provider2), + deleteProvider: (id) => models3.deleteProvider(id), + clearProviders: () => models3.clearProviders() + }; + return mutable; +} +var PI_ATTRIBUTION, NVIDIA_NIM_HOST, OPENCODE_HOST; var init_identity = __esm({ "node_modules/@earendil-works/pi-ai/dist/utils/identity.js"() { init_version(); + PI_ATTRIBUTION = { name: "pi", url: "https://pi.dev", categories: ["cli-agent"] }; NVIDIA_NIM_HOST = "integrate.api.nvidia.com"; OPENCODE_HOST = "opencode.ai"; } @@ -1077,11 +1119,11 @@ function getCurrentSystemMessage(messages) { const text = contentText(message.content); if (text.length > 0) content.push(text); - for (const [name, value] of Object.entries(message.sections ?? {})) { - if (value === null) + for (const [name, value2] of Object.entries(message.sections ?? {})) { + if (value2 === null) sections.delete(name); else - sections.set(name, value); + sections.set(name, value2); } } const tools = getCurrentTools(messages); @@ -1103,6 +1145,17 @@ function collapseSystemMessages(context) { function resolveTranscript(context, supportsMidConvoSystemMessages) { return supportsMidConvoSystemMessages ? context : collapseSystemMessages(context); } +function toToolDeclaration(tool) { + return { + name: tool.name, + description: tool.description, + parameters: JSON.parse(JSON.stringify(tool.parameters)), + ...tool.constrainedSampling === void 0 ? {} : { constrainedSampling: tool.constrainedSampling } + }; +} +function declarationsEqual(left, right) { + return JSON.stringify(toToolDeclaration(left)) === JSON.stringify(toToolDeclaration(right)); +} function getDeclaredTools(messages) { const definitions = /* @__PURE__ */ new Map(); for (const message of messages) { @@ -1148,20 +1201,20 @@ var init_transcript = __esm({ function hasKnownModelType(model2) { return Object.hasOwn(KNOWN_MODEL_TYPES, getModelType(model2)); } -function withKnownModelTypes(entry) { - return { ...entry, models: entry.models.filter(hasKnownModelType) }; +function withKnownModelTypes(entry2) { + return { ...entry2, models: entry2.models.filter(hasKnownModelType) }; } -function mergeHeaders(base, override) { - if (!base && !override) +function mergeHeaders(base, override2) { + if (!base && !override2) return void 0; const merged = { ...base }; - for (const [name, value] of Object.entries(override ?? {})) { + for (const [name, value2] of Object.entries(override2 ?? {})) { const lowerName = name.toLowerCase(); for (const existingName of Object.keys(merged)) { if (existingName.toLowerCase() === lowerName) delete merged[existingName]; } - merged[name] = value; + merged[name] = value2; } return merged; } @@ -1173,19 +1226,19 @@ function createProvider(input) { const byApi = single || !input.api ? void 0 : input.api; const images = input.images; const classifiers = input.classifiers; - const streams = single ? [single] : Object.values(byApi ?? {}).filter((entry) => entry !== void 0); - const imageImplementations = Object.values(images ?? {}).filter((entry) => entry !== void 0); - const classifierImplementations = Object.values(classifiers ?? {}).filter((entry) => entry !== void 0); + const streams = single ? [single] : Object.values(byApi ?? {}).filter((entry2) => entry2 !== void 0); + const imageImplementations = Object.values(images ?? {}).filter((entry2) => entry2 !== void 0); + const classifierImplementations = Object.values(classifiers ?? {}).filter((entry2) => entry2 !== void 0); if (streams.length === 0 && imageImplementations.length === 0 && classifierImplementations.length === 0) { throw new Error(`Provider ${input.id}: at least one of "api", "images", or "classifiers" is required.`); } const baselineModels = input.models; let dynamicModels = []; const fetchModels = input.fetchModels; - const currentModels = () => { + const currentModels2 = () => { const merged = [...baselineModels]; for (const model2 of dynamicModels) { - const index = merged.findIndex((entry) => getModelType(entry) === getModelType(model2) && entry.id === model2.id); + const index = merged.findIndex((entry2) => getModelType(entry2) === getModelType(model2) && entry2.id === model2.id); if (index >= 0) merged[index] = model2; else @@ -1194,14 +1247,14 @@ function createProvider(input) { return merged; }; const apiFor = (model2) => single ?? byApi?.[model2.api]; - const dispatch = (model2, run) => { + const dispatch = (model2, run2) => { const streams2 = apiFor(model2); if (!streams2) { return lazyStream(model2, async () => { throw new ModelsError("stream", `Provider ${input.id} has no API implementation for "${model2.api}"`); }); } - return run(streams2); + return run2(streams2); }; const provider2 = { id: input.id, @@ -1209,8 +1262,8 @@ function createProvider(input) { baseUrl: input.baseUrl, headers: input.headers, auth: input.auth, - getModels: () => currentModels().filter((model2) => isModelType(model2, "chat")), - getAllModels: currentModels, + getModels: () => currentModels2().filter((model2) => isModelType(model2, "chat")), + getAllModels: currentModels2, refreshModels: fetchModels ? async (context) => { if (context.stored) { const restored = context.stored.models.filter((model2) => model2.provider === input.id).map((model2) => model2); @@ -1240,7 +1293,7 @@ function createProvider(input) { stream: (model2, context, options) => dispatch(model2, (streams2) => streams2.stream(model2, context, options)), streamSimple: (model2, context, options) => dispatch(model2, (streams2) => streams2.streamSimple(model2, context, options)) }; - if (streams.some((entry) => entry.fetchDeferred !== void 0)) { + if (streams.some((entry2) => entry2.fetchDeferred !== void 0)) { provider2.fetchDeferred = (model2, handle, options) => lazyStream(model2, async () => { const implementation = apiFor(model2); if (!implementation?.fetchDeferred) { @@ -1249,7 +1302,7 @@ function createProvider(input) { return implementation.fetchDeferred(model2, handle, options); }); } - if (streams.some((entry) => entry.cancelDeferred !== void 0)) { + if (streams.some((entry2) => entry2.cancelDeferred !== void 0)) { provider2.cancelDeferred = async (model2, handle, options) => { const implementation = apiFor(model2); if (!implementation?.cancelDeferred) { @@ -1342,7 +1395,6 @@ var init_models = __esm({ init_identity(); init_model_operations(); init_transcript(); - init_model_operations(); KNOWN_MODEL_TYPES = { chat: true, image: true, classifier: true }; ModelsImpl = class { providers = /* @__PURE__ */ new Map(); @@ -1381,43 +1433,43 @@ var init_models = __esm({ } getModels(provider2) { if (provider2 !== void 0) { - const entry = this.providers.get(provider2); - if (!entry) + const entry2 = this.providers.get(provider2); + if (!entry2) return []; try { - return entry.getModels(); + return entry2.getModels(); } catch { return []; } } - const models2 = []; - for (const entry of this.providers.values()) { + const models3 = []; + for (const entry2 of this.providers.values()) { try { - models2.push(...entry.getModels()); + models3.push(...entry2.getModels()); } catch { } } - return models2; + return models3; } getAllModels(provider2) { if (provider2 !== void 0) { - const entry = this.providers.get(provider2); - if (!entry) + const entry2 = this.providers.get(provider2); + if (!entry2) return []; try { - return entry.getAllModels?.() ?? entry.getModels(); + return entry2.getAllModels?.() ?? entry2.getModels(); } catch { return []; } } - const models2 = []; - for (const entry of this.providers.values()) { + const models3 = []; + for (const entry2 of this.providers.values()) { try { - models2.push(...entry.getAllModels?.() ?? entry.getModels()); + models3.push(...entry2.getAllModels?.() ?? entry2.getModels()); } catch { } } - return models2; + return models3; } getModelsOfType(type, provider2) { return this.getAllModels(provider2).filter((model2) => isModelType(model2, type)); @@ -1592,20 +1644,20 @@ var init_models = __esm({ } async getAuthenticatedProviders(providerId, signal) { signal.throwIfAborted(); - const providers = providerId ? [this.providers.get(providerId)].filter((entry) => entry !== void 0) : this.getProviders(); + const providers = providerId ? [this.providers.get(providerId)].filter((entry2) => entry2 !== void 0) : this.getProviders(); const checks = await Promise.all(providers.map(async (provider2) => { const credential = await this.readCredential(provider2.id, signal); return { provider: provider2, credential, auth: await this.checkProviderAuth(provider2, credential, signal) }; })); - return checks.filter((entry) => entry.auth !== void 0); + return checks.filter((entry2) => entry2.auth !== void 0); } getAvailable(providerId, options) { const signal = operationSignal(options?.signal); const available = (async () => { const providers = await this.getAuthenticatedProviders(providerId, signal); return providers.flatMap(({ provider: provider2, credential }) => { - const models2 = provider2.getModels(); - return provider2.filterModels?.(models2, credential) ?? models2; + const models3 = provider2.getModels(); + return provider2.filterModels?.(models3, credential) ?? models3; }); })(); return raceWithAbortSignal(available, signal); @@ -1618,13 +1670,13 @@ var init_models = __esm({ const available = (async () => { const providers = await this.getAuthenticatedProviders(providerId, signal); return providers.flatMap(({ provider: provider2, credential }) => { - const models2 = provider2.getAllModels?.() ?? provider2.getModels(); + const models3 = provider2.getAllModels?.() ?? provider2.getModels(); if (provider2.filterAllModels) - return provider2.filterAllModels(models2, credential); + return provider2.filterAllModels(models3, credential); if (!provider2.filterModels) - return models2; + return models3; const availableChatIds = new Set(provider2.filterModels(provider2.getModels(), credential).map((model2) => model2.id)); - return models2.filter((model2) => !isModelType(model2, "chat") || availableChatIds.has(model2.id)); + return models3.filter((model2) => !isModelType(model2, "chat") || availableChatIds.has(model2.id)); }); })(); return raceWithAbortSignal(available, signal); @@ -1660,8 +1712,8 @@ var init_models = __esm({ const credential = await raceWithAbortSignal(loginOperation, signal); let mutationStarted = false; let markMutationStarted; - const started = new Promise((resolve) => { - markMutationStarted = resolve; + const started = new Promise((resolve2) => { + markMutationStarted = resolve2; }); const mutation = this.credentials.modify(providerId, async () => { mutationStarted = true; @@ -1671,18 +1723,18 @@ var init_models = __esm({ void mutation.catch(() => { }); try { - await new Promise((resolve, reject) => { + await new Promise((resolve2, reject2) => { const onAbort = () => { if (!mutationStarted) - reject(signal.reason); + reject2(signal.reason); }; signal.addEventListener("abort", onAbort, { once: true }); void Promise.race([started, mutation]).then(() => { signal.removeEventListener("abort", onAbort); - resolve(); + resolve2(); }, (error) => { signal.removeEventListener("abort", onAbort); - reject(error); + reject2(error); }); if (signal.aborted) onAbort(); @@ -1725,11 +1777,11 @@ var init_models = __esm({ if (!resolution) { throw new ModelsError("auth", `Provider is not configured: ${model2.provider}`); } - const auth2 = resolution.auth; - const apiKey = options?.apiKey ?? auth2.apiKey; - const requestModel = auth2.baseUrl ? { ...model2, baseUrl: auth2.baseUrl } : model2; + const auth = resolution.auth; + const apiKey = options?.apiKey ?? auth.apiKey; + const requestModel = auth.baseUrl ? { ...model2, baseUrl: auth.baseUrl } : model2; const sessionId = options && "sessionId" in options && typeof options.sessionId === "string" ? options.sessionId : void 0; - let headers = mergeHeaders(mergeHeaders(getOpenCodeSessionHeaders(requestModel, sessionId), auth2.headers), options?.headers); + let headers = mergeHeaders(mergeHeaders(getOpenCodeSessionHeaders(requestModel, sessionId), auth.headers), options?.headers); if (options?.transformHeaders) headers = await options.transformHeaders(headers ?? {}); const env = resolution.env || options?.env ? { ...resolution.env ?? {}, ...options?.env ?? {} } : void 0; @@ -1819,462 +1871,15 @@ var init_models = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/error-body.js -function normalizeProviderError(error) { - if (!(error instanceof Error)) { - return { message: safeJsonStringify(error), messageCarriesBody: false }; - } - const sdkError = error; - const status = extractStatus(sdkError); - const body = extractBody(sdkError); - const messageCarriesBody = body === void 0 || error.message.includes(body); - return { - status, - body, - message: error.message, - messageCarriesBody - }; -} -function extractStatus(error) { - if (typeof error.statusCode === "number") - return error.statusCode; - if (typeof error.status === "number") - return error.status; - if (typeof error.$metadata?.httpStatusCode === "number") - return error.$metadata.httpStatusCode; - if (typeof error.$response?.statusCode === "number") - return error.$response.statusCode; - return void 0; -} -function extractBody(error) { - const bodyText = pickBodyText(error); - if (bodyText === void 0) - return void 0; - const trimmed = bodyText.trim(); - if (trimmed.length === 0) - return void 0; - return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS); -} -function pickBodyText(error) { - if (typeof error.body === "string") - return error.body; - if (isPlainNonEmptyObject(error.error)) - return safeJsonStringify(error.error); - const responseBody = error.$response?.body; - if (typeof responseBody === "string") - return responseBody; - if (isReadableStreamLike(responseBody)) - return void 0; - if (isPlainNonEmptyObject(responseBody)) - return safeJsonStringify(responseBody); - return void 0; -} -function isReadableStreamLike(value) { - return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function"; -} -function isPlainNonEmptyObject(value) { - if (typeof value !== "object" || value === null) - return false; - const proto = Object.getPrototypeOf(value); - if (proto !== Object.prototype && proto !== null) - return false; - return Object.keys(value).length > 0; -} -function formatProviderError(norm, prefix) { - if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) { - return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message; - } - return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`; -} -function truncateErrorText(text, maxChars) { - if (text.length <= maxChars) - return text; - return `${ownedSlice(text, 0, maxChars)}... [truncated ${text.length - maxChars} chars]`; -} -function safeJsonStringify(value) { - try { - const serialized = JSON.stringify(value); - return serialized === void 0 ? String(value) : serialized; - } catch { - return String(value); - } -} -var MAX_PROVIDER_ERROR_BODY_CHARS; -var init_error_body = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/error-body.js"() { - init_text(); - MAX_PROVIDER_ERROR_BODY_CHARS = 4e3; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/headers.js -function headersToRecord(headers) { - const result = {}; - for (const [key, value] of headers.entries()) { - result[key] = value; - } - return result; -} -function providerHeadersToRecord(...headerSources) { - const merged = /* @__PURE__ */ new Map(); - for (const source of headerSources) { - for (const [name, value] of Object.entries(source ?? {})) { - const normalizedName = name.toLowerCase(); - merged.delete(normalizedName); - if (value !== null) - merged.set(normalizedName, [name, value]); - } - } - return merged.size > 0 ? Object.fromEntries(merged.values()) : void 0; -} -var init_headers = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/headers.js"() { - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js -function isProviderError(error) { - if (!(error instanceof Error) || !("status" in error) || !("headers" in error)) - return false; - return (error.status === void 0 || typeof error.status === "number") && (error.headers === void 0 || error.headers instanceof Headers); -} -function isRetryableProviderError(error) { - const shouldRetry = error.headers?.get("x-should-retry"); - if (shouldRetry === "true") - return true; - if (shouldRetry === "false") - return false; - if (error.status === void 0) - return true; - return error.status === 408 || error.status === 409 || error.status === 429 || typeof error.status === "number" && error.status >= 500; -} -function validateServerRetryDelayMs(delayMs, maxRetryDelayMs, providerErrorMessage) { - const maxDelayMs = maxRetryDelayMs ?? DEFAULT_MAX_RETRY_DELAY_MS; - if (maxDelayMs > 0 && delayMs > maxDelayMs) { - throw new Error(`Server requested ${Math.ceil(delayMs / 1e3)}s retry delay (max: ${Math.ceil(maxDelayMs / 1e3)}s). ${providerErrorMessage}`); - } - return delayMs; -} -function getRetryDelayMs(error, retryIndex, maxRetryDelayMs) { - const retryAfterMs = error.headers?.get("retry-after-ms"); - if (retryAfterMs) { - const value = Number.parseFloat(retryAfterMs); - if (Number.isFinite(value)) - return validateServerRetryDelayMs(value, maxRetryDelayMs, error.message); - } - const retryAfter = error.headers?.get("retry-after"); - if (retryAfter) { - const seconds = Number.parseFloat(retryAfter); - const delayMs = Number.isNaN(seconds) ? Date.parse(retryAfter) - Date.now() : seconds * 1e3; - if (Number.isFinite(delayMs)) - return validateServerRetryDelayMs(delayMs, maxRetryDelayMs, error.message); - } - const exponentialDelay = Math.min(0.5 * 2 ** retryIndex, 8) * 1e3; - return exponentialDelay * (1 - Math.random() * 0.25); -} -function createAbortError() { - const error = new Error("Request aborted"); - error.name = "AbortError"; - return error; -} -function abortableSleep(ms, signal) { - return new Promise((resolve, reject) => { - if (signal?.aborted) { - reject(createAbortError()); - return; - } - const onAbort = () => { - clearTimeout(timeout); - reject(createAbortError()); - }; - const timeout = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve(); - }, Math.max(0, ms)); - signal?.addEventListener("abort", onAbort, { once: true }); - }); -} -async function retryProviderRequest(request2, options = {}) { - const maxRetries = options.maxRetries ?? 0; - let retriesRemaining = maxRetries; - for (; ; ) { - try { - return await request2(); - } catch (error) { - if (options.signal?.aborted) - throw createAbortError(); - if (retriesRemaining <= 0 || !isProviderError(error) || !isRetryableProviderError(error)) - throw error; - if (error.status !== void 0 && options.noRetryStatuses?.includes(error.status)) - throw error; - const retryIndex = maxRetries - retriesRemaining; - retriesRemaining--; - await abortableSleep(getRetryDelayMs(error, retryIndex, options.maxRetryDelayMs), options.signal); - } - } -} -var DEFAULT_MAX_RETRY_DELAY_MS; -var init_provider_retry = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js"() { - DEFAULT_MAX_RETRY_DELAY_MS = 6e4; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js -function httpError(label, response, body) { - const error = new Error(`${label} returned ${response.status}`); - error.status = response.status; - error.headers = response.headers; - error.body = body; - return error; -} -function timeoutError(timeoutMs) { - const error = new Error(`Request timed out after ${timeoutMs}ms`); - error.name = "TimeoutError"; - error.status = void 0; - error.headers = void 0; - error.body = ""; - return error; -} -function isRecord(value) { - return typeof value === "object" && value !== null && !Array.isArray(value); -} -function requiredNumber(label, value, field) { - if (typeof value !== "number" || !Number.isFinite(value)) { - throw new Error(`${label} returned an invalid ${field}`); - } - return value; -} -function requestHeaders(model2, apiKey, optionsHeaders, identity) { - return providerHeadersToRecord(getIdentityHeaders(model2, identity), { authorization: `Bearer ${apiKey}`, "content-type": "application/json" }, model2.headers, optionsHeaders) ?? {}; -} -async function postClassifierRequest(label, url, model2, body, options, noRetryStatuses) { - if (!options?.apiKey) - throw new Error(`No API key for provider: ${model2.provider}`); - const apiKey = options.apiKey; - let payload = body; - const transformed = await options.onPayload?.(payload, model2); - if (transformed !== void 0) - payload = transformed; - const requestFetch = options.fetch ?? globalThis.fetch; - const { response, json } = await retryProviderRequest(async () => { - const timeoutSignal = options.timeoutMs !== void 0 ? AbortSignal.timeout(options.timeoutMs) : void 0; - const signal = options.signal && timeoutSignal ? AbortSignal.any([options.signal, timeoutSignal]) : options.signal ?? timeoutSignal; - try { - const next = await requestFetch(url, { - method: "POST", - headers: requestHeaders(model2, apiKey, options.headers, options.identity), - body: JSON.stringify(payload), - signal - }); - if (!next.ok) - throw httpError(label, next, await next.text()); - return { response: next, json: await next.json() }; - } catch (error) { - if (timeoutSignal?.aborted && !options.signal?.aborted) - throw timeoutError(options.timeoutMs); - throw error; - } - }, { - maxRetries: options.maxRetries ?? 2, - maxRetryDelayMs: options.maxRetryDelayMs, - signal: options.signal, - noRetryStatuses - }); - await options.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - return json; -} -function tokenCount(value) { - return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0; -} -function parseClassifierUsage(value, model2) { - if (!isRecord(value) || value.input_tokens === void 0 && value.output_tokens === void 0) - return void 0; - const input = tokenCount(value.input_tokens); - const output = tokenCount(value.output_tokens); - const usage = { - input, - output, - cacheRead: 0, - cacheWrite: 0, - totalTokens: input + output, - cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } - }; - calculateCost(model2, usage); - return usage; -} -var init_classifier_shared = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js"() { - init_models(); - init_headers(); - init_identity(); - init_provider_retry(); - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js -var openai_decisions_exports = {}; -__export(openai_decisions_exports, { - classify: () => classify -}); -function predicateInstructions(question) { - const meanings = [ - question.criteria.true ? `True means: ${question.criteria.true}` : "", - question.criteria.false ? `False means: ${question.criteria.false}` : "" - ].filter(Boolean); - return meanings.length > 0 ? `${question.instructions} - -${meanings.join("\n")}` : question.instructions; -} -function wireQuestion(name, question) { - if (question.type === "choice") { - return { - type: "choice", - name, - instructions: question.instructions, - choices: Object.entries(question.criteria).map(([value, description]) => description ? { value, description } : { value }) - }; - } - if (question.type === "score") { - return { - type: "score", - name, - instructions: question.instructions, - levels: question.criteria.map((label) => ({ label })) - }; - } - return { type: "predicate", name, instructions: predicateInstructions(question) }; -} -function wireInput(context) { - const state2 = JSON.stringify(context.state); - const images = context.images ?? []; - if (images.length === 0) - return state2; - if (images.length > MAX_IMAGES) { - throw new Error(`${LABEL} accepts at most ${MAX_IMAGES} images, got ${images.length}`); - } - return [ - { - role: "user", - content: [ - { type: "input_text", text: state2 }, - ...images.map((image) => ({ - type: "input_image", - image_url: `data:${image.mimeType};base64,${image.data}` - })) - ] - } - ]; -} -function choiceProbabilities(value, id) { - if (!Array.isArray(value)) - throw new Error(`${LABEL} returned invalid probabilities for ${id}`); - return Object.fromEntries(value.map((entry) => { - if (!isRecord(entry) || typeof entry.value !== "string") { - throw new Error(`${LABEL} returned invalid probabilities for ${id}`); - } - return [entry.value, requiredNumber(LABEL, entry.probability, `probability for ${id}.${entry.value}`)]; - })); -} -function parseAnswer(id, question, answer) { - if (answer.type === "refusal") - throw new Error(`${LABEL} refused to answer ${id}`); - if (question.type === "choice") { - if (answer.type !== "choice" || typeof answer.choice !== "string") { - throw new Error(`${LABEL} did not return a choice answer for ${id}`); - } - return { - type: "choice", - choice: answer.choice, - probabilities: choiceProbabilities(answer.probabilities, id), - confidence: requiredNumber(LABEL, answer.confidence, `confidence for ${id}`) - }; - } - if (question.type === "score") { - if (answer.type !== "score") - throw new Error(`${LABEL} did not return a score answer for ${id}`); - return { - type: "score", - score: requiredNumber(LABEL, answer.score, `score for ${id}`), - confidence: requiredNumber(LABEL, answer.confidence, `confidence for ${id}`) - }; - } - if (answer.type !== "predicate") - throw new Error(`${LABEL} did not return a predicate answer for ${id}`); - return { type: "bool", probability: requiredNumber(LABEL, answer.probability, `probability for ${id}`) }; -} -function parseAnswers(value, context) { - if (!Array.isArray(value)) - throw new Error(`${LABEL} returned an unexpected response`); - const byName = /* @__PURE__ */ new Map(); - for (const answer of value) { - if (isRecord(answer) && typeof answer.name === "string") - byName.set(answer.name, answer); - } - return Object.fromEntries(Object.entries(context.questions).map(([id, question]) => { - const answer = byName.get(id); - if (!answer) - throw new Error(`${LABEL} did not return an answer for ${id}`); - return [id, parseAnswer(id, question, answer)]; - })); -} -function errorMessage(error) { - if (error.status === 504) { - return `${LABEL} error (504): the request timed out at the gateway. Very large inputs (above roughly 600K tokens) currently exceed its time limit.`; - } - return formatProviderError(normalizeProviderError(error), `${LABEL} error`); -} -var LABEL, MAX_IMAGES, NO_RETRY_STATUSES, classify; -var init_openai_decisions = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js"() { - init_error_body(); - init_classifier_shared(); - LABEL = "OpenAI Decisions"; - MAX_IMAGES = 128; - NO_RETRY_STATUSES = [504]; - classify = async (model2, context, options) => { - const output = { - api: model2.api, - provider: model2.provider, - model: model2.id, - answers: {}, - stopReason: "stop", - timestamp: Date.now() - }; - try { - if (model2.api !== "openai-decisions") - throw new Error(`Unsupported classifier API: ${model2.api}`); - const body = await postClassifierRequest(LABEL, new URL("decisions", `${model2.baseUrl.replace(/\/+$/u, "")}/`), model2, { - model: model2.id, - input: wireInput(context), - questions: Object.entries(context.questions).map(([id, question]) => wireQuestion(id, question)) - }, options, NO_RETRY_STATUSES); - if (!isRecord(body)) - throw new Error(`${LABEL} returned an unexpected response`); - const usage = parseClassifierUsage(body.usage, model2); - if (usage) - output.usage = usage; - output.answers = parseAnswers(body.answers, context); - return output; - } catch (error) { - output.answers = {}; - output.stopReason = options?.signal?.aborted ? "aborted" : "error"; - output.errorMessage = errorMessage(error); - return output; - } - }; - } -}); - -// node_modules/openai/internal/tslib.mjs -function __classPrivateFieldSet(receiver, state2, value, kind, f) { +// node_modules/@anthropic-ai/sdk/internal/tslib.mjs +function __classPrivateFieldSet(receiver, state2, value2, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state2.set(receiver, value), value; + return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state2.set(receiver, value2), value2; } function __classPrivateFieldGet(receiver, state2, kind, f) { if (kind === "a" && !f) @@ -2284,28 +1889,11 @@ function __classPrivateFieldGet(receiver, state2, kind, f) { return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); } var init_tslib = __esm({ - "node_modules/openai/internal/tslib.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/tslib.mjs"() { } }); -// node_modules/openai/internal/utils/uuid.mjs -var uuid4; -var init_uuid = __esm({ - "node_modules/openai/internal/utils/uuid.mjs"() { - uuid4 = function() { - const { crypto: crypto3 } = globalThis; - if (crypto3?.randomUUID) { - uuid4 = crypto3.randomUUID.bind(crypto3); - return crypto3.randomUUID(); - } - const u8 = new Uint8Array(1); - const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; - return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); - }; - } -}); - -// node_modules/openai/internal/errors.mjs +// node_modules/@anthropic-ai/sdk/internal/errors.mjs function isAbortError(err) { return typeof err === "object" && err !== null && // Spec-compliant fetch implementations ("name" in err && err.name === "AbortError" || // Expo fetch @@ -2313,18 +1901,18 @@ function isAbortError(err) { } var castToError; var init_errors = __esm({ - "node_modules/openai/internal/errors.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/errors.mjs"() { castToError = (err) => { if (err instanceof Error) return err; if (typeof err === "object" && err !== null) { try { - if (Object.prototype.toString.call(err) === "[object Error]") { - const hasCause = "cause" in err; - const error = new Error(err.message, hasCause ? { cause: err.cause } : {}); + const tag = Object.prototype.toString.call(err); + if (tag === "[object Error]" || tag === "[object DOMException]") { + const error = new Error(err.message, err.cause ? { cause: err.cause } : {}); if (err.stack) error.stack = err.stack; - if (hasCause && !Object.prototype.hasOwnProperty.call(error, "cause")) + if (err.cause && !error.cause) error.cause = err.cause; if (err.name) error.name = err.name; @@ -2342,24 +1930,25 @@ var init_errors = __esm({ } }); -// node_modules/openai/core/error.mjs -var OpenAIError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, LengthFinishReasonError, ContentFilterFinishReasonError, InvalidWebhookSignatureError, OAuthError, SubjectTokenProviderError; +// node_modules/@anthropic-ai/sdk/core/error.mjs +var AnthropicError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, RetryableError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError; var init_error = __esm({ - "node_modules/openai/core/error.mjs"() { + "node_modules/@anthropic-ai/sdk/core/error.mjs"() { init_errors(); - OpenAIError = class extends Error { - }; - APIError = class _APIError extends OpenAIError { - constructor(status, error, message, headers) { + AnthropicError = /* @__PURE__ */ (() => { + class AnthropicError2 extends Error { + } + return AnthropicError2; + })(); + APIError = class _APIError extends AnthropicError { + constructor(status, error, message, headers, type) { super(`${_APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; - this.requestID = headers?.get("x-request-id"); + this.requestID = headers?.get("request-id"); + this.workspaceID = headers?.get("anthropic-workspace-id"); this.error = error; - const data = error; - this.code = data?.["code"]; - this.param = data?.["param"]; - this.type = data?.["type"]; + this.type = type ?? null; } static makeMessage(status, error, message) { const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message; @@ -2378,32 +1967,33 @@ var init_error = __esm({ if (!status || !headers) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } - const error = errorResponse?.["error"]; + const error = errorResponse; + const type = error?.["error"]?.["type"]; if (status === 400) { - return new BadRequestError(status, error, message, headers); + return new BadRequestError(status, error, message, headers, type); } if (status === 401) { - return new AuthenticationError(status, error, message, headers); + return new AuthenticationError(status, error, message, headers, type); } if (status === 403) { - return new PermissionDeniedError(status, error, message, headers); + return new PermissionDeniedError(status, error, message, headers, type); } if (status === 404) { - return new NotFoundError(status, error, message, headers); + return new NotFoundError(status, error, message, headers, type); } if (status === 409) { - return new ConflictError(status, error, message, headers); + return new ConflictError(status, error, message, headers, type); } if (status === 422) { - return new UnprocessableEntityError(status, error, message, headers); + return new UnprocessableEntityError(status, error, message, headers, type); } if (status === 429) { - return new RateLimitError(status, error, message, headers); + return new RateLimitError(status, error, message, headers, type); } if (status >= 500) { - return new InternalServerError(status, error, message, headers); + return new InternalServerError(status, error, message, headers, type); } - return new _APIError(status, error, message, headers); + return new _APIError(status, error, message, headers, type); } }; APIUserAbortError = class extends APIError { @@ -2423,6 +2013,13 @@ var init_error = __esm({ super({ message: message ?? "Request timed out." }); } }; + RetryableError = class extends AnthropicError { + constructor(message, { cause } = {}) { + super(message ?? "Retryable error."); + if (cause !== void 0) + this.cause = cause; + } + }; BadRequestError = class extends APIError { }; AuthenticationError = class extends APIError { @@ -2439,50 +2036,10 @@ var init_error = __esm({ }; InternalServerError = class extends APIError { }; - LengthFinishReasonError = class extends OpenAIError { - constructor() { - super(`Could not parse response content as the length limit was reached`); - } - }; - ContentFilterFinishReasonError = class extends OpenAIError { - constructor() { - super(`Could not parse response content as the request was rejected by the content filter`); - } - }; - InvalidWebhookSignatureError = class extends Error { - constructor(message) { - super(message); - } - }; - OAuthError = class extends APIError { - constructor(status, error, headers) { - let finalMessage = "OAuth2 authentication error"; - let error_code = void 0; - if (error && typeof error === "object") { - const errorData = error; - error_code = errorData["error"]; - const description = errorData["error_description"]; - if (description && typeof description === "string") { - finalMessage = description; - } else if (error_code) { - finalMessage = error_code; - } - } - super(status, error, finalMessage, headers); - this.error_code = error_code; - } - }; - SubjectTokenProviderError = class extends OpenAIError { - constructor(message, provider2, cause) { - super(message); - this.provider = provider2; - this.cause = cause; - } - }; } }); -// node_modules/openai/internal/utils/values.mjs +// node_modules/@anthropic-ai/sdk/internal/utils/values.mjs function maybeObj(x) { if (typeof x !== "object") { return {}; @@ -2502,9 +2059,11 @@ function hasOwn(obj2, key) { function isObj(obj2) { return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); } +function checkNever(_value) { +} var startsWithSchemeRegexp, isAbsoluteURL, isArray, isReadonlyArray, validatePositiveInteger, safeJSON; var init_values = __esm({ - "node_modules/openai/internal/utils/values.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/utils/values.mjs"() { init_error(); startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; isAbsoluteURL = (url) => { @@ -2514,10 +2073,10 @@ var init_values = __esm({ isReadonlyArray = isArray; validatePositiveInteger = (name, n) => { if (typeof n !== "number" || !Number.isInteger(n)) { - throw new OpenAIError(`${name} must be an integer`); + throw new AnthropicError(`${name} must be an integer`); } if (n < 0) { - throw new OpenAIError(`${name} must be a positive integer`); + throw new AnthropicError(`${name} must be a positive integer`); } return n; }; @@ -2531,1207 +2090,35 @@ var init_values = __esm({ } }); -// node_modules/openai/internal/utils/sleep.mjs +// node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs var sleep; var init_sleep = __esm({ - "node_modules/openai/internal/utils/sleep.mjs"() { - sleep = (ms, ...signals) => new Promise((resolve, reject) => { - const activeSignals = [...new Set(signals.filter((signal) => signal != null))]; - let timeout; - let settled = false; - const cleanup = () => { - for (const signal of activeSignals) { - try { - signal.removeEventListener("abort", abort); - } catch { - } - } + "node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs"() { + sleep = (ms, signal) => new Promise((resolve2) => { + if (signal?.aborted) + return resolve2(); + const onAbort = () => { + clearTimeout(timer); + resolve2(); }; - const settle = (callback) => { - if (settled) { - return; - } - settled = true; - if (timeout !== void 0) { - clearTimeout(timeout); - timeout = void 0; - } - cleanup(); - callback(); - }; - const abort = () => { - settle(() => reject()); - }; - if (activeSignals.some((signal) => signal.aborted)) { - abort(); - return; - } - timeout = setTimeout(() => { - settle(resolve); + const timer = setTimeout(() => { + signal?.removeEventListener("abort", onAbort); + resolve2(); }, ms); - for (const signal of activeSignals) { - if (settled) { - break; - } - try { - signal.addEventListener("abort", abort, { once: true }); - } catch (error) { - settle(() => reject(error)); - } - } - if (activeSignals.some((signal) => signal.aborted)) { - abort(); - } + signal?.addEventListener("abort", onAbort, { once: true }); }); } }); -// node_modules/openai/internal/utils/abort.mjs -function subscribeWeakly(signal, reference, registry2) { - let subscription = subscriptions.get(signal); - if (!subscription) { - const callbacks = /* @__PURE__ */ new Set(); - const abort = () => { - subscriptions.delete(signal); - for (const callback of callbacks) { - registry2.unregister(callback); - callback.deref()?.(); - } - callbacks.clear(); - }; - subscription = { callbacks, abort }; - signal.addEventListener("abort", abort, { once: true }); - subscriptions.set(signal, subscription); - } - const owner = subscription; - owner.callbacks.add(reference); - return () => { - owner.callbacks.delete(reference); - registry2.unregister(reference); - if (owner.callbacks.size === 0) { - if (subscriptions.get(signal) === owner) { - subscriptions.delete(signal); - } - signal.removeEventListener("abort", owner.abort); - } - }; -} -function releaseOnAbort(signal, callbacks, abort) { - signal.addEventListener("abort", () => callbacks.deref()?.delete(abort), { once: true }); -} -function retainRequestAbortCallback(owner, abort, requestSignal) { - if (typeof weakGlobals.WeakRef === "function" && finalizer && !requestSignal.aborted) { - let callbacks = callbackOwners.get(owner); - if (!callbacks) { - callbacks = /* @__PURE__ */ new Set(); - callbackOwners.set(owner, callbacks); - } - callbacks.add(abort); - releaseOnAbort(requestSignal, new weakGlobals.WeakRef(callbacks), abort); - } -} -function addRequestAbortListener(signal, abort, requestSignal) { - if (signal.aborted) { - abort(); - return () => { - }; - } - if (typeof weakGlobals.WeakRef !== "function" || !finalizer) { - signal.addEventListener("abort", abort, { once: true }); - return () => signal.removeEventListener("abort", abort); - } - const reference = new weakGlobals.WeakRef(abort); - const cleanup = subscribeWeakly(signal, reference, finalizer); - finalizer.register(abort, cleanup, reference); - retainRequestAbortCallback(requestSignal, abort, requestSignal); - return cleanup; -} -var weakGlobals, finalizer, callbackOwners, subscriptions; -var init_abort2 = __esm({ - "node_modules/openai/internal/utils/abort.mjs"() { - weakGlobals = globalThis; - finalizer = // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Weak references and finalizers are optional host capabilities, so probe them before constructing either. - typeof weakGlobals.FinalizationRegistry === "function" ? new weakGlobals.FinalizationRegistry((cleanup) => { - try { - cleanup(); - } catch { - } - }) : void 0; - callbackOwners = /* @__PURE__ */ new WeakMap(); - subscriptions = /* @__PURE__ */ new WeakMap(); - } -}); - -// node_modules/openai/internal/shims.mjs -function getDefaultFetch() { - if (typeof fetch !== "undefined") { - return fetch; - } - throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); -} -function makeReadableStream(...args) { - const ReadableStream2 = globalThis.ReadableStream; - if (typeof ReadableStream2 === "undefined") { - throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); - } - return new ReadableStream2(...args); -} -function ReadableStreamFrom(iterable) { - let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); - return makeReadableStream({ - start() { - }, - async pull(controller) { - const { done, value } = await iter.next(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - }, - async cancel() { - await iter.return?.(); - } - }); -} -function ReadableStreamToAsyncIterable(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) - reader.releaseLock(); - return result; - } catch (e) { - reader.releaseLock(); - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: void 0 }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -async function CancelReadableStream(stream4) { - if (stream4 === null || typeof stream4 !== "object") - return; - if (stream4[Symbol.asyncIterator]) { - await stream4[Symbol.asyncIterator]().return?.(); - return; - } - const reader = stream4.getReader(); - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; -} -var init_shims = __esm({ - "node_modules/openai/internal/shims.mjs"() { - } -}); - -// node_modules/openai/internal/utils/bytes.mjs -function encodeUTF8(str2) { - let encoder3; - return (encodeUTF8_ ?? (encoder3 = new globalThis.TextEncoder(), encodeUTF8_ = encoder3.encode.bind(encoder3)))(str2); -} -function decodeUTF8(bytes2) { - let decoder3; - return (decodeUTF8_ ?? (decoder3 = new globalThis.TextDecoder(), decodeUTF8_ = decoder3.decode.bind(decoder3)))(bytes2); -} -var encodeUTF8_, decodeUTF8_; -var init_bytes = __esm({ - "node_modules/openai/internal/utils/bytes.mjs"() { - } -}); - -// node_modules/openai/internal/decoders/line.mjs -function findNewlineIndex(buffer, start, end) { - const newline = 10; - const carriage = 13; - for (let i = start; i < end; i++) { - if (buffer[i] === newline) { - return { preceding: i, index: i + 1, carriage: false }; - } - if (buffer[i] === carriage) { - return { preceding: i, index: i + 1, carriage: true }; - } - } - return null; -} -function findDoubleNewlineIndex(buffer) { - for (let i = 0; i < buffer.length - 1; i++) { - const firstEndingLength = lineEndingLength(buffer, i); - if (firstEndingLength > 0) { - const secondEndingIndex = i + firstEndingLength; - const secondEndingLength = lineEndingLength(buffer, secondEndingIndex); - if (secondEndingLength > 0) { - return secondEndingIndex + secondEndingLength; - } - } - } - return -1; -} -function lineEndingLength(buffer, index) { - const newline = 10; - const carriage = 13; - if (buffer[index] === newline) { - return 1; - } - if (buffer[index] === carriage) { - return buffer[index + 1] === newline ? 2 : 1; - } - return 0; -} -var _LineDecoder_instances, _LineDecoder_buffer, _LineDecoder_start, _LineDecoder_end, _LineDecoder_searchIndex, _LineDecoder_skipLeadingLF, _LineDecoder_append, MAX_RETAINED_BUFFER_BYTES, LineDecoder; -var init_line = __esm({ - "node_modules/openai/internal/decoders/line.mjs"() { - init_tslib(); - init_bytes(); - MAX_RETAINED_BUFFER_BYTES = 64 * 1024; - LineDecoder = class { - /** Creates a decoder with no buffered bytes or pending newline continuation. */ - constructor() { - _LineDecoder_instances.add(this); - _LineDecoder_buffer.set(this, void 0); - _LineDecoder_start.set(this, void 0); - _LineDecoder_end.set(this, void 0); - _LineDecoder_searchIndex.set(this, void 0); - _LineDecoder_skipLeadingLF.set(this, void 0); - __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); - } - /** - * Appends a text or UTF-8 byte chunk and returns every newly completed line. - * - * Incomplete lines remain buffered for the next call. A trailing `\r` - * completes its line immediately, and a following `\n` is consumed as its - * continuation. `null` and `undefined` are ignored and do not flush buffered - * content. - */ - decode(chunk) { - if (chunk == null) { - return []; - } - let binaryChunk; - if (chunk instanceof ArrayBuffer) { - binaryChunk = new Uint8Array(chunk); - } else if (typeof chunk === "string") { - binaryChunk = encodeUTF8(chunk); - } else { - binaryChunk = chunk; - } - if (binaryChunk.length === 0) { - return []; - } - if (__classPrivateFieldGet(this, _LineDecoder_skipLeadingLF, "f")) { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); - if (binaryChunk[0] === 10) { - binaryChunk = binaryChunk.subarray(1); - } - if (binaryChunk.length === 0) { - return []; - } - } - __classPrivateFieldGet(this, _LineDecoder_instances, "m", _LineDecoder_append).call(this, binaryChunk); - const lines = []; - let patternIndex; - while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), __classPrivateFieldGet(this, _LineDecoder_searchIndex, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))) != null) { - const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), patternIndex.preceding)); - lines.push(line); - __classPrivateFieldSet(this, _LineDecoder_start, patternIndex.index, "f"); - if (patternIndex.carriage) { - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") < __classPrivateFieldGet(this, _LineDecoder_end, "f") && __classPrivateFieldGet(this, _LineDecoder_buffer, "f")[__classPrivateFieldGet(this, _LineDecoder_start, "f")] === 10) { - __classPrivateFieldSet(this, _LineDecoder_start, __classPrivateFieldGet(this, _LineDecoder_start, "f") + 1, "f"); - } else if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, true, "f"); - } - } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_start, "f"), "f"); - } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_end, "f"), "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, 0, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > MAX_RETAINED_BUFFER_BYTES) { - __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); - } - } else if (lines.length > 0 && __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > MAX_RETAINED_BUFFER_BYTES) { - const length = __classPrivateFieldGet(this, _LineDecoder_end, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"); - if (length <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length > length * 4) { - const capacity = length <= MAX_RETAINED_BUFFER_BYTES ? Math.min(Math.max(length * 2, 256), MAX_RETAINED_BUFFER_BYTES) : length * 2; - const buffer = new Uint8Array(capacity); - buffer.set(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))); - __classPrivateFieldSet(this, _LineDecoder_buffer, buffer, "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet(this, _LineDecoder_end, length, "f"); - __classPrivateFieldSet(this, _LineDecoder_searchIndex, length, "f"); - } - } - return lines; - } - /** Emits the remaining unterminated line, or returns an empty array when idle. */ - flush() { - __classPrivateFieldSet(this, _LineDecoder_skipLeadingLF, false, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") === __classPrivateFieldGet(this, _LineDecoder_end, "f")) { - return []; - } - return this.decode("\n"); - } - }; - _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_start = /* @__PURE__ */ new WeakMap(), _LineDecoder_end = /* @__PURE__ */ new WeakMap(), _LineDecoder_searchIndex = /* @__PURE__ */ new WeakMap(), _LineDecoder_skipLeadingLF = /* @__PURE__ */ new WeakMap(), _LineDecoder_instances = /* @__PURE__ */ new WeakSet(), _LineDecoder_append = function _LineDecoder_append2(chunk) { - if (__classPrivateFieldGet(this, _LineDecoder_end, "f") + chunk.length > __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { - const length = __classPrivateFieldGet(this, _LineDecoder_end, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"); - if (__classPrivateFieldGet(this, _LineDecoder_start, "f") >= __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length / 2 && length + chunk.length <= __classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { - __classPrivateFieldGet(this, _LineDecoder_buffer, "f").copyWithin(0, __classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f")); - } else { - const capacity = Math.max(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length * 2, length + chunk.length, 256); - const buffer = new Uint8Array(capacity); - buffer.set(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_start, "f"), __classPrivateFieldGet(this, _LineDecoder_end, "f"))); - __classPrivateFieldSet(this, _LineDecoder_buffer, buffer, "f"); - } - __classPrivateFieldSet(this, _LineDecoder_searchIndex, __classPrivateFieldGet(this, _LineDecoder_searchIndex, "f") - __classPrivateFieldGet(this, _LineDecoder_start, "f"), "f"); - __classPrivateFieldSet(this, _LineDecoder_end, length, "f"); - __classPrivateFieldSet(this, _LineDecoder_start, 0, "f"); - } - __classPrivateFieldGet(this, _LineDecoder_buffer, "f").set(chunk, __classPrivateFieldGet(this, _LineDecoder_end, "f")); - __classPrivateFieldSet(this, _LineDecoder_end, __classPrivateFieldGet(this, _LineDecoder_end, "f") + chunk.length, "f"); - }; - LineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); - LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g; - } -}); - -// node_modules/openai/internal/utils/log.mjs -function noop() { -} -function makeLogFn(fnLevel, logger, logLevel) { - if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) { - return noop; - } else { - return logger[fnLevel].bind(logger); - } -} -function loggerFor(client) { - const logger = client.logger; - const logLevel = client.logLevel ?? "off"; - if (!logger) { - return noopLogger; - } - const cachedLogger = cachedLoggers.get(logger); - if (cachedLogger && cachedLogger[0] === logLevel) { - return cachedLogger[1]; - } - const levelLogger = { - error: makeLogFn("error", logger, logLevel), - warn: makeLogFn("warn", logger, logLevel), - info: makeLogFn("info", logger, logLevel), - debug: makeLogFn("debug", logger, logLevel) - }; - cachedLoggers.set(logger, [logLevel, levelLogger]); - return levelLogger; -} -function isSensitiveQueryParameter(name) { - const normalized = name.toLowerCase().replace(/[-_]/gu, ""); - return sensitiveQueryNames.has(normalized) || sensitiveQueryNames.has(normalized.replace(/^x/u, "")); -} -function isSensitiveHeader(name) { - return sensitiveHeaderNames.has(name.toLowerCase().replace(/_/gu, "-")) || isSensitiveQueryParameter(name); -} -function redactURL(value) { - const url = new URL(value); - url.username = ""; - url.password = ""; - url.hash = ""; - for (const name of url.searchParams.keys()) { - if (isSensitiveQueryParameter(name)) { - url.searchParams.set(name, "***"); - } - } - return url.href; -} -var levelNumbers, parseLogLevel, noopLogger, cachedLoggers, sensitiveQueryNames, sensitiveHeaderNames, formatRequestDetails; -var init_log = __esm({ - "node_modules/openai/internal/utils/log.mjs"() { - init_values(); - levelNumbers = { - off: 0, - error: 200, - warn: 300, - info: 400, - debug: 500 - }; - parseLogLevel = (maybeLevel, sourceName, client) => { - if (!maybeLevel) { - return void 0; - } - if (hasOwn(levelNumbers, maybeLevel)) { - return maybeLevel; - } - loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`); - return void 0; - }; - noopLogger = { - error: noop, - warn: noop, - info: noop, - debug: noop - }; - cachedLoggers = /* @__PURE__ */ new WeakMap(); - sensitiveQueryNames = /* @__PURE__ */ new Set([ - "apikey", - "accesstoken", - "refreshtoken", - "sessiontoken", - "sessionid", - "idtoken", - "authtoken", - "authorization", - "token", - "password", - "clientsecret", - "signingsecret", - "xamzsecuritytoken", - "xamzsignature", - "xamzcredential" - ]); - sensitiveHeaderNames = /* @__PURE__ */ new Set([ - "authorization", - "proxy-authorization", - "api-key", - "x-api-key", - "x-amz-security-token", - "cookie", - "set-cookie", - "x-session-token", - "x-session-id", - "x-auth-token", - "x-id-token" - ]); - formatRequestDetails = (details) => { - if (details.options) { - details.options = { ...details.options }; - delete details.options["headers"]; - if (details.options.path) { - const path4 = details.options.path; - const redacted = new URL(redactURL(new URL(path4, "https://redacted.invalid").href)); - details.options.path = redacted.origin === "https://redacted.invalid" ? `${path4.startsWith("/") ? "/" : ""}${redacted.pathname.slice(1)}${redacted.search}` : redacted.href; - } - if (details.options.query) { - details.options.query = Object.fromEntries(Object.entries(details.options.query).map(([name, value]) => [ - name, - isSensitiveQueryParameter(name) ? "***" : value - ])); - } - } - if (details.url) { - details.url = redactURL(details.url); - } - if (details.headers) { - details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [name, isSensitiveHeader(name) ? "***" : value])); - } - if ("retryOfRequestLogID" in details) { - if (details.retryOfRequestLogID) { - details.retryOf = details.retryOfRequestLogID; - } - delete details.retryOfRequestLogID; - } - return details; - }; - } -}); - -// node_modules/openai/core/streaming.mjs -function isTransportAbortError(error) { - return !(error instanceof APIError) && isAbortError(error); -} -function createStreamTeeQueue() { - let entries = []; - let head = 0; - let canceled = false; - return { - get length() { - return entries.length - head; - }, - get canceled() { - return canceled; - }, - enqueue(value) { - if (!canceled) { - entries.push(value); - } - }, - dequeue() { - if (head === entries.length) { - return void 0; - } - const value = entries[head]; - entries[head] = void 0; - head += 1; - if (head === entries.length) { - entries = []; - head = 0; - } else if (head >= 1024 && head * 2 >= entries.length) { - entries = entries.slice(head); - head = 0; - } - return value; - }, - cancel() { - canceled = true; - entries.length = 0; - head = 0; - } - }; -} -function createAbortableSSESource(body, signal) { - const reader = typeof body.getReader === "function" ? body.getReader() : void 0; - const source = reader ? { - next: () => reader.read(), - return: () => reader.cancel() - } : ReadableStreamToAsyncIterable(body)[Symbol.asyncIterator](); - const ended = { value: void 0, done: true }; - let closed = false; - let canceled = false; - let cancellation; - let interrupt; - const waitForAbort = () => ( - // oxlint-disable-next-line promise/avoid-new -- AbortSignal callbacks need a portable Promise bridge. - new Promise((resolve) => { - interrupt = resolve; - }) - ); - const cancel = () => { - if (canceled || closed) { - return cancellation; - } - canceled = true; - try { - cancellation = Promise.resolve(source.return?.()); - } catch (error) { - cancellation = Promise.reject(error); - } - cancellation.catch(() => void 0); - return cancellation; - }; - const abort = () => { - queueMicrotask(() => { - interrupt?.(); - cancel(); - }); - }; - const iterator = { - async next() { - if (signal.aborted) { - return ended; - } - const aborted = waitForAbort().then(() => ended); - try { - const result = await Promise.race([source.next(), aborted]); - if (signal.aborted) { - return ended; - } - if (result.done) { - closed = true; - return ended; - } - return { value: result.value, done: false }; - } catch (error) { - if (signal.aborted && (isAbortError(error) || error === signal.reason)) { - return ended; - } - throw error; - } finally { - interrupt = void 0; - } - }, - async return() { - const pending = cancel(); - if (pending && !signal.aborted) { - const aborted = waitForAbort(); - try { - if (!signal.aborted) { - await Promise.race([pending, aborted]); - } - } finally { - interrupt = void 0; - } - } - return ended; - }, - [Symbol.asyncIterator]() { - return this; - } - }; - return { - iterator, - start() { - signal.addEventListener("abort", abort, { once: true }); - if (signal.aborted) { - abort(); - } - }, - async cleanup(failed) { - let cleanupError; - try { - signal.removeEventListener("abort", abort); - } catch (error) { - cleanupError = error; - } - if (!closed) { - const pending = cancel(); - if (pending && !failed && !signal.aborted) { - try { - await pending; - } catch (error) { - cleanupError ?? (cleanupError = error); - } - } - } - if (reader) { - try { - reader.releaseLock(); - } catch (error) { - cleanupError ?? (cleanupError = error); - } - } - if (cleanupError !== void 0 && !failed && !signal.aborted) { - throw cleanupError; - } - } - }; -} -async function* _iterSSEMessages(response, controller) { - if (!response.body) { - controller.abort(); - if (globalThis.navigator !== void 0 && globalThis.navigator.product === "ReactNative") { - throw new OpenAIError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); - } - throw new OpenAIError(`Attempted to iterate over a response with no body`); - } - const sseDecoder = new SSEDecoder(); - const lineDecoder = new LineDecoder(); - const { signal } = controller; - const source = createAbortableSSESource(response.body, signal); - let failed = false; - try { - source.start(); - for await (const sseChunk of iterSSEChunks(source.iterator)) { - if (signal.aborted) { - return; - } - for (const line of lineDecoder.decode(sseChunk)) { - if (signal.aborted) { - return; - } - const sse = sseDecoder.decode(line); - if (sse) { - yield sse; - } - } - } - if (signal.aborted) { - return; - } - for (const line of lineDecoder.flush()) { - if (signal.aborted) { - return; - } - const sse = sseDecoder.decode(line); - if (sse) { - yield sse; - } - } - if (signal.aborted) { - return; - } - const pending = sseDecoder.flush(); - if (pending) { - yield pending; - } - } catch (error) { - failed = true; - if (!signal.aborted || !isAbortError(error) && error !== signal.reason) { - throw error; - } - } finally { - await source.cleanup(failed); - } -} -async function* iterSSEChunks(iterator) { - let data = new Uint8Array(); - let dataStart = 0; - let dataEnd = 0; - let searchStartIndex = 0; - for await (const chunk of iterator) { - if (chunk == null) { - continue; - } - let binaryChunk; - if (chunk instanceof ArrayBuffer) { - binaryChunk = new Uint8Array(chunk); - } else if (typeof chunk === "string") { - binaryChunk = encodeUTF8(chunk); - } else { - binaryChunk = chunk; - } - if (dataEnd + binaryChunk.length > data.length) { - const bufferedLength = dataEnd - dataStart; - if (dataStart >= data.length / 2 && bufferedLength + binaryChunk.length <= data.length) { - data.copyWithin(0, dataStart, dataEnd); - } else { - const newData = new Uint8Array(Math.max(data.length * 2, bufferedLength + binaryChunk.length)); - newData.set(data.subarray(dataStart, dataEnd)); - data = newData; - } - searchStartIndex -= dataStart; - dataStart = 0; - dataEnd = bufferedLength; - } - data.set(binaryChunk, dataEnd); - dataEnd += binaryChunk.length; - let patternIndex; - while ((patternIndex = findDoubleNewlineIndex(data.subarray(searchStartIndex, dataEnd))) !== -1) { - patternIndex += searchStartIndex; - yield data.slice(dataStart, patternIndex); - dataStart = patternIndex; - searchStartIndex = dataStart; - } - searchStartIndex = Math.max(dataStart, dataEnd - DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES); - } - if (dataEnd > dataStart) { - yield data.slice(dataStart, dataEnd); - } -} -function partition(str2, delimiter) { - const index = str2.indexOf(delimiter); - if (index !== -1) { - return [str2.slice(0, index), delimiter, str2.slice(index + delimiter.length)]; - } - return [str2, "", ""]; -} -var _Stream_instances, _Stream_client, _Stream_isTeeBranch, _Stream_cancelIterator, Stream, DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES, SSEDecoder; -var init_streaming = __esm({ - "node_modules/openai/core/streaming.mjs"() { - init_tslib(); - init_error(); - init_shims(); - init_line(); - init_errors(); - init_bytes(); - init_log(); - Stream = class _Stream { - /** Wraps an asynchronous event iterator and the controller that owns its request. */ - constructor(iterator, controller, client) { - _Stream_instances.add(this); - _Stream_client.set(this, void 0); - _Stream_isTeeBranch.set(this, false); - this.iterator = iterator; - this.controller = controller; - __classPrivateFieldSet(this, _Stream_client, client, "f"); - } - /** - * Decodes an SSE response into parsed JSON events. - * - * The resulting stream can be consumed only once, ignores events after `[DONE]`, and - * surfaces API error payloads as `APIError` instances. When - * `synthesizeEventData` is enabled, each item also includes its SSE event name. - */ - static fromSSEResponse(response, controller, client, synthesizeEventData) { - let consumed = false; - const logger = client ? loggerFor(client) : console; - async function* iterator() { - if (consumed) { - throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - let receivedCompletionSentinel = false; - const messages = _iterSSEMessages(response, controller); - const closeMessages = messages.return.bind(messages); - messages.return = (value) => { - if (!receivedCompletionSentinel) { - controller.abort(); - } - return closeMessages(value); - }; - try { - for await (const sse of messages) { - if (sse.data === "[DONE]") { - receivedCompletionSentinel = true; - break; - } - if (sse.event === null || !sse.event.startsWith("thread.")) { - let data; - try { - data = JSON.parse(sse.data); - } catch { - logger.error(`Could not parse message into JSON:`); - logger.error(`From chunk:`); - throw new SyntaxError("Error reading response: malformed server-sent event JSON."); - } - if (sse.event === "error") { - throw new APIError(void 0, data?.error ?? data, void 0, response.headers); - } - if (data && data.error) { - throw new APIError(void 0, data.error, void 0, response.headers); - } - yield synthesizeEventData ? { event: sse.event, data } : data; - } else { - let data; - try { - data = JSON.parse(sse.data); - } catch { - logger.error(`Could not parse message into JSON:`); - logger.error(`From chunk:`); - throw new SyntaxError("Error reading response: malformed server-sent event JSON."); - } - yield { event: sse.event, data }; - } - } - done = true; - } catch (e) { - if (receivedCompletionSentinel || isTransportAbortError(e) || controller.signal.aborted && e === controller.signal.reason) { - return; - } - throw e; - } finally { - if (!done) { - controller.abort(); - } - } - } - return new _Stream(iterator, controller, client); - } - /** - * Generates a Stream from a newline-separated ReadableStream - * where each item is a JSON value. - */ - static fromReadableStream(readableStream, controller, client) { - let consumed = false; - async function* iterLines() { - const lineDecoder = new LineDecoder(); - const reader = readableStream.getReader(); - let closed = false; - let cancelPromise; - const cancel = () => { - cancelPromise ?? (cancelPromise = reader.cancel()); - cancelPromise.catch(() => void 0); - }; - controller.signal.addEventListener("abort", cancel, { once: true }); - try { - if (controller.signal.aborted) { - cancel(); - return; - } - while (true) { - const { value: chunk, done } = await reader.read(); - if (done) { - closed = true; - break; - } - if (controller.signal.aborted) { - return; - } - for (const line of lineDecoder.decode(chunk)) { - if (controller.signal.aborted) { - return; - } - yield line; - } - } - if (controller.signal.aborted) { - return; - } - for (const line of lineDecoder.flush()) { - if (controller.signal.aborted) { - return; - } - yield line; - } - } finally { - controller.signal.removeEventListener("abort", cancel); - if (!closed) { - cancel(); - } - reader.releaseLock(); - } - } - async function* iterator() { - if (consumed) { - throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const line of iterLines()) { - if (line) { - let data; - try { - data = JSON.parse(line); - } catch (error) { - if (error instanceof SyntaxError) { - throw new SyntaxError("Error reading response: malformed newline-delimited JSON."); - } - throw error; - } - yield data; - } - } - done = true; - } catch (e) { - if (controller.signal.aborted || isAbortError(e)) { - return; - } - throw e; - } finally { - if (!done) { - controller.abort(); - } - } - } - return new _Stream(iterator, controller, client); - } - /** Starts consuming this stream; attempting to consume it again throws. */ - [(_Stream_client = /* @__PURE__ */ new WeakMap(), _Stream_isTeeBranch = /* @__PURE__ */ new WeakMap(), _Stream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - return this.iterator(); - } - /** - * Splits the stream into two streams which can be - * independently read from at different speeds. - * Closing a branch discards its buffered events without stopping its sibling. - * Future reads on that branch finish immediately; previously issued `next()` - * promises remain shared with its sibling and may still resolve with events. - * Closing both branches invokes the source iterator's `return()` when available. - * For {@link Stream.fromReadableStream}, closing both branches before iteration - * starts does not cancel the supplied readable; cancel that readable directly. - */ - tee() { - const { controller } = this; - const left = createStreamTeeQueue(); - const right = createStreamTeeQueue(); - const iterator = this.iterator(); - const teeIterator = (queue) => ({ - next: () => { - if (queue.canceled) { - return Promise.resolve({ value: void 0, done: true }); - } - if (queue.length === 0) { - const result = iterator.next(); - left.enqueue(result); - right.enqueue(result); - } - return queue.dequeue(); - }, - return: async () => { - if (!queue.canceled) { - queue.cancel(); - if (left.canceled && right.canceled) { - await __classPrivateFieldGet(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iterator, controller); - } - } - return { value: void 0, done: true }; - } - }); - const branch = (queue) => { - const stream4 = new _Stream(() => teeIterator(queue), controller, __classPrivateFieldGet(this, _Stream_client, "f")); - __classPrivateFieldSet(stream4, _Stream_isTeeBranch, true, "f"); - return stream4; - }; - return [branch(left), branch(right)]; - } - /** - * Converts this stream to a newline-separated ReadableStream of - * JSON stringified values in the stream - * which can be turned back into a Stream with `Stream.fromReadableStream()`. - * Canceling a response-backed readable aborts its request. Canceling a tee - * branch discards its buffered events and leaves sibling consumers running. - * Read or serialization failures also release the iterator without replacing the original error. - */ - toReadableStream() { - const { controller } = this; - let iter; - let cancellation; - const cancel = () => cancellation ?? (cancellation = __classPrivateFieldGet(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iter, controller)); - return makeReadableStream({ - start: async () => { - iter = this[Symbol.asyncIterator](); - }, - async pull(ctrl) { - try { - const { value, done } = await iter.next(); - if (done) { - return ctrl.close(); - } - const bytes2 = encodeUTF8(JSON.stringify(value) + "\n"); - ctrl.enqueue(bytes2); - } catch (err) { - ctrl.error(err); - void cancel().catch(() => void 0); - } - }, - cancel - }); - } - }; - _Stream_cancelIterator = async function _Stream_cancelIterator2(iterator, controller) { - const returnMethod = iterator.return; - if (returnMethod) { - if (!__classPrivateFieldGet(this, _Stream_isTeeBranch, "f")) { - controller.abort(); - } - await Reflect.apply(returnMethod, iterator, []); - } - }; - DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES = 3; - SSEDecoder = class { - constructor() { - this.event = null; - this.data = []; - this.chunks = []; - } - decode(line) { - if (line.endsWith("\r")) { - line = line.slice(0, -1); - } - if (!line) { - if (!this.event && !this.data.length) { - return null; - } - const sse = { - event: this.event, - data: this.data.join("\n"), - raw: this.chunks - }; - this.event = null; - this.data = []; - this.chunks = []; - return sse; - } - this.chunks.push(line); - if (line.startsWith(":")) { - return null; - } - const [fieldname, , initialValue] = partition(line, ":"); - let value = initialValue; - if (value.startsWith(" ")) { - value = value.slice(1); - } - if (fieldname === "event") { - this.event = value; - } else if (fieldname === "data") { - this.data.push(value); - } - return null; - } - /** - * Emits a pending event at EOF when the stream omitted the trailing blank - * line. Returns `null` when no event is in progress so a record that already - * ended with a blank line is not delivered twice. - */ - flush() { - return this.decode(""); - } - }; - } -}); - -// node_modules/openai/internal/parse.mjs -async function defaultParseResponse(client, props) { - const { response, requestLogID, retryOfRequestLogID, startTime } = props; - let jsonBodyLength; - const body = await (async () => { - if (props.options.stream) { - loggerFor(client).debug("response", response.status, response.url, response.headers, response.body); - if (props.options.__streamClass) { - return props.options.__streamClass.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); - } - return Stream.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); - } - if (response.status === 204) { - return null; - } - if (props.options.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim().toLowerCase(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - const contentLength = response.headers.get("content-length"); - if (contentLength === "0") { - return void 0; - } - const bodyText = await response.text(); - if (!bodyText) { - return void 0; - } - const json = JSON.parse(bodyText); - jsonBodyLength = bodyText.length; - return addRequestID(json, response); - } - const text = await response.text(); - return text; - })().catch((error) => { - throw asAbortError(error, props.controller.signal); - }); - if (client.logLevel === "debug") { - loggerFor(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails({ - retryOfRequestLogID, - url: response.url, - status: response.status, - body: jsonBodyLength === void 0 ? body : { type: "json", length: jsonBodyLength }, - durationMs: Date.now() - startTime - })); - } - return body; -} -function asAbortError(error, signal) { - if (!signal.aborted || error !== signal.reason || isAbortError(error)) { - return error; - } - const message = "This operation was aborted"; - const DOMExceptionConstructor = globalThis.DOMException; - return typeof DOMExceptionConstructor === "function" ? new DOMExceptionConstructor(message, "AbortError") : Object.assign(new Error(message), { name: "AbortError" }); -} -function addRequestID(value, response) { - if (!value || typeof value !== "object" || Array.isArray(value)) { - return value; - } - return Object.defineProperty(value, "_request_id", { - value: response.headers.get("x-request-id"), - enumerable: false - }); -} -var init_parse = __esm({ - "node_modules/openai/internal/parse.mjs"() { - init_streaming(); - init_errors(); - init_log(); - } -}); - -// node_modules/openai/version.mjs +// node_modules/@anthropic-ai/sdk/version.mjs var VERSION; var init_version2 = __esm({ - "node_modules/openai/version.mjs"() { - VERSION = "7.19.0"; + "node_modules/@anthropic-ai/sdk/version.mjs"() { + VERSION = "0.129.0"; } }); -// node_modules/openai/internal/detect-platform.mjs +// node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs function getDetectedPlatform() { if (typeof Deno !== "undefined" && Deno.build != null) { return "deno"; @@ -3749,7 +2136,7 @@ function getBrowserInfo() { return null; } const browserPatterns = [ - { key: "edge", pattern: /\bEdg(?:e|A|iOS)?\b(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, @@ -3769,7 +2156,7 @@ function getBrowserInfo() { } var isRunningInBrowser, getPlatformProperties, normalizeArch, normalizePlatform, _platformHeaders, getPlatformHeaders; var init_detect_platform = __esm({ - "node_modules/openai/internal/detect-platform.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs"() { init_version2(); isRunningInBrowser = () => { return ( @@ -3870,66 +2257,130 @@ var init_detect_platform = __esm({ } }); -// node_modules/openai/internal/request-options.mjs -function observeJSONRequestBody(body, observer) { - let observers = jsonRequestBodyObservers.get(body); - if (!observers) { - observers = /* @__PURE__ */ new Set(); - jsonRequestBodyObservers.set(body, observers); +// node_modules/@anthropic-ai/sdk/internal/request-signal.mjs +function makeCleanup(signal, listener) { + return () => signal.removeEventListener("abort", listener); +} +function registerRequestSignalCleanup(controller, signal, listener) { + cleanups.set(controller, makeCleanup(signal, listener)); +} +function armAbandonmentBackstop(body, controller) { + if (cleanups.has(controller)) + registry?.register(body, controller, controller); +} +function releaseRequestSignal(controller) { + const cleanup = cleanups.get(controller); + if (cleanup) { + cleanups.delete(controller); + registry?.unregister(controller); + cleanup(); } - observers.add(observer); - return () => { - const active = jsonRequestBodyObservers.get(body); - if (!active) { - return; +} +var cleanups, registry; +var init_request_signal = __esm({ + "node_modules/@anthropic-ai/sdk/internal/request-signal.mjs"() { + cleanups = /* @__PURE__ */ new WeakMap(); + registry = typeof globalThis.FinalizationRegistry === "function" ? new globalThis.FinalizationRegistry((controller) => releaseRequestSignal(controller)) : null; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/shims.mjs +function getDefaultFetch() { + if (typeof fetch !== "undefined") { + return fetch; + } + throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); +} +function makeReadableStream(...args) { + const ReadableStream2 = globalThis.ReadableStream; + if (typeof ReadableStream2 === "undefined") { + throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); + } + return new ReadableStream2(...args); +} +function ReadableStreamFrom(iterable) { + let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + return makeReadableStream({ + start() { + }, + async pull(controller) { + const { done, value: value2 } = await iter.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value2); + } + }, + async cancel() { + await iter.return?.(); } - active.delete(observer); - if (active.size === 0) { - jsonRequestBodyObservers.delete(body); + }); +} +function ReadableStreamToAsyncIterable(stream5) { + if (stream5[Symbol.asyncIterator]) + return stream5; + const reader = stream5.getReader(); + return { + async next() { + try { + const result = await reader.read(); + if (result?.done) + reader.releaseLock(); + return result; + } catch (e) { + reader.releaseLock(); + throw e; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: void 0 }; + }, + [Symbol.asyncIterator]() { + return this; } }; } -var jsonRequestBodyObservers, FallbackEncoder; +async function CancelReadableStream(stream5) { + if (stream5 === null || typeof stream5 !== "object") + return; + if (stream5[Symbol.asyncIterator]) { + await stream5[Symbol.asyncIterator]().return?.(); + return; + } + const reader = stream5.getReader(); + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; +} +var init_shims = __esm({ + "node_modules/@anthropic-ai/sdk/internal/shims.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/request-options.mjs +var FallbackEncoder; var init_request_options = __esm({ - "node_modules/openai/internal/request-options.mjs"() { - jsonRequestBodyObservers = /* @__PURE__ */ new WeakMap(); + "node_modules/@anthropic-ai/sdk/internal/request-options.mjs"() { FallbackEncoder = ({ headers, body }) => { - const observers = typeof body === "object" && body !== null ? jsonRequestBodyObservers.get(body) : void 0; - let encoded; - if (!observers || observers.size === 0) { - encoded = JSON.stringify(body); - } else { - const active = [...observers]; - encoded = JSON.stringify(body, function(key, value) { - let observed = value; - for (const observer of active) { - const replacement = observer.value(this, key, observed); - if (replacement !== void 0) { - observed = replacement; - } - } - return observed; - }); - for (const observer of active) { - observer.complete(); - } - } return { bodyHeaders: { "content-type": "application/json" }, - body: encoded + body: JSON.stringify(body) }; }; } }); -// node_modules/openai/internal/qs/formats.mjs +// node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs var default_format, default_formatter, formatters, RFC1738; var init_formats = __esm({ - "node_modules/openai/internal/qs/formats.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs"() { default_format = "RFC3986"; - default_formatter = String; + default_formatter = (v) => String(v); formatters = { RFC1738: (v) => String(v).replace(/%20/g, "+"), RFC3986: default_formatter @@ -3938,7 +2389,7 @@ var init_formats = __esm({ } }); -// node_modules/openai/internal/qs/utils.mjs +// node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs function is_buffer(obj2) { if (!obj2 || typeof obj2 !== "object") { return false; @@ -3948,23 +2399,19 @@ function is_buffer(obj2) { function maybe_map(val, fn) { if (isArray(val)) { const mapped = []; - for (const item of val) { - mapped.push(fn(item)); + for (let i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); } return mapped; } return fn(val); } -var cachedHas, has, hex_table, limit, encode; +var has, hex_table, limit, encode; var init_utils = __esm({ - "node_modules/openai/internal/qs/utils.mjs"() { + "node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs"() { init_formats(); init_values(); - has = (obj2, key) => { - const resolvedHas = cachedHas ?? Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty); - cachedHas = resolvedHas; - return resolvedHas(obj2, key); - }; + has = (obj2, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj2, key)); hex_table = /* @__PURE__ */ (() => { const array = []; for (let i = 0; i < 256; ++i) { @@ -3984,15 +2431,13 @@ var init_utils = __esm({ string2 = String(str2); } if (charset === "iso-8859-1") { - return escape(string2).replace(/%u[0-9a-f]{4}/gi, ($0) => "%26%23" + Number.parseInt($0.slice(2), 16) + "%3B"); + return escape(string2).replace(/%u[0-9a-f]{4}/gi, function($0) { + return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; + }); } let out = ""; - for (let j = 0; j < string2.length; ) { - let segmentEnd = Math.min((Math.floor(j / limit) + 1) * limit, string2.length); - if (segmentEnd < string2.length && string2.codePointAt(segmentEnd - 1) > 65535) { - segmentEnd += 1; - } - const segment = string2.length >= limit ? string2.slice(j, segmentEnd) : string2; + for (let j = 0; j < string2.length; j += limit) { + const segment = string2.length >= limit ? string2.slice(j, j + limit) : string2; const arr2 = []; for (let i = 0; i < segment.length; ++i) { let c = segment.charCodeAt(i); @@ -4024,18 +2469,17 @@ var init_utils = __esm({ arr2[arr2.length] = hex_table[240 | c >> 18] + hex_table[128 | c >> 12 & 63] + hex_table[128 | c >> 6 & 63] + hex_table[128 | c & 63]; } out += arr2.join(""); - j = segmentEnd; } return out; }; } }); -// node_modules/openai/internal/qs/stringify.mjs +// node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs function is_non_nullish_primitive(v) { return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; } -function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder3, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { +function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder4, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { let obj2 = object; let tmp_sc = sideChannel; let step = 0; @@ -4043,14 +2487,14 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al while ((tmp_sc = tmp_sc.get(sentinel)) !== void 0 && !find_flag) { const pos = tmp_sc.get(object); step += 1; - if (pos !== void 0) { + if (typeof pos !== "undefined") { if (pos === step) { throw new RangeError("Cyclic object value"); } else { find_flag = true; } } - if (tmp_sc.get(sentinel) === void 0) { + if (typeof tmp_sc.get(sentinel) === "undefined") { step = 0; } } @@ -4059,78 +2503,69 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al } else if (obj2 instanceof Date) { obj2 = serializeDate?.(obj2); } else if (generateArrayPrefix === "comma" && isArray(obj2)) { - obj2 = maybe_map(obj2, (value) => { - if (value instanceof Date) { - return serializeDate?.(value); + obj2 = maybe_map(obj2, function(value2) { + if (value2 instanceof Date) { + return serializeDate?.(value2); } - return value; + return value2; }); } if (obj2 === null) { if (strictNullHandling) { - return encoder3 && !encodeValuesOnly ? ( + return encoder4 && !encodeValuesOnly ? ( // @ts-expect-error - encoder3(prefix, defaults.encoder, charset, "key", format) + encoder4(prefix, defaults.encoder, charset, "key", format) ) : prefix; } obj2 = ""; } if (is_non_nullish_primitive(obj2) || is_buffer(obj2)) { - if (encoder3) { - const key_value = encodeValuesOnly ? prefix : ( - // @ts-expect-error - encoder3(prefix, defaults.encoder, charset, "key", format) - ); + if (encoder4) { + const key_value = encodeValuesOnly ? prefix : encoder4(prefix, defaults.encoder, charset, "key", format); return [ formatter?.(key_value) + "=" + // @ts-expect-error - formatter?.(encoder3(obj2, defaults.encoder, charset, "value", format)) + formatter?.(encoder4(obj2, defaults.encoder, charset, "value", format)) ]; } return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; } const values = []; - if (obj2 === void 0) { + if (typeof obj2 === "undefined") { return values; } let obj_keys; if (generateArrayPrefix === "comma" && isArray(obj2)) { - if (encodeValuesOnly && encoder3) { - obj2 = maybe_map(obj2, encoder3); + if (encodeValuesOnly && encoder4) { + obj2 = maybe_map(obj2, encoder4); } obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; } else if (isArray(filter)) { obj_keys = filter; } else { const keys = Object.keys(obj2); - if (sort) { - keys.sort(sort); - } - obj_keys = keys; + obj_keys = sort ? keys.sort(sort) : keys; } const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); const adjusted_prefix = commaRoundTrip && isArray(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; if (allowEmptyArrays && isArray(obj2) && obj2.length === 0) { return adjusted_prefix + "[]"; } - for (const key of obj_keys) { - const value = ( + for (let j = 0; j < obj_keys.length; ++j) { + const key = obj_keys[j]; + const value2 = ( // @ts-ignore - typeof key === "object" && key.value !== void 0 ? key.value : obj2[key] + typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj2[key] ); - if (skipNulls && value === null) { + if (skipNulls && value2 === null) { continue; } const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; - let key_prefix; - if (isArray(obj2)) { - key_prefix = typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix; - } else { - key_prefix = adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); - } + const key_prefix = isArray(obj2) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); sideChannel.set(object, step); - const valueSideChannel = new WeakMap([[sentinel, sideChannel]]); + const valueSideChannel = /* @__PURE__ */ new WeakMap(); + valueSideChannel.set(sentinel, sideChannel); push_to_array(values, inner_stringify( - value, + value2, key_prefix, generateArrayPrefix, commaRoundTrip, @@ -4139,7 +2574,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al skipNulls, encodeDotInKeys, // @ts-ignore - generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj2) ? null : encoder3, + generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj2) ? null : encoder4, filter, sort, allowDots, @@ -4154,21 +2589,21 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al return values; } function normalize_stringify_options(opts = defaults) { - if (opts.allowEmptyArrays !== void 0 && typeof opts.allowEmptyArrays !== "boolean") { + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); } - if (opts.encodeDotInKeys !== void 0 && typeof opts.encodeDotInKeys !== "boolean") { + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); } - if (opts.encoder !== null && opts.encoder !== void 0 && typeof opts.encoder !== "function") { + if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { throw new TypeError("Encoder has to be a function."); } const charset = opts.charset || defaults.charset; - if (opts.charset !== void 0 && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); } let format = default_format; - if (opts.format !== void 0) { + if (typeof opts.format !== "undefined") { if (!has(formatters, opts.format)) { throw new TypeError("Unknown format option provided."); } @@ -4190,12 +2625,7 @@ function normalize_stringify_options(opts = defaults) { if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); } - let allowDots; - if (opts.allowDots === void 0) { - allowDots = !!opts.encodeDotInKeys === true ? true : defaults.allowDots; - } else { - allowDots = !!opts.allowDots; - } + const allowDots = typeof opts.allowDots === "undefined" ? !!opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; return { addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix, // @ts-ignore @@ -4205,7 +2635,7 @@ function normalize_stringify_options(opts = defaults) { charset, charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel, commaRoundTrip: !!opts.commaRoundTrip, - delimiter: opts.delimiter === void 0 ? defaults.delimiter : opts.delimiter, + delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter, encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode, encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys, encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder, @@ -4245,7 +2675,8 @@ function stringify(object, opts = {}) { obj_keys.sort(options.sort); } const sideChannel = /* @__PURE__ */ new WeakMap(); - for (const key of obj_keys) { + for (let i = 0; i < obj_keys.length; ++i) { + const key = obj_keys[i]; if (options.skipNulls && obj2[key] === null) { continue; } @@ -4273,6 +2704,18981 @@ function stringify(object, opts = {}) { } const joined = keys.join(options.delimiter); let prefix = options.addQueryPrefix === true ? "?" : ""; + if (options.charsetSentinel) { + if (options.charset === "iso-8859-1") { + prefix += "utf8=%26%2310003%3B&"; + } else { + prefix += "utf8=%E2%9C%93&"; + } + } + return joined.length > 0 ? prefix + joined : ""; +} +var array_prefix_generators, push_to_array, toISOString, defaults, sentinel; +var init_stringify = __esm({ + "node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs"() { + init_utils(); + init_formats(); + init_values(); + array_prefix_generators = { + brackets(prefix) { + return String(prefix) + "[]"; + }, + comma: "comma", + indices(prefix, key) { + return String(prefix) + "[" + key + "]"; + }, + repeat(prefix) { + return String(prefix); + } + }; + push_to_array = function(arr2, value_or_array) { + Array.prototype.push.apply(arr2, isArray(value_or_array) ? value_or_array : [value_or_array]); + }; + defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", + charset: "utf-8", + charsetSentinel: false, + delimiter: "&", + encode: true, + encodeDotInKeys: false, + encoder: encode, + encodeValuesOnly: false, + format: default_format, + formatter: default_formatter, + /** @deprecated */ + indices: false, + serializeDate(date) { + return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date); + }, + skipNulls: false, + strictNullHandling: false + }; + sentinel = {}; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +function stringifyQuery(query) { + return stringify(query, { arrayFormat: "brackets" }); +} +var init_query = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/query.mjs"() { + init_stringify(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +var node_browser_exports = {}; +__export(node_browser_exports, { + child_process: () => child_process, + crypto: () => crypto2, + fs: () => fs, + os: () => os, + path: () => path, + stream: () => stream, + util: () => util +}); +function unavailable(module) { + return new Proxy({}, { + get(_target, property) { + if (typeof property === "symbol") + return void 0; + throw new AnthropicError(`\`${module}.${property}\` is not available in this environment; it needs a Node.js-compatible runtime`); + } + }); +} +var child_process, crypto2, fs, os, path, stream, util; +var init_node_browser = __esm({ + "node_modules/@anthropic-ai/sdk/internal/node.browser.mjs"() { + init_error(); + child_process = /* @__PURE__ */ unavailable("child_process"); + crypto2 = /* @__PURE__ */ unavailable("crypto"); + fs = /* @__PURE__ */ unavailable("fs"); + os = /* @__PURE__ */ unavailable("os"); + path = /* @__PURE__ */ unavailable("path"); + stream = /* @__PURE__ */ unavailable("stream"); + util = /* @__PURE__ */ unavailable("util"); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +function requireSecureTokenEndpoint(baseURL) { + if (!baseURL) + return; + let u; + try { + u = new URL(baseURL); + } catch (err) { + throw new WorkloadIdentityError(`Invalid token endpoint base URL "${baseURL}": ${err}`); + } + if (u.protocol === "https:") + return; + const host = u.hostname.toLowerCase().replace(/^\[|\]$/g, ""); + if (u.protocol === "http:" && (host === "localhost" || host === "127.0.0.1" || host === "::1")) { + return; + } + throw new WorkloadIdentityError(`Refusing to send credential over non-https token endpoint "${baseURL}"`); +} +async function parseTokenResponse(resp, requestId) { + const text = await readLimitedText(resp); + let data; + try { + data = JSON.parse(text); + } catch { + throw new WorkloadIdentityError(`Token endpoint returned non-JSON response (status ${resp.status})`, resp.status, redactSensitive(text), requestId); + } + if (!data.access_token) { + throw new WorkloadIdentityError(`Token endpoint response missing access_token: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + if (data.token_type && data.token_type.toLowerCase() !== "bearer") { + throw new WorkloadIdentityError(`Token endpoint response: unsupported token_type "${data.token_type}" (want Bearer)`, resp.status, redactSensitive(data), requestId); + } + return data; +} +function redactSensitive(body) { + if (body == null) + return body; + if (typeof body === "string") { + let parsed; + try { + parsed = JSON.parse(body); + } catch { + if (body.length <= MAX_ERROR_BODY_CHARS) + return body; + return body.slice(0, MAX_ERROR_BODY_CHARS) + `... <${body.length - MAX_ERROR_BODY_CHARS} more chars>`; + } + return JSON.stringify(redactSensitive(parsed)); + } + if (typeof body === "object" && !Array.isArray(body)) { + const out = {}; + for (const [k, v] of Object.entries(body)) { + if (SAFE_ERROR_KEYS.has(k)) + out[k] = v; + } + return out; + } + return null; +} +async function checkCredentialsFileSafety(path5, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) { + if (typeof process === "undefined" || process.platform === "win32") + return; + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + let resolved = path5; + let st; + try { + resolved = await fs3.promises.realpath(path5); + st = await fs3.promises.stat(resolved); + } catch { + return; + } + const mode = st.mode & 511; + if (mode & 18) { + throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-writable (mode 0o${mode.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${resolved}\`.`); + } + if (mode & 36) { + throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-readable (mode 0o${mode.toString(8)}); run \`chmod 600 ${resolved}\` before retrying.`); + } + if (typeof process.getuid === "function" && st.uid !== process.getuid()) { + onWarn(`credentials file at ${resolved} is owned by uid ${st.uid} (current process uid ${process.getuid()}); verify this is intentional.`); + } +} +async function writeCredentialsFileAtomic(targetPath, data) { + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const dir = path5.dirname(targetPath); + await fs3.promises.mkdir(dir, { recursive: true, mode: 448 }); + const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`; + try { + const fh = await fs3.promises.open(tmpPath, "w", 384); + try { + await fh.writeFile(JSON.stringify(data, null, 2)); + await fh.sync(); + } finally { + await fh.close(); + } + await fs3.promises.rename(tmpPath, targetPath); + } catch (err) { + await fs3.promises.unlink(tmpPath).catch(() => { + }); + throw err; + } + try { + const dirFh = await fs3.promises.open(dir, "r"); + try { + await dirFh.sync(); + } finally { + await dirFh.close(); + } + } catch { + } +} +async function readLimitedText(resp) { + if (!resp.body) { + return ""; + } + const reader = resp.body.getReader(); + const chunks = []; + let received = 0; + for (; ; ) { + const { done, value: value2 } = await reader.read(); + if (done) + break; + if (received + value2.length > MAX_TOKEN_RESPONSE_BYTES) { + const remaining = MAX_TOKEN_RESPONSE_BYTES - received; + if (remaining > 0) + chunks.push(value2.subarray(0, remaining)); + await reader.cancel(); + break; + } + chunks.push(value2); + received += value2.length; + } + let merged; + if (chunks.length === 1) { + merged = chunks[0]; + } else { + merged = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0)); + let offset = 0; + for (const c of chunks) { + merged.set(c, offset); + offset += c.length; + } + } + return new TextDecoder("utf-8").decode(merged); +} +var GRANT_TYPE_JWT_BEARER, GRANT_TYPE_REFRESH_TOKEN, TOKEN_ENDPOINT, OAUTH_API_BETA_HEADER, FEDERATION_BETA_HEADER, ADVISORY_REFRESH_THRESHOLD_IN_SECONDS, MANDATORY_REFRESH_THRESHOLD_IN_SECONDS, ADVISORY_REFRESH_BACKOFF_IN_SECONDS, MAX_TOKEN_RESPONSE_BYTES, MAX_ERROR_BODY_CHARS, SAFE_ERROR_KEYS, WorkloadIdentityError; +var init_types = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs"() { + init_error(); + GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer"; + GRANT_TYPE_REFRESH_TOKEN = "refresh_token"; + TOKEN_ENDPOINT = "/v1/oauth/token"; + OAUTH_API_BETA_HEADER = "oauth-2025-04-20"; + FEDERATION_BETA_HEADER = "oidc-federation-2026-04-01"; + ADVISORY_REFRESH_THRESHOLD_IN_SECONDS = 120; + MANDATORY_REFRESH_THRESHOLD_IN_SECONDS = 30; + ADVISORY_REFRESH_BACKOFF_IN_SECONDS = 5; + MAX_TOKEN_RESPONSE_BYTES = 1 << 20; + MAX_ERROR_BODY_CHARS = 2e3; + SAFE_ERROR_KEYS = /* @__PURE__ */ new Set(["error", "error_description", "error_uri"]); + WorkloadIdentityError = class extends AnthropicError { + constructor(message, statusCode = null, body = null, requestId = null) { + super(message); + this.statusCode = statusCode; + this.body = body; + this.requestId = requestId; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/time.mjs +function nowAsSeconds() { + return Math.floor(Date.now() / 1e3); +} +var init_time = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/time.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs +var TokenCache; +var init_token_cache = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs"() { + init_types(); + init_time(); + TokenCache = class { + constructor(provider2, onAdvisoryRefreshError) { + this.cached = null; + this.pendingRefresh = null; + this.nextForce = false; + this.lastAdvisoryError = 0; + this.provider = provider2; + this.onAdvisoryRefreshError = onAdvisoryRefreshError; + } + async getToken() { + const force = this.nextForce; + this.nextForce = false; + const cached = this.cached; + if (force || cached == null) { + const token2 = await this.refresh(force); + return token2.token; + } + if (cached.expiresAt == null) { + return cached.token; + } + const remaining = cached.expiresAt - nowAsSeconds(); + if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) { + return cached.token; + } + if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { + this.backgroundRefresh(); + return cached.token; + } + const token = await this.refresh(); + return token.token; + } + /** + * Clears the cached token and marks the next {@link getToken} as a forced + * refresh, so the underlying provider bypasses any on-disk freshness check. + * Called after a 401 — the server has just told us the token is bad even + * if its `expires_at` still looks fresh. + */ + invalidate() { + this.cached = null; + this.nextForce = true; + } + /** + * Mandatory refresh. Joins any in-flight refresh unless forced — a forced + * refresh must not coalesce into a non-forced one that may re-serve the + * same stale disk token. + */ + refresh(force = false) { + if (this.pendingRefresh && !force) { + return this.pendingRefresh; + } + return this.doRefresh(force); + } + /** + * Advisory background refresh. Shares the same in-flight promise as + * mandatory refreshes for deduplication, but swallows errors so the + * stale cached token keeps being served. Backs off for + * {@link ADVISORY_REFRESH_BACKOFF_IN_SECONDS} after a failure so an + * outage during the advisory window doesn't hammer the token endpoint. + */ + backgroundRefresh() { + if (this.pendingRefresh) { + return; + } + if (nowAsSeconds() - this.lastAdvisoryError < ADVISORY_REFRESH_BACKOFF_IN_SECONDS) { + return; + } + this.doRefresh().catch((err) => { + this.lastAdvisoryError = nowAsSeconds(); + this.onAdvisoryRefreshError?.(err); + }); + } + /** + * Core refresh. Sets {@link pendingRefresh} so concurrent callers + * (both advisory and mandatory) coalesce into a single provider call. + */ + doRefresh(force = false) { + this.pendingRefresh = this.provider(force ? { forceRefresh: true } : void 0).then((token) => { + this.cached = token; + this.pendingRefresh = null; + return token; + }, (err) => { + this.pendingRefresh = null; + throw err; + }); + return this.pendingRefresh; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +var readEnv; +var init_env = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/env.mjs"() { + readEnv = (env) => { + if (typeof globalThis.process !== "undefined") { + return globalThis.process.env?.[env]?.trim() || void 0; + } + if (typeof globalThis.Deno !== "undefined") { + return globalThis.Deno.env?.get?.(env)?.trim() || void 0; + } + return void 0; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +function concatBytes(buffers) { + let length = 0; + for (const buffer of buffers) { + length += buffer.length; + } + const output = new Uint8Array(length); + let index = 0; + for (const buffer of buffers) { + output.set(buffer, index); + index += buffer.length; + } + return output; +} +function encodeUTF8(str2) { + let encoder4; + return (encodeUTF8_ ?? (encoder4 = new globalThis.TextEncoder(), encodeUTF8_ = encoder4.encode.bind(encoder4)))(str2); +} +function decodeUTF8(bytes2) { + let decoder3; + return (decodeUTF8_ ?? (decoder3 = new globalThis.TextDecoder(), decodeUTF8_ = decoder3.decode.bind(decoder3)))(bytes2); +} +var encodeUTF8_, decodeUTF8_; +var init_bytes = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +var fromBase64; +var init_base64 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs"() { + init_error(); + fromBase64 = (str2) => { + if (typeof globalThis.Buffer !== "undefined") { + const buf = globalThis.Buffer.from(str2, "base64"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + if (typeof atob !== "undefined") { + const bstr = atob(str2); + const buf = new Uint8Array(bstr.length); + for (let i = 0; i < bstr.length; i++) { + buf[i] = bstr.charCodeAt(i); + } + return buf; + } + throw new AnthropicError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined"); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +function noop() { +} +function makeLogFn(fnLevel, logger, logLevel) { + if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) { + return noop; + } else { + return logger[fnLevel].bind(logger); + } +} +function filterLogger(logger, logLevel) { + const cachedLogger = cachedLoggers.get(logger); + if (cachedLogger && cachedLogger[0] === logLevel) { + return cachedLogger[1]; + } + const levelLogger = { + error: makeLogFn("error", logger, logLevel), + warn: makeLogFn("warn", logger, logLevel), + info: makeLogFn("info", logger, logLevel), + debug: makeLogFn("debug", logger, logLevel) + }; + cachedLoggers.set(logger, [logLevel, levelLogger]); + return levelLogger; +} +function loggerFor(client) { + const logger = client.logger; + const logLevel = client.logLevel ?? "off"; + if (!logger) { + return noopLogger; + } + return filterLogger(logger, logLevel); +} +function defaultLogger() { + const envLevel = readEnv("ANTHROPIC_LOG"); + if (!cachedDefaultLogger || envLevel !== lastEnvLevel) { + lastEnvLevel = envLevel; + cachedDefaultLogger = filterLogger(console, parseLogLevel(envLevel, "process.env['ANTHROPIC_LOG']", filterLogger(console, defaultLogLevel)) ?? defaultLogLevel); + } + return cachedDefaultLogger; +} +function debugLogRequestDetails(logger, message, details) { + if (logger.debug === noop) { + return; + } + logger.debug(message, formatRequestDetails(details)); +} +var defaultLogLevel, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, lastEnvLevel, cachedDefaultLogger, formatRequestDetails; +var init_log = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/log.mjs"() { + init_values(); + init_env(); + defaultLogLevel = "warn"; + levelNumbers = { + off: 0, + error: 200, + warn: 300, + info: 400, + debug: 500 + }; + parseLogLevel = (maybeLevel, sourceName, logger) => { + if (!maybeLevel) { + return void 0; + } + if (hasOwn(levelNumbers, maybeLevel)) { + return maybeLevel; + } + logger.warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`); + return void 0; + }; + noopLogger = { + error: noop, + warn: noop, + info: noop, + debug: noop + }; + cachedLoggers = /* @__PURE__ */ new WeakMap(); + formatRequestDetails = (details) => { + if (details.options) { + details.options = { ...details.options }; + delete details.options["headers"]; + } + if (details.headers) { + details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value2]) => [ + name, + name.toLowerCase() === "authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value2 + ])); + } + if ("retryOfRequestLogID" in details) { + if (details.retryOfRequestLogID) { + details.retryOf = details.retryOfRequestLogID; + } + delete details.retryOfRequestLogID; + } + return details; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +var uuid4; +var init_uuid = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs"() { + uuid4 = function() { + const { crypto: crypto3 } = globalThis; + if (crypto3?.randomUUID) { + uuid4 = crypto3.randomUUID.bind(crypto3); + return crypto3.randomUUID(); + } + const u8 = new Uint8Array(1); + const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils.mjs +var init_utils2 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils.mjs"() { + init_values(); + init_base64(); + init_env(); + init_log(); + init_uuid(); + init_sleep(); + init_query(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/credentials.mjs +function validateProfileName(name) { + if (!name) { + throw new Error("profile name is empty"); + } + if (name === "." || name === "..") { + throw new Error(`profile name "${name}" is not allowed`); + } + if (name.includes("/") || name.includes("\\")) { + throw new Error(`profile name "${name}" must not contain path separators`); + } + if (!PROFILE_NAME_PATTERN.test(name)) { + throw new Error(`profile name "${name}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`); + } +} +var CREDENTIALS_FILE_VERSION, PROFILE_NAME_PATTERN, loadConfigWithSource, getCredentialsPath, getRootConfigPath, supportsLocalConfigFiles, getActiveProfileName; +var init_credentials = __esm({ + "node_modules/@anthropic-ai/sdk/core/credentials.mjs"() { + init_detect_platform(); + init_utils2(); + CREDENTIALS_FILE_VERSION = "1.0"; + PROFILE_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/; + loadConfigWithSource = async (profile) => { + var _a6, _b; + const rootConfigPath = await getRootConfigPath(); + if (rootConfigPath === null) { + return null; + } + const profileName = profile ?? await getActiveProfileName(); + if (profileName === null) { + return null; + } + validateProfileName(profileName); + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const configPath = path5.join(rootConfigPath, "configs", `${profileName}.json`); + let configRaw; + try { + configRaw = await fs3.promises.readFile(configPath, "utf-8"); + } catch (err) { + if (err?.code !== "ENOENT") { + throw new Error(`failed to read config file ${configPath}: ${err}`); + } + configRaw = null; + } + if (configRaw === null) { + const organizationId = readEnv("ANTHROPIC_ORGANIZATION_ID"); + const identityTokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + const federationRuleId = readEnv("ANTHROPIC_FEDERATION_RULE_ID"); + if (federationRuleId && organizationId) { + return { + fromFile: false, + config: { + organization_id: organizationId, + // A defaulted-but-empty CI variable (`ANTHROPIC_WORKSPACE_ID=""`) is + // treated as unset — readEnv coerces empty to undefined, and the body + // builder's truthy check skips it — so `"workspace_id": ""` never goes + // on the wire. + workspace_id: readEnv("ANTHROPIC_WORKSPACE_ID"), + base_url: readEnv("ANTHROPIC_BASE_URL"), + authentication: { + type: "oidc_federation", + federation_rule_id: federationRuleId, + service_account_id: readEnv("ANTHROPIC_SERVICE_ACCOUNT_ID"), + identity_token: identityTokenFile ? { source: "file", path: identityTokenFile } : void 0, + scope: readEnv("ANTHROPIC_SCOPE") + } + } + }; + } + return null; + } + let config2; + try { + config2 = JSON.parse(configRaw); + } catch (err) { + throw new Error(`failed to parse config file ${configPath}: ${err}`); + } + if (!config2.authentication) { + throw new Error(`config file ${configPath} is missing "authentication"`); + } + const authType = config2.authentication.type; + if (authType !== "oidc_federation" && authType !== "user_oauth") { + throw new Error(`authentication.type "${authType}" is not a known authentication type`); + } + config2.organization_id ?? (config2.organization_id = readEnv("ANTHROPIC_ORGANIZATION_ID")); + config2.workspace_id ?? (config2.workspace_id = readEnv("ANTHROPIC_WORKSPACE_ID")); + config2.base_url ?? (config2.base_url = readEnv("ANTHROPIC_BASE_URL")); + (_a6 = config2.authentication).scope ?? (_a6.scope = readEnv("ANTHROPIC_SCOPE")); + if (config2.authentication.type === "oidc_federation") { + if (!config2.authentication.identity_token) { + const identityTokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + if (identityTokenFile) { + config2.authentication.identity_token = { + source: "file", + path: identityTokenFile + }; + } + } + if (!config2.authentication.federation_rule_id) { + config2.authentication.federation_rule_id = readEnv("ANTHROPIC_FEDERATION_RULE_ID") ?? ""; + } + (_b = config2.authentication).service_account_id ?? (_b.service_account_id = readEnv("ANTHROPIC_SERVICE_ACCOUNT_ID")); + } + return { config: config2, fromFile: true }; + }; + getCredentialsPath = async (config2, profile) => { + if (config2?.authentication.credentials_path) { + return config2.authentication.credentials_path; + } + const rootConfigPath = await getRootConfigPath(); + if (!rootConfigPath) { + return null; + } + const profileName = profile ?? await getActiveProfileName(); + if (!profileName) { + return null; + } + validateProfileName(profileName); + const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + return path5.join(rootConfigPath, "credentials", `${profileName}.json`); + }; + getRootConfigPath = async () => { + if (!supportsLocalConfigFiles()) { + return null; + } + const { path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const configDir = readEnv("ANTHROPIC_CONFIG_DIR"); + if (configDir) { + return configDir; + } + const os2 = getPlatformHeaders()["X-Stainless-OS"]; + if (os2 === "Windows") { + const appData = readEnv("APPDATA"); + if (appData) { + return path5.join(appData, "Anthropic"); + } + const userProfile = readEnv("USERPROFILE"); + if (userProfile) { + return path5.join(userProfile, "AppData", "Roaming", "Anthropic"); + } + return null; + } + const xdgConfigHome = readEnv("XDG_CONFIG_HOME"); + if (xdgConfigHome) { + return path5.join(xdgConfigHome, "anthropic"); + } + const home = readEnv("HOME"); + if (home) { + return path5.join(home, ".config", "anthropic"); + } + return null; + }; + supportsLocalConfigFiles = () => { + const runtime = getPlatformHeaders()["X-Stainless-Runtime"]; + return runtime === "node" || runtime === "deno"; + }; + getActiveProfileName = async () => { + const rootConfigPath = await getRootConfigPath(); + if (!rootConfigPath) { + return null; + } + const profileName = readEnv("ANTHROPIC_PROFILE"); + if (profileName) { + return profileName; + } + const { fs: fs3, path: path5 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + const filePath = path5.join(rootConfigPath, "active_config"); + try { + return (await fs3.promises.readFile(filePath, "utf-8")).trim() || "default"; + } catch (err) { + if (err?.code !== "ENOENT") { + throw new Error(`failed to read ${filePath}: ${err}`); + } + return "default"; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +function identityTokenFromFile(path5) { + if (!path5) { + throw new AnthropicError("Identity token file path is empty"); + } + return async () => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + let content; + try { + content = await fs3.promises.readFile(path5, "utf-8"); + } catch (err) { + throw new AnthropicError(`Failed to read identity token file at ${path5}: ${err}`); + } + const token = content.trim(); + if (!token) { + throw new AnthropicError(`Identity token file at ${path5} is empty`); + } + return token; + }; +} +function identityTokenFromValue(token) { + if (!token) { + throw new AnthropicError("Identity token value is empty"); + } + return () => token; +} +var init_identity_token = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs +function oidcFederationProvider(config2) { + return async () => { + requireSecureTokenEndpoint(config2.baseURL); + const jwt = await config2.identityTokenProvider(); + if (jwt.length > 16 * 1024) { + throw new WorkloadIdentityError(`Identity token is ${Math.ceil(jwt.length / 1024)} KiB, exceeds the 16 KiB assertion limit`); + } + const body = { + grant_type: GRANT_TYPE_JWT_BEARER, + assertion: jwt, + federation_rule_id: config2.federationRuleId, + organization_id: config2.organizationId + }; + if (config2.serviceAccountId) { + body["service_account_id"] = config2.serviceAccountId; + } + if (config2.workspaceId) { + body["workspace_id"] = config2.workspaceId; + } + const url = `${config2.baseURL}${TOKEN_ENDPOINT}`; + let resp; + try { + resp = await config2.fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + "anthropic-beta": `${OAUTH_API_BETA_HEADER},${FEDERATION_BETA_HEADER}`, + "User-Agent": config2.userAgent || `anthropic-sdk-typescript/${VERSION} oidcFederationProvider` + }, + body: JSON.stringify(body) + }); + } catch (err) { + throw new WorkloadIdentityError(`Failed to reach token endpoint ${url}: ${err}`); + } + const requestId = resp.headers.get("Request-Id"); + if (!resp.ok) { + const text = await resp.text().catch(() => ""); + const redacted = redactSensitive(text); + let hint = ""; + if (resp.status === 401) { + const hintMiddle = config2.workspaceId ? "" : "If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "; + hint = ` Ensure your federation rule matches your identity token. ${hintMiddle}View your authentication events in the Workload identity page of Claude Console for more details.`; + } + throw new WorkloadIdentityError(`Token exchange failed with status ${resp.status}${requestId ? ` (request-id ${requestId})` : ""}: ${redacted}${hint}`, resp.status, redacted, requestId); + } + const data = await parseTokenResponse(resp, requestId); + const expiresIn = Number(data.expires_in); + if (!Number.isFinite(expiresIn)) { + throw new WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + return { + token: data.access_token, + expiresAt: nowAsSeconds() + expiresIn + }; + }; +} +var init_oidc_federation = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs"() { + init_types(); + init_time(); + init_version2(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +function userOAuthProvider(config2) { + return async (opts) => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + await checkCredentialsFileSafety(config2.credentialsPath, config2.onSafetyWarning); + let raw; + try { + raw = await fs3.promises.readFile(config2.credentialsPath, "utf-8"); + } catch (err) { + throw new WorkloadIdentityError(`Credentials file not found at ${config2.credentialsPath}: ${err}`); + } + let creds; + try { + creds = JSON.parse(raw); + } catch (err) { + throw new WorkloadIdentityError(`Credentials file at ${config2.credentialsPath} is not valid JSON: ${err}`); + } + const accessToken = creds.access_token; + if (!accessToken) { + throw new WorkloadIdentityError(`Credentials file at ${config2.credentialsPath} must include 'access_token'`); + } + const expiresAt = creds.expires_at; + if (!opts?.forceRefresh && (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS)) { + return { token: accessToken, expiresAt: expiresAt ?? null }; + } + const refreshToken = creds.refresh_token; + if (!config2.clientId || !refreshToken) { + throw new WorkloadIdentityError(`Access token at ${config2.credentialsPath} has expired and no refresh is available (client_id ${config2.clientId ? "set" : "empty"}, refresh_token ${refreshToken ? "set" : "empty"})`); + } + requireSecureTokenEndpoint(config2.baseURL); + const body = { + grant_type: GRANT_TYPE_REFRESH_TOKEN, + refresh_token: refreshToken, + client_id: config2.clientId + }; + const url = `${config2.baseURL}${TOKEN_ENDPOINT}`; + let resp; + try { + resp = await config2.fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + "anthropic-beta": OAUTH_API_BETA_HEADER, + "User-Agent": config2.userAgent || `anthropic-sdk-typescript/${VERSION} userOAuthProvider` + }, + body: JSON.stringify(body) + }); + } catch (err) { + throw new WorkloadIdentityError(`User OAuth refresh failed to reach token endpoint: ${err}`); + } + const requestId = resp.headers.get("Request-Id"); + if (!resp.ok) { + const text = await resp.text().catch(() => ""); + throw new WorkloadIdentityError(`User OAuth refresh failed (HTTP ${resp.status}): ${redactSensitive(text)}`, resp.status, redactSensitive(text), requestId); + } + const data = await parseTokenResponse(resp, requestId); + const expiresIn = Number(data.expires_in); + if (!Number.isFinite(expiresIn)) { + throw new WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); + } + const newExpiresAt = nowAsSeconds() + expiresIn; + const newRefreshToken = data.refresh_token || refreshToken; + await writeCredentialsFileAtomic(config2.credentialsPath, { + ...creds, + version: CREDENTIALS_FILE_VERSION, + type: "oauth_token", + access_token: data.access_token, + expires_at: newExpiresAt, + refresh_token: newRefreshToken + }); + return { token: data.access_token, expiresAt: newExpiresAt }; + }; +} +var init_user_oauth = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs"() { + init_credentials(); + init_types(); + init_time(); + init_version2(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +function resolveCredentialsFromConfig(config2, options) { + const credentialsPath = config2.authentication.credentials_path ?? null; + const effectiveBaseURL = (config2.base_url || options.baseURL).replace(/\/+$/, ""); + const provider2 = buildProvider(config2, credentialsPath, effectiveBaseURL, options); + const extraHeaders = {}; + if (config2.workspace_id && config2.authentication.type === "user_oauth") { + extraHeaders["anthropic-workspace-id"] = config2.workspace_id; + } + return { provider: provider2, extraHeaders, baseURL: config2.base_url || void 0 }; +} +async function defaultCredentials(options, profile) { + const loaded = await loadConfigWithSource(profile); + if (!loaded) { + return null; + } + const { config: config2, fromFile } = loaded; + const withPath = config2.authentication.credentials_path || !fromFile ? config2 : { + ...config2, + authentication: { + ...config2.authentication, + credentials_path: await getCredentialsPath(config2, profile) ?? void 0 + } + }; + return resolveCredentialsFromConfig(withPath, options); +} +function buildProvider(config2, credentialsPath, baseURL, options) { + switch (config2.authentication.type) { + case "oidc_federation": { + const auth = config2.authentication; + const identityProvider = resolveIdentityTokenProvider(auth); + if (!identityProvider) { + throw new WorkloadIdentityError("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)"); + } + if (!auth.federation_rule_id) { + throw new WorkloadIdentityError("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence)."); + } + if (!config2.organization_id) { + throw new WorkloadIdentityError("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)"); + } + const exchange = oidcFederationProvider({ + identityTokenProvider: identityProvider, + federationRuleId: auth.federation_rule_id, + organizationId: config2.organization_id, + serviceAccountId: auth.service_account_id, + workspaceId: config2.workspace_id, + baseURL, + fetch: options.fetch, + userAgent: options.userAgent + }); + if (credentialsPath) { + return cachedExchangeProvider(exchange, credentialsPath, options.onCacheWriteError, options.onSafetyWarning); + } + return exchange; + } + case "user_oauth": { + if (!credentialsPath) { + throw new WorkloadIdentityError("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)"); + } + return userOAuthProvider({ + credentialsPath, + clientId: config2.authentication.client_id, + baseURL, + fetch: options.fetch, + userAgent: options.userAgent, + onSafetyWarning: options.onSafetyWarning + }); + } + default: { + const t = config2.authentication.type; + throw new WorkloadIdentityError(`authentication.type "${t}" is not a known authentication type`); + } + } +} +function resolveIdentityTokenProvider(auth) { + if (auth.identity_token) { + const source = auth.identity_token.source; + if (source !== "file") { + throw new WorkloadIdentityError(`identity_token.source "${source}" is not supported by this SDK version (only "file")`); + } + if (!auth.identity_token.path) { + throw new WorkloadIdentityError(`identity_token.source "file" requires a non-empty path`); + } + return identityTokenFromFile(auth.identity_token.path); + } + const tokenFile = readEnv("ANTHROPIC_IDENTITY_TOKEN_FILE"); + if (tokenFile) { + return identityTokenFromFile(tokenFile); + } + const tokenValue = readEnv("ANTHROPIC_IDENTITY_TOKEN"); + if (tokenValue) { + return identityTokenFromValue(tokenValue); + } + return null; +} +function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) { + return async (opts) => { + const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); + await checkCredentialsFileSafety(credentialsPath, onSafetyWarning); + let existing; + try { + const raw = await fs3.promises.readFile(credentialsPath, "utf-8"); + existing = JSON.parse(raw); + const token = existing?.["access_token"]; + if (token && !opts?.forceRefresh) { + const expiresAt = existing?.["expires_at"]; + if (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { + return { token, expiresAt: expiresAt ?? null }; + } + } + } catch (err) { + const code = err?.code; + if (code !== "ENOENT" && !(err instanceof SyntaxError)) { + onCacheWriteError?.(err); + } + } + const result = await exchange(opts); + try { + await writeCredentialsFileAtomic(credentialsPath, { + ...existing ?? {}, + version: CREDENTIALS_FILE_VERSION, + type: "oauth_token", + access_token: result.token, + expires_at: result.expiresAt + }); + } catch (err) { + onCacheWriteError?.(err); + } + return result; + }; +} +var init_credential_chain = __esm({ + "node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs"() { + init_env(); + init_credentials(); + init_types(); + init_time(); + init_identity_token(); + init_oidc_federation(); + init_user_oauth(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +function findNewlineIndex(buffer, startIndex) { + const newline = 10; + const carriage = 13; + for (let i = startIndex ?? 0; i < buffer.length; i++) { + if (buffer[i] === newline) { + return { preceding: i, index: i + 1, carriage: false }; + } + if (buffer[i] === carriage) { + return { preceding: i, index: i + 1, carriage: true }; + } + } + return null; +} +var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex, LineDecoder; +var init_line = __esm({ + "node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs"() { + init_tslib(); + init_bytes(); + LineDecoder = /* @__PURE__ */ (() => { + class LineDecoder3 { + constructor() { + _LineDecoder_buffer.set(this, void 0); + _LineDecoder_carriageReturnIndex.set(this, void 0); + __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + } + decode(chunk) { + if (chunk == null) { + return []; + } + const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? encodeUTF8(chunk) : chunk; + __classPrivateFieldSet(this, _LineDecoder_buffer, concatBytes([__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), binaryChunk]), "f"); + const lines2 = []; + let patternIndex; + while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { + if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) { + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); + continue; + } + if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { + lines2.push(decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1))); + __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + continue; + } + const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; + const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, endIndex)); + lines2.push(line); + __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(patternIndex.index), "f"); + __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + } + return lines2; + } + flush() { + if (!__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { + return []; + } + return this.decode("\n"); + } + } + _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); + LineDecoder3.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); + LineDecoder3.NEWLINE_REGEXP = /\r\n|[\n\r]/g; + return LineDecoder3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/streaming.mjs +async function* _iterSSEMessages(response, controller) { + if (!response.body) { + controller.abort(); + if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { + throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); + } + throw new AnthropicError(`Attempted to iterate over a response with no body`); + } + const sseDecoder = new SSEDecoder(); + const lineDecoder = new LineDecoder(); + const iter = ReadableStreamToAsyncIterable(response.body); + for await (const chunk of iter) { + for (const line of lineDecoder.decode(chunk)) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; + } + } + for (const line of lineDecoder.flush()) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; + } +} +function partition(str2, delimiter) { + const index = str2.indexOf(delimiter); + if (index !== -1) { + return [str2.substring(0, index), delimiter, str2.substring(index + delimiter.length)]; + } + return [str2, "", ""]; +} +var _Stream_client, Stream, SSEDecoder; +var init_streaming = __esm({ + "node_modules/@anthropic-ai/sdk/core/streaming.mjs"() { + init_tslib(); + init_error(); + init_shims(); + init_line(); + init_shims(); + init_errors(); + init_values(); + init_bytes(); + init_log(); + init_error(); + init_request_signal(); + Stream = /* @__PURE__ */ (() => { + class Stream3 { + constructor(iterator, controller, client) { + this.iterator = iterator; + _Stream_client.set(this, void 0); + this.controller = controller; + __classPrivateFieldSet(this, _Stream_client, client, "f"); + } + /** + * Iterate the raw Server-Sent Events from `response` — `{event, data, raw}` + * objects, before any JSON parsing or event-name filtering. + * + * This reads `response.body` directly (not a clone), so the response is + * consumed. Use this in middleware that fully replaces the stream body; for + * read-only observation of parsed events, use `ctx.parse()` instead. + */ + static rawEvents(response, controller = new AbortController()) { + return _iterSSEMessages(response, controller); + } + static fromSSEResponse(response, controller, client) { + let consumed = false; + const logger = client ? loggerFor(client) : console; + async function* iterator() { + if (consumed) { + throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const sse of _iterSSEMessages(response, controller)) { + if (sse.event === "completion") { + try { + yield JSON.parse(sse.data); + } catch (e) { + logger.error(`Could not parse message into JSON:`, sse.data); + logger.error(`From chunk:`, sse.raw); + throw e; + } + } + if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop" || sse.event === "message" || sse.event === "user.message" || sse.event === "user.interrupt" || sse.event === "user.tool_confirmation" || sse.event === "user.custom_tool_result" || sse.event === "user.tool_result" || sse.event === "agent.message" || sse.event === "agent.thinking" || sse.event === "agent.tool_use" || sse.event === "agent.tool_result" || sse.event === "agent.mcp_tool_use" || sse.event === "agent.mcp_tool_result" || sse.event === "agent.custom_tool_use" || sse.event === "agent.thread_context_compacted" || sse.event === "session.status_running" || sse.event === "session.status_idle" || sse.event === "session.status_rescheduled" || sse.event === "session.status_terminated" || sse.event === "session.error" || sse.event === "session.deleted" || sse.event === "session.updated" || sse.event === "span.model_request_start" || sse.event === "span.model_request_end" || sse.event === "span.outcome_evaluation_start" || sse.event === "span.outcome_evaluation_ongoing" || sse.event === "span.outcome_evaluation_end" || sse.event === "user.define_outcome" || sse.event === "agent.thread_message_received" || sse.event === "agent.thread_message_sent" || sse.event === "agent.session_thread_message_received" || sse.event === "agent.session_thread_message_sent" || sse.event === "session.thread_created" || sse.event === "session.thread_status_created" || sse.event === "session.thread_status_running" || sse.event === "session.thread_status_idle" || sse.event === "session.thread_status_rescheduled" || sse.event === "session.thread_status_terminated" || sse.event === "event_start" || sse.event === "event_delta" || sse.event === "system.message") { + try { + yield JSON.parse(sse.data); + } catch (e) { + logger.error(`Could not parse message into JSON:`, sse.data); + logger.error(`From chunk:`, sse.raw); + throw e; + } + } + if (sse.event === "ping") { + continue; + } + if (sse.event === "error") { + const body = safeJSON(sse.data) ?? sse.data; + const type = body?.error?.type; + throw new APIError(void 0, body, void 0, response.headers, type); + } + } + done = true; + } catch (e) { + if (isAbortError(e)) + return; + throw e; + } finally { + if (!done) + controller.abort(); + releaseRequestSignal(controller); + } + } + return new Stream3(iterator, controller, client); + } + /** + * Generates a Stream from a newline-separated ReadableStream + * where each item is a JSON value. + */ + static fromReadableStream(readableStream, controller, client) { + let consumed = false; + async function* iterLines() { + const lineDecoder = new LineDecoder(); + const iter = ReadableStreamToAsyncIterable(readableStream); + for await (const chunk of iter) { + for (const line of lineDecoder.decode(chunk)) { + yield line; + } + } + for (const line of lineDecoder.flush()) { + yield line; + } + } + async function* iterator() { + if (consumed) { + throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const line of iterLines()) { + if (done) + continue; + if (line) + yield JSON.parse(line); + } + done = true; + } catch (e) { + if (isAbortError(e)) + return; + throw e; + } finally { + if (!done) + controller.abort(); + releaseRequestSignal(controller); + } + } + return new Stream3(iterator, controller, client); + } + [(_Stream_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + return this.iterator(); + } + /** + * Splits the stream into two streams which can be + * independently read from at different speeds. + */ + tee() { + const left = []; + const right = []; + const iterator = this.iterator(); + const teeIterator = (queue) => { + return { + next: () => { + if (queue.length === 0) { + const result = iterator.next(); + left.push(result); + right.push(result); + } + return queue.shift(); + } + }; + }; + return [ + new Stream3(() => teeIterator(left), this.controller, __classPrivateFieldGet(this, _Stream_client, "f")), + new Stream3(() => teeIterator(right), this.controller, __classPrivateFieldGet(this, _Stream_client, "f")) + ]; + } + /** + * Converts this stream to a newline-separated ReadableStream of + * JSON stringified values in the stream + * which can be turned back into a Stream with `Stream.fromReadableStream()`. + */ + toReadableStream() { + const self = this; + let iter; + return makeReadableStream({ + async start() { + iter = self[Symbol.asyncIterator](); + }, + async pull(ctrl) { + try { + const { value: value2, done } = await iter.next(); + if (done) + return ctrl.close(); + const bytes2 = encodeUTF8(JSON.stringify(value2) + "\n"); + ctrl.enqueue(bytes2); + } catch (err) { + ctrl.error(err); + } + }, + async cancel() { + await iter.return?.(); + } + }); + } + } + return Stream3; + })(); + SSEDecoder = class { + constructor() { + this.event = null; + this.data = []; + this.chunks = []; + } + decode(line) { + if (line.endsWith("\r")) { + line = line.substring(0, line.length - 1); + } + if (!line) { + if (!this.event && !this.data.length) + return null; + const sse = { + event: this.event, + data: this.data.join("\n"), + raw: this.chunks + }; + this.event = null; + this.data = []; + this.chunks = []; + return sse; + } + this.chunks.push(line); + if (line.startsWith(":")) { + return null; + } + let [fieldname, _, value2] = partition(line, ":"); + if (value2.startsWith(" ")) { + value2 = value2.substring(1); + } + if (fieldname === "event") { + this.event = value2; + } else if (fieldname === "data") { + this.data.push(value2); + } + return null; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/parse.mjs +async function defaultParseResponse(client, props) { + const { response, requestLogID, retryOfRequestLogID, startTime } = props; + const body = await (async () => { + if (props.options.stream) { + loggerFor(client).debug("response", response.status, response.url, response.headers, response.body); + return Stream.fromSSEResponse(response, props.controller, client); + } + if (response.status === 204) { + return null; + } + if (props.options.__binaryResponse) { + return response; + } + const contentType = response.headers.get("content-type"); + const mediaType = contentType?.split(";")[0]?.trim(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + const contentLength = response.headers.get("content-length"); + if (contentLength === "0") { + return void 0; + } + const json = await response.json(); + return addResponseIDs(json, response); + } + const text = await response.text(); + return text; + })().finally(() => { + if (!props.options.stream && !props.options.__binaryResponse) { + releaseRequestSignal(props.controller); + } + }); + debugLogRequestDetails(loggerFor(client), `[${requestLogID}] response parsed`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + body, + durationMs: Date.now() - startTime + }); + return body; +} +function addResponseIDs(value2, response) { + if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) { + return value2; + } + return Object.defineProperties(value2, { + _request_id: { value: response.headers.get("request-id"), enumerable: false }, + _workspace_id: { value: response.headers.get("anthropic-workspace-id"), enumerable: false } + }); +} +var init_parse = __esm({ + "node_modules/@anthropic-ai/sdk/internal/parse.mjs"() { + init_streaming(); + init_log(); + init_request_signal(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/middleware.mjs +function isFetchOriginError(err) { + return typeof err === "object" && err !== null && fetchOriginErrors.has(err); +} +function isRetryableError(err) { + const seen = /* @__PURE__ */ new Set(); + while (typeof err === "object" && err !== null && !seen.has(err)) { + seen.add(err); + if (isFetchOriginError(err) || isAbortError(err) || err instanceof APIConnectionError || err instanceof RetryableError) { + return true; + } + err = err.cause; + } + return false; +} +function wrapFetchWithMiddleware(fetchFn, middleware, options, client) { + return async (url, init = {}) => { + if (middleware.length === 0) { + return fetchFn.call(void 0, url, init); + } + const headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); + const response = await applyMiddleware(fetchFn, middleware, options, client)({ + ...init, + headers, + url: typeof url === "string" ? url : url instanceof URL ? url.href : url.url + }); + if (response.bodyUsed || response.body?.locked) { + throw new AnthropicError("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it"); + } + return response; + }; +} +function createMiddlewareContext(options, client) { + const cache = /* @__PURE__ */ new WeakMap(); + return { + options, + // Resolved per chain, so changes to the client's `logLevel`/`logger` + // apply to subsequent requests. + logger: client ? loggerFor(client) : defaultLogger(), + parse(response) { + if (options?.stream && response.ok) { + return parseMiddlewareResponse(response, options, client); + } + let parsed = cache.get(response); + if (!parsed) { + parsed = parseMiddlewareResponse(response, options, client); + cache.set(response, parsed); + } + return parsed; + } + }; +} +async function parseMiddlewareResponse(response, options, client) { + if (response.bodyUsed || response.body?.locked) { + throw new AnthropicError("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()"); + } + if (options?.stream && response.ok) { + return Stream.fromSSEResponse(response.clone(), new AbortController(), client); + } + if (response.status === 204) { + return null; + } + if (options?.__binaryResponse) { + return response; + } + const contentType = response.headers.get("content-type"); + const mediaType = contentType?.split(";")[0]?.trim(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + if (response.headers.get("content-length") === "0") { + return void 0; + } + return addResponseIDs(await response.clone().json(), response); + } + return await response.clone().text(); +} +function applyMiddleware(fetchFn, middleware, options, client) { + let next = async ({ url, ...init }) => { + try { + return await fetchFn.call(void 0, url, init); + } catch (err) { + const error = castToError(err); + fetchOriginErrors.add(error); + throw error; + } + }; + const ctx = createMiddlewareContext(options, client); + for (let i = middleware.length - 1; i >= 0; i--) { + const mw = middleware[i]; + const nextInner = next; + next = async (request2) => mw(request2, nextInner, ctx); + } + return next; +} +var fetchOriginErrors; +var init_middleware = __esm({ + "node_modules/@anthropic-ai/sdk/core/middleware.mjs"() { + init_errors(); + init_parse(); + init_log(); + init_error(); + init_streaming(); + fetchOriginErrors = /* @__PURE__ */ new WeakSet(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/api-promise.mjs +var _APIPromise_client, APIPromise; +var init_api_promise = __esm({ + "node_modules/@anthropic-ai/sdk/core/api-promise.mjs"() { + init_tslib(); + init_parse(); + APIPromise = /* @__PURE__ */ (() => { + class APIPromise3 extends Promise { + constructor(client, responsePromise, parseResponse2 = defaultParseResponse) { + super((resolve2) => { + resolve2(null); + }); + this.responsePromise = responsePromise; + this.parseResponse = parseResponse2; + _APIPromise_client.set(this, void 0); + __classPrivateFieldSet(this, _APIPromise_client, client, "f"); + } + _thenUnwrap(transform) { + return new APIPromise3(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addResponseIDs(transform(await this.parseResponse(client, props), props), props.response)); + } + /** + * Gets the raw `Response` instance instead of parsing the response + * data. + * + * If you want to parse the response body but still get the `Response` + * instance, you can use {@link withResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + asResponse() { + return this.responsePromise.then((p) => p.response); + } + /** + * Gets the parsed response data, the raw `Response` instance and the ID of the request, + * returned via the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * If you just want to get the raw `Response` instance without parsing it, + * you can use {@link asResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + async withResponse() { + const [data, response] = await Promise.all([this.parse(), this.asResponse()]); + return { + data, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + parse() { + if (!this.parsedPromise) { + this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); + } + return this.parsedPromise; + } + then(onfulfilled, onrejected) { + return this.parse().then(onfulfilled, onrejected); + } + catch(onrejected) { + return this.parse().catch(onrejected); + } + finally(onfinally) { + return this.parse().finally(onfinally); + } + } + _APIPromise_client = /* @__PURE__ */ new WeakMap(); + return APIPromise3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/core/pagination.mjs +var _AbstractPage_client, AbstractPage, PagePromise, Page, PageCursor, BidirectionalPageCursor; +var init_pagination = __esm({ + "node_modules/@anthropic-ai/sdk/core/pagination.mjs"() { + init_tslib(); + init_error(); + init_parse(); + init_api_promise(); + init_values(); + AbstractPage = /* @__PURE__ */ (() => { + class AbstractPage3 { + constructor(client, response, body, options) { + _AbstractPage_client.set(this, void 0); + __classPrivateFieldSet(this, _AbstractPage_client, client, "f"); + this.options = options; + this.response = response; + this.body = body; + } + hasNextPage() { + const items = this.getPaginatedItems(); + if (!items.length) + return false; + return this.nextPageRequestOptions() != null; + } + async getNextPage() { + const nextOptions = this.nextPageRequestOptions(); + if (!nextOptions) { + throw new AnthropicError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); + } + return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + } + async *iterPages() { + let page2 = this; + yield page2; + while (page2.hasNextPage()) { + page2 = await page2.getNextPage(); + yield page2; + } + } + async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + for await (const page2 of this.iterPages()) { + for (const item of page2.getPaginatedItems()) { + yield item; + } + } + } + } + return AbstractPage3; + })(); + PagePromise = /* @__PURE__ */ (() => { + class PagePromise3 extends APIPromise { + constructor(client, request2, Page3) { + super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse(client2, props), props.options)); + } + /** + * Allow auto-paginating iteration on an unawaited list call, eg: + * + * for await (const item of client.items.list()) { + * console.log(item) + * } + */ + async *[Symbol.asyncIterator]() { + const page2 = await this; + for await (const item of page2) { + yield item; + } + } + } + return PagePromise3; + })(); + Page = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.has_more = body.has_more || false; + this.first_id = body.first_id || null; + this.last_id = body.last_id || null; + } + getPaginatedItems() { + return this.data ?? []; + } + hasNextPage() { + if (this.has_more === false) { + return false; + } + return super.hasNextPage(); + } + nextPageRequestOptions() { + if (this.options.query?.["before_id"]) { + const first_id = this.first_id; + if (!first_id) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + before_id: first_id + } + }; + } + const cursor = this.last_id; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + after_id: cursor + } + }; + } + }; + PageCursor = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.next_page = body.next_page || null; + } + getPaginatedItems() { + return this.data ?? []; + } + nextPageRequestOptions() { + const cursor = this.next_page; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + page: cursor + } + }; + } + }; + BidirectionalPageCursor = class extends AbstractPage { + constructor(client, response, body, options) { + super(client, response, body, options); + this.data = body.data || []; + this.next_page = body.next_page || null; + this.prev_page = body.prev_page || null; + } + getPaginatedItems() { + return this.data ?? []; + } + nextPageRequestOptions() { + const cursor = this.next_page; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + page: cursor + } + }; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/uploads.mjs +function makeFile(fileBits, fileName, options) { + checkFileSupport(); + return new File(fileBits, fileName ?? "", options); +} +function getName(value2, stripPath) { + const val = typeof value2 === "object" && value2 !== null && ("name" in value2 && value2.name && String(value2.name) || "url" in value2 && value2.url && String(value2.url) || "filename" in value2 && value2.filename && String(value2.filename) || "path" in value2 && value2.path && String(value2.path)) || ""; + return stripPath ? val.split(/[\\/]/).pop() || void 0 : val; +} +function supportsFormData(fetchObject) { + const fetch3 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; + const cached = supportsFormDataMap.get(fetch3); + if (cached) + return cached; + const promise = (async () => { + try { + const FetchResponse = "Response" in fetch3 ? fetch3.Response : (await fetch3("data:,")).constructor; + const data = new FormData(); + if (data.toString() === await new FetchResponse(data).text()) { + return false; + } + return true; + } catch { + return true; + } + })(); + supportsFormDataMap.set(fetch3, promise); + return promise; +} +var checkFileSupport, isAsyncIterable, multipartFormRequestOptions, supportsFormDataMap, createForm, addFormValue; +var init_uploads = __esm({ + "node_modules/@anthropic-ai/sdk/internal/uploads.mjs"() { + init_shims(); + checkFileSupport = () => { + if (typeof File === "undefined") { + const { process: process2 } = globalThis; + const isOldNode = typeof process2?.versions?.node === "string" && parseInt(process2.versions.node.split(".")) < 20; + throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : "")); + } + }; + isAsyncIterable = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; + multipartFormRequestOptions = async (opts, fetch3, stripFilenames = true) => { + return { ...opts, body: await createForm(opts.body, fetch3, stripFilenames) }; + }; + supportsFormDataMap = /* @__PURE__ */ new WeakMap(); + createForm = async (body, fetch3, stripFilenames = true) => { + if (!await supportsFormData(fetch3)) { + throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); + } + const form = new FormData(); + await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue(form, key, value2, stripFilenames))); + return form; + }; + addFormValue = async (form, key, value2, stripFilenames) => { + if (value2 === void 0) + return; + if (value2 == null) { + throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); + } + if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean") { + form.append(key, String(value2)); + } else if (value2 instanceof Response) { + let options = {}; + const contentType = value2.headers.get("Content-Type"); + if (contentType) { + options = { type: contentType }; + } + form.append(key, makeFile([await value2.blob()], getName(value2, stripFilenames), options)); + } else if (isAsyncIterable(value2)) { + form.append(key, makeFile([await new Response(ReadableStreamFrom(value2)).blob()], getName(value2, stripFilenames))); + } else if (value2 instanceof Blob) { + const isFile = typeof File !== "undefined" && value2 instanceof File; + const name = isFile ? value2.name : getName(value2, stripFilenames); + form.append(key, makeFile([value2], name, { type: value2.type })); + } else if (Array.isArray(value2)) { + await Promise.all(value2.map((entry2) => addFormValue(form, key + "[]", entry2, stripFilenames))); + } else if (typeof value2.then === "function") { + throw new TypeError(`Received a Promise for "${key}"; await it first, e.g. \`await toFile(...)\``); + } else if (value2 instanceof ArrayBuffer || ArrayBuffer.isView(value2)) { + throw new TypeError(`Received ${value2.constructor.name} for "${key}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``); + } else if (typeof value2 === "object") { + await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop, stripFilenames))); + } else { + throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/to-file.mjs +async function toFile(value2, name, options) { + checkFileSupport(); + value2 = await value2; + name || (name = value2 instanceof File ? value2.name : getName(value2, true)); + if (isFileLike(value2)) { + if (value2 instanceof File && name == null && options == null) { + return value2; + } + return makeFile([await value2.arrayBuffer()], name ?? value2.name, { + type: value2.type, + lastModified: value2.lastModified, + ...options + }); + } + if (isResponseLike(value2)) { + const blob = await value2.blob(); + name || (name = new URL(value2.url).pathname.split(/[\\/]/).pop()); + return makeFile(await getBytes(blob), name, options); + } + const parts = await getBytes(value2); + if (!options?.type) { + const type = parts.find((part) => typeof part === "object" && "type" in part && part.type); + if (typeof type === "string") { + options = { ...options, type }; + } + } + return makeFile(parts, name, options); +} +async function getBytes(value2) { + let parts = []; + if (typeof value2 === "string" || ArrayBuffer.isView(value2) || // includes Uint8Array, Buffer, etc. + value2 instanceof ArrayBuffer) { + parts.push(value2); + } else if (isBlobLike(value2)) { + parts.push(value2 instanceof Blob ? value2 : await value2.arrayBuffer()); + } else if (isAsyncIterable(value2)) { + for await (const chunk of value2) { + parts.push(...await getBytes(chunk)); + } + } else { + const constructor = value2?.constructor?.name; + throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError(value2)}`); + } + return parts; +} +function propsForError(value2) { + if (typeof value2 !== "object" || value2 === null) + return ""; + const props = Object.getOwnPropertyNames(value2); + return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; +} +var isBlobLike, isFileLike, isResponseLike; +var init_to_file = __esm({ + "node_modules/@anthropic-ai/sdk/internal/to-file.mjs"() { + init_uploads(); + init_uploads(); + isBlobLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; + isFileLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike(value2); + isResponseLike = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; + } +}); + +// node_modules/@anthropic-ai/sdk/core/uploads.mjs +var init_uploads2 = __esm({ + "node_modules/@anthropic-ai/sdk/core/uploads.mjs"() { + init_to_file(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/shared.mjs +var init_shared = __esm({ + "node_modules/@anthropic-ai/sdk/resources/shared.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/core/resource.mjs +var APIResource; +var init_resource = __esm({ + "node_modules/@anthropic-ai/sdk/core/resource.mjs"() { + APIResource = class { + constructor(client) { + this._client = client; + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/headers.mjs +function* iterateHeaders(headers) { + if (!headers) + return; + if (brand_privateNullableHeaders in headers) { + const { values, nulls } = headers; + yield* values.entries(); + for (const name of nulls) { + yield [name, null]; + } + return; + } + let shouldClear = false; + let iter; + if (headers instanceof Headers) { + iter = headers.entries(); + } else if (isReadonlyArray(headers)) { + iter = headers; + } else { + shouldClear = true; + iter = Object.entries(headers ?? {}); + } + for (let row of iter) { + const name = row[0]; + if (typeof name !== "string") + throw new TypeError("expected header name to be a string"); + const values = isReadonlyArray(row[1]) ? row[1] : [row[1]]; + let didClear = false; + for (const value2 of values) { + if (value2 === void 0) + continue; + if (shouldClear && !didClear) { + didClear = true; + yield [name, clearSentinel]; + } + yield [name, value2]; + } + } +} +var brand_privateNullableHeaders, clearSentinel, APPEND_HEADERS, appendHeaderValue, buildHeaders; +var init_headers = __esm({ + "node_modules/@anthropic-ai/sdk/internal/headers.mjs"() { + init_values(); + brand_privateNullableHeaders = /* @__PURE__ */ Symbol.for("brand.privateNullableHeaders"); + clearSentinel = /* @__PURE__ */ Symbol("clear"); + APPEND_HEADERS = /* @__PURE__ */ new Set(["x-stainless-helper"]); + appendHeaderValue = (existing, addition) => { + const tokens = existing ? existing.split(",").map((t) => t.trim()).filter(Boolean) : []; + for (const tok of addition.split(",").map((t) => t.trim())) { + if (tok && !tokens.includes(tok)) + tokens.push(tok); + } + return tokens.join(", "); + }; + buildHeaders = (newHeaders) => { + const targetHeaders = new Headers(); + const nullHeaders = /* @__PURE__ */ new Set(); + for (const headers of newHeaders) { + const seenHeaders = /* @__PURE__ */ new Set(); + for (const [name, value2] of iterateHeaders(headers)) { + const lowerName = name.toLowerCase(); + if (APPEND_HEADERS.has(lowerName)) { + if (value2 === clearSentinel) + continue; + if (value2 === null) { + targetHeaders.delete(name); + nullHeaders.add(lowerName); + } else { + targetHeaders.set(name, appendHeaderValue(targetHeaders.get(name), value2)); + nullHeaders.delete(lowerName); + } + continue; + } + if (value2 === clearSentinel || !seenHeaders.has(lowerName)) { + targetHeaders.delete(name); + seenHeaders.add(lowerName); + if (value2 === clearSentinel) + continue; + } + if (value2 === null) { + targetHeaders.delete(name); + nullHeaders.add(lowerName); + } else { + targetHeaders.append(name, value2); + nullHeaders.delete(lowerName); + } + } + } + return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders }; + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +function encodeURIPath(str2) { + return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); +} +var EMPTY, createPathTagFunction, path2; +var init_path = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() { + init_error(); + EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + createPathTagFunction = (pathEncoder = encodeURIPath) => function path5(statics, ...params) { + if (statics.length === 1) + return statics[0]; + let postPath = false; + const invalidSegments = []; + const path6 = statics.reduce((previousValue, currentValue, index) => { + if (/[?#]/.test(currentValue)) { + postPath = true; + } + const value2 = params[index]; + let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value2); + if (index !== params.length && (value2 == null || typeof value2 === "object" && // handle values from other realms + value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY) ?? EMPTY)?.toString)) { + encoded = value2 + ""; + invalidSegments.push({ + start: previousValue.length + currentValue.length, + length: encoded.length, + error: `Value of type ${Object.prototype.toString.call(value2).slice(8, -1)} is not a valid path parameter` + }); + } + return previousValue + currentValue + (index === params.length ? "" : encoded); + }, ""); + const pathOnly = path6.split(/[?#]/, 1)[0]; + const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; + let match; + while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { + invalidSegments.push({ + start: match.index, + length: match[0].length, + error: `Value "${match[0]}" can't be safely passed as a path parameter` + }); + } + invalidSegments.sort((a, b) => a.start - b.start); + if (invalidSegments.length > 0) { + let lastEnd = 0; + const underline = invalidSegments.reduce((acc, segment) => { + const spaces = " ".repeat(segment.start - lastEnd); + const arrows = "^".repeat(segment.length); + lastEnd = segment.start + segment.length; + return acc + spaces + arrows; + }, ""); + throw new AnthropicError(`Path parameters result in path with invalid segments: +${invalidSegments.map((e) => e.error).join("\n")} +${path6} +${underline}`); + } + return path6; + }; + path2 = /* @__PURE__ */ createPathTagFunction(encodeURIPath); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +var DeploymentRuns; +var init_deployment_runs = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + DeploymentRuns = class extends APIResource { + /** + * Get Deployment Run + * + * @example + * ```ts + * const betaManagedAgentsDeploymentRun = + * await client.beta.deploymentRuns.retrieve( + * 'deployment_run_id', + * ); + * ``` + */ + retrieve(deploymentRunID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/deployment_runs/${deploymentRunID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Deployment Runs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsDeploymentRun of client.beta.deploymentRuns.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/deployment_runs?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +var Deployments; +var init_deployments = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Deployments = class extends APIResource { + /** + * Create Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.create({ + * agent: 'string', + * environment_id: 'x', + * initial_events: [ + * { + * content: [ + * { + * text: 'Where is my order #1234?', + * type: 'text', + * }, + * ], + * type: 'user.message', + * }, + * ], + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/deployments?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.retrieve( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + retrieve(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/deployments/${deploymentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.update( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + update(deploymentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/deployments/${deploymentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Deployments + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsDeployment of client.beta.deployments.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/deployments?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.archive( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + archive(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Pause Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.pause( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + pause(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/pause?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Run Deployment Now + * + * @example + * ```ts + * const betaManagedAgentsDeploymentRun = + * await client.beta.deployments.run( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + run(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/run?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Unpause Deployment + * + * @example + * ```ts + * const betaManagedAgentsDeployment = + * await client.beta.deployments.unpause( + * 'depl_011CZkZcDH3vPqd7xnEfwTai', + * ); + * ``` + */ + unpause(deploymentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/deployments/${deploymentID}/unpause?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +var Dreams; +var init_dreams = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Dreams = class extends APIResource { + /** + * Start an asynchronous job that uses past sessions to produce a reorganized + * version of a memory store and get back the dream to poll for the result. + * + * By default the dream writes its result to a new memory store and doesn't change + * the input memory store. The response has `status` set to `pending` and an empty + * `outputs` array. Poll the dream until `status` is `completed`, `failed`, or + * `canceled`. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#create-a-dream) + * to learn more about creating dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.create({ + * inputs: [{ memory_store_id: 'x', type: 'memory_store' }], + * model: 'string', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/dreams?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get a dream by ID to check its status, output memory store, and token usage. + * + * Archived dreams are returned too. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#track-progress) + * for how to poll a dream and what each status means. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.retrieve( + * 'dream_id', + * ); + * ``` + */ + retrieve(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/dreams/${dreamID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List the dreams in the workspace, newest first. + * + * Archived dreams are left out unless `include_archived` is `true`. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#list-dreams) + * for how to page through dreams. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaDream of client.beta.dreams.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/dreams?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Hide a `completed`, `failed`, or `canceled` dream from the default list of + * dreams. + * + * Archiving a `pending` or `running` dream returns a 400 error, so cancel it + * first. Archiving an archived dream returns it unchanged. An archived dream can + * still be fetched by ID. Archiving can't be undone. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#archive-a-dream) + * to learn more about archiving dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.archive( + * 'dream_id', + * ); + * ``` + */ + archive(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/dreams/${dreamID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stop a `pending` or `running` dream. + * + * The response shows `status` as `canceled`, unless the dream reached `completed` + * or `failed` first. `usage` can keep changing after the response. Canceling a + * `canceled` dream returns it unchanged. Canceling a `completed` or `failed` dream + * returns a 400 error. + * + * See the + * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#cancel-a-dream) + * to learn more about canceling dreams. + * + * @example + * ```ts + * const betaDream = await client.beta.dreams.cancel( + * 'dream_id', + * ); + * ``` + */ + cancel(dreamID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/dreams/${dreamID}/cancel?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs +function helperHeader(value2) { + return { [STAINLESS_HELPER_HEADER]: value2 }; +} +function wasCreatedByStainlessHelper(value2) { + return typeof value2 === "object" && value2 !== null && SDK_HELPER_SYMBOL in value2; +} +function collectStainlessHelpers(tools, messages) { + const helpers = /* @__PURE__ */ new Set(); + if (tools) { + for (const tool of tools) { + if (wasCreatedByStainlessHelper(tool)) { + helpers.add(tool[SDK_HELPER_SYMBOL]); + } + } + } + if (messages) { + for (const message of messages) { + if (wasCreatedByStainlessHelper(message)) { + helpers.add(message[SDK_HELPER_SYMBOL]); + } + const content = message.content; + if (Array.isArray(content)) { + for (const block of content) { + if (wasCreatedByStainlessHelper(block)) { + helpers.add(block[SDK_HELPER_SYMBOL]); + } + const definition = block?.tool?.definition; + if (wasCreatedByStainlessHelper(definition)) { + helpers.add(definition[SDK_HELPER_SYMBOL]); + } + } + } + } + } + return Array.from(helpers); +} +function stainlessHelperHeader(tools, messages) { + const helpers = collectStainlessHelpers(tools, messages); + if (helpers.length === 0) + return {}; + return { [STAINLESS_HELPER_HEADER]: helpers.join(", ") }; +} +function stainlessHelperHeaderFromFile(file2) { + if (wasCreatedByStainlessHelper(file2)) { + return { [STAINLESS_HELPER_HEADER]: file2[SDK_HELPER_SYMBOL] }; + } + return {}; +} +var STAINLESS_HELPER_HEADER, STAINLESS_HELPER_METHOD_HEADER, SDK_HELPER_SYMBOL; +var init_stainless_helper_header = __esm({ + "node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs"() { + STAINLESS_HELPER_HEADER = "x-stainless-helper"; + STAINLESS_HELPER_METHOD_HEADER = "x-stainless-helper-method"; + SDK_HELPER_SYMBOL = /* @__PURE__ */ Symbol("anthropic.sdk.stainlessHelper"); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +var Files; +var init_files = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/files.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_stainless_helper_header(); + init_uploads(); + init_path(); + Files = class extends APIResource { + /** + * List Files + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFileMetadata of client.beta.files.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/files?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete File + * + * @example + * ```ts + * const betaDeletedFile = await client.beta.files.delete( + * 'file_id', + * ); + * ``` + */ + delete(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/files/${fileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Download File + * + * @example + * ```ts + * const response = await client.beta.files.download( + * 'file_id', + * ); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}/content?beta=true`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + /** + * Get File Metadata + * + * @example + * ```ts + * const betaFileMetadata = + * await client.beta.files.retrieveMetadata('file_id'); + * ``` + */ + retrieveMetadata(fileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Upload File + * + * @example + * ```ts + * const betaFileMetadata = await client.beta.files.upload({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + upload(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/files?beta=true", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + stainlessHelperHeaderFromFile(body.file), + options?.headers + ]) + }, this._client)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +var Models; +var init_models2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/models.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Models = class extends APIResource { + /** + * Get a specific model. + * + * The Models API response can be used to determine information about a specific + * model or resolve a model alias to a model ID. + * + * @example + * ```ts + * const betaModelInfo = await client.beta.models.retrieve( + * 'model_id', + * ); + * ``` + */ + retrieve(modelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/models/${modelID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List available models. + * + * The Models API response can be used to determine which models are available for + * use in the API. More recently released models are listed first. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaModelInfo of client.beta.models.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/models?beta=true", Page, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +var UserProfiles; +var init_user_profiles = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + UserProfiles = class extends APIResource { + /** + * Create User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.create(); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/user_profiles?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.retrieve( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + retrieve(userProfileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/user_profiles/${userProfileID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update User Profile + * + * @example + * ```ts + * const betaUserProfile = + * await client.beta.userProfiles.update( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + update(userProfileID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/user_profiles/${userProfileID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List User Profiles + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaUserProfile of client.beta.userProfiles.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/user_profiles?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Create Enrollment URL + * + * @example + * ```ts + * const betaUserProfileEnrollmentURL = + * await client.beta.userProfiles.createEnrollmentURL( + * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', + * ); + * ``` + */ + createEnrollmentURL(userProfileID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@stablelib/base64/lib/base64.js +var require_base64 = __commonJS({ + "node_modules/@stablelib/base64/lib/base64.js"(exports) { + "use strict"; + var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p]; + }; + return extendStatics(d, b); + }; + return function(d, b) { + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + var INVALID_BYTE = 256; + var Coder = ( + /** @class */ + (function() { + function Coder2(_paddingCharacter) { + if (_paddingCharacter === void 0) { + _paddingCharacter = "="; + } + this._paddingCharacter = _paddingCharacter; + } + Coder2.prototype.encodedLength = function(length) { + if (!this._paddingCharacter) { + return (length * 8 + 5) / 6 | 0; + } + return (length + 2) / 3 * 4 | 0; + }; + Coder2.prototype.encode = function(data) { + var out = ""; + var i = 0; + for (; i < data.length - 2; i += 3) { + var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2]; + out += this._encodeByte(c >>> 3 * 6 & 63); + out += this._encodeByte(c >>> 2 * 6 & 63); + out += this._encodeByte(c >>> 1 * 6 & 63); + out += this._encodeByte(c >>> 0 * 6 & 63); + } + var left = data.length - i; + if (left > 0) { + var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0); + out += this._encodeByte(c >>> 3 * 6 & 63); + out += this._encodeByte(c >>> 2 * 6 & 63); + if (left === 2) { + out += this._encodeByte(c >>> 1 * 6 & 63); + } else { + out += this._paddingCharacter || ""; + } + out += this._paddingCharacter || ""; + } + return out; + }; + Coder2.prototype.maxDecodedLength = function(length) { + if (!this._paddingCharacter) { + return (length * 6 + 7) / 8 | 0; + } + return length / 4 * 3 | 0; + }; + Coder2.prototype.decodedLength = function(s) { + return this.maxDecodedLength(s.length - this._getPaddingLength(s)); + }; + Coder2.prototype.decode = function(s) { + if (s.length === 0) { + return new Uint8Array(0); + } + var paddingLength = this._getPaddingLength(s); + var length = s.length - paddingLength; + var out = new Uint8Array(this.maxDecodedLength(length)); + var op2 = 0; + var i = 0; + var haveBad = 0; + var v0 = 0, v1 = 0, v2 = 0, v3 = 0; + for (; i < length - 4; i += 4) { + v0 = this._decodeChar(s.charCodeAt(i + 0)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + v2 = this._decodeChar(s.charCodeAt(i + 2)); + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op2++] = v0 << 2 | v1 >>> 4; + out[op2++] = v1 << 4 | v2 >>> 2; + out[op2++] = v2 << 6 | v3; + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + haveBad |= v2 & INVALID_BYTE; + haveBad |= v3 & INVALID_BYTE; + } + if (i < length - 1) { + v0 = this._decodeChar(s.charCodeAt(i)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + out[op2++] = v0 << 2 | v1 >>> 4; + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + } + if (i < length - 2) { + v2 = this._decodeChar(s.charCodeAt(i + 2)); + out[op2++] = v1 << 4 | v2 >>> 2; + haveBad |= v2 & INVALID_BYTE; + } + if (i < length - 3) { + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op2++] = v2 << 6 | v3; + haveBad |= v3 & INVALID_BYTE; + } + if (haveBad !== 0) { + throw new Error("Base64Coder: incorrect characters for decoding"); + } + return out; + }; + Coder2.prototype._encodeByte = function(b) { + var result = b; + result += 65; + result += 25 - b >>> 8 & 0 - 65 - 26 + 97; + result += 51 - b >>> 8 & 26 - 97 - 52 + 48; + result += 61 - b >>> 8 & 52 - 48 - 62 + 43; + result += 62 - b >>> 8 & 62 - 43 - 63 + 47; + return String.fromCharCode(result); + }; + Coder2.prototype._decodeChar = function(c) { + var result = INVALID_BYTE; + result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62; + result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63; + result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; + result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; + result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; + return result; + }; + Coder2.prototype._getPaddingLength = function(s) { + var paddingLength = 0; + if (this._paddingCharacter) { + for (var i = s.length - 1; i >= 0; i--) { + if (s[i] !== this._paddingCharacter) { + break; + } + paddingLength++; + } + if (s.length < 4 || paddingLength > 2) { + throw new Error("Base64Coder: incorrect padding"); + } + } + return paddingLength; + }; + return Coder2; + })() + ); + exports.Coder = Coder; + var stdCoder = new Coder(); + function encode3(data) { + return stdCoder.encode(data); + } + exports.encode = encode3; + function decode(s) { + return stdCoder.decode(s); + } + exports.decode = decode; + var URLSafeCoder = ( + /** @class */ + (function(_super) { + __extends(URLSafeCoder2, _super); + function URLSafeCoder2() { + return _super !== null && _super.apply(this, arguments) || this; + } + URLSafeCoder2.prototype._encodeByte = function(b) { + var result = b; + result += 65; + result += 25 - b >>> 8 & 0 - 65 - 26 + 97; + result += 51 - b >>> 8 & 26 - 97 - 52 + 48; + result += 61 - b >>> 8 & 52 - 48 - 62 + 45; + result += 62 - b >>> 8 & 62 - 45 - 63 + 95; + return String.fromCharCode(result); + }; + URLSafeCoder2.prototype._decodeChar = function(c) { + var result = INVALID_BYTE; + result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62; + result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63; + result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; + result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; + result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; + return result; + }; + return URLSafeCoder2; + })(Coder) + ); + exports.URLSafeCoder = URLSafeCoder; + var urlSafeCoder = new URLSafeCoder(); + function encodeURLSafe(data) { + return urlSafeCoder.encode(data); + } + exports.encodeURLSafe = encodeURLSafe; + function decodeURLSafe(s) { + return urlSafeCoder.decode(s); + } + exports.decodeURLSafe = decodeURLSafe; + exports.encodedLength = function(length) { + return stdCoder.encodedLength(length); + }; + exports.maxDecodedLength = function(length) { + return stdCoder.maxDecodedLength(length); + }; + exports.decodedLength = function(s) { + return stdCoder.decodedLength(s); + }; + } +}); + +// node_modules/fast-sha256/sha256.js +var require_sha256 = __commonJS({ + "node_modules/fast-sha256/sha256.js"(exports, module) { + (function(root2, factory) { + var exports2 = {}; + factory(exports2); + var sha256 = exports2["default"]; + for (var k in exports2) { + sha256[k] = exports2[k]; + } + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = sha256; + } else if (typeof define === "function" && define.amd) { + define(function() { + return sha256; + }); + } else { + root2.sha256 = sha256; + } + })(exports, function(exports2) { + "use strict"; + exports2.__esModule = true; + exports2.digestLength = 32; + exports2.blockSize = 64; + var K = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + function hashBlocks(w, v, p, pos, len) { + var a, b, c, d, e, f, g, h, u, i, j, t1, t2; + while (len >= 64) { + a = v[0]; + b = v[1]; + c = v[2]; + d = v[3]; + e = v[4]; + f = v[5]; + g = v[6]; + h = v[7]; + for (i = 0; i < 16; i++) { + j = pos + i * 4; + w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255; + } + for (i = 16; i < 64; i++) { + u = w[i - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0); + } + for (i = 0; i < 64; i++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + v[0] += a; + v[1] += b; + v[2] += c; + v[3] += d; + v[4] += e; + v[5] += f; + v[6] += g; + v[7] += h; + pos += 64; + len -= 64; + } + return pos; + } + var Hash = ( + /** @class */ + (function() { + function Hash2() { + this.digestLength = exports2.digestLength; + this.blockSize = exports2.blockSize; + this.state = new Int32Array(8); + this.temp = new Int32Array(64); + this.buffer = new Uint8Array(128); + this.bufferLength = 0; + this.bytesHashed = 0; + this.finished = false; + this.reset(); + } + Hash2.prototype.reset = function() { + this.state[0] = 1779033703; + this.state[1] = 3144134277; + this.state[2] = 1013904242; + this.state[3] = 2773480762; + this.state[4] = 1359893119; + this.state[5] = 2600822924; + this.state[6] = 528734635; + this.state[7] = 1541459225; + this.bufferLength = 0; + this.bytesHashed = 0; + this.finished = false; + return this; + }; + Hash2.prototype.clean = function() { + for (var i = 0; i < this.buffer.length; i++) { + this.buffer[i] = 0; + } + for (var i = 0; i < this.temp.length; i++) { + this.temp[i] = 0; + } + this.reset(); + }; + Hash2.prototype.update = function(data, dataLength) { + if (dataLength === void 0) { + dataLength = data.length; + } + if (this.finished) { + throw new Error("SHA256: can't update because hash was finished."); + } + var dataPos = 0; + this.bytesHashed += dataLength; + if (this.bufferLength > 0) { + while (this.bufferLength < 64 && dataLength > 0) { + this.buffer[this.bufferLength++] = data[dataPos++]; + dataLength--; + } + if (this.bufferLength === 64) { + hashBlocks(this.temp, this.state, this.buffer, 0, 64); + this.bufferLength = 0; + } + } + if (dataLength >= 64) { + dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength); + dataLength %= 64; + } + while (dataLength > 0) { + this.buffer[this.bufferLength++] = data[dataPos++]; + dataLength--; + } + return this; + }; + Hash2.prototype.finish = function(out) { + if (!this.finished) { + var bytesHashed = this.bytesHashed; + var left = this.bufferLength; + var bitLenHi = bytesHashed / 536870912 | 0; + var bitLenLo = bytesHashed << 3; + var padLength = bytesHashed % 64 < 56 ? 64 : 128; + this.buffer[left] = 128; + for (var i = left + 1; i < padLength - 8; i++) { + this.buffer[i] = 0; + } + this.buffer[padLength - 8] = bitLenHi >>> 24 & 255; + this.buffer[padLength - 7] = bitLenHi >>> 16 & 255; + this.buffer[padLength - 6] = bitLenHi >>> 8 & 255; + this.buffer[padLength - 5] = bitLenHi >>> 0 & 255; + this.buffer[padLength - 4] = bitLenLo >>> 24 & 255; + this.buffer[padLength - 3] = bitLenLo >>> 16 & 255; + this.buffer[padLength - 2] = bitLenLo >>> 8 & 255; + this.buffer[padLength - 1] = bitLenLo >>> 0 & 255; + hashBlocks(this.temp, this.state, this.buffer, 0, padLength); + this.finished = true; + } + for (var i = 0; i < 8; i++) { + out[i * 4 + 0] = this.state[i] >>> 24 & 255; + out[i * 4 + 1] = this.state[i] >>> 16 & 255; + out[i * 4 + 2] = this.state[i] >>> 8 & 255; + out[i * 4 + 3] = this.state[i] >>> 0 & 255; + } + return this; + }; + Hash2.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; + }; + Hash2.prototype._saveState = function(out) { + for (var i = 0; i < this.state.length; i++) { + out[i] = this.state[i]; + } + }; + Hash2.prototype._restoreState = function(from, bytesHashed) { + for (var i = 0; i < this.state.length; i++) { + this.state[i] = from[i]; + } + this.bytesHashed = bytesHashed; + this.finished = false; + this.bufferLength = 0; + }; + return Hash2; + })() + ); + exports2.Hash = Hash; + var HMAC = ( + /** @class */ + (function() { + function HMAC2(key) { + this.inner = new Hash(); + this.outer = new Hash(); + this.blockSize = this.inner.blockSize; + this.digestLength = this.inner.digestLength; + var pad = new Uint8Array(this.blockSize); + if (key.length > this.blockSize) { + new Hash().update(key).finish(pad).clean(); + } else { + for (var i = 0; i < key.length; i++) { + pad[i] = key[i]; + } + } + for (var i = 0; i < pad.length; i++) { + pad[i] ^= 54; + } + this.inner.update(pad); + for (var i = 0; i < pad.length; i++) { + pad[i] ^= 54 ^ 92; + } + this.outer.update(pad); + this.istate = new Uint32Array(8); + this.ostate = new Uint32Array(8); + this.inner._saveState(this.istate); + this.outer._saveState(this.ostate); + for (var i = 0; i < pad.length; i++) { + pad[i] = 0; + } + } + HMAC2.prototype.reset = function() { + this.inner._restoreState(this.istate, this.inner.blockSize); + this.outer._restoreState(this.ostate, this.outer.blockSize); + return this; + }; + HMAC2.prototype.clean = function() { + for (var i = 0; i < this.istate.length; i++) { + this.ostate[i] = this.istate[i] = 0; + } + this.inner.clean(); + this.outer.clean(); + }; + HMAC2.prototype.update = function(data) { + this.inner.update(data); + return this; + }; + HMAC2.prototype.finish = function(out) { + if (this.outer.finished) { + this.outer.finish(out); + } else { + this.inner.finish(out); + this.outer.update(out, this.digestLength).finish(out); + } + return this; + }; + HMAC2.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + this.finish(out); + return out; + }; + return HMAC2; + })() + ); + exports2.HMAC = HMAC; + function hash(data) { + var h = new Hash().update(data); + var digest = h.digest(); + h.clean(); + return digest; + } + exports2.hash = hash; + exports2["default"] = hash; + function hmac(key, data) { + var h = new HMAC(key).update(data); + var digest = h.digest(); + h.clean(); + return digest; + } + exports2.hmac = hmac; + function fillBuffer(buffer, hmac2, info, counter) { + var num2 = counter[0]; + if (num2 === 0) { + throw new Error("hkdf: cannot expand more"); + } + hmac2.reset(); + if (num2 > 1) { + hmac2.update(buffer); + } + if (info) { + hmac2.update(info); + } + hmac2.update(counter); + hmac2.finish(buffer); + counter[0]++; + } + var hkdfSalt = new Uint8Array(exports2.digestLength); + function hkdf(key, salt, info, length) { + if (salt === void 0) { + salt = hkdfSalt; + } + if (length === void 0) { + length = 32; + } + var counter = new Uint8Array([1]); + var okm = hmac(salt, key); + var hmac_ = new HMAC(okm); + var buffer = new Uint8Array(hmac_.digestLength); + var bufpos = buffer.length; + var out = new Uint8Array(length); + for (var i = 0; i < length; i++) { + if (bufpos === buffer.length) { + fillBuffer(buffer, hmac_, info, counter); + bufpos = 0; + } + out[i] = buffer[bufpos++]; + } + hmac_.clean(); + buffer.fill(0); + counter.fill(0); + return out; + } + exports2.hkdf = hkdf; + function pbkdf2(password, salt, iterations, dkLen) { + var prf = new HMAC(password); + var len = prf.digestLength; + var ctr = new Uint8Array(4); + var t = new Uint8Array(len); + var u = new Uint8Array(len); + var dk = new Uint8Array(dkLen); + for (var i = 0; i * len < dkLen; i++) { + var c = i + 1; + ctr[0] = c >>> 24 & 255; + ctr[1] = c >>> 16 & 255; + ctr[2] = c >>> 8 & 255; + ctr[3] = c >>> 0 & 255; + prf.reset(); + prf.update(salt); + prf.update(ctr); + prf.finish(u); + for (var j = 0; j < len; j++) { + t[j] = u[j]; + } + for (var j = 2; j <= iterations; j++) { + prf.reset(); + prf.update(u).finish(u); + for (var k = 0; k < len; k++) { + t[k] ^= u[k]; + } + } + for (var j = 0; j < len && i * len + j < dkLen; j++) { + dk[i * len + j] = t[j]; + } + } + for (var i = 0; i < len; i++) { + t[i] = u[i] = 0; + } + for (var i = 0; i < 4; i++) { + ctr[i] = 0; + } + prf.clean(); + return dk; + } + exports2.pbkdf2 = pbkdf2; + }); + } +}); + +// node_modules/standardwebhooks/dist/timing_safe_equal.js +var require_timing_safe_equal = __commonJS({ + "node_modules/standardwebhooks/dist/timing_safe_equal.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.timingSafeEqual = timingSafeEqual; + function assert2(expr, msg = "") { + if (!expr) { + throw new Error(msg); + } + } + function timingSafeEqual(a, b) { + if (a.byteLength !== b.byteLength) { + return false; + } + if (!(a instanceof DataView)) { + a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a); + } + if (!(b instanceof DataView)) { + b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b); + } + assert2(a instanceof DataView); + assert2(b instanceof DataView); + const length = a.byteLength; + let out = 0; + let i = -1; + while (++i < length) { + out |= a.getUint8(i) ^ b.getUint8(i); + } + return out === 0; + } + } +}); + +// node_modules/standardwebhooks/dist/index.js +var require_dist = __commonJS({ + "node_modules/standardwebhooks/dist/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Webhook = exports.WebhookVerificationError = void 0; + var base64 = require_base64(); + var sha256 = require_sha256(); + var timing_safe_equal_1 = require_timing_safe_equal(); + var WEBHOOK_TOLERANCE_IN_SECONDS = 5 * 60; + var ExtendableError = class _ExtendableError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _ExtendableError.prototype); + this.name = "ExtendableError"; + this.stack = new Error(message).stack; + } + }; + var WebhookVerificationError = class _WebhookVerificationError extends ExtendableError { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _WebhookVerificationError.prototype); + this.name = "WebhookVerificationError"; + } + }; + exports.WebhookVerificationError = WebhookVerificationError; + var Webhook2 = class _Webhook { + constructor(secret, options) { + if ((options === null || options === void 0 ? void 0 : options.format) === "raw") { + if (secret instanceof Uint8Array) { + this.key = secret; + } else { + this.key = Uint8Array.from(secret, (c) => c.charCodeAt(0)); + } + } else { + if (typeof secret !== "string") { + throw new Error("Expected secret to be of type string"); + } + if (secret.startsWith(_Webhook.prefix)) { + secret = secret.substring(_Webhook.prefix.length); + } + this.key = base64.decode(secret); + } + if (this.key.length === 0) { + throw new Error("Secret can't be empty."); + } + } + verify(payload, headers, options) { + var _a6; + const jsonParse = (_a6 = options === null || options === void 0 ? void 0 : options.jsonParse) !== null && _a6 !== void 0 ? _a6 : true; + const normalizedHeaders = {}; + for (const key of Object.keys(headers)) { + normalizedHeaders[key.toLowerCase()] = headers[key]; + } + const msgId = normalizedHeaders["webhook-id"]; + const msgSignature = normalizedHeaders["webhook-signature"]; + const msgTimestamp = normalizedHeaders["webhook-timestamp"]; + if (!msgSignature || !msgId || !msgTimestamp) { + throw new WebhookVerificationError("Missing required headers"); + } + const timestamp2 = this.verifyTimestamp(msgTimestamp); + const computedSignature = this.sign(msgId, timestamp2, payload); + const expectedSignature = computedSignature.split(",")[1]; + const passedSignatures = msgSignature.split(" "); + const encoder4 = new globalThis.TextEncoder(); + for (const versionedSignature of passedSignatures) { + const [version, signature] = versionedSignature.split(","); + if (version !== "v1") { + continue; + } + if ((0, timing_safe_equal_1.timingSafeEqual)(encoder4.encode(signature), encoder4.encode(expectedSignature))) { + const payloadString = payload.toString(); + if (payloadString === "") { + return void 0; + } + if (jsonParse) { + return JSON.parse(payloadString); + } else { + return void 0; + } + } + } + throw new WebhookVerificationError("No matching signature found"); + } + sign(msgId, timestamp2, payload) { + if (typeof payload === "string") { + } else if (payload.constructor.name === "Buffer") { + payload = payload.toString(); + } else { + throw new Error("Expected payload to be of type string or Buffer."); + } + const encoder4 = new TextEncoder(); + const timestampNumber = Math.floor(timestamp2.getTime() / 1e3); + const toSign = encoder4.encode(`${msgId}.${timestampNumber}.${payload}`); + const expectedSignature = base64.encode(sha256.hmac(this.key, toSign)); + return `v1,${expectedSignature}`; + } + verifyTimestamp(timestampHeader) { + const now = Math.floor(Date.now() / 1e3); + const timestamp2 = parseInt(timestampHeader, 10); + if (Number.isNaN(timestamp2)) { + throw new WebhookVerificationError("Invalid Signature Headers"); + } + if (now - timestamp2 > WEBHOOK_TOLERANCE_IN_SECONDS) { + throw new WebhookVerificationError("Message timestamp too old"); + } + if (timestamp2 > now + WEBHOOK_TOLERANCE_IN_SECONDS) { + throw new WebhookVerificationError("Message timestamp too new"); + } + return new Date(timestamp2 * 1e3); + } + }; + exports.Webhook = Webhook2; + Webhook2.prefix = "whsec_"; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +var import_standardwebhooks, Webhooks; +var init_webhooks = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs"() { + init_resource(); + import_standardwebhooks = __toESM(require_dist(), 1); + Webhooks = class extends APIResource { + /** + * Parses a webhook payload into an event without verifying its signature. Prefer + * `unwrap()` unless you have already verified the signature yourself. + */ + parseUnverified(body) { + return JSON.parse(body); + } + /** + * Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and + * `webhook-signature` headers using your webhook signing key, then parses the + * payload into an event. Fails if the signature is missing or invalid. + */ + unwrap(body, options) { + const headers = options?.headers; + if (headers == null) + throw new Error("Webhook headers are required in order to verify the signature"); + const keyStr = options.key === void 0 ? this._client.webhookKey : options.key; + if (!keyStr) + throw new Error("Webhook key must not be null or empty in order to unwrap"); + const wh = new import_standardwebhooks.Webhook(keyStr); + wh.verify(body, headers); + return JSON.parse(body); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs +var Versions; +var init_versions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Versions = class extends APIResource { + /** + * List Agent Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsAgent of client.beta.agents.versions.list( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * )) { + * // ... + * } + * ``` + */ + list(agentID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/agents/${agentID}/versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs +var Agents; +var init_agents = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs"() { + init_resource(); + init_versions(); + init_versions(); + init_pagination(); + init_headers(); + init_path(); + Agents = /* @__PURE__ */ (() => { + class Agents3 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions(this._client); + } + /** + * Create Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.create({ + * model: 'claude-opus-5', + * name: 'My First Agent', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/agents?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.retrieve( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * ); + * ``` + */ + retrieve(agentID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.get(path2`/v1/agents/${agentID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.update( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * { description: 'updated' }, + * ); + * ``` + */ + update(agentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/agents/${agentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Agents + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsAgent of client.beta.agents.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/agents?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Agent + * + * @example + * ```ts + * const betaManagedAgentsAgent = + * await client.beta.agents.archive( + * 'agent_011CZkYpogX7uDKUyvBTophP', + * ); + * ``` + */ + archive(agentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/agents/${agentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Agents3.Versions = Versions; + return Agents3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs +function linkAbort(external, controller) { + if (!external) + return () => { + }; + if (external.aborted) { + controller.abort(); + return () => { + }; + } + const onAbort = () => controller.abort(); + external.addEventListener("abort", onAbort); + return () => external.removeEventListener("abort", onAbort); +} +var init_abort2 = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs +function isStatus(e, code) { + return e instanceof APIError && e.status === code; +} +function is4xx(e) { + return e instanceof APIError && typeof e.status === "number" && e.status >= 400 && e.status < 500; +} +function isFatal4xx(e) { + return is4xx(e) && !isStatus(e, 408) && !isStatus(e, 409) && !isStatus(e, 429); +} +function backoff(attempt, baseMs, capMs) { + return Math.min(baseMs * 2 ** attempt, capMs); +} +function jitter(lowMs, highMs) { + return lowMs + Math.random() * (highMs - lowMs); +} +function applyJitter(ms) { + return ms * (1 - Math.random() * 0.25); +} +var init_backoff = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/helper-client.mjs +function copyClientForHelper(client, { authToken, helper }) { + if (!authToken) { + throw new AnthropicError(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(authToken)}`); + } + const internal = client; + const parentDefaults = internal._options.defaultHeaders; + const parentAuthExtraHeaders = internal._authState?.extraHeaders; + const inheritedAuthExtraHeaders = parentAuthExtraHeaders ? Object.fromEntries(Object.entries(parentAuthExtraHeaders).filter(([name]) => { + const lower = name.toLowerCase(); + return lower !== "authorization" && lower !== "x-api-key"; + })) : void 0; + const defaultHeaders = buildHeaders([ + inheritedAuthExtraHeaders, + parentDefaults, + { [STAINLESS_HELPER_HEADER]: helper } + ]); + return client.withOptions({ + apiKey: null, + authToken, + baseURL: client.baseURL, + credentials: void 0, + defaultHeaders + }); +} +var init_helper_client = __esm({ + "node_modules/@anthropic-ai/sdk/lib/helper-client.mjs"() { + init_error(); + init_headers(); + init_stainless_helper_header(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +function backoff2(attempt) { + return backoff(attempt, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS); +} +function defaultWorkerId() { + const env = globalThis.process?.env; + const host = env?.["HOSTNAME"]; + return host ? `${host}-${uuid4()}` : uuid4(); +} +var _WorkPoller_runnerClient, _WorkPoller_consumed, _WorkPoller_controller, _WorkPoller_detachExternal, _WorkPoller_autoStop, _WorkPoller_drain, _WorkPoller_blockMs, _WorkPoller_reclaimOlderThanMs, _WorkPoller_requestOpts, _IdleLog_log, _IdleLog_environmentId, _IdleLog_idleSince, _IdleLog_lastReport, POLL_BLOCK_MS, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS, IDLE_REPORT_INTERVAL_MS, WorkPoller, IdleLog; +var init_poller = __esm({ + "node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_sleep(); + init_uuid(); + init_abort2(); + init_headers(); + init_backoff(); + init_helper_client(); + POLL_BLOCK_MS = 999; + POLL_BACKOFF_BASE_MS = 1e3; + POLL_BACKOFF_CAP_MS = 6e4; + IDLE_REPORT_INTERVAL_MS = 3e5; + WorkPoller = /* @__PURE__ */ (() => { + class WorkPoller2 { + constructor(opts) { + _WorkPoller_runnerClient.set(this, void 0); + _WorkPoller_consumed.set(this, false); + _WorkPoller_controller.set(this, void 0); + _WorkPoller_detachExternal.set(this, void 0); + _WorkPoller_autoStop.set(this, void 0); + _WorkPoller_drain.set(this, void 0); + _WorkPoller_blockMs.set(this, void 0); + _WorkPoller_reclaimOlderThanMs.set(this, void 0); + _WorkPoller_requestOpts.set(this, void 0); + this.client = opts.client; + this.environmentId = opts.environmentId; + this.environmentKey = opts.environmentKey; + this.workerId = opts.workerId ?? defaultWorkerId(); + __classPrivateFieldSet(this, _WorkPoller_runnerClient, copyClientForHelper(opts.client, { + authToken: opts.environmentKey, + helper: "environments-work-poller" + }), "f"); + __classPrivateFieldSet(this, _WorkPoller_autoStop, opts.autoStop ?? true, "f"); + __classPrivateFieldSet(this, _WorkPoller_drain, opts.drain ?? false, "f"); + __classPrivateFieldSet(this, _WorkPoller_blockMs, opts.blockMs === void 0 ? POLL_BLOCK_MS : opts.blockMs, "f"); + __classPrivateFieldSet(this, _WorkPoller_reclaimOlderThanMs, opts.reclaimOlderThanMs ?? null, "f"); + __classPrivateFieldSet(this, _WorkPoller_requestOpts, opts.requestOptions, "f"); + __classPrivateFieldSet(this, _WorkPoller_controller, new AbortController(), "f"); + __classPrivateFieldSet(this, _WorkPoller_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet(this, _WorkPoller_controller, "f")), "f"); + } + /** Read-only view of this iterator's abort signal. */ + get signal() { + return __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal; + } + /** Abort the iterator. The current `for await` will exit cleanly. */ + abort() { + __classPrivateFieldGet(this, _WorkPoller_controller, "f").abort(); + } + async *[(_WorkPoller_runnerClient = /* @__PURE__ */ new WeakMap(), _WorkPoller_consumed = /* @__PURE__ */ new WeakMap(), _WorkPoller_controller = /* @__PURE__ */ new WeakMap(), _WorkPoller_detachExternal = /* @__PURE__ */ new WeakMap(), _WorkPoller_autoStop = /* @__PURE__ */ new WeakMap(), _WorkPoller_drain = /* @__PURE__ */ new WeakMap(), _WorkPoller_blockMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_reclaimOlderThanMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_requestOpts = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + if (__classPrivateFieldGet(this, _WorkPoller_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed WorkPoller"); + } + __classPrivateFieldSet(this, _WorkPoller_consumed, true, "f"); + const log = loggerFor(this.client); + log.info("poller starting", { + component: "work-poller", + environment_id: this.environmentId + }); + const idle = new IdleLog(log, this.environmentId); + try { + let attempt = 0; + while (!__classPrivateFieldGet(this, _WorkPoller_controller, "f").signal.aborted) { + let work; + try { + work = await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.poll(this.environmentId, { + "Anthropic-Worker-ID": this.workerId, + ...__classPrivateFieldGet(this, _WorkPoller_blockMs, "f") !== null ? { block_ms: __classPrivateFieldGet(this, _WorkPoller_blockMs, "f") } : {}, + ...__classPrivateFieldGet(this, _WorkPoller_reclaimOlderThanMs, "f") !== null ? { reclaim_older_than_ms: __classPrivateFieldGet(this, _WorkPoller_reclaimOlderThanMs, "f") } : {} + }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal }); + } catch (e) { + if (__classPrivateFieldGet(this, _WorkPoller_controller, "f").signal.aborted) + return; + if (isFatal4xx(e)) { + log.error("poll failed permanently, stopping poller", { error: String(e) }); + throw e; + } + const wait = applyJitter(backoff2(attempt)); + log.warn("poll failed, backing off", { error: String(e), backoff_ms: wait }); + attempt++; + await sleep(wait, __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal); + continue; + } + attempt = 0; + if (work == null) { + if (__classPrivateFieldGet(this, _WorkPoller_drain, "f")) + return; + idle.onEmptyPoll(); + await sleep(jitter(1e3, 3e3), __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal); + continue; + } + idle.onClaim(); + log.info("claimed work", { + component: "work-poller", + environment_id: this.environmentId, + work_id: work.id, + work_type: work.data.type + }); + try { + await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.ack(work.id, { environment_id: work.environment_id }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet(this, _WorkPoller_controller, "f").signal }); + } catch (e) { + log.error("ack failed", { work_id: work.id, error: String(e) }); + continue; + } + try { + yield work; + } finally { + if (__classPrivateFieldGet(this, _WorkPoller_autoStop, "f")) { + try { + await __classPrivateFieldGet(this, _WorkPoller_runnerClient, "f").beta.environments.work.stop(work.id, { environment_id: work.environment_id }, { headers: buildHeaders([__classPrivateFieldGet(this, _WorkPoller_requestOpts, "f")?.headers]) }); + } catch (e) { + if (!isStatus(e, 409)) + log.warn("stop failed", { work_id: work.id, error: String(e) }); + } + } + } + } + } finally { + __classPrivateFieldGet(this, _WorkPoller_detachExternal, "f").call(this); + } + } + } + return WorkPoller2; + })(); + IdleLog = /* @__PURE__ */ (() => { + class IdleLog2 { + constructor(log, environmentId) { + _IdleLog_log.set(this, void 0); + _IdleLog_environmentId.set(this, void 0); + _IdleLog_idleSince.set(this, void 0); + _IdleLog_lastReport.set(this, 0); + __classPrivateFieldSet(this, _IdleLog_log, log, "f"); + __classPrivateFieldSet(this, _IdleLog_environmentId, environmentId, "f"); + } + onEmptyPoll() { + const now = Date.now(); + const fields = { component: "work-poller", environment_id: __classPrivateFieldGet(this, _IdleLog_environmentId, "f") }; + if (__classPrivateFieldGet(this, _IdleLog_idleSince, "f") === void 0) { + __classPrivateFieldSet(this, _IdleLog_idleSince, __classPrivateFieldSet(this, _IdleLog_lastReport, now, "f"), "f"); + __classPrivateFieldGet(this, _IdleLog_log, "f").info("idle; polling for work", fields); + } else if (now - __classPrivateFieldGet(this, _IdleLog_lastReport, "f") >= IDLE_REPORT_INTERVAL_MS) { + __classPrivateFieldSet(this, _IdleLog_lastReport, now, "f"); + __classPrivateFieldGet(this, _IdleLog_log, "f").info(`still polling; idle for ${Math.round((now - __classPrivateFieldGet(this, _IdleLog_idleSince, "f")) / 1e3)}s`, fields); + } else { + __classPrivateFieldGet(this, _IdleLog_log, "f").debug("poll returned no work", fields); + } + } + onClaim() { + __classPrivateFieldSet(this, _IdleLog_idleSince, void 0, "f"); + } + } + _IdleLog_log = /* @__PURE__ */ new WeakMap(), _IdleLog_environmentId = /* @__PURE__ */ new WeakMap(), _IdleLog_idleSince = /* @__PURE__ */ new WeakMap(), _IdleLog_lastReport = /* @__PURE__ */ new WeakMap(); + return IdleLog2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +var _AsyncQueue_items, _AsyncQueue_waiters, _AsyncQueue_closed, AsyncQueue; +var init_async_queue = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs"() { + init_tslib(); + AsyncQueue = /* @__PURE__ */ (() => { + class AsyncQueue2 { + constructor() { + _AsyncQueue_items.set(this, []); + _AsyncQueue_waiters.set(this, []); + _AsyncQueue_closed.set(this, false); + } + /** Enqueue an item, or hand it directly to a waiting reader. Returns `false` once closed. */ + push(item) { + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f")) + return false; + const w = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").shift(); + if (w) + w({ done: false, value: item }); + else + __classPrivateFieldGet(this, _AsyncQueue_items, "f").push(item); + return true; + } + /** Mark the queue done. Idempotent; wakes every pending reader with `done: true`. */ + close() { + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f")) + return; + __classPrivateFieldSet(this, _AsyncQueue_closed, true, "f"); + while (__classPrivateFieldGet(this, _AsyncQueue_waiters, "f").length > 0) { + const w = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").shift(); + w({ done: true, value: void 0 }); + } + } + /** + * Resolve with the next item, or `done: true` once the queue is closed and + * drained. When `signal` is supplied, aborting it resolves a pending read + * with `done: true` (cancellation is pushed down here rather than handled by + * an outer `Promise.race`). + */ + next(signal) { + if (__classPrivateFieldGet(this, _AsyncQueue_items, "f").length > 0) { + return Promise.resolve({ done: false, value: __classPrivateFieldGet(this, _AsyncQueue_items, "f").shift() }); + } + if (__classPrivateFieldGet(this, _AsyncQueue_closed, "f") || signal?.aborted) { + return Promise.resolve({ done: true, value: void 0 }); + } + return new Promise((resolve2) => { + const waiter = (r) => { + signal?.removeEventListener("abort", onAbort); + resolve2(r); + }; + const onAbort = () => { + const idx = __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").indexOf(waiter); + if (idx >= 0) + __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").splice(idx, 1); + resolve2({ done: true, value: void 0 }); + }; + __classPrivateFieldGet(this, _AsyncQueue_waiters, "f").push(waiter); + signal?.addEventListener("abort", onAbort, { once: true }); + }); + } + /** Synchronously remove and return the next buffered item, or `undefined` if empty. */ + tryShift() { + return __classPrivateFieldGet(this, _AsyncQueue_items, "f").shift(); + } + } + _AsyncQueue_items = /* @__PURE__ */ new WeakMap(), _AsyncQueue_waiters = /* @__PURE__ */ new WeakMap(), _AsyncQueue_closed = /* @__PURE__ */ new WeakMap(); + return AsyncQueue2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs +var ToolError; +var init_ToolError = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs"() { + ToolError = /* @__PURE__ */ (() => { + class ToolError2 extends Error { + constructor(content) { + const message = typeof content === "string" ? content : content.map((block) => { + if (block.type === "text") + return block.text; + return `[${block.type}]`; + }).join(" "); + super(message); + this.name = "ToolError"; + this.content = content; + } + } + return ToolError2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs +function toolName(tool) { + return "name" in tool ? tool.name : "mcp_server_name" in tool ? tool.mcp_server_name : tool.type; +} +function toolErrorContent(e) { + return e instanceof ToolError ? e.content : `Error: ${e instanceof Error ? e.message : String(e)}`; +} +async function runRunnableTool(tool, rawInput, context) { + try { + const input = tool.parse ? tool.parse(rawInput) : rawInput; + const content = await tool.run(input, context); + return { content, isError: false }; + } catch (e) { + return { content: toolErrorContent(e), isError: true }; + } +} +var init_BetaRunnableTool = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs"() { + init_ToolError(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +function isEndTurnIdle(ev) { + return ev.type === "session.status_idle" && ev.stop_reason?.type === "end_turn"; +} +function buildResultEvent(ev, isError, content) { + if (ev.type === "agent.custom_tool_use") { + return { type: "user.custom_tool_result", custom_tool_use_id: ev.id, is_error: isError, content }; + } + return { type: "user.tool_result", tool_use_id: ev.id, is_error: isError, content }; +} +function toSessionContent(content) { + if (typeof content === "string") + return [{ type: "text", text: content || "(no output)" }]; + const out = content.map((b) => { + if (b.type === "text") + return { type: "text", text: b.text || "(no output)" }; + if (b.type === "image" || b.type === "document") + return b; + if (b.type === "search_result") { + return { + type: "search_result", + source: b.source, + title: b.title, + content: b.content.map((c) => ({ type: "text", text: c.text })), + citations: { enabled: b.citations?.enabled ?? false } + }; + } + return { type: "text", text: JSON.stringify(b) }; + }); + return out.length > 0 ? out : [{ type: "text", text: "(no output)" }]; +} +var _IdleClock_maxIdleMs, _IdleClock_onExpire, _IdleClock_blockers, _IdleClock_armPending, _IdleClock_timer, _SessionToolRunner_instances, _SessionToolRunner_consumed, _SessionToolRunner_controller, _SessionToolRunner_detachExternal, _SessionToolRunner_requestOpts, _SessionToolRunner_toolByName, _SessionToolRunner_logger, _SessionToolRunner_seen, _SessionToolRunner_answered, _SessionToolRunner_confirmationVerdicts, _SessionToolRunner_awaitingConfirmation, _SessionToolRunner_results, _SessionToolRunner_inFlightCount, _SessionToolRunner_sendRetryWindowMs, _SessionToolRunner_onIdle, _SessionToolRunner_idleClock, _SessionToolRunner_requestOptions, _SessionToolRunner_streamLoop, _SessionToolRunner_reconcile, _SessionToolRunner_ingestHistory, _SessionToolRunner_handleStreamEvent, _SessionToolRunner_routeToolEvent, _SessionToolRunner_noteConfirmation, _SessionToolRunner_applyVerdict, _SessionToolRunner_surfaceCall, _SessionToolRunner_execute, _SessionToolRunner_sendResult, _SessionToolRunner_drain, STREAM_BACKOFF_START_MS, STREAM_BACKOFF_CAP_MS, TOOL_TIMEOUT_MS, DRAIN_TIMEOUT_MS, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS, SEND_RETRY_WINDOW_MS, DEFAULT_MAX_IDLE_MS, IdleClock, SessionToolRunner; +var init_SessionToolRunner = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_sleep(); + init_backoff(); + init_abort2(); + init_async_queue(); + init_headers(); + init_stainless_helper_header(); + init_BetaRunnableTool(); + STREAM_BACKOFF_START_MS = 500; + STREAM_BACKOFF_CAP_MS = 1e4; + TOOL_TIMEOUT_MS = 12e4; + DRAIN_TIMEOUT_MS = 3e4; + SEND_BACKOFF_START_MS = 1e3; + SEND_BACKOFF_CAP_MS = 3e4; + SEND_RETRY_WINDOW_MS = 5 * 6e4; + DEFAULT_MAX_IDLE_MS = 6e4; + IdleClock = /* @__PURE__ */ (() => { + class IdleClock2 { + constructor(maxIdleMs, onExpire) { + _IdleClock_maxIdleMs.set(this, void 0); + _IdleClock_onExpire.set(this, void 0); + _IdleClock_blockers.set(this, /* @__PURE__ */ new Set()); + _IdleClock_armPending.set(this, false); + _IdleClock_timer.set(this, void 0); + __classPrivateFieldSet(this, _IdleClock_maxIdleMs, maxIdleMs, "f"); + __classPrivateFieldSet(this, _IdleClock_onExpire, onExpire, "f"); + } + /** + * Arm on `status_idle{end_turn}`; disarm otherwise. `user.tool_confirmation` + * is neutral: it signals neither agent activity nor an idle, and its effect + * on the clock flows through {@link block} / {@link unblock} instead — + * disarming here would discard the pending arm the verdict is about to + * settle. + */ + noteEvent(ev) { + if (ev.type === "user.tool_confirmation") + return; + if (isEndTurnIdle(ev)) + this.arm(); + else + this.disarm(); + } + /** Register gated work that must resolve before an idle countdown starts. */ + block(toolUseId) { + __classPrivateFieldGet(this, _IdleClock_blockers, "f").add(toolUseId); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) { + __classPrivateFieldSet(this, _IdleClock_armPending, true, "f"); + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, void 0, "f"); + } + } + /** + * Retire gated work (a no-op for ids never blocked); applies a pending arm — + * with a fresh full `maxIdleMs` window — once the last blocker retires. + */ + unblock(toolUseId) { + __classPrivateFieldGet(this, _IdleClock_blockers, "f").delete(toolUseId); + if (__classPrivateFieldGet(this, _IdleClock_blockers, "f").size === 0 && __classPrivateFieldGet(this, _IdleClock_armPending, "f")) + this.arm(); + } + /** + * (Re)start the idle countdown — or, while blockers are outstanding, hold + * the arm pending instead. Stopping then would drop a held call when its + * verdict later arrives, or cut the runner off before a released call's + * result can drive the next turn. + */ + arm() { + if (__classPrivateFieldGet(this, _IdleClock_maxIdleMs, "f") <= 0) + return; + if (__classPrivateFieldGet(this, _IdleClock_blockers, "f").size > 0) { + __classPrivateFieldSet(this, _IdleClock_armPending, true, "f"); + return; + } + __classPrivateFieldSet(this, _IdleClock_armPending, false, "f"); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, setTimeout(__classPrivateFieldGet(this, _IdleClock_onExpire, "f"), __classPrivateFieldGet(this, _IdleClock_maxIdleMs, "f")), "f"); + } + /** + * Cancel the idle countdown and any pending arm. Blockers persist — they + * track real outstanding work, retired only by {@link unblock}. + */ + disarm() { + __classPrivateFieldSet(this, _IdleClock_armPending, false, "f"); + if (__classPrivateFieldGet(this, _IdleClock_timer, "f") !== void 0) { + clearTimeout(__classPrivateFieldGet(this, _IdleClock_timer, "f")); + __classPrivateFieldSet(this, _IdleClock_timer, void 0, "f"); + } + } + } + _IdleClock_maxIdleMs = /* @__PURE__ */ new WeakMap(), _IdleClock_onExpire = /* @__PURE__ */ new WeakMap(), _IdleClock_blockers = /* @__PURE__ */ new WeakMap(), _IdleClock_armPending = /* @__PURE__ */ new WeakMap(), _IdleClock_timer = /* @__PURE__ */ new WeakMap(); + return IdleClock2; + })(); + SessionToolRunner = /* @__PURE__ */ (() => { + class SessionToolRunner2 { + constructor(sessionId, opts) { + _SessionToolRunner_instances.add(this); + _SessionToolRunner_consumed.set(this, false); + _SessionToolRunner_controller.set(this, void 0); + _SessionToolRunner_detachExternal.set(this, void 0); + _SessionToolRunner_requestOpts.set(this, void 0); + _SessionToolRunner_toolByName.set(this, void 0); + _SessionToolRunner_logger.set(this, void 0); + _SessionToolRunner_seen.set(this, /* @__PURE__ */ new Set()); + _SessionToolRunner_answered.set(this, /* @__PURE__ */ new Set()); + _SessionToolRunner_confirmationVerdicts.set(this, /* @__PURE__ */ new Map()); + _SessionToolRunner_awaitingConfirmation.set(this, /* @__PURE__ */ new Map()); + _SessionToolRunner_results.set(this, new AsyncQueue()); + _SessionToolRunner_inFlightCount.set(this, 0); + _SessionToolRunner_sendRetryWindowMs.set(this, SEND_RETRY_WINDOW_MS); + _SessionToolRunner_onIdle.set(this, null); + _SessionToolRunner_idleClock.set(this, void 0); + this.client = opts.client; + this.sessionId = sessionId; + this.tools = opts.tools; + this.maxIdleMs = opts.maxIdleMs ?? DEFAULT_MAX_IDLE_MS; + __classPrivateFieldSet(this, _SessionToolRunner_logger, loggerFor(opts.client), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_toolByName, new Map(opts.tools.map((t) => [toolName(t), t])), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_controller, new AbortController(), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet(this, _SessionToolRunner_controller, "f")), "f"); + __classPrivateFieldSet(this, _SessionToolRunner_requestOpts, opts.requestOptions, "f"); + __classPrivateFieldSet(this, _SessionToolRunner_idleClock, new IdleClock(this.maxIdleMs, () => { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session idle after end_turn; stopping", { + component: "session-tool-runner", + session_id: this.sessionId, + max_idle_ms: this.maxIdleMs + }); + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + }), "f"); + } + /** Read-only view of this runner's abort signal. */ + get signal() { + return __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal; + } + /** Abort the runner. Background tasks will wind down and `for await` will exit cleanly. */ + abort() { + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + } + /** + * @internal + * `EnvironmentWorker` keeps this equal to the lease TTL each heartbeat + * reports; applies to a send already retrying. + */ + _setSendRetryWindow(ms) { + __classPrivateFieldSet(this, _SessionToolRunner_sendRetryWindowMs, ms, "f"); + } + async *[(_SessionToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_controller = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_detachExternal = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_requestOpts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_toolByName = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_logger = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_seen = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_answered = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_confirmationVerdicts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_awaitingConfirmation = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_results = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_inFlightCount = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_sendRetryWindowMs = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_onIdle = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_idleClock = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + if (__classPrivateFieldGet(this, _SessionToolRunner_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed SessionToolRunner"); + } + __classPrivateFieldSet(this, _SessionToolRunner_consumed, true, "f"); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session tool runner starting", { + component: "session-tool-runner", + session_id: this.sessionId + }); + const streamPromise = __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_streamLoop).call(this).catch((e) => { + if (!__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal.aborted) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("stream loop failed", { error: String(e) }); + } + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + }); + try { + while (true) { + const next = await __classPrivateFieldGet(this, _SessionToolRunner_results, "f").next(__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal); + if (next.done) + break; + yield next.value; + } + await streamPromise; + let pending; + while ((pending = __classPrivateFieldGet(this, _SessionToolRunner_results, "f").tryShift()) !== void 0) { + yield pending; + } + } finally { + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + await streamPromise; + try { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_drain).call(this); + } catch (e) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("drain failed", { error: String(e) }); + } + __classPrivateFieldGet(this, _SessionToolRunner_results, "f").close(); + for (const t of this.tools) { + try { + await t.close?.(); + } catch (e) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("tool.close failed", { tool: toolName(t), error: String(e) }); + } + } + __classPrivateFieldGet(this, _SessionToolRunner_detachExternal, "f").call(this); + } + } + } + _SessionToolRunner_requestOptions = function _SessionToolRunner_requestOptions2() { + return { + ...__classPrivateFieldGet(this, _SessionToolRunner_requestOpts, "f"), + headers: buildHeaders([helperHeader("session-tool-runner"), __classPrivateFieldGet(this, _SessionToolRunner_requestOpts, "f")?.headers]), + signal: __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal + }; + }, _SessionToolRunner_streamLoop = // ===== event stream ===== + async function _SessionToolRunner_streamLoop2() { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + let backoff3 = STREAM_BACKOFF_START_MS; + while (!ctrl.signal.aborted) { + try { + const stream5 = await this.client.beta.sessions.events.stream(this.sessionId, {}, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_reconcile).call(this); + for await (const ev of stream5) { + backoff3 = STREAM_BACKOFF_START_MS; + if (await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_handleStreamEvent).call(this, ev)) + return; + } + } catch (e) { + ctrl.signal.throwIfAborted(); + if (isFatal4xx(e)) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("permanent stream failure, shutting down", { error: String(e) }); + ctrl.abort(); + throw e; + } + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("stream disconnected, reconnecting", { + error: String(e), + backoff_ms: backoff3 + }); + } + ctrl.signal.throwIfAborted(); + await sleep(backoff3, ctrl.signal); + backoff3 = Math.min(backoff3 * 2, STREAM_BACKOFF_CAP_MS); + } + }, _SessionToolRunner_reconcile = /** + * Read full history before dispatching so a `tool_use` whose result appears + * later in the same history is not re-executed. Runs after the live stream is + * already attached (see {@link SessionToolRunner.#streamLoop}). + */ + async function _SessionToolRunner_reconcile2() { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + const pending = []; + let lastWasEndTurn = false; + try { + for await (const ev of this.client.beta.sessions.events.list(this.sessionId, { limit: 1e3 }, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this))) { + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_ingestHistory).call(this, ev, pending); + lastWasEndTurn = isEndTurnIdle(ev); + } + } catch (e) { + ctrl.signal.throwIfAborted(); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("reconcile list failed", { error: String(e) }); + for (const ev of pending) + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").delete(ev.id); + return; + } + const unanswered = pending.filter((ev) => !__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + for (const ev of unanswered) + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); + for (const held of [...__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").values()]) { + const verdict = __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").get(held.id); + if (verdict !== void 0) + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held, verdict); + } + const outstanding = unanswered.filter((ev) => !__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id) && !__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)); + if (lastWasEndTurn && outstanding.length === 0) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").arm(); + else + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").disarm(); + }, _SessionToolRunner_ingestHistory = function _SessionToolRunner_ingestHistory2(ev, pending) { + if (ev.type === "agent.tool_use" || ev.type === "agent.custom_tool_use") { + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").add(ev.id); + if (!__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)) + pending.push(ev); + } else if (ev.type === "user.tool_result") { + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); + } else if (ev.type === "user.custom_tool_result") { + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); + } else if (ev.type === "user.tool_confirmation") { + if (!__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.tool_use_id)) + __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); + } + }, _SessionToolRunner_handleStreamEvent = /** Returns true when the runner should exit. */ + async function _SessionToolRunner_handleStreamEvent2(ev) { + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").noteEvent(ev); + switch (ev.type) { + case "agent.tool_use": + case "agent.custom_tool_use": + if (!__classPrivateFieldGet(this, _SessionToolRunner_seen, "f").has(ev.id)) { + __classPrivateFieldGet(this, _SessionToolRunner_seen, "f").add(ev.id); + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); + } + return false; + case "user.tool_confirmation": + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_noteConfirmation).call(this, ev); + return false; + case "user.tool_result": + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); + return false; + case "user.custom_tool_result": + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); + return false; + case "session.status_terminated": + case "session.deleted": + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("session terminated", { + component: "session-tool-runner", + session_id: this.sessionId + }); + __classPrivateFieldGet(this, _SessionToolRunner_controller, "f").abort(); + return true; + default: + return false; + } + }, _SessionToolRunner_routeToolEvent = // ===== confirmation gating (always_ask tools) ===== + /** + * Dispatch `ev`, honoring its evaluated permission. A call the server gated + * (`evaluated_permission == "ask"`) is held until its `user.tool_confirmation` + * arrives. Fails closed: only an explicit `allow` verdict releases a gated + * call; a server-side `deny` overrides any recorded verdict; an unrecognized + * permission is held like `ask` and an unrecognized verdict is denied. + */ + async function _SessionToolRunner_routeToolEvent2(ev) { + const permission = ev.evaluated_permission; + const verdict = permission === "deny" ? "deny" : __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").get(ev.id); + if (verdict === void 0) { + if (permission === void 0 || permission === "allow") { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, void 0); + } else if (!__classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call awaiting confirmation; holding", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").set(ev.id, ev); + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").block(ev.id); + } + return; + } + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, ev, verdict); + }, _SessionToolRunner_noteConfirmation = /** Record an allow/deny verdict and release the held call it gates, if any. */ + async function _SessionToolRunner_noteConfirmation2(ev) { + __classPrivateFieldGet(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); + const held = __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").get(ev.tool_use_id); + if (held === void 0) + return; + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held, ev.result); + }, _SessionToolRunner_applyVerdict = /** + * Dispatch or resolve a gated call according to its verdict. + * + * The idle-clock blocker accounting lives here: a denial retires the held + * call's blocker, while an allow keeps one on the call — taking it now if the + * verdict was already known when the call was routed, so it was never held — + * until `#execute` has finished with it. The countdown must not run over + * gated work that is still in flight. + */ + async function _SessionToolRunner_applyVerdict2(ev, verdict) { + const wasHeld = __classPrivateFieldGet(this, _SessionToolRunner_awaitingConfirmation, "f").delete(ev.id); + if (verdict === "allow") { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call confirmed", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + if (!wasHeld) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").block(ev.id); + try { + await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, "allow"); + } finally { + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); + } + return; + } + if (wasHeld) + __classPrivateFieldGet(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool call denied; not executing", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + toolUseId: ev.id, + name: ev.name, + isError: false, + posted: false, + confirmation: "deny" + }); + }, _SessionToolRunner_surfaceCall = function _SessionToolRunner_surfaceCall2(call) { + __classPrivateFieldGet(this, _SessionToolRunner_results, "f").push(call); + }, _SessionToolRunner_execute = // ===== tool execution ===== + async function _SessionToolRunner_execute2(ev, confirmation) { + var _a6, _b; + if (__classPrivateFieldGet(this, _SessionToolRunner_answered, "f").has(ev.id)) + return; + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("executing tool", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldSet(this, _SessionToolRunner_inFlightCount, (_a6 = __classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f"), _a6++, _a6), "f"); + try { + const tool = __classPrivateFieldGet(this, _SessionToolRunner_toolByName, "f").get(ev.name); + if (!tool) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner", { + component: "session-tool-runner", + session_id: this.sessionId, + tool: ev.name, + tool_use_id: ev.id + }); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + toolUseId: ev.id, + name: ev.name, + isError: false, + posted: false, + confirmation + }); + return; + } + let content; + let isError; + const toolCtrl = new AbortController(); + const detachTool = linkAbort(__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal, toolCtrl); + const timer = setTimeout(() => toolCtrl.abort(), TOOL_TIMEOUT_MS); + try { + const outcome = await runRunnableTool(tool, ev.input, { + toolUse: ev, + toolUseBlock: ev, + signal: toolCtrl.signal + }); + content = outcome.content; + isError = outcome.isError; + } finally { + clearTimeout(timer); + detachTool(); + } + const result = buildResultEvent(ev, isError, toSessionContent(content)); + const posted = await __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_sendResult).call(this, result, ev.id); + __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { + event: ev, + result, + toolUseId: ev.id, + name: ev.name, + isError, + posted, + confirmation + }); + } finally { + __classPrivateFieldSet(this, _SessionToolRunner_inFlightCount, (_b = __classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f"), _b--, _b), "f"); + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") === 0) + __classPrivateFieldGet(this, _SessionToolRunner_onIdle, "f")?.call(this); + } + }, _SessionToolRunner_sendResult = async function _SessionToolRunner_sendResult2(result, toolUseId) { + const ctrl = __classPrivateFieldGet(this, _SessionToolRunner_controller, "f"); + const start = Date.now(); + let lastErr; + let attempt = 0; + while (true) { + attempt++; + ctrl.signal.throwIfAborted(); + try { + await this.client.beta.sessions.events.send(this.sessionId, { events: [result] }, __classPrivateFieldGet(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); + __classPrivateFieldGet(this, _SessionToolRunner_answered, "f").add(toolUseId); + return true; + } catch (e) { + lastErr = e; + if (isFatal4xx(e)) + break; + const remainingMs = __classPrivateFieldGet(this, _SessionToolRunner_sendRetryWindowMs, "f") - (Date.now() - start); + if (remainingMs <= 0) + break; + const waitMs = Math.min(applyJitter(backoff(attempt - 1, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS)), remainingMs); + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("tool result send failed; retrying", { + tool_use_id: toolUseId, + attempt, + backoff_ms: waitMs, + error: String(e) + }); + await sleep(waitMs, ctrl.signal); + } + } + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").error("failed to send tool result", { + tool_use_id: toolUseId, + attempts: attempt, + error: String(lastErr) + }); + return false; + }, _SessionToolRunner_drain = /** Wait (bounded) for in-flight tool executions to finish during teardown. */ + async function _SessionToolRunner_drain2() { + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") === 0) + return; + await Promise.race([new Promise((r) => __classPrivateFieldSet(this, _SessionToolRunner_onIdle, r, "f")), sleep(DRAIN_TIMEOUT_MS)]); + __classPrivateFieldSet(this, _SessionToolRunner_onIdle, null, "f"); + if (__classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f") > 0) { + __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").warn("drain timeout exceeded"); + } + }; + return SessionToolRunner2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs +function checkMemorySyncInterval(ms, option) { + if (!(ms >= MIN_MEMORY_SYNC_INTERVAL_MS)) { + throw new AnthropicError(`${option} must be at least ${MIN_MEMORY_SYNC_INTERVAL_MS}ms (got ${ms}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`); + } +} +var DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS; +var init_sync_interval = __esm({ + "node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs"() { + init_error(); + DEFAULT_MEMORY_SYNC_INTERVAL_MS = 15e3; + MIN_MEMORY_SYNC_INTERVAL_MS = 5e3; + } +}); + +// node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +var node_browser_exports2 = {}; +__export(node_browser_exports2, { + BashSession: () => BashSession, + BashTimeoutError: () => BashTimeoutError, + DEFAULT_MEMORY_SYNC_INTERVAL_MS: () => DEFAULT_MEMORY_SYNC_INTERVAL_MS, + MARKER_PATH: () => MARKER_PATH, + MEMORY_FLUSH_TIMEOUT_MS: () => MEMORY_FLUSH_TIMEOUT_MS, + MIN_MEMORY_SYNC_INTERVAL_MS: () => MIN_MEMORY_SYNC_INTERVAL_MS, + SessionMemoryError: () => SessionMemoryError, + SessionMemoryStores: () => SessionMemoryStores, + betaAgentToolset20260401: () => betaAgentToolset20260401, + betaBashTool: () => betaBashTool, + betaEditTool: () => betaEditTool, + betaGlobTool: () => betaGlobTool, + betaGrepTool: () => betaGrepTool, + betaReadTool: () => betaReadTool, + betaWriteTool: () => betaWriteTool, + extractSkillArchive: () => extractSkillArchive, + resolvePath: () => resolvePath, + setupSkills: () => setupSkills +}); +function nodeOnly(name) { + throw new AnthropicError(`${name} requires Node.js or a Node-compatible runtime`); +} +function setupSkills(_ctx) { + return nodeOnly("setupSkills"); +} +function extractSkillArchive(_resp, _dest) { + return nodeOnly("extractSkillArchive"); +} +function betaAgentToolset20260401(_ctx) { + return nodeOnly("betaAgentToolset20260401"); +} +function resolvePath(_ctx, _p) { + return nodeOnly("resolvePath"); +} +function betaBashTool(_ctx) { + return nodeOnly("betaBashTool"); +} +function betaReadTool(_ctx) { + return nodeOnly("betaReadTool"); +} +function betaWriteTool(_ctx) { + return nodeOnly("betaWriteTool"); +} +function betaEditTool(_ctx) { + return nodeOnly("betaEditTool"); +} +function betaGlobTool(_ctx) { + return nodeOnly("betaGlobTool"); +} +function betaGrepTool(_ctx) { + return nodeOnly("betaGrepTool"); +} +var MEMORY_FLUSH_TIMEOUT_MS, MARKER_PATH, SessionMemoryError, SessionMemoryStores, BashTimeoutError, BashSession; +var init_node_browser2 = __esm({ + "node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs"() { + init_error(); + init_sync_interval(); + MEMORY_FLUSH_TIMEOUT_MS = 3e4; + MARKER_PATH = ".anthropic-memory-store"; + SessionMemoryError = class extends AnthropicError { + constructor(message, cause) { + super(message); + this.name = "SessionMemoryError"; + if (cause !== void 0) + this.cause = cause; + } + }; + SessionMemoryStores = class { + constructor(_client, _opts) { + nodeOnly("SessionMemoryStores"); + } + get roots() { + return nodeOnly("SessionMemoryStores"); + } + get readOnlyRoots() { + return nodeOnly("SessionMemoryStores"); + } + download(_session) { + return nodeOnly("SessionMemoryStores"); + } + finish() { + return nodeOnly("SessionMemoryStores"); + } + /** @internal */ + syncAll(_final) { + return nodeOnly("SessionMemoryStores"); + } + syncIfDue() { + return nodeOnly("SessionMemoryStores"); + } + flushWrites(_signal) { + return nodeOnly("SessionMemoryStores"); + } + dispose() { + return nodeOnly("SessionMemoryStores"); + } + }; + BashTimeoutError = class extends AnthropicError { + constructor(timeoutMs) { + super(`bash command timed out after ${timeoutMs}ms`); + this.name = "BashTimeoutError"; + this.timeoutMs = timeoutMs; + } + }; + BashSession = class { + constructor(_dir, _env) { + nodeOnly("BashSession"); + } + get closed() { + return nodeOnly("BashSession"); + } + exec(_command, _opts = {}) { + return nodeOnly("BashSession"); + } + close() { + nodeOnly("BashSession"); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +function hasMemoryStore(session) { + return session.resources.some((r) => r.type === "memory_store"); +} +function sessionsTokenFromSecret(secret) { + if (!secret) + return null; + let parsed; + try { + const normalized = secret.replace(/-/g, "+").replace(/_/g, "/"); + const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "="); + parsed = JSON.parse(decodeUTF8(fromBase64(padded))); + } catch { + return null; + } + if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) + return null; + const token = parsed.sessions_token; + return typeof token === "string" && token !== "" ? token : null; +} +async function withTimeout(p, ms) { + let timer; + try { + return await Promise.race([ + p.then(() => false, () => false), + new Promise((resolve2) => { + timer = setTimeout(() => resolve2(true), ms); + }) + ]); + } finally { + if (timer !== void 0) + clearTimeout(timer); + } +} +async function forceStop(client, work, log, requestOptions) { + try { + await client.beta.environments.work.stop( + work.id, + { environment_id: work.environment_id, force: true }, + // Caller's headers pass through; the helper-tag header is on the scoped + // sub-client's default_headers via copyClientForHelper, so no per-call + // re-stamping needed. + { ...requestOptions, headers: buildHeaders([requestOptions?.headers]) } + ); + } catch (e) { + if (!isStatus(e, 409)) { + log.error("force-stop on exit failed", { work_id: work.id, error: String(e) }); + } + } +} +function serverLeaseState(e) { + let node = e instanceof APIError ? e.error : void 0; + for (const key of ["error", "details", "current_state"]) { + if (!isObj(node)) + return {}; + node = node[key]; + } + return isObj(node) ? node : {}; +} +async function heartbeatLoop(client, work, lease, logger, requestOptions, onLeaseTtl) { + let intervalMs = HEARTBEAT_DEFAULT_MS; + let ttlMs = HEARTBEAT_TTL_DEFAULT_MS; + let lastSuccessMs = Date.now(); + let last = NO_HEARTBEAT_SENTINEL; + const beat = async () => { + const beatCtrl = new AbortController(); + const detach = linkAbort(lease.signal, beatCtrl); + const cutoff = setTimeout(() => beatCtrl.abort(), intervalMs); + try { + const resp = await client.beta.environments.work.heartbeat(work.id, { environment_id: work.environment_id, expected_last_heartbeat: last }, { ...requestOptions, headers: buildHeaders([requestOptions?.headers]), signal: beatCtrl.signal }); + lastSuccessMs = Date.now(); + last = resp.last_heartbeat; + if (resp.ttl_seconds > 0) { + ttlMs = resp.ttl_seconds * 1e3; + intervalMs = Math.max(1e3, Math.min(ttlMs / 2, HEARTBEAT_DEFAULT_MS)); + onLeaseTtl?.(ttlMs); + } + if (resp.state === "stopping" || resp.state === "stopped") { + logger.info("heartbeat signals shutdown", { work_id: work.id, state: resp.state }); + lease.finish("control_plane_stop"); + } + if (!resp.lease_extended) { + logger.warn("lease not extended, shutting down", { work_id: work.id }); + lease.finish("control_plane_stop"); + } + } catch (e) { + lease.signal.throwIfAborted(); + if (isStatus(e, 412)) { + const server = serverLeaseState(e); + logger.error("lease lost: heartbeat precondition failed", { + work_id: work.id, + server_state: server["state"], + server_ttl_seconds: server["ttl_seconds"], + server_last_heartbeat: server["last_heartbeat"] + }); + lease.finish("lease_lost"); + return; + } + if (isFatal4xx(e)) { + logger.error("permanent heartbeat failure", { work_id: work.id, error: String(e) }); + lease.finish("heartbeat_rejected"); + throw e; + } + if (Date.now() - lastSuccessMs > ttlMs) { + logger.error("lease assumed lost: no successful heartbeat in ttl", { + work_id: work.id, + ttl_ms: ttlMs, + error: String(e) + }); + lease.finish("assumed_lost"); + return; + } + logger.warn("transient heartbeat failure", { work_id: work.id, error: String(e) }); + } finally { + clearTimeout(cutoff); + detach(); + } + }; + await beat(); + while (!lease.signal.aborted) { + await sleep(intervalMs, lease.signal); + lease.signal.throwIfAborted(); + await beat(); + } +} +var _EnvironmentWorker_instances, _EnvironmentWorker_signal, _EnvironmentWorker_handleItem, _Lease_ctrl, _Lease_endReason, HEARTBEAT_DEFAULT_MS, HEARTBEAT_TTL_DEFAULT_MS, NO_HEARTBEAT_SENTINEL, EnvironmentWorker, Lease; +var init_worker = __esm({ + "node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs"() { + init_tslib(); + init_error(); + init_log(); + init_base64(); + init_bytes(); + init_env(); + init_sleep(); + init_backoff(); + init_abort2(); + init_values(); + init_headers(); + init_SessionToolRunner(); + init_poller(); + init_helper_client(); + init_sync_interval(); + HEARTBEAT_DEFAULT_MS = 3e4; + HEARTBEAT_TTL_DEFAULT_MS = 9e4; + NO_HEARTBEAT_SENTINEL = "NO_HEARTBEAT"; + EnvironmentWorker = /* @__PURE__ */ (() => { + class EnvironmentWorker2 { + constructor(opts) { + _EnvironmentWorker_instances.add(this); + _EnvironmentWorker_signal.set(this, void 0); + if (opts.unrestrictedPaths !== void 0) { + throw new AnthropicError("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory."); + } + this.client = opts.client; + this.environmentId = opts.environmentId; + this.environmentKey = opts.environmentKey; + this.tools = opts.tools; + this.workdir = opts.workdir ?? process.cwd(); + this.maxFileBytes = opts.maxFileBytes; + this.maxIdleMs = opts.maxIdleMs; + if (opts.memorySyncIntervalMs != null) { + checkMemorySyncInterval(opts.memorySyncIntervalMs, "memorySyncIntervalMs"); + } + this.memorySyncIntervalMs = opts.memorySyncIntervalMs; + this.memorySyncDeletions = opts.memorySyncDeletions ?? "enabled"; + this.workerId = opts.workerId; + this.requestOptions = opts.requestOptions; + __classPrivateFieldSet(this, _EnvironmentWorker_signal, opts.signal, "f"); + } + /** + * Poll the environment and service each claimed session until the supplied + * signal (or the one passed to the constructor) aborts. Throws if + * `environmentId` / `environmentKey` were not provided to the constructor. + */ + async run(signal) { + const { environmentId, environmentKey } = this; + if (environmentId === void 0 || environmentKey === void 0) { + throw new AnthropicError("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work"); + } + const externalSignal = signal ?? __classPrivateFieldGet(this, _EnvironmentWorker_signal, "f"); + const poller = new WorkPoller({ + client: this.client, + environmentId, + environmentKey, + ...this.workerId !== void 0 ? { workerId: this.workerId } : {}, + ...externalSignal ? { signal: externalSignal } : {}, + ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, + // The per-item handler stops or releases every work item on exit; let it + // be the single owner of `work.stop` rather than double-posting from the + // poller. + autoStop: false + }); + for await (const work of poller) { + try { + await __classPrivateFieldGet(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, poller.signal); + } catch (e) { + if (poller.signal?.aborted) + throw e; + loggerFor(this.client).error("work item failed", { work_id: work.id, error: String(e) }); + } + } + } + /** + * Service a single, already-claimed work item without the poll loop: build the + * per-session {@link AgentToolContext} (workdir from this worker's options), + * download the session agent's skills (`setupSkills`), run a + * {@link SessionToolRunner} for the session while heartbeating the work-item + * lease, and force-stop the work item on exit (whether the runner finishes + * normally, throws, or the control plane signals shutdown). The one + * exception is a lost lease: the item then belongs to the queue or another + * worker and is left alone. + * + * Use this when something else does the claiming — e.g. a `worker poll + * --on-work` script that hands an already-claimed item to a fresh process. The + * work id / environment id / session id each fall back to `ANTHROPIC_WORK_ID` / + * `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that + * command sets) when not passed; the environment key resolves from this + * option, then the worker's own `environmentKey`, then + * `ANTHROPIC_ENVIRONMENT_KEY`, and is needed only when the work item's + * `secret` yields no sessions token — a host that receives only the + * per-item secret runs without ever holding the key. With no arguments + * inside that command it just works. Throws a clear error naming the first + * required value still missing after resolution, and — rather than ever + * running unauthenticated — when neither a sessions token nor an + * environment key resolved. Throws `SessionMemoryError` when the + * session has memory stores attached but they cannot be mounted — the work + * item carried no sessions token (unless `memorySyncIntervalMs` turned + * memory off), or a store failed to download. + * + * `workSecret` is the work item's per-item `secret` payload from the poll + * response, falling back to `ANTHROPIC_WORK_SECRET`; unlike the others it is + * optional — when present, the sessions token extracted from it is preferred + * as the Bearer credential for this item's heartbeat / force-stop / session + * calls; when absent (or undecodable) those calls use the environment key. + */ + async handleItem(opts) { + const workId = opts?.workId ?? readEnv("ANTHROPIC_WORK_ID"); + const environmentId = opts?.environmentId ?? readEnv("ANTHROPIC_ENVIRONMENT_ID"); + const sessionId = opts?.sessionId ?? readEnv("ANTHROPIC_SESSION_ID"); + const environmentKey = (opts?.environmentKey ?? this.environmentKey ?? readEnv("ANTHROPIC_ENVIRONMENT_KEY")) || void 0; + const workSecret = opts?.workSecret || readEnv("ANTHROPIC_WORK_SECRET") || null; + if (!workId) { + throw new AnthropicError("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID"); + } + if (!environmentId) { + throw new AnthropicError("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID"); + } + if (!sessionId) { + throw new AnthropicError("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID"); + } + if (!environmentKey && !workSecret) { + throw new AnthropicError("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY"); + } + const work = { + id: workId, + environment_id: environmentId, + secret: workSecret, + data: { type: "session", id: sessionId } + }; + await __classPrivateFieldGet(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, opts?.signal ?? __classPrivateFieldGet(this, _EnvironmentWorker_signal, "f")); + } + } + _EnvironmentWorker_signal = /* @__PURE__ */ new WeakMap(), _EnvironmentWorker_instances = /* @__PURE__ */ new WeakSet(), _EnvironmentWorker_handleItem = /** + * The per-item body shared by {@link EnvironmentWorker.run}'s poll loop and + * {@link EnvironmentWorker.handleItem}: run a {@link SessionToolRunner} for the + * work item's session while heartbeating its lease, force-stopping on exit + * unless the lease was lost. Non-session work items are ignored. + * + * When the poll response carried a per-item `secret` (a short-lived payload + * scoped to this work item), the sessions token extracted from it is + * preferred over `environmentKey` as the Bearer credential for those + * per-item calls; a missing/undecodable secret falls back to + * `environmentKey` unchanged. + */ + async function _EnvironmentWorker_handleItem2(work, environmentKey, externalSignal) { + const log = loggerFor(this.client); + const sessionsToken = sessionsTokenFromSecret(work.secret); + const itemCredential = sessionsToken ?? environmentKey; + if (itemCredential === void 0) { + throw new AnthropicError("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)"); + } + if (work.secret && sessionsToken === null) { + log.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key", { work_id: work.id }); + } + const sessionClient = copyClientForHelper(this.client, { + authToken: itemCredential, + helper: "environments-worker" + }); + const sessionId = work.data.id; + const ctrl = new AbortController(); + const detachExternal = linkAbort(externalSignal, ctrl); + const lease = new Lease(ctrl); + const agentToolset = await Promise.resolve().then(() => (init_node_browser2(), node_browser_exports2)); + let leaseTtlMs; + let runner; + const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => { + leaseTtlMs = ttlMs; + runner?._setSendRetryWindow(ttlMs); + }).catch((e) => { + if (!ctrl.signal.aborted) + log.error("heartbeat loop failed", { work_id: work.id, error: String(e) }); + ctrl.abort(); + }); + let cleanupSkills = async () => { + }; + let stores; + let cleanEnd = false; + try { + if (work.data.type !== "session") { + log.debug("skipping non-session work item", { work_id: work.id, type: work.data.type }); + return; + } + const session = await sessionClient.beta.sessions.retrieve(sessionId); + if (sessionsToken === null && this.memorySyncIntervalMs !== null && hasMemoryStore(session)) { + throw new agentToolset.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${work.id}, session_id=${sessionId}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`); + } + const ctx = { + workdir: this.workdir, + // The scoped sub-client, not the parent: the skill download + // `setupSkills` performs for this session rides the same per-item + // credential as every other per-item call. + client: sessionClient, + session, + ...this.maxFileBytes !== void 0 ? { maxFileBytes: this.maxFileBytes } : {} + }; + try { + cleanupSkills = await agentToolset.setupSkills(ctx); + } catch (e) { + log.warn("skill setup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); + } + if (sessionsToken !== null && this.memorySyncIntervalMs !== null) { + stores = new agentToolset.SessionMemoryStores(sessionClient, { + workdir: this.workdir, + ...this.memorySyncIntervalMs !== void 0 ? { syncIntervalMs: this.memorySyncIntervalMs } : {}, + syncDeletions: this.memorySyncDeletions + }); + await stores.download(session); + ctx.allowedRoots = stores.roots; + ctx.readOnlyRoots = stores.readOnlyRoots; + } else { + log.debug("memory stores disabled for this item", { work_id: work.id }); + } + const tools = typeof this.tools === "function" ? this.tools(ctx) : this.tools ?? agentToolset.betaAgentToolset20260401(ctx); + runner = new SessionToolRunner(sessionId, { + client: sessionClient, + tools, + ...this.maxIdleMs !== void 0 ? { maxIdleMs: this.maxIdleMs } : {}, + ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, + signal: ctrl.signal + }); + if (leaseTtlMs !== void 0) + runner._setSendRetryWindow(leaseTtlMs); + for await (const _ of runner) { + if (stores) + await stores.syncIfDue(); + } + cleanEnd = !ctrl.signal.aborted; + } finally { + try { + await cleanupSkills().catch((e) => { + log.warn("skill cleanup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); + }); + } finally { + if (stores) { + const boundMs = agentToolset.MEMORY_FLUSH_TIMEOUT_MS; + if (cleanEnd) { + const finishCutOff = await withTimeout(stores.finish(), boundMs); + if (finishCutOff) { + log.warn(`final memory sync cut off after ${boundMs}ms; the flush that follows still uploads changed files`, { session_id: sessionId, work_id: work.id }); + } + } + const flushBound = new AbortController(); + const flushCutOff = await withTimeout(stores.flushWrites(flushBound.signal), boundMs); + if (flushCutOff) { + flushBound.abort(); + log.warn(`memory flush cut off after ${boundMs}ms; changed files it had not uploaded yet are not saved`, { session_id: sessionId, work_id: work.id }); + } + await stores.dispose().catch((e) => { + log.warn("memory store cleanup failed", { + session_id: sessionId, + work_id: work.id, + error: String(e) + }); + }); + } + } + lease.finish("runner_done"); + detachExternal(); + await heartbeatPromise; + if (lease.lost) { + log.info("lease lost; released without stopping it", { session_id: sessionId, work_id: work.id }); + } else { + await forceStop(sessionClient, work, log, this.requestOptions); + } + } + }; + return EnvironmentWorker2; + })(); + Lease = /* @__PURE__ */ (() => { + class Lease2 { + constructor(ctrl) { + _Lease_ctrl.set(this, void 0); + _Lease_endReason.set(this, void 0); + __classPrivateFieldSet(this, _Lease_ctrl, ctrl, "f"); + } + get signal() { + return __classPrivateFieldGet(this, _Lease_ctrl, "f").signal; + } + finish(reason) { + __classPrivateFieldSet(this, _Lease_endReason, __classPrivateFieldGet(this, _Lease_endReason, "f") ?? reason, "f"); + __classPrivateFieldGet(this, _Lease_ctrl, "f").abort(); + } + /** True once the item belongs to the queue or another worker. */ + get lost() { + return __classPrivateFieldGet(this, _Lease_endReason, "f") === "lease_lost" || __classPrivateFieldGet(this, _Lease_endReason, "f") === "assumed_lost"; + } + } + _Lease_ctrl = /* @__PURE__ */ new WeakMap(), _Lease_endReason = /* @__PURE__ */ new WeakMap(); + return Lease2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +var Work; +var init_work = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + init_poller(); + init_worker(); + Work = /* @__PURE__ */ (() => { + class Work2 extends APIResource { + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Retrieve detailed information about a specific work item. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.retrieve('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + retrieve(workID, params, options) { + const { environment_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/environments/${environment_id}/work/${workID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Update work item metadata with merge semantics. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.update('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * metadata: { foo: 'string' }, + * }); + * ``` + */ + update(workID, params, options) { + const { environment_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * List work items in an environment. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSelfHostedWork of client.beta.environments.work.list( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * )) { + * // ... + * } + * ``` + */ + list(environmentID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/environments/${environmentID}/work?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' + * and removing it from the queue. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.ack('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + ack(workID, params, options) { + const { environment_id, betas } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/ack?beta=true`, { + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Record a heartbeat for a work item to maintain the lease. + * + * @example + * ```ts + * const betaSelfHostedWorkHeartbeatResponse = + * await client.beta.environments.work.heartbeat('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + heartbeat(workID, params, options) { + const { environment_id, desired_ttl_seconds, expected_last_heartbeat, betas } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/heartbeat?beta=true`, { + query: { desired_ttl_seconds, expected_last_heartbeat }, + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Long poll for work items in the queue. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.poll( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + poll(environmentID, params = {}, options) { + const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}/work/poll?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...anthropicWorkerID != null ? { "Anthropic-Worker-ID": anthropicWorkerID } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get statistics about the work queue for an environment. + * + * @example + * ```ts + * const betaSelfHostedWorkQueueStats = + * await client.beta.environments.work.stats( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + stats(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}/work/stats?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Note: these endpoints are called automatically by the pre-built environment + * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted + * sandbox environments. They are included here as a reference; you do not need to + * invoke them directly. + * + * Stop a work item, initiating graceful or forced shutdown. + * + * @example + * ```ts + * const betaSelfHostedWork = + * await client.beta.environments.work.stop('work_id', { + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + stop(workID, params, options) { + const { environment_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environment_id}/work/${workID}/stop?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Continuously claim work from a self-hosted environment, ack each item, + * and yield it. Posts `stop` automatically when the consumer's loop body + * returns or when iteration ends. + * + * @example + * ```ts + * for await (const work of client.beta.environments.work.poller({ + * environmentId, + * environmentKey, + * })) { + * if (work.data.type !== 'session') continue; + * // ...service the work... + * } + * ``` + */ + poller(opts) { + return new WorkPoller({ ...opts, client: this._client }); + } + worker(opts) { + return new EnvironmentWorker({ ...opts, client: this._client }); + } + } + Work2.WorkPoller = WorkPoller; + Work2.EnvironmentWorker = EnvironmentWorker; + return Work2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +var Environments; +var init_environments = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs"() { + init_resource(); + init_work(); + init_work(); + init_pagination(); + init_headers(); + init_path(); + Environments = /* @__PURE__ */ (() => { + class Environments3 extends APIResource { + constructor() { + super(...arguments); + this.work = new Work(this._client); + } + /** + * Create a new environment with the specified configuration. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.create({ + * name: 'python-data-analysis', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/environments?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a specific environment by ID. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.retrieve( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + retrieve(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/environments/${environmentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update an existing environment's configuration. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.update( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + update(environmentID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/environments/${environmentID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List environments with pagination support. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaEnvironment of client.beta.environments.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/environments?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete an environment by ID. Returns a confirmation of the deletion. + * + * @example + * ```ts + * const betaEnvironmentDeleteResponse = + * await client.beta.environments.delete( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + delete(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/environments/${environmentID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive an environment by ID. Archived environments cannot be used to create new + * sessions. + * + * @example + * ```ts + * const betaEnvironment = + * await client.beta.environments.archive( + * 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * ); + * ``` + */ + archive(environmentID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/environments/${environmentID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Environments3.Work = Work; + return Environments3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +var Memories; +var init_memories = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Memories = class extends APIResource { + /** + * Create a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.create( + * 'memory_store_id', + * { content: 'content', path: 'xx' }, + * ); + * ``` + */ + create(memoryStoreID, params, options) { + const { view: view2, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, { + query: { view: view2 }, + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.retrieve( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + retrieve(memoryID, params, options) { + const { memory_store_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update a memory + * + * @example + * ```ts + * const betaManagedAgentsMemory = + * await client.beta.memoryStores.memories.update( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + update(memoryID, params, options) { + const { memory_store_id, view: view2, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query: { view: view2 }, + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memories + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryListItem of client.beta.memoryStores.memories.list( + * 'memory_store_id', + * )) { + * // ... + * } + * ``` + */ + list(memoryStoreID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a memory + * + * @example + * ```ts + * const betaManagedAgentsDeletedMemory = + * await client.beta.memoryStores.memories.delete( + * 'memory_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + delete(memoryID, params, options) { + const { memory_store_id, expected_content_sha256, betas, workspace_id } = params; + return this._client.delete(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { + query: { expected_content_sha256 }, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +var MemoryVersions; +var init_memory_versions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + MemoryVersions = class extends APIResource { + /** + * Retrieve a memory version + * + * @example + * ```ts + * const betaManagedAgentsMemoryVersion = + * await client.beta.memoryStores.memoryVersions.retrieve( + * 'memory_version_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + retrieve(memoryVersionID, params, options) { + const { memory_store_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memory versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryVersion of client.beta.memoryStores.memoryVersions.list( + * 'memory_store_id', + * )) { + * // ... + * } + * ``` + */ + list(memoryStoreID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Redact a memory version + * + * @example + * ```ts + * const betaManagedAgentsMemoryVersion = + * await client.beta.memoryStores.memoryVersions.redact( + * 'memory_version_id', + * { memory_store_id: 'memory_store_id' }, + * ); + * ``` + */ + redact(memoryVersionID, params, options) { + const { memory_store_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +var MemoryStores; +var init_memory_stores = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs"() { + init_resource(); + init_memories(); + init_memories(); + init_memory_versions(); + init_memory_versions(); + init_pagination(); + init_headers(); + init_path(); + MemoryStores = /* @__PURE__ */ (() => { + class MemoryStores2 extends APIResource { + constructor() { + super(...arguments); + this.memories = new Memories(this._client); + this.memoryVersions = new MemoryVersions(this._client); + } + /** + * Create a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.create({ name: 'x' }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/memory_stores?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Retrieve a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.retrieve( + * 'memory_store_id', + * ); + * ``` + */ + retrieve(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.update('memory_store_id'); + * ``` + */ + update(memoryStoreID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List memory stores + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsMemoryStore of client.beta.memoryStores.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/memory_stores?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a memory store + * + * @example + * ```ts + * const betaManagedAgentsDeletedMemoryStore = + * await client.beta.memoryStores.delete('memory_store_id'); + * ``` + */ + delete(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/memory_stores/${memoryStoreID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive a memory store + * + * @example + * ```ts + * const betaManagedAgentsMemoryStore = + * await client.beta.memoryStores.archive('memory_store_id'); + * ``` + */ + archive(memoryStoreID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + MemoryStores2.Memories = Memories; + MemoryStores2.MemoryVersions = MemoryVersions; + return MemoryStores2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/error.mjs +var init_error2 = __esm({ + "node_modules/@anthropic-ai/sdk/error.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +var JSONLDecoder; +var init_jsonl = __esm({ + "node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs"() { + init_error(); + init_shims(); + init_line(); + JSONLDecoder = /* @__PURE__ */ (() => { + class JSONLDecoder2 { + constructor(iterator, controller) { + this.iterator = iterator; + this.controller = controller; + } + async *decoder() { + const lineDecoder = new LineDecoder(); + for await (const chunk of this.iterator) { + for (const line of lineDecoder.decode(chunk)) { + yield JSON.parse(line); + } + } + for (const line of lineDecoder.flush()) { + yield JSON.parse(line); + } + } + [Symbol.asyncIterator]() { + return this.decoder(); + } + static fromResponse(response, controller) { + if (!response.body) { + controller.abort(); + if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { + throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); + } + throw new AnthropicError(`Attempted to iterate over a response with no body`); + } + return new JSONLDecoder2(ReadableStreamToAsyncIterable(response.body), controller); + } + } + return JSONLDecoder2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +var Batches; +var init_batches = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_jsonl(); + init_error2(); + init_path(); + Batches = class extends APIResource { + /** + * Send a batch of Message creation requests. + * + * The Message Batches API can be used to process multiple Messages API requests at + * once. Once a Message Batch is created, it begins processing immediately. Batches + * can take up to 24 hours to complete. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.create({ + * requests: [ + * { + * custom_id: 'my-custom-id-1', + * params: { + * max_tokens: 1024, + * messages: [ + * { content: 'Hello, world', role: 'user' }, + * ], + * model: 'claude-opus-5', + * }, + * }, + * ], + * }); + * ``` + */ + create(params, options) { + const { betas, user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/batches?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * This endpoint is idempotent and can be used to poll for Message Batch + * completion. To access the results of a Message Batch, make a request to the + * `results_url` field in the response. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.retrieve( + * 'message_batch_id', + * ); + * ``` + */ + retrieve(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/messages/batches/${messageBatchID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List all Message Batches within a Workspace. Most recently created batches are + * returned first. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaMessageBatch of client.beta.messages.batches.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/messages/batches?beta=true", Page, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete a Message Batch. + * + * Message Batches can only be deleted once they've finished processing. If you'd + * like to delete an in-progress batch, you must first cancel it. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaDeletedMessageBatch = + * await client.beta.messages.batches.delete( + * 'message_batch_id', + * ); + * ``` + */ + delete(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/messages/batches/${messageBatchID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Batches may be canceled any time before processing ends. Once cancellation is + * initiated, the batch enters a `canceling` state, at which time the system may + * complete any in-progress, non-interruptible requests before finalizing + * cancellation. + * + * The number of canceled requests is specified in `request_counts`. To determine + * which requests were canceled, check the individual results within the batch. + * Note that cancellation may not result in any canceled requests if they were + * non-interruptible. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatch = + * await client.beta.messages.batches.cancel( + * 'message_batch_id', + * ); + * ``` + */ + cancel(messageBatchID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Streams the results of a Message Batch as a `.jsonl` file. + * + * Each line in the file is a JSON object containing the result of a single request + * in the Message Batch. Results are not guaranteed to be in the same order as + * requests. Use the `custom_id` field to match results to requests. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const betaMessageBatchIndividualResponse = + * await client.beta.messages.batches.results( + * 'message_batch_id', + * ); + * ``` + */ + async results(messageBatchID, params = {}, options) { + const batch = await this.retrieve(messageBatchID, params, options); + if (!batch.results_url) { + throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); + } + const { betas, workspace_id } = params ?? {}; + return this._client.get(batch.results_url, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true, + __binaryResponse: true + })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/internal/constants.mjs +var MODEL_NONSTREAMING_TOKENS; +var init_constants = __esm({ + "node_modules/@anthropic-ai/sdk/internal/constants.mjs"() { + MODEL_NONSTREAMING_TOKENS = { + "claude-opus-4@20250514": 8192, + "anthropic.claude-opus-4-1-20250805-v1:0": 8192, + "claude-opus-4-1@20250805": 8192 + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs +function getOutputFormat(params) { + return params?.output_format ?? params?.output_config?.format; +} +function maybeParseBetaMessage(message, params, opts) { + const outputFormat = getOutputFormat(params); + if (!params || !("parse" in (outputFormat ?? {}))) { + return { + ...message, + content: message.content.map((block) => { + if (block.type === "text") { + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: null, + enumerable: false + }); + return Object.defineProperty(parsedBlock, "parsed", { + get() { + opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); + return null; + }, + enumerable: false + }); + } + return block; + }), + parsed_output: null + }; + } + return parseBetaMessage(message, params, opts); +} +function parseBetaMessage(message, params, opts) { + let firstParsedOutput = null; + const content = message.content.map((block) => { + if (block.type === "text") { + const parsedOutput = parseBetaOutputFormat(params, block.text); + if (firstParsedOutput === null) { + firstParsedOutput = parsedOutput; + } + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: parsedOutput, + enumerable: false + }); + return Object.defineProperty(parsedBlock, "parsed", { + get() { + opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); + return parsedOutput; + }, + enumerable: false + }); + } + return block; + }); + return { + ...message, + content, + parsed_output: firstParsedOutput + }; +} +function parseBetaOutputFormat(params, content) { + const outputFormat = getOutputFormat(params); + if (outputFormat?.type !== "json_schema") { + return null; + } + try { + if ("parse" in outputFormat) { + return outputFormat.parse(content); + } + return JSON.parse(content); + } catch (error) { + throw new AnthropicError(`Failed to parse structured output: ${error}`); + } +} +var init_beta_parser = __esm({ + "node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/streaming.mjs +var init_streaming2 = __esm({ + "node_modules/@anthropic-ai/sdk/streaming.mjs"() { + init_streaming(); + } +}); + +// node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +var tokenize, strip, unstrip, generate, partialParse; +var init_parser = __esm({ + "node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs"() { + tokenize = (input) => { + let current = 0; + let tokens = []; + while (current < input.length) { + let char = input[current]; + if (char === "\\") { + current++; + continue; + } + if (char === "{") { + tokens.push({ + type: "brace", + value: "{" + }); + current++; + continue; + } + if (char === "}") { + tokens.push({ + type: "brace", + value: "}" + }); + current++; + continue; + } + if (char === "[") { + tokens.push({ + type: "paren", + value: "[" + }); + current++; + continue; + } + if (char === "]") { + tokens.push({ + type: "paren", + value: "]" + }); + current++; + continue; + } + if (char === ":") { + tokens.push({ + type: "separator", + value: ":" + }); + current++; + continue; + } + if (char === ",") { + tokens.push({ + type: "delimiter", + value: "," + }); + current++; + continue; + } + if (char === '"') { + const start = current + 1; + let end = start; + let danglingQuote = false; + while (true) { + end = input.indexOf('"', end); + if (end === -1) { + danglingQuote = true; + break; + } + let backslashes = 0; + let i = end - 1; + while (i >= start && input[i] === "\\") { + backslashes++; + i--; + } + if (backslashes % 2 === 0) + break; + end++; + } + if (danglingQuote) { + current = input.length; + } else { + tokens.push({ + type: "string", + value: input.slice(start, end) + }); + current = end + 1; + } + continue; + } + let WHITESPACE = /\s/; + if (char && WHITESPACE.test(char)) { + current++; + continue; + } + let NUMBERS = /[0-9]/; + if (char && NUMBERS.test(char) || char === "-" || char === ".") { + let value2 = ""; + if (char === "-") { + value2 += char; + char = input[++current]; + } + while (char && (NUMBERS.test(char) || char === "." || // exponent marker, e.g. `1e10` or `1.5E-9` + char === "e" || char === "E" || // exponent sign, only valid immediately after the exponent marker + (char === "-" || char === "+") && (value2[value2.length - 1] === "e" || value2[value2.length - 1] === "E"))) { + value2 += char; + char = input[++current]; + } + tokens.push({ + type: "number", + value: value2, + unterminated: current === input.length + }); + continue; + } + let LETTERS = /[a-z]/i; + if (char && LETTERS.test(char)) { + let value2 = ""; + while (char && LETTERS.test(char)) { + if (current === input.length) { + break; + } + value2 += char; + char = input[++current]; + } + if (value2 == "true" || value2 == "false" || value2 === "null") { + tokens.push({ + type: "name", + value: value2 + }); + } else { + current++; + continue; + } + continue; + } + current++; + } + return tokens; + }; + strip = (tokens) => { + let open = []; + for (const token of tokens) { + if (token.type === "brace" || token.type === "paren") { + if (token.value === "{" || token.value === "[") { + open.push(token.value); + } else { + open.pop(); + } + } + } + let innermostOpenBracket = open[open.length - 1]; + let length = tokens.length; + let JSON_NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/; + while (length > 0) { + let lastToken = tokens[length - 1]; + switch (lastToken.type) { + case "separator": + length--; + continue; + case "number": + if (lastToken.unterminated || !JSON_NUMBER.test(lastToken.value)) { + length--; + continue; + } + break; + case "string": + let tokenBeforeTheLastToken = tokens[length - 2]; + if (innermostOpenBracket === "{" && (tokenBeforeTheLastToken?.type === "delimiter" || tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{")) { + length--; + continue; + } + break; + case "delimiter": + length--; + break; + } + break; + } + return tokens.slice(0, length); + }; + unstrip = (tokens) => { + let tail = []; + tokens.map((token) => { + if (token.type === "brace") { + if (token.value === "{") { + tail.push("}"); + } else { + tail.splice(tail.lastIndexOf("}"), 1); + } + } + if (token.type === "paren") { + if (token.value === "[") { + tail.push("]"); + } else { + tail.splice(tail.lastIndexOf("]"), 1); + } + } + }); + if (tail.length > 0) { + tail.reverse().map((item) => { + if (item === "}") { + tokens.push({ + type: "brace", + value: "}" + }); + } else if (item === "]") { + tokens.push({ + type: "paren", + value: "]" + }); + } + }); + } + return tokens; + }; + generate = (tokens) => { + let output = ""; + tokens.map((token) => { + switch (token.type) { + case "string": + output += '"' + token.value + '"'; + break; + default: + output += token.value; + break; + } + }); + return output; + }; + partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input))))); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs +function withLazyInput(prev, jsonBuf) { + const next = {}; + for (const key of Object.keys(prev)) { + if (key !== "input") + next[key] = prev[key]; + } + Object.defineProperty(next, JSON_BUF_PROPERTY, { value: jsonBuf, enumerable: false, writable: true }); + let input; + let parsed = false; + Object.defineProperty(next, "input", { + enumerable: true, + configurable: true, + get() { + if (!parsed) { + input = jsonBuf ? partialParse(jsonBuf) : {}; + parsed = true; + } + return input; + } + }); + return next; +} +var JSON_BUF_PROPERTY; +var init_message_stream_utils = __esm({ + "node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs"() { + init_parser(); + JSON_BUF_PROPERTY = "__json_buf"; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +function tracksToolInput(content) { + return content.type === "tool_use" || content.type === "server_tool_use" || content.type === "mcp_tool_use"; +} +var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_params, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_workspace_id, _BetaMessageStream_logger, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage, _BetaMessageStream_toolInputParseError, BetaMessageStream; +var init_BetaMessageStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_error2(); + init_errors(); + init_values(); + init_streaming2(); + init_beta_parser(); + init_message_stream_utils(); + BetaMessageStream = /* @__PURE__ */ (() => { + class BetaMessageStream2 { + constructor(params, opts) { + _BetaMessageStream_instances.add(this); + this.messages = []; + this.receivedMessages = []; + _BetaMessageStream_currentMessageSnapshot.set(this, void 0); + _BetaMessageStream_params.set(this, null); + this.controller = new AbortController(); + _BetaMessageStream_connectedPromise.set(this, void 0); + _BetaMessageStream_resolveConnectedPromise.set(this, () => { + }); + _BetaMessageStream_rejectConnectedPromise.set(this, () => { + }); + _BetaMessageStream_endPromise.set(this, void 0); + _BetaMessageStream_resolveEndPromise.set(this, () => { + }); + _BetaMessageStream_rejectEndPromise.set(this, () => { + }); + _BetaMessageStream_listeners.set(this, {}); + _BetaMessageStream_ended.set(this, false); + _BetaMessageStream_errored.set(this, false); + _BetaMessageStream_aborted.set(this, false); + _BetaMessageStream_catchingPromiseCreated.set(this, false); + _BetaMessageStream_response.set(this, void 0); + _BetaMessageStream_request_id.set(this, void 0); + _BetaMessageStream_workspace_id.set(this, void 0); + _BetaMessageStream_logger.set(this, void 0); + _BetaMessageStream_handleError.set(this, (error) => { + __classPrivateFieldSet(this, _BetaMessageStream_errored, true, "f"); + if (isAbortError(error)) { + error = new APIUserAbortError(); + } + if (error instanceof APIUserAbortError) { + __classPrivateFieldSet(this, _BetaMessageStream_aborted, true, "f"); + return this._emit("abort", error); + } + if (error instanceof AnthropicError) { + return this._emit("error", error); + } + if (error instanceof Error) { + const anthropicError = new AnthropicError(error.message); + anthropicError.cause = error; + return this._emit("error", anthropicError); + } + return this._emit("error", new AnthropicError(String(error))); + }); + __classPrivateFieldSet(this, _BetaMessageStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_rejectConnectedPromise, reject2, "f"); + }), "f"); + __classPrivateFieldSet(this, _BetaMessageStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_rejectEndPromise, reject2, "f"); + }), "f"); + __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, "f").catch(() => { + }); + __classPrivateFieldGet(this, _BetaMessageStream_endPromise, "f").catch(() => { + }); + __classPrivateFieldSet(this, _BetaMessageStream_params, params, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_logger, opts?.logger ?? console, "f"); + } + get response() { + return __classPrivateFieldGet(this, _BetaMessageStream_response, "f"); + } + get request_id() { + return __classPrivateFieldGet(this, _BetaMessageStream_request_id, "f"); + } + get workspace_id() { + return __classPrivateFieldGet(this, _BetaMessageStream_workspace_id, "f"); + } + /** + * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, + * returned vie the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * This is the same as the `APIPromise.withResponse()` method. + * + * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` + * as no `Response` is available. + */ + async withResponse() { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + const response = await __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, "f"); + if (!response) { + throw new Error("Could not resolve a `Response` object"); + } + return { + data: this, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + /** + * Intended for use on the frontend, consuming a stream produced with + * `.toReadableStream()` on the backend. + * + * Note that messages sent to the model do not appear in `.on('message')` + * in this context. + */ + static fromReadableStream(stream5) { + const runner = new BetaMessageStream2(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; + } + static createMessage(messages, params, options, { logger } = {}) { + const runner = new BetaMessageStream2(params, { logger }); + for (const message of params.messages) { + runner._addMessageParam(message); + } + __classPrivateFieldSet(runner, _BetaMessageStream_params, { ...params, stream: true }, "f"); + runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return runner; + } + _run(executor) { + executor().then(() => { + this._emitFinal(); + this._emit("end"); + }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f")); + } + _addMessageParam(message) { + this.messages.push(message); + } + _addMessage(message, emit = true) { + this.receivedMessages.push(message); + if (emit) { + this._emit("message", message); + } + } + async _createMessage(messages, params, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); + const { response, data: stream5 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); + this._connected(response); + for await (const event of stream5) { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + _connected(response) { + if (this.ended) + return; + __classPrivateFieldSet(this, _BetaMessageStream_response, response, "f"); + __classPrivateFieldSet(this, _BetaMessageStream_request_id, response?.headers.get("request-id"), "f"); + __classPrivateFieldSet(this, _BetaMessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); + __classPrivateFieldGet(this, _BetaMessageStream_resolveConnectedPromise, "f").call(this, response); + this._emit("connect"); + } + get ended() { + return __classPrivateFieldGet(this, _BetaMessageStream_ended, "f"); + } + get errored() { + return __classPrivateFieldGet(this, _BetaMessageStream_errored, "f"); + } + get aborted() { + return __classPrivateFieldGet(this, _BetaMessageStream_aborted, "f"); + } + abort() { + this.controller.abort(); + } + /** + * Adds the listener function to the end of the listeners array for the event. + * No checks are made to see if the listener has already been added. Multiple calls passing + * the same combination of event and listener will result in the listener being added, and + * called, multiple times. + * @returns this MessageStream, so that calls can be chained + */ + on(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = []); + listeners.push({ listener }); + return this; + } + /** + * Removes the specified listener from the listener array for the event. + * off() will remove, at most, one instance of a listener from the listener array. If any single + * listener has been added multiple times to the listener array for the specified event, then + * off() must be called multiple times to remove each instance. + * @returns this MessageStream, so that calls can be chained + */ + off(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event]; + if (!listeners) + return this; + const index = listeners.findIndex((l) => l.listener === listener); + if (index >= 0) + listeners.splice(index, 1); + return this; + } + /** + * Adds a one-time listener function for the event. The next time the event is triggered, + * this listener is removed and then invoked. + * @returns this MessageStream, so that calls can be chained + */ + once(event, listener) { + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = []); + listeners.push({ listener, once: true }); + return this; + } + /** + * This is similar to `.once()`, but returns a Promise that resolves the next time + * the event is triggered, instead of calling a listener callback. + * @returns a Promise that resolves the next time given event is triggered, + * or rejects if an error is emitted. (If you request the 'error' event, + * returns a promise that resolves with the error). + * + * Example: + * + * const message = await stream.emitted('message') // rejects if the stream errors + */ + emitted(event) { + return new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + if (event !== "error") + this.once("error", reject2); + this.once(event, resolve2); + }); + } + async done() { + __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet(this, _BetaMessageStream_endPromise, "f"); + } + get currentMessage() { + return __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + } + /** + * @returns a promise that resolves with the the final assistant Message response, + * or rejects if an error occurred or the stream ended prematurely without producing a Message. + * If structured outputs were used, this will be a ParsedMessage with a `parsed` field. + */ + async finalMessage() { + await this.done(); + return __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this); + } + /** + * @returns a promise that resolves with the the final assistant Message's text response, concatenated + * together if there are more than one text blocks. + * Rejects if an error occurred or the stream ended prematurely without producing a Message. + */ + async finalText() { + await this.done(); + return __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalText).call(this); + } + _emit(event, ...args) { + if (__classPrivateFieldGet(this, _BetaMessageStream_ended, "f")) + return; + if (event === "end") { + __classPrivateFieldSet(this, _BetaMessageStream_ended, true, "f"); + __classPrivateFieldGet(this, _BetaMessageStream_resolveEndPromise, "f").call(this); + } + const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event]; + if (listeners) { + __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); + listeners.forEach(({ listener }) => listener(...args)); + } + if (event === "abort") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + return; + } + if (event === "error") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + } + } + _emitFinal() { + const finalMessage = this.receivedMessages.at(-1); + if (finalMessage) { + this._emit("finalMessage", __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this)); + } + } + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); + this._connected(null); + const stream5 = Stream.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + [(_BetaMessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_params = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_listeners = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_ended = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_errored = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_aborted = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_response = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_request_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_logger = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_handleError = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_instances = /* @__PURE__ */ new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + return this.receivedMessages.at(-1); + }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); + if (textBlocks.length === 0) { + throw new AnthropicError("stream ended without producing a content block with type=text"); + } + return textBlocks.join(" "); + }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest2() { + if (this.ended) + return; + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); + }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent2(event) { + if (this.ended) + return; + const messageSnapshot = __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_accumulateMessage).call(this, event); + this._emit("streamEvent", event, messageSnapshot); + switch (event.type) { + case "content_block_delta": { + const content = messageSnapshot.content.at(-1); + switch (event.delta.type) { + case "text_delta": { + if (content.type === "text") { + this._emit("text", event.delta.text, content.text || ""); + } + break; + } + case "citations_delta": { + if (content.type === "text") { + this._emit("citation", event.delta.citation, content.citations ?? []); + } + break; + } + case "input_json_delta": { + if (tracksToolInput(content) && __classPrivateFieldGet(this, _BetaMessageStream_listeners, "f").inputJson?.length) { + let jsonSnapshot; + try { + jsonSnapshot = content.input; + } catch (err) { + __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, content, err)); + break; + } + this._emit("inputJson", event.delta.partial_json, jsonSnapshot); + } + break; + } + case "thinking_delta": { + if (content.type === "thinking") { + this._emit("thinking", event.delta.thinking, content.thinking); + } + break; + } + case "signature_delta": { + if (content.type === "thinking") { + this._emit("signature", content.signature); + } + break; + } + case "compaction_delta": { + if (content.type === "compaction" && content.content) { + this._emit("compaction", content.content); + } + break; + } + default: + checkNever(event.delta); + } + break; + } + case "message_stop": { + this._addMessageParam(messageSnapshot); + this._addMessage(maybeParseBetaMessage(messageSnapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, "f") }), true); + break; + } + case "content_block_stop": { + this._emit("contentBlock", messageSnapshot.content.at(-1)); + break; + } + case "message_start": { + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); + break; + } + case "content_block_start": + case "message_delta": + break; + } + }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest2() { + if (this.ended) { + throw new AnthropicError(`stream has ended, this shouldn't happen`); + } + const snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + if (!snapshot) { + throw new AnthropicError(`request ended without sending any chunks`); + } + __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); + return maybeParseBetaMessage(snapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, "f") }); + }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage2(event) { + let snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, "f"); + if (event.type === "message_start") { + if (snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); + } + return event.message; + } + if (!snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); + } + switch (event.type) { + case "message_stop": + return snapshot; + case "message_delta": + snapshot.stop_reason = event.delta.stop_reason; + snapshot.stop_sequence = event.delta.stop_sequence; + snapshot.stop_details = event.delta.stop_details; + snapshot.usage.output_tokens = event.usage.output_tokens; + if (event.delta.container != null) { + snapshot.container = event.delta.container; + } + if (event.context_management != null) { + snapshot.context_management = event.context_management; + } + if (event.input_transformations != null) { + snapshot.input_transformations = event.input_transformations; + } + if (event.usage.input_tokens != null) { + snapshot.usage.input_tokens = event.usage.input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; + } + if (event.usage.server_tool_use != null) { + snapshot.usage.server_tool_use = event.usage.server_tool_use; + } + if (event.usage.iterations != null) { + snapshot.usage.iterations = event.usage.iterations; + } + if (event.usage.fallback_credit != null) { + snapshot.usage.fallback_credit = event.usage.fallback_credit; + } + if (event.usage.output_tokens_details != null) { + snapshot.usage.output_tokens_details = event.usage.output_tokens_details; + } + return snapshot; + case "content_block_start": + snapshot.content.push(event.content_block); + if (event.content_block.type === "fallback") { + snapshot.model = event.content_block.to.model; + } + return snapshot; + case "content_block_delta": { + const snapshotContent = snapshot.content.at(event.index); + switch (event.delta.type) { + case "text_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + text: (snapshotContent.text || "") + event.delta.text + }; + } + break; + } + case "citations_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + citations: [...snapshotContent.citations ?? [], event.delta.citation] + }; + } + break; + } + case "input_json_delta": { + if (snapshotContent && tracksToolInput(snapshotContent)) { + const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; + snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); + } + break; + } + case "thinking_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + thinking: snapshotContent.thinking + event.delta.thinking + }; + } + break; + } + case "signature_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + signature: event.delta.signature + }; + } + break; + } + case "compaction_delta": { + if (snapshotContent?.type === "compaction") { + const block = { ...snapshotContent, content: event.delta.content }; + if ("encrypted_content" in event.delta) { + block.encrypted_content = event.delta.encrypted_content; + } + snapshot.content[event.index] = block; + } + break; + } + default: + checkNever(event.delta); + } + return snapshot; + } + case "content_block_stop": { + const snapshotContent = snapshot.content.at(event.index); + if (snapshotContent && tracksToolInput(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { + let input; + try { + input = snapshotContent.input; + } catch (err) { + input = {}; + __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, snapshotContent, err)); + } + Object.defineProperty(snapshotContent, "input", { + value: input, + enumerable: true, + configurable: true, + writable: true + }); + } + return snapshot; + } + } + }, _BetaMessageStream_toolInputParseError = function _BetaMessageStream_toolInputParseError2(block, err) { + const jsonBuf = block[JSON_BUF_PROPERTY]; + return new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`); + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("streamEvent", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); + } else { + pushQueue.push(event); + } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; + } + toReadableStream() { + const stream5 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); + } + } + return BetaMessageStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs +var _BetaToolRunnerStream_instances, _BetaToolRunnerStream_onToolCall, _BetaToolRunnerStream_emitted, _BetaToolRunnerStream_readers, _BetaToolRunnerStream_toolCalls, _BetaToolRunnerStream_closed, _BetaToolRunnerStream_ready, _BetaToolRunnerStream_fallback, _BetaToolRunnerStream_track, _BetaToolRunnerStream_release, _BetaToolRunnerStream_removeReader, BetaToolRunnerStream; +var init_BetaToolRunnerStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_BetaMessageStream(); + BetaToolRunnerStream = /* @__PURE__ */ (() => { + class BetaToolRunnerStream2 extends BetaMessageStream { + constructor(params, onToolCall) { + super(params); + _BetaToolRunnerStream_instances.add(this); + _BetaToolRunnerStream_onToolCall.set(this, void 0); + _BetaToolRunnerStream_emitted.set(this, 0); + _BetaToolRunnerStream_readers.set(this, []); + _BetaToolRunnerStream_toolCalls.set(this, []); + _BetaToolRunnerStream_closed.set(this, void 0); + _BetaToolRunnerStream_ready.set(this, []); + _BetaToolRunnerStream_fallback.set(this, false); + __classPrivateFieldSet(this, _BetaToolRunnerStream_onToolCall, onToolCall, "f"); + } + /** The `tool_use` blocks that have finished streaming, in the model's order */ + get toolCalls() { + return __classPrivateFieldGet(this, _BetaToolRunnerStream_toolCalls, "f"); + } + /** Sends the request as `client.beta.messages.stream()` does. */ + static start(messages, params, options, onToolCall) { + const stream5 = new BetaToolRunnerStream2({ ...params, stream: true }, onToolCall); + for (const message of params.messages) { + stream5._addMessageParam(message); + } + stream5._run(() => stream5._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return stream5; + } + _emit(event, ...args) { + var _a6; + if (event !== "streamEvent" || this.ended) { + super._emit(event, ...args); + return; + } + __classPrivateFieldSet(this, _BetaToolRunnerStream_emitted, (_a6 = __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f"), _a6++, _a6), "f"); + const [streamEvent, snapshot] = args; + const block = streamEvent.type === "content_block_stop" ? snapshot.content[streamEvent.index] : void 0; + const closed = block?.type === "tool_use" ? block : void 0; + if (closed) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_toolCalls, "f").push(closed); + } + super._emit(event, ...args); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_track).call(this, streamEvent, closed); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + [(_BetaToolRunnerStream_onToolCall = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_emitted = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_readers = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_toolCalls = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_closed = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_ready = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_fallback = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + const iterator = super[Symbol.asyncIterator](); + const reader = { handled: __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f") }; + __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").push(reader); + let holdsEvent = false; + return { + next: async () => { + if (holdsEvent) { + holdsEvent = false; + reader.handled++; + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + try { + const result = await iterator.next(); + holdsEvent = !result.done; + if (result.done) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + } + return result; + } catch (error) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + throw error; + } + }, + return: async () => { + const result = iterator.return?.(); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); + return await result ?? { value: void 0, done: true }; + } + }; + } + } + _BetaToolRunnerStream_track = function _BetaToolRunnerStream_track2(event, closed) { + if (__classPrivateFieldGet(this, _BetaToolRunnerStream_fallback, "f")) { + return; + } + if (event.type === "content_block_start" && event.content_block.type === "fallback") { + __classPrivateFieldSet(this, _BetaToolRunnerStream_fallback, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, void 0, "f"); + return; + } + const movedOn = event.type === "content_block_start" || event.type === "message_delta" && event.delta.stop_reason === "tool_use"; + if (__classPrivateFieldGet(this, _BetaToolRunnerStream_closed, "f") && movedOn) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f").push({ toolUse: __classPrivateFieldGet(this, _BetaToolRunnerStream_closed, "f"), event: __classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f") }); + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, void 0, "f"); + } + if (closed) { + __classPrivateFieldSet(this, _BetaToolRunnerStream_closed, closed, "f"); + } + }, _BetaToolRunnerStream_release = function _BetaToolRunnerStream_release2() { + if (this.errored || this.controller.signal.aborted) { + return; + } + const handled = Math.min(__classPrivateFieldGet(this, _BetaToolRunnerStream_emitted, "f"), ...__classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").map((reader) => reader.handled)); + while (__classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f")[0] && __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f")[0].event <= handled) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_onToolCall, "f").call(this, __classPrivateFieldGet(this, _BetaToolRunnerStream_ready, "f").shift().toolUse); + } + }, _BetaToolRunnerStream_removeReader = function _BetaToolRunnerStream_removeReader2(reader) { + const index = __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").indexOf(reader); + if (index >= 0) { + __classPrivateFieldGet(this, _BetaToolRunnerStream_readers, "f").splice(index, 1); + __classPrivateFieldGet(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); + } + }; + return BetaToolRunnerStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs +function promiseWithResolvers() { + let resolve2; + let reject2; + const promise = new Promise((res, rej) => { + resolve2 = res; + reject2 = rej; + }); + return { promise, resolve: resolve2, reject: reject2 }; +} +var init_promise = __esm({ + "node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs"() { + } +}); + +// node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +function rejectCompactionParam(params) { + if ("compaction" in params && params.compaction != null) { + throw new AnthropicError("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead."); + } +} +function rejectCompactionControl(params) { + if ("compactionControl" in params && params.compactionControl != null) { + throw new AnthropicError("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted."); + } +} +function rejectRunToolsEagerlyWithoutStream(params) { + if (params.runToolsEagerly && !params.stream) { + throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole."); + } +} +function rejectCompactionEdit(params) { + if (params.context_management?.edits?.some((edit) => edit.type.startsWith("compact_"))) { + throw new AnthropicError("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first."); + } +} +function withoutCompactionIncompatibleParams(params) { + const { context_management, stop_sequences, output_format, ...kept } = params; + const withoutFormat = ({ format, ...outputConfig }) => outputConfig; + if (kept.tool_choice?.type === "any" || kept.tool_choice?.type === "tool") { + delete kept.tool_choice; + } + if (kept.output_config) { + kept.output_config = withoutFormat(kept.output_config); + } + if (Array.isArray(kept.fallbacks)) { + kept.fallbacks = kept.fallbacks.map((fallback) => fallback.output_config ? { ...fallback, output_config: withoutFormat(fallback.output_config) } : fallback); + } + return kept; +} +async function generateToolResponse(runnable, available, lastMessage, requestOptions, calls) { + if (!lastMessage || lastMessage.role !== "assistant" || !lastMessage.content || typeof lastMessage.content === "string") { + return null; + } + const toolUseBlocks = lastMessage.content.filter((content) => content.type === "tool_use"); + if (toolUseBlocks.length === 0) { + return null; + } + const toolResults = await Promise.all(toolUseBlocks.map((toolUse) => { + const call = calls?.get(toolUse.id); + if (call?.status === "started") { + return call.result; + } + const result = runToolCall(runnable, available, toolUse, requestOptions); + calls?.set(toolUse.id, { status: "started", result }); + return result; + })); + return { + role: "user", + content: toolResults + }; +} +async function runToolCall(runnable, available, toolUse, requestOptions) { + const tool = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0; + if (!tool) { + return toolNotFoundResult(toolUse); + } + try { + let input = toolUse.input; + if ("parse" in tool && tool.parse) { + input = tool.parse(input); + } + const result = await tool.run(input, { + toolUse, + toolUseBlock: toolUse, + signal: requestOptions?.signal + }); + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: result + }; + } catch (error) { + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: error instanceof ToolError ? error.content : `Error: ${error instanceof Error ? error.message : String(error)}`, + is_error: true + }; + } +} +function asContentParam(content) { + return content; +} +function toolNotFoundResult(toolUse) { + return { + type: "tool_result", + tool_use_id: toolUse.id, + content: `Error: Tool '${toolUse.name}' not found`, + is_error: true + }; +} +function applyToolChange(block, available) { + switch (block.type) { + case "tool_removal": + case "tool_addition": + applyToolReference(block, available); + break; + } +} +function applyToolReference(block, available) { + const name = changedToolName(block.tool); + if (name === void 0) + return; + if (block.type === "tool_removal") { + available.delete(name); + } else { + available.add(name); + } +} +function changedToolName(tool) { + switch (tool.type) { + case "tool_reference": + return tool.name; + case "tool_definition": + return "name" in tool.definition ? tool.definition.name : void 0; + default: + return void 0; + } +} +function determineNextStepFromStopReason(stopReason) { + if (stopReason === null) + return "stop"; + switch (stopReason) { + case "tool_use": + return "run_tools"; + case "pause_turn": + // pause_after_compaction hands the turn back before the model answers; sending it back + // unchanged continues it. + case "compaction": + return "resume"; + case "end_turn": + case "stop_sequence": + case "max_tokens": + case "model_context_window_exceeded": + case "refusal": + return "stop"; + default: + checkNever(stopReason); + return "stop"; + } +} +var _BetaToolRunner_instances, _BetaToolRunner_consumed, _BetaToolRunner_mutated, _BetaToolRunner_state, _BetaToolRunner_options, _BetaToolRunner_message, _BetaToolRunner_stream, _BetaToolRunner_toolResponse, _BetaToolRunner_completion, _BetaToolRunner_iterationCount, _BetaToolRunner_compaction, _BetaToolRunner_calls, _BetaToolRunner_lastStopReason, _BetaToolRunner_toolOverrides, _BetaToolRunner_pendingToolChanges, _BetaToolRunner_send, _BetaToolRunner_streamThatStartsTools, _BetaToolRunner_startedCallsSettled, _BetaToolRunner_compact, _BetaToolRunner_runnableTools, _BetaToolRunner_availableToolNames, _BetaToolRunner_recordRemovalsFromHistory, _BetaToolRunner_compactAfterFinalTurn, _BetaToolRunner_generateToolResponse, _BetaToolRunner_flushPendingToolChanges, _BetaToolRunner_pendingToolChangesMessage, BetaToolRunner; +var init_BetaToolRunner = __esm({ + "node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs"() { + init_tslib(); + init_ToolError(); + init_error(); + init_BetaToolRunnerStream(); + init_headers(); + init_promise(); + init_values(); + init_log(); + init_stainless_helper_header(); + BetaToolRunner = /* @__PURE__ */ (() => { + class BetaToolRunner2 { + constructor(client, params, options) { + _BetaToolRunner_instances.add(this); + this.client = client; + _BetaToolRunner_consumed.set(this, false); + _BetaToolRunner_mutated.set(this, false); + _BetaToolRunner_state.set(this, void 0); + _BetaToolRunner_options.set(this, void 0); + _BetaToolRunner_message.set(this, void 0); + _BetaToolRunner_stream.set(this, void 0); + _BetaToolRunner_toolResponse.set(this, void 0); + _BetaToolRunner_completion.set(this, void 0); + _BetaToolRunner_iterationCount.set(this, 0); + _BetaToolRunner_compaction.set(this, { status: "idle" }); + _BetaToolRunner_calls.set(this, void 0); + _BetaToolRunner_lastStopReason.set(this, null); + _BetaToolRunner_toolOverrides.set(this, /* @__PURE__ */ new Map()); + _BetaToolRunner_pendingToolChanges.set(this, []); + rejectCompactionParam(params); + rejectCompactionControl(params); + rejectRunToolsEagerlyWithoutStream(params); + __classPrivateFieldSet(this, _BetaToolRunner_state, { + params: { + // You can't clone the entire params since there are functions as handlers. + // You also don't really need to clone params.messages, but it probably will prevent a foot gun + // somewhere. + ...params, + // Not structuredClone(): it throws on a function, and a runnable tool written by value into a + // `tool_addition` block has `run`. A JSON copy is the messages as they are sent, which drops it. + messages: JSON.parse(JSON.stringify(params.messages)) + } + }, "f"); + const collected = collectStainlessHelpers(params.tools, params.messages); + __classPrivateFieldSet(this, _BetaToolRunner_options, { + ...options, + headers: buildHeaders([ + helperHeader("BetaToolRunner"), + collected.length ? { [STAINLESS_HELPER_HEADER]: collected.join(", ") } : void 0, + options?.headers + ]) + }, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); + } + async *[(_BetaToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_mutated = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_state = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_options = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_message = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_stream = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolResponse = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_completion = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_iterationCount = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_compaction = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_calls = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_lastStopReason = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolOverrides = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_pendingToolChanges = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + var _a6; + if (__classPrivateFieldGet(this, _BetaToolRunner_consumed, "f")) { + throw new AnthropicError("Cannot iterate over a consumed stream"); + } + __classPrivateFieldSet(this, _BetaToolRunner_consumed, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + try { + while (true) { + try { + if (__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.max_iterations && __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, "f") >= __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.max_iterations) { + break; + } + __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_flushPendingToolChanges).call(this); + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "scheduled" && determineNextStepFromStopReason(__classPrivateFieldGet(this, _BetaToolRunner_lastStopReason, "f")) !== "resume") { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").config); + continue; + } + __classPrivateFieldSet(this, _BetaToolRunner_mutated, false, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_iterationCount, (_a6 = __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, "f"), _a6++, _a6), "f"); + __classPrivateFieldSet(this, _BetaToolRunner_message, void 0, "f"); + const { max_iterations, runToolsEagerly, ...params } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, params); + if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, "f")) { + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + const nextStep = determineNextStepFromStopReason(message.stop_reason); + __classPrivateFieldSet(this, _BetaToolRunner_lastStopReason, message.stop_reason, "f"); + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push({ + role: message.role, + content: asContentParam(message.content) + }); + const { container } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + if (message.container) { + if (container == null) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.container = message.container.id; + } else if (typeof container === "object" && container.id == null) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.container = { ...container, id: message.container.id }; + } + } + if (nextStep === "stop") { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); + break; + } + if (nextStep === "resume") { + continue; + } + } else { + __classPrivateFieldSet(this, _BetaToolRunner_lastStopReason, null, "f"); + } + const toolMessage = await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.at(-1)); + if (toolMessage) { + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push(toolMessage); + } else if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, "f")) { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); + break; + } + } finally { + __classPrivateFieldGet(this, _BetaToolRunner_stream, "f")?.abort(); + __classPrivateFieldSet(this, _BetaToolRunner_stream, void 0, "f"); + } + } + await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); + if (!__classPrivateFieldGet(this, _BetaToolRunner_message, "f")) { + throw new AnthropicError("ToolRunner concluded without a message from the server"); + } + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").resolve(await __classPrivateFieldGet(this, _BetaToolRunner_message, "f")); + } catch (error) { + __classPrivateFieldSet(this, _BetaToolRunner_consumed, false, "f"); + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").promise.catch(() => { + }); + __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").reject(error); + __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); + throw error; + } + } + setMessagesParams(paramsOrMutator) { + const params = typeof paramsOrMutator === "function" ? paramsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params) : paramsOrMutator; + rejectCompactionParam(params); + rejectRunToolsEagerlyWithoutStream(params); + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status !== "idle") { + rejectCompactionEdit(params); + } + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "in_flight" && params.messages !== __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages) { + throw new AnthropicError("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead."); + } + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params = params; + __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + } + setRequestOptions(optionsOrMutator) { + if (typeof optionsOrMutator === "function") { + __classPrivateFieldSet(this, _BetaToolRunner_options, optionsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + } else { + __classPrivateFieldSet(this, _BetaToolRunner_options, { ...__classPrivateFieldGet(this, _BetaToolRunner_options, "f"), ...optionsOrMutator }, "f"); + } + } + /** + * Get the tool response for the last message from the assistant. + * Avoids redundant tool executions by caching results. With `runToolsEagerly`, it reuses the calls of + * the reply that have started and runs the rest, including the ones `deferToolCall()` is holding, so that no + * call runs twice. + * + * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed + * + * @example + * const toolResponse = await runner.generateToolResponse(); + * if (toolResponse) { + * console.log('Tool results:', toolResponse.content); + * } + */ + async generateToolResponse(signal = __classPrivateFieldGet(this, _BetaToolRunner_options, "f").signal) { + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f") ?? this.params.messages.at(-1); + if (!message) { + return null; + } + return __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, message, signal); + } + /** + * Hold a tool call of the current reply until you are done with the reply, which is when it runs without + * streaming: at the end of the loop body, or when you call `generateToolResponse()`. + * + * With `runToolsEagerly` the runner otherwise starts each call while the reply streams, as soon as + * the model has moved on from it: when the next block starts, or the reply stops with `tool_use`. A call + * never starts before your stream listeners and any `for await` over the stream have handled that event, so + * you can call this from either once you have seen the call. The other calls of the reply still start early. + * It does nothing for a call that has started, outside the loop body, and without `runToolsEagerly`. + * + * @param toolUse - The `tool_use` block of the call, or its id + * + * @example + * for await (const stream of runner) { + * stream.on('contentBlock', (block) => { + * if (block.type === 'tool_use' && block.name === 'delete_file') { + * runner.deferToolCall(block); + * } + * }); + * await stream.finalMessage(); + * // No `delete_file` call has started yet. + * } + */ + deferToolCall(toolUse) { + const id = typeof toolUse === "string" ? toolUse : toolUse.id; + if (__classPrivateFieldGet(this, _BetaToolRunner_calls, "f") && !__classPrivateFieldGet(this, _BetaToolRunner_calls, "f").has(id)) { + __classPrivateFieldGet(this, _BetaToolRunner_calls, "f").set(id, { status: "held" }); + } + } + /** + * The tool calls of the current reply that `deferToolCall()` is holding, in the model's order, as their + * `tool_use` blocks. A call is in the list once its block has finished streaming, so read the list when you + * are done with the stream. A call that has started is not in it. It is empty without + * `runToolsEagerly`. + * + * Held calls are listed whatever the reply's `stop_reason`, because `generateToolResponse()` runs them + * whatever it is. After `max_tokens` the input of the last call can be cut off. + * + * @example + * for await (const stream of runner) { + * stream.on('contentBlock', (block) => { + * if (block.type === 'tool_use' && block.name === 'delete_file') { + * runner.deferToolCall(block); + * } + * }); + * await stream.finalMessage(); + * + * const held = runner.deferredToolCalls; + * if (held.length > 0 && !(await confirm(held))) break; + * } + */ + get deferredToolCalls() { + const stream5 = __classPrivateFieldGet(this, _BetaToolRunner_stream, "f"); + const calls = __classPrivateFieldGet(this, _BetaToolRunner_calls, "f"); + if (!(stream5 instanceof BetaToolRunnerStream) || !calls) { + return []; + } + return stream5.toolCalls.filter((toolUse) => calls.get(toolUse.id)?.status === "held"); + } + /** + * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and + * will wait for an instance to start and go to completion. + * + * @returns A promise that resolves to the final BetaMessage when the iterator completes + * + * @example + * // Start consuming the iterator + * for await (const message of runner) { + * console.log('Message:', message.content); + * } + * + * // Meanwhile, wait for completion from another part of the code + * const finalMessage = await runner.done(); + * console.log('Final response:', finalMessage.content); + */ + done() { + return __classPrivateFieldGet(this, _BetaToolRunner_completion, "f").promise; + } + /** + * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream: + * * If the iterator has not been consumed, consume the entire iterator and return the final message from the + * assistant. + * * If the iterator has been consumed, waits for it to complete and returns the final message. + * + * @returns A promise that resolves to the final BetaMessage from the conversation + * @throws {AnthropicError} If no messages were processed during the conversation + * + * @example + * const finalMessage = await runner.runUntilDone(); + * console.log('Final response:', finalMessage.content); + */ + async runUntilDone() { + if (!__classPrivateFieldGet(this, _BetaToolRunner_consumed, "f")) { + for await (const _ of this) { + } + } + return this.done(); + } + /** + * Get the current parameters being used by the ToolRunner. + * + * @returns A readonly view of the current ToolRunnerParams + * + * @example + * const currentParams = runner.params; + * console.log('Current model:', currentParams.model); + * console.log('Message count:', currentParams.messages.length); + */ + get params() { + return __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + } + /** + * Add one or more messages to the conversation history. + * + * @param messages - One or more BetaMessageParam objects to add to the conversation + * + * @example + * runner.pushMessages( + * { role: 'user', content: 'Also, what about the weather in NYC?' } + * ); + * + * @example + * // Adding multiple messages + * runner.pushMessages( + * { role: 'user', content: 'What about NYC?' }, + * { role: 'user', content: 'And Boston?' } + * ); + */ + pushMessages(...messages) { + this.setMessagesParams((params) => ({ + ...params, + messages: [...params.messages, ...messages] + })); + } + /** + * Schedule a compaction of the conversation. Once the current turn has finished, including any tool + * calls, the runner requests a summary and replaces the message history with the compaction response, + * which is yielded like any other message. Requires the `compact-2026-09-04` beta. + * + * @param compaction - The config to send, as `messages.create()` takes it. Defaults to `{ type: 'summarize' }` + * + * @example + * for await (const message of runner) { + * if (message.usage.input_tokens > 100_000) { + * runner.compactBeforeNextTurn(); + * } + * } + */ + compactBeforeNextTurn(compaction) { + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status === "in_flight") { + return; + } + rejectCompactionEdit(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "scheduled", config: compaction ?? { type: "summarize" } }, "f"); + } + /** + * Give the model more tools without changing `params.tools`, which would miss the prompt cache. + * + * Each tool's whole definition is sent in a `tool_addition` block with the next request, and a + * runnable tool replaces a runnable tool of the same name straight away, even for a call already in + * the message being handled. A call that started while the reply streamed keeps the old one. A raw + * definition is only sent: the runner never runs it, and stops running a tool of the same name. + * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. + * + * @param tools - Runnable tools (for example from `betaZodTool()`) or raw tool definitions + * + * @example + * runner.addTools(queryDatabaseTool); + */ + addTools(...tools) { + for (const tool of tools) { + if ("name" in tool) { + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(tool.name, "run" in tool ? tool : null); + } + __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool }); + } + } + /** + * Take tools away from the model without changing `params.tools`, which would miss the prompt cache. + * + * The tools stop being run straight away: a call to one of them, even one in the message being + * handled, gets the same "not found" error result as a call to an unknown tool. A call that started + * while the reply streamed finishes as usual. The model is told in a `tool_removal` block with the + * next request. Use {@link addTools} to bring a tool back. + * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. + * + * @param tools - The tools to remove, or their names + * + * @example + * runner.removeTools('query_database'); + */ + removeTools(...tools) { + for (const tool of tools) { + const name = typeof tool === "string" ? tool : tool.name; + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(name, null); + __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "removal", name }); + } + } + /** + * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone() + * This allows using `await runner` instead of `await runner.runUntilDone()` + */ + then(onfulfilled, onrejected) { + return this.runUntilDone().then(onfulfilled, onrejected); + } + } + _BetaToolRunner_send = /** + * Sends one request and yields its message, or its stream when streaming. `#message` and `#stream` are set + * before the yield, so they are there while the caller handles the item; the loop aborts the stream at the + * end of the iteration. + */ + async function* _BetaToolRunner_send2(params) { + await __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); + __classPrivateFieldSet(this, _BetaToolRunner_calls, void 0, "f"); + if (params.stream) { + __classPrivateFieldSet(this, _BetaToolRunner_stream, __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.runToolsEagerly ? __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_streamThatStartsTools).call(this, params) : this.client.beta.messages.stream({ ...params }, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + __classPrivateFieldSet(this, _BetaToolRunner_message, __classPrivateFieldGet(this, _BetaToolRunner_stream, "f").finalMessage(), "f"); + __classPrivateFieldGet(this, _BetaToolRunner_message, "f").catch(() => { + }); + yield __classPrivateFieldGet(this, _BetaToolRunner_stream, "f"); + } else { + __classPrivateFieldSet(this, _BetaToolRunner_message, this.client.beta.messages.create({ ...params, stream: false }, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")), "f"); + yield __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + } + }, _BetaToolRunner_streamThatStartsTools = function _BetaToolRunner_streamThatStartsTools2(params) { + const calls = /* @__PURE__ */ new Map(); + __classPrivateFieldSet(this, _BetaToolRunner_calls, calls, "f"); + return BetaToolRunnerStream.start(this.client.beta.messages, params, __classPrivateFieldGet(this, _BetaToolRunner_options, "f"), (toolUse) => { + if (calls.has(toolUse.id)) { + return; + } + const result = runToolCall(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), toolUse, __classPrivateFieldGet(this, _BetaToolRunner_options, "f")); + result.catch(() => { + }); + calls.set(toolUse.id, { status: "started", result }); + }); + }, _BetaToolRunner_startedCallsSettled = /** Waits for the calls of the last streamed reply that have started, whether or not their results were sent. */ + async function _BetaToolRunner_startedCallsSettled2() { + const started = [...__classPrivateFieldGet(this, _BetaToolRunner_calls, "f")?.values() ?? []].filter((call) => call.status === "started"); + await Promise.allSettled(started.map((call) => call.result)); + }, _BetaToolRunner_compact = async function* _BetaToolRunner_compact2(compaction) { + rejectCompactionEdit(__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params); + const { max_iterations, runToolsEagerly, ...requestParams } = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params; + const params = withoutCompactionIncompatibleParams(requestParams); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "in_flight" }, "f"); + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, void 0, "f"); + const lastMessage = __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + try { + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, { ...params, compaction }); + const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, "f"); + if (message.content.some((block) => block.type === "compaction" && block.content)) { + __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_recordRemovalsFromHistory).call(this); + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages = [{ role: message.role, content: message.content }]; + } else { + loggerFor(this.client).warn("Compaction produced no summary; keeping the conversation as it is."); + __classPrivateFieldSet(this, _BetaToolRunner_message, lastMessage, "f"); + } + } finally { + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); + } + }, _BetaToolRunner_runnableTools = function _BetaToolRunner_runnableTools2() { + const runnable = /* @__PURE__ */ new Map(); + for (const tool of __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.tools) { + if ("run" in tool) { + runnable.set(tool.name, tool); + } + } + for (const [name, tool] of __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f")) { + if (tool) { + runnable.set(name, tool); + } else { + runnable.delete(name); + } + } + return runnable; + }, _BetaToolRunner_availableToolNames = function _BetaToolRunner_availableToolNames2() { + const available = new Set(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()); + for (const message of [...__classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages, __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)]) { + if (typeof message.content === "string") { + continue; + } + for (const block of message.content) { + if (message.role === "system") { + applyToolChange(block, available); + } else if (message.role === "assistant" && block.type === "compaction") { + for (const change of block.tool_changes ?? []) { + applyToolChange(change, available); + } + } + } + } + return available; + }, _BetaToolRunner_recordRemovalsFromHistory = function _BetaToolRunner_recordRemovalsFromHistory2() { + const available = __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this); + for (const name of __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()) { + if (!available.has(name)) { + __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(name, null); + } + } + }, _BetaToolRunner_compactAfterFinalTurn = async function* _BetaToolRunner_compactAfterFinalTurn2() { + if (__classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").status !== "scheduled") { + return; + } + const lastContent = __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.at(-1)?.content; + if (Array.isArray(lastContent) && lastContent.some((block) => block.type === "tool_use")) { + loggerFor(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."); + __classPrivateFieldSet(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); + return; + } + yield* __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet(this, _BetaToolRunner_compaction, "f").config); + }, _BetaToolRunner_generateToolResponse = async function _BetaToolRunner_generateToolResponse2(lastMessage, signal = __classPrivateFieldGet(this, _BetaToolRunner_options, "f").signal) { + if (__classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f") !== void 0) { + return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f"); + } + __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, generateToolResponse(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), lastMessage, { ...__classPrivateFieldGet(this, _BetaToolRunner_options, "f"), signal }, __classPrivateFieldGet(this, _BetaToolRunner_calls, "f")), "f"); + return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, "f"); + }, _BetaToolRunner_flushPendingToolChanges = function _BetaToolRunner_flushPendingToolChanges2() { + if (__classPrivateFieldGet(this, _BetaToolRunner_lastStopReason, "f") === "pause_turn" || __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").length === 0) { + return; + } + __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.messages.push(__classPrivateFieldGet(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)); + __classPrivateFieldSet(this, _BetaToolRunner_pendingToolChanges, [], "f"); + }, _BetaToolRunner_pendingToolChangesMessage = function _BetaToolRunner_pendingToolChangesMessage2() { + const content = []; + for (const change of __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f")) { + if (change.type === "removal") { + content.push({ type: "tool_removal", tool: { type: "tool_reference", name: change.name } }); + continue; + } + let definition = change.tool; + if ("run" in change.tool) { + const { run: run2, parse: parse2, close, ...rest } = change.tool; + definition = rest; + } + content.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); + } + return { role: "system", content }; + }; + return BetaToolRunner2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +function transformOutputFormat(params) { + if (!params.output_format) { + return params; + } + if (params.output_config?.format) { + throw new AnthropicError("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated)."); + } + const { output_format, ...rest } = params; + return { + ...rest, + output_config: { + ...params.output_config, + format: output_format + } + }; +} +var DEPRECATED_MODELS, MODELS_TO_WARN_WITH_THINKING_ENABLED, Messages; +var init_messages = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs"() { + init_error2(); + init_batches(); + init_resource(); + init_constants(); + init_headers(); + init_stainless_helper_header(); + init_beta_parser(); + init_BetaMessageStream(); + init_BetaToolRunner(); + init_ToolError(); + init_batches(); + DEPRECATED_MODELS = {}; + MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-mythos-preview", "claude-opus-4-6"]; + Messages = /* @__PURE__ */ (() => { + class Messages5 extends APIResource { + constructor() { + super(...arguments); + this.batches = new Batches(this._client); + } + create(params, options) { + const modifiedParams = transformOutputFormat(params); + const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; + if (body.model in DEPRECATED_MODELS) { + console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); + } + if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) && body.thinking && body.thinking.type === "enabled") { + console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); + } + let timeout = options?.timeout ?? this._client._options.timeout; + if (!body.stream && timeout == null) { + const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; + timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); + } + const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); + return this._client.post("/v1/messages?beta=true", { + body, + timeout: timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + helperHeader2, + options?.headers + ]), + stream: modifiedParams.stream ?? false + }); + } + /** + * Send a structured list of input messages with text and/or image content, along with an expected `output_format` and + * the response will be automatically parsed and available in the `parsed_output` property of the message. + * + * @example + * ```ts + * const message = await client.beta.messages.parse({ + * model: 'claude-3-5-sonnet-20241022', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'), + * }); + * + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + parse(params, options) { + options = { + ...options, + headers: buildHeaders([ + { "anthropic-beta": [...params.betas ?? [], "structured-outputs-2025-12-15"].toString() }, + options?.headers + ]) + }; + return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console })); + } + /** + * Create a Message stream + */ + stream(body, options) { + return BetaMessageStream.createMessage(this, body, options); + } + /** + * Count the number of tokens in a Message. + * + * The Token Count API can be used to count the number of tokens in a Message, + * including tools, images, and documents, without creating it. + * + * Learn more about token counting in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) + * + * @example + * ```ts + * const betaMessageTokensCount = + * await client.beta.messages.countTokens({ + * messages: [{ content: 'Hello, world', role: 'user' }], + * model: 'claude-opus-5', + * }); + * ``` + */ + countTokens(params, options) { + const modifiedParams = transformOutputFormat(params); + const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; + return this._client.post("/v1/messages/count_tokens?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "token-counting-2024-11-01"].toString(), + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + toolRunner(body, options) { + return new BetaToolRunner(this._client, body, options); + } + } + Messages5.Batches = Batches; + Messages5.BetaToolRunner = BetaToolRunner; + Messages5.ToolError = ToolError; + return Messages5; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +var APIKeys; +var init_api_keys = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs"() { + init_resource(); + init_pagination(); + init_path(); + APIKeys = class extends APIResource { + /** + * Get API Key + * + * @example + * ```ts + * const betaAPIKey = + * await client.beta.organization.apiKeys.retrieve( + * 'api_key_id', + * ); + * ``` + */ + retrieve(apiKeyID, options) { + return this._client.get(path2`/v1/organizations/api_keys/${apiKeyID}?beta=true`, options); + } + /** + * Update API Key + * + * @example + * ```ts + * const betaAPIKey = + * await client.beta.organization.apiKeys.update( + * 'api_key_id', + * ); + * ``` + */ + update(apiKeyID, body, options) { + return this._client.post(path2`/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options }); + } + /** + * List API Keys + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/api_keys?beta=true", Page, { + query, + ...options + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +var ComplianceSettings; +var init_compliance_settings = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs"() { + init_resource(); + ComplianceSettings = class extends APIResource { + /** + * Retrieve your organization's Compliance Settings. + * + * Compliance Settings is a singleton resource: there is exactly one per + * organization, addressed without an identifier. The `state` field reflects + * whether the Compliance API is enabled. An organization with a parent + * organization reads the state inherited from the parent's configuration. + * + * @example + * ```ts + * const betaComplianceSettings = + * await client.beta.organization.complianceSettings.retrieve(); + * ``` + */ + retrieve(options) { + return this._client.get("/v1/organizations/compliance_settings?beta=true", options); + } + /** + * Update your organization's Compliance Settings. + * + * Setting `state` to `enabled` turns on the Compliance API and begins capturing + * organization activity events. Setting it to `disabled` turns both off. `state` + * reflects whether the Compliance API is enabled. + * + * A request that sets `state` to its current value succeeds and leaves the + * resource unchanged. A `disabled` request stays in effect until a later `enabled` + * request or the organization's next provisioning action that enables Access + * Transparency: enabling Access Transparency also enables the Compliance API, + * which serves its activity events, so such provisioning (including re-runs) + * re-enables the Compliance API even after a `disabled` request. Automated + * provisioning never disables compliance settings. + * + * @example + * ```ts + * const betaComplianceSettings = + * await client.beta.organization.complianceSettings.update({ + * state: { type: 'enabled' }, + * }); + * ``` + */ + update(body, options) { + return this._client.post("/v1/organizations/compliance_settings?beta=true", { body, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +var ExternalKeys; +var init_external_keys = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs"() { + init_resource(); + init_pagination(); + init_path(); + ExternalKeys = class extends APIResource { + /** + * Create an external key config owned by the caller's organization. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.create({ + * provider_config: { + * kms_arn: + * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222', + * type: 'aws', + * }, + * }); + * ``` + */ + create(body, options) { + return this._client.post("/v1/organizations/external_keys?beta=true", { body, ...options }); + } + /** + * Retrieve a single external key config in the caller's organization by ID. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.retrieve( + * 'external_key_id', + * ); + * ``` + */ + retrieve(externalKeyID, options) { + return this._client.get(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); + } + /** + * Partially update an external key config. Omitted fields are left unchanged. + * + * `display_name` is always editable. `geo` and `provider_config` cannot be changed + * once any workspace references this config, because previously encrypted data + * requires the original key identity to decrypt. + * + * @example + * ```ts + * const betaExternalKey = + * await client.beta.organization.externalKeys.update( + * 'external_key_id', + * ); + * ``` + */ + update(externalKeyID, body, options) { + return this._client.post(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, { + body, + ...options + }); + } + /** + * List external key configs in the caller's organization. + * + * Results are ordered by creation time (newest first). Use the `next_page` cursor + * from the response to fetch subsequent pages. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/external_keys?beta=true", PageCursor, { + query, + ...options + }); + } + /** + * Delete an external key config. + * + * The request is rejected if any workspace still references this config. + * + * @example + * ```ts + * const externalKey = + * await client.beta.organization.externalKeys.delete( + * 'external_key_id', + * ); + * ``` + */ + delete(externalKeyID, options) { + return this._client.delete(path2`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); + } + /** + * Validate an external key config against the customer's KMS. + * + * Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key + * and waits up to 30 seconds for the result. The response status is `success` if + * the roundtrip succeeded, or `failure` with an error message if it failed or + * timed out. + * + * @example + * ```ts + * const response = + * await client.beta.organization.externalKeys.validate( + * 'external_key_id', + * ); + * ``` + */ + validate(externalKeyID, options) { + return this._client.post(path2`/v1/organizations/external_keys/${externalKeyID}/validate?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +var Invites; +var init_invites = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Invites = class extends APIResource { + /** + * Invite a user to join the organization by email. + * + * On plans that draw members from a finite pool of purchased seats, the invite + * automatically consumes a seat from the lowest tier with availability; there is + * no seat-tier parameter. When no seat is free the request fails with a 400 error + * rather than purchasing a seat. + * + * @example + * ```ts + * const betaOrganizationInvite = + * await client.beta.organization.invites.create({ + * email: 'user@emaildomain.com', + * role: 'user', + * }); + * ``` + */ + create(body, options) { + return this._client.post("/v1/organizations/invites?beta=true", { body, ...options }); + } + /** + * Retrieve an invite by ID. + * + * @example + * ```ts + * const betaOrganizationInvite = + * await client.beta.organization.invites.retrieve( + * 'invite_id', + * ); + * ``` + */ + retrieve(inviteID, options) { + return this._client.get(path2`/v1/organizations/invites/${inviteID}?beta=true`, options); + } + /** + * List the organization's invites. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationInvite of client.beta.organization.invites.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/invites?beta=true", Page, { + query, + ...options + }); + } + /** + * Delete a pending invite. + * + * @example + * ```ts + * const invite = + * await client.beta.organization.invites.delete( + * 'invite_id', + * ); + * ``` + */ + delete(inviteID, options) { + return this._client.delete(path2`/v1/organizations/invites/${inviteID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +var RateLimits; +var init_rate_limits = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs"() { + init_resource(); + init_pagination(); + RateLimits = class extends APIResource { + /** + * List Messages API rate limits for your organization. + * + * Each entry corresponds to one rate-limit group (either a model family or an + * API-surface category such as the Files API or Message Batches) and contains the + * set of limiter values that apply to it. + * + * When `limit` is omitted, every matching entry is returned in a single page; when + * `limit` truncates the result, follow `next_page` to fetch the remaining entries. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationRateLimit of client.beta.organization.rateLimits.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +var Users; +var init_users = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Users = class extends APIResource { + /** + * Retrieve a member of the organization by user ID. + * + * @example + * ```ts + * const betaOrganizationUser = + * await client.beta.organization.users.retrieve('user_id'); + * ``` + */ + retrieve(userID, options) { + return this._client.get(path2`/v1/organizations/users/${userID}?beta=true`, options); + } + /** + * Update a member's organization role. + * + * @example + * ```ts + * const betaOrganizationUser = + * await client.beta.organization.users.update('user_id', { + * role: 'user', + * }); + * ``` + */ + update(userID, body, options) { + return this._client.post(path2`/v1/organizations/users/${userID}?beta=true`, { body, ...options }); + } + /** + * List the organization's members. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaOrganizationUser of client.beta.organization.users.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/users?beta=true", Page, { + query, + ...options + }); + } + /** + * Remove a member from the organization. + * + * @example + * ```ts + * const user = await client.beta.organization.users.remove( + * 'user_id', + * ); + * ``` + */ + remove(userID, options) { + return this._client.delete(path2`/v1/organizations/users/${userID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +var Issuers; +var init_issuers = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Issuers = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Register an OIDC issuer that Anthropic will trust for workload identity + * federation in your organization. + * + * The `jwks` field controls how the issuer's signing keys are obtained and takes + * one of three shapes selected by `type`: `discovery` (resolve keys through OIDC + * discovery), `explicit_url` (fetch keys from a fixed JWKS URL), or `inline` + * (provide a static key set). When `jwks.type` is `discovery` and no + * `discovery_base` is set, the issuer URL must be publicly reachable over HTTPS so + * Anthropic can fetch the discovery document; for `explicit_url` and `inline` + * modes the issuer URL is only matched as the JWT's `iss` claim and is not + * fetched. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.create({ + * issuer_url: 'x', + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/federation_issuers?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a federation issuer by its ID (`fdis_...`). + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.retrieve( + * 'federation_issuer_id', + * ); + * ``` + */ + retrieve(federationIssuerID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Partially update a federation issuer. + * + * Setting `jwks` replaces the full JWKS shape at once. Archived issuers cannot be + * updated; this returns 400. Create a new issuer instead. + * + * Updating an issuer that backs a rule with a scope outside `workspace:developer` + * or `workspace:inference` requires a Console session. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.update( + * 'federation_issuer_id', + * ); + * ``` + */ + update(federationIssuerID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List federation issuers in your organization. + * + * Archived issuers are excluded unless `include_archived=true`. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationIssuer of client.beta.organization.federation.issuers.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a federation issuer. + * + * Idempotent; re-archiving returns the issuer with its original `archived_at`. + * Rejected with 400 if any live (non-archived) federation rule still references + * the issuer; archive those rules first (a rule's issuer cannot be changed), or + * recreate them against another issuer. + * + * @example + * ```ts + * const betaFederationIssuer = + * await client.beta.organization.federation.issuers.archive( + * 'federation_issuer_id', + * ); + * ``` + */ + archive(federationIssuerID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/federation_issuers/${federationIssuerID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +var Workspaces; +var init_workspaces = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Workspaces = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List workspaces where this federation rule is enabled. + * + * Returns all workspace enablements in a single response; the `limit` and `page` + * parameters are accepted but have no effect, and `next_page` is always `null`. + * Returns explicit per-workspace enablements only; for rules with + * `applies_to_all_workspaces` or a legacy single `workspace_id`, check those + * fields on the rule itself. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationRuleWorkspace of client.beta.organization.federation.rules.workspaces.list( + * 'federation_rule_id', + * )) { + * // ... + * } + * ``` + */ + list(federationRuleID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Enable a federation rule for a workspace. + * + * Idempotent; re-enabling returns the existing enablement. The rule and workspace + * must both belong to your organization. Membership of the rule's target service + * account in this workspace is not checked at enablement: token exchange into this + * workspace is rejected unless the target is a member (it is implicitly a member + * of the default workspace). Archived rules are rejected with 400. OAuth callers + * may only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRuleWorkspace = + * await client.beta.organization.federation.rules.workspaces.add( + * 'federation_rule_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + add(federationRuleID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Disable a federation rule for a workspace. + * + * Idempotent; succeeds even if the enablement was already removed. OAuth callers + * may only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const workspace = + * await client.beta.organization.federation.rules.workspaces.remove( + * 'workspace_id', + * { federation_rule_id: 'federation_rule_id' }, + * ); + * ``` + */ + remove(workspaceID, params, options) { + const { federation_rule_id, betas } = params; + return this._client.delete(path2`/v1/organizations/federation_rules/${federation_rule_id}/workspaces/${workspaceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +var Rules; +var init_rules = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs"() { + init_resource(); + init_workspaces(); + init_workspaces(); + init_pagination(); + init_headers(); + init_path(); + Rules = /* @__PURE__ */ (() => { + class Rules2 extends APIResource { + constructor() { + super(...arguments); + this.workspaces = new Workspaces(this._client); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Create a federation rule owned by your organization. + * + * The referenced issuer and the target service account must already exist in the + * same organization; invalid references are rejected with a 400 error. The + * workspace reference is validated. Membership is not checked at rule creation: + * token exchange resolves a single enabled workspace per call and is rejected + * unless the target service account is a member of that workspace (it is + * implicitly a member of the default workspace). Rules on well-known shared + * issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, Google) must + * constrain tenant identity via an identity-bearing claim, a tenant-pinning + * subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition referencing one + * of those identity claims (e.g. `claims.repository_owner`). OAuth callers may + * only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.create({ + * issuer_id: 'issuer_id', + * match: {}, + * name: 'x', + * oauth_scope: 'x', + * target: { + * service_account_id: 'svac_01SDCCSbTxrXDpWc1phhtcfK', + * type: 'service_account', + * }, + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/federation_rules?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a federation rule by its ID (`fdrl_...`). + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.retrieve( + * 'federation_rule_id', + * ); + * ``` + */ + retrieve(federationRuleID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Partially update a federation rule. + * + * `issuer_id` is immutable. `match` and `target` are replaced as whole objects + * when set. Referenced service accounts and workspaces must exist in your + * organization; invalid references are rejected with a 400 error. Archived rules + * cannot be updated; this returns 400. Create a new rule instead. Rules on + * well-known shared issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, + * Google) must constrain tenant identity via an identity-bearing claim, a + * tenant-pinning subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition + * referencing one of those identity claims (e.g. `claims.repository_owner`). On + * these issuers the requirement is re-checked on every update; if an existing + * rule's stored match does not yet constrain tenant identity, any update (even a + * rename or description change) must also supply a conforming `match` in the same + * request. OAuth callers may only manage rules whose `oauth_scope` is + * `workspace:developer` or `workspace:inference`; other scopes require a Console + * session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.update( + * 'federation_rule_id', + * ); + * ``` + */ + update(federationRuleID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List federation rules in your organization. + * + * Optionally filter by issuer with `issuer_id`. Archived rules are excluded unless + * `include_archived=true`. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaFederationRule of client.beta.organization.federation.rules.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/federation_rules?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a federation rule. + * + * Token exchange through this rule stops immediately. Idempotent; re-archiving + * returns the rule with its original `archived_at`. Archiving clears the rule's + * workspace targeting (`workspace_id` and `workspace_ids` are emptied). Tokens + * already minted before archive remain valid until they expire. OAuth callers may + * only manage rules whose `oauth_scope` is `workspace:developer` or + * `workspace:inference`; other scopes require a Console session. + * + * @example + * ```ts + * const betaFederationRule = + * await client.beta.organization.federation.rules.archive( + * 'federation_rule_id', + * ); + * ``` + */ + archive(federationRuleID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/federation_rules/${federationRuleID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + } + Rules2.Workspaces = Workspaces; + return Rules2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +var Federation; +var init_federation = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs"() { + init_resource(); + init_issuers(); + init_issuers(); + init_rules(); + init_rules(); + Federation = /* @__PURE__ */ (() => { + class Federation2 extends APIResource { + constructor() { + super(...arguments); + this.issuers = new Issuers(this._client); + this.rules = new Rules(this._client); + } + } + Federation2.Issuers = Issuers; + Federation2.Rules = Rules; + return Federation2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +var Workspaces2; +var init_workspaces2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Workspaces2 = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List the workspaces a service account is a member of. + * + * Each entry includes the service account's `workspace_role` in that workspace. + * Use `limit` and the `next_page` cursor to paginate. When the service account has + * no explicit default-workspace membership, the implicit (`implicit: true`) + * membership is returned as the first entry on the first page; with `limit=1` the + * first page may return up to 2 entries (the implicit entry plus one explicit + * membership) so a pagination cursor can be derived. Memberships are returned only + * while the service account is active. Without a `page` cursor, an archived + * service account returns an empty list. A `page` cursor that does not match an + * active membership returns a 400 invalid-request error. A cursor stops matching + * when the membership is removed, the workspace is deleted, or the service account + * is archived. Restart pagination from the first page to recover. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.serviceAccounts.workspaces.list( + * 'service_account_id', + * )) { + * // ... + * } + * ``` + */ + list(serviceAccountID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Add a service account to a workspace with the given `workspace_role`. + * + * Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed from the + * service-account side; both create the same membership. If the service account is + * already an explicit member of the workspace, its `workspace_role` is replaced + * with the value supplied here. Archived workspaces return 400. Archived service + * accounts cannot be added and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.serviceAccounts.workspaces.add( + * 'service_account_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(serviceAccountID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Remove a service account from a workspace. + * + * Mirror of + * `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`, + * addressed from the service-account side. Removal is idempotent (returns 200 even + * if the membership was already removed). A DELETE against the implicit + * default-workspace membership returns 200 but is a no-op and the membership + * persists; deleting an explicit default-workspace row reverts to the implicit + * `workspace_user` membership. Archived workspaces return 400. + * + * @example + * ```ts + * const workspace = + * await client.beta.organization.serviceAccounts.workspaces.remove( + * 'workspace_id', + * { service_account_id: 'service_account_id' }, + * ); + * ``` + */ + remove(workspaceID, params, options) { + const { service_account_id, betas } = params; + return this._client.delete(path2`/v1/organizations/service_accounts/${service_account_id}/workspaces/${workspaceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +var ServiceAccounts; +var init_service_accounts = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs"() { + init_resource(); + init_workspaces2(); + init_workspaces2(); + init_pagination(); + init_headers(); + init_path(); + ServiceAccounts = /* @__PURE__ */ (() => { + class ServiceAccounts4 extends APIResource { + constructor() { + super(...arguments); + this.workspaces = new Workspaces2(this._client); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Create a service account. + * + * A service account is a named workload identity that federation rules target. + * `organization_role` is `developer` (default) or `admin`; a rule may only be + * created or retargeted to grant `org:admin` scope when the target's + * `organization_role` is `admin`. Creating an `admin`-role service account + * requires an interactive credential (a user OAuth token or a Console session) — a + * workload may only create `developer`-role service accounts. + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.create({ + * name: 'ci-deploy-bot', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/service_accounts?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a service account by its ID (`svac_...`). + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.retrieve( + * 'service_account_id', + * ); + * ``` + */ + retrieve(serviceAccountID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.get(path2`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Update a service account. + * + * Only `description` and `organization_role` are mutable; `name` cannot be + * changed. Archived service accounts cannot be updated; this returns 400. Setting + * `organization_role` to `admin` (even when unchanged) requires an interactive + * credential (a user OAuth token or a Console session). + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.update( + * 'service_account_id', + * ); + * ``` + */ + update(serviceAccountID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List service accounts in the caller's organization. + * + * Results are ordered by creation time, newest first. Use `limit` and the + * `next_page` cursor to paginate; set `include_archived=true` to include archived + * service accounts. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList("/v1/organizations/service_accounts?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Archive a service account. + * + * Idempotent; re-archiving returns the service account with its original + * `archived_at`. Rejected with 400 if any live (non-archived) federation rule + * still targets this service account, same as issuer archival; archive those rules + * first or change their target to another service account. + * + * @example + * ```ts + * const betaServiceAccount = + * await client.beta.organization.serviceAccounts.archive( + * 'service_account_id', + * ); + * ``` + */ + archive(serviceAccountID, params = {}, options) { + const { betas } = params ?? {}; + return this._client.post(path2`/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + } + ServiceAccounts4.Workspaces = Workspaces2; + return ServiceAccounts4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +var Members; +var init_members = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs"() { + init_resource(); + init_pagination(); + init_path(); + Members = class extends APIResource { + /** + * Get Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.retrieve( + * 'user_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + retrieve(userID, params, options) { + const { workspace_id } = params; + return this._client.get(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); + } + /** + * Update Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.update( + * 'user_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + update(userID, params, options) { + const { workspace_id, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, { + body, + ...options + }); + } + /** + * List Workspace Members + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspaceMember of client.beta.organization.workspaces.members.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, query = {}, options) { + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page, { query, ...options }); + } + /** + * Create Workspace Member + * + * @example + * ```ts + * const betaWorkspaceMember = + * await client.beta.organization.workspaces.members.add( + * 'workspace_id', + * { + * user_id: 'user_01WCz1FkmYMm4gnmykNKUu3Q', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(workspaceID, body, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, { + body, + ...options + }); + } + /** + * Delete Workspace Member + * + * @example + * ```ts + * const member = + * await client.beta.organization.workspaces.members.remove( + * 'user_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + remove(userID, params, options) { + const { workspace_id } = params; + return this._client.delete(path2`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +var RateLimits2; +var init_rate_limits2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs"() { + init_resource(); + init_pagination(); + init_path(); + RateLimits2 = class extends APIResource { + /** + * List a workspace's rate limits. + * + * By default, returns only the groups and limiter types that have a + * workspace-level override. With `include_inherited=true`, returns every group + * with organization-level limits the workspace can see, listing for each the + * values it inherits from the organization as well as its own overrides. Each + * value's `source` says which it is. + * + * When `limit` is omitted, every matching entry is returned in a single page; when + * `limit` truncates the result, follow `next_page` to fetch the remaining entries. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspaceRateLimit of client.beta.organization.workspaces.rateLimits.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, query = {}, options) { + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query, ...options }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +var ServiceAccounts2; +var init_service_accounts2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + ServiceAccounts2 = class extends APIResource { + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Retrieve a service account's membership in a workspace. + * + * Returns the membership record, including the service account's `workspace_role` + * in this workspace. Archived workspaces return 400. For the default workspace, + * returns the implicit (`implicit: true`) membership when no explicit membership + * exists; an explicitly added membership is returned with its assigned role. An + * archived service account returns 404. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.retrieve( + * 'service_account_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + retrieve(serviceAccountID, params, options) { + const { workspace_id, betas } = params; + return this._client.get(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Change a service account's role in a workspace. + * + * The new `workspace_role` replaces the current one. Only explicit memberships can + * be updated; to set a role on the implicit default-workspace membership, add the + * service account explicitly with + * `POST /workspaces/{workspace_id}/service_accounts`. Archived workspaces + * return 400. Archived service accounts cannot be updated and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.update( + * 'service_account_id', + * { + * workspace_id: 'workspace_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + update(serviceAccountID, params, options) { + const { workspace_id, betas, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * List the service accounts that are members of a workspace. + * + * Each entry includes the service account's `workspace_role`. Use `limit` and the + * `next_page` cursor to paginate. Archived workspaces return 400; use + * `GET /service_accounts/{id}/workspaces` to audit memberships of an archived + * workspace. The implicit default-workspace membership is not included in this + * list. Memberships of archived service accounts are omitted from the results. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.workspaces.serviceAccounts.list( + * 'workspace_id', + * )) { + * // ... + * } + * ``` + */ + list(workspaceID, params = {}, options) { + const { betas, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Add a service account to a workspace with the given `workspace_role`. + * + * The role determines what the service account can do in the workspace and which + * workspace-scoped permissions it can be granted when authenticating through + * federation. Every service account is already an implicit `workspace_user` member + * of the default workspace; adding it explicitly assigns a chosen role. If the + * service account is already an explicit member of the workspace, its + * `workspace_role` is replaced with the value supplied here. Archived workspaces + * return 400. Archived service accounts cannot be added and are rejected. + * + * @example + * ```ts + * const betaServiceAccountWorkspaceMember = + * await client.beta.organization.workspaces.serviceAccounts.add( + * 'workspace_id', + * { + * service_account_id: 'service_account_id', + * workspace_role: 'workspace_admin', + * }, + * ); + * ``` + */ + add(workspaceID, params, options) { + const { betas, ...body } = params; + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * **Requires an OAuth access token with the `org:admin` scope**, from + * `ant auth login --scope org:admin` or a workload identity federation rule; Admin + * API keys are not accepted. See + * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). + * + * Remove a service account from a workspace. + * + * Removal is idempotent (returns 200 even if the membership was already removed). + * A DELETE against the implicit default-workspace membership returns 200 but is a + * no-op and the membership persists; deleting an explicit default-workspace row + * reverts to the implicit `workspace_user` membership. Archived workspaces + * return 400. + * + * @example + * ```ts + * const serviceAccount = + * await client.beta.organization.workspaces.serviceAccounts.remove( + * 'service_account_id', + * { workspace_id: 'workspace_id' }, + * ); + * ``` + */ + remove(serviceAccountID, params, options) { + const { workspace_id, betas } = params; + return this._client.delete(path2`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +var Workspaces3; +var init_workspaces3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs"() { + init_resource(); + init_members(); + init_members(); + init_rate_limits2(); + init_rate_limits2(); + init_service_accounts2(); + init_service_accounts2(); + init_pagination(); + init_headers(); + init_path(); + Workspaces3 = /* @__PURE__ */ (() => { + class Workspaces4 extends APIResource { + constructor() { + super(...arguments); + this.rateLimits = new RateLimits2(this._client); + this.members = new Members(this._client); + this.serviceAccounts = new ServiceAccounts2(this._client); + } + /** + * Create Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.create({ + * name: 'x', + * }); + * ``` + */ + create(params, options) { + const { betas, ...body } = params; + return this._client.post("/v1/organizations/workspaces?beta=true", { + body, + ...options, + headers: buildHeaders([ + { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, + options?.headers + ]) + }); + } + /** + * Get Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.retrieve( + * 'workspace_id', + * ); + * ``` + */ + retrieve(workspaceID, options) { + return this._client.get(path2`/v1/organizations/workspaces/${workspaceID}?beta=true`, options); + } + /** + * Update Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.update( + * 'workspace_id', + * ); + * ``` + */ + update(workspaceID, body, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}?beta=true`, { + body, + ...options + }); + } + /** + * List Workspaces + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaWorkspace of client.beta.organization.workspaces.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/v1/organizations/workspaces?beta=true", Page, { + query, + ...options + }); + } + /** + * Archive Workspace + * + * @example + * ```ts + * const betaWorkspace = + * await client.beta.organization.workspaces.archive( + * 'workspace_id', + * ); + * ``` + */ + archive(workspaceID, options) { + return this._client.post(path2`/v1/organizations/workspaces/${workspaceID}/archive?beta=true`, options); + } + } + Workspaces4.RateLimits = RateLimits2; + Workspaces4.Members = Members; + Workspaces4.ServiceAccounts = ServiceAccounts2; + return Workspaces4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +var Organization; +var init_organization = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs"() { + init_resource(); + init_api_keys(); + init_api_keys(); + init_compliance_settings(); + init_compliance_settings(); + init_external_keys(); + init_external_keys(); + init_invites(); + init_invites(); + init_rate_limits(); + init_rate_limits(); + init_users(); + init_users(); + init_federation(); + init_federation(); + init_service_accounts(); + init_service_accounts(); + init_workspaces3(); + init_workspaces3(); + Organization = /* @__PURE__ */ (() => { + class Organization3 extends APIResource { + constructor() { + super(...arguments); + this.apiKeys = new APIKeys(this._client); + this.externalKeys = new ExternalKeys(this._client); + this.federation = new Federation(this._client); + this.invites = new Invites(this._client); + this.serviceAccounts = new ServiceAccounts(this._client); + this.users = new Users(this._client); + this.workspaces = new Workspaces3(this._client); + this.rateLimits = new RateLimits(this._client); + this.complianceSettings = new ComplianceSettings(this._client); + } + /** + * Retrieve information about the organization associated with the authenticated + * API key. + * + * @example + * ```ts + * const betaOrganization = + * await client.beta.organization.retrieve(); + * ``` + */ + retrieve(options) { + return this._client.get("/v1/organizations/me?beta=true", options); + } + } + Organization3.APIKeys = APIKeys; + Organization3.ExternalKeys = ExternalKeys; + Organization3.Federation = Federation; + Organization3.Invites = Invites; + Organization3.ServiceAccounts = ServiceAccounts; + Organization3.Users = Users; + Organization3.Workspaces = Workspaces3; + Organization3.RateLimits = RateLimits; + Organization3.ComplianceSettings = ComplianceSettings; + return Organization3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +var Events; +var init_events = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + init_SessionToolRunner(); + Events = /* @__PURE__ */ (() => { + class Events4 extends APIResource { + /** + * List Events + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.events.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Send Events + * + * @example + * ```ts + * const betaManagedAgentsSendSessionEvents = + * await client.beta.sessions.events.send( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * { + * events: [ + * { + * content: [ + * { + * text: 'Where is my order #1234?', + * type: 'text', + * }, + * ], + * type: 'user.message', + * }, + * ], + * }, + * ); + * ``` + */ + send(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}/events?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stream Events + * + * @example + * ```ts + * const betaManagedAgentsStreamSessionEvents = + * await client.beta.sessions.events.stream( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + stream(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.get(path2`/v1/sessions/${sessionID}/events/stream?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true + }); + } + /** + * Attach to a session and dispatch every incoming `agent.tool_use` and + * `agent.custom_tool_use` event to a local tool registry, sending the matching + * result back (`user.tool_result` / `user.custom_tool_result`). The + * sessions-side counterpart to `client.beta.messages.toolRunner`: yields one + * entry per completed tool call so callers can observe each dispatch (and + * `break` to abort cleanly). + * + * @example + * ```ts + * import { betaAgentToolset20260401 } from '@anthropic-ai/sdk/tools/agent-toolset/node'; + * + * for await (const call of client.beta.sessions.events.toolRunner(work.data.id, { + * tools: [...betaAgentToolset20260401({ workdir }), myTool], + * })) { + * console.log(`${call.name} -> ${call.isError ? 'error' : 'ok'}`); + * } + * ``` + */ + toolRunner(sessionID, opts) { + return new SessionToolRunner(sessionID, { ...opts, client: this._client }); + } + } + Events4.SessionToolRunner = SessionToolRunner; + return Events4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs +var Resources; +var init_resources = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Resources = class extends APIResource { + /** + * Get Session Resource + * + * @example + * ```ts + * const resource = + * await client.beta.sessions.resources.retrieve( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + retrieve(resourceID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Session Resource + * + * @example + * ```ts + * const resource = + * await client.beta.sessions.resources.update( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { + * session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * authorization_token: 'ghp_exampletoken', + * }, + * ); + * ``` + */ + update(resourceID, params, options) { + const { session_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Session Resources + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionResource of client.beta.sessions.resources.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Session Resource + * + * @example + * ```ts + * const betaManagedAgentsDeleteSessionResource = + * await client.beta.sessions.resources.delete( + * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + delete(resourceID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Add Session Resource + * + * @example + * ```ts + * const betaManagedAgentsFileResource = + * await client.beta.sessions.resources.add( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * { + * file_id: 'file_011CNha8iCJcU1wXNR6q4V8w', + * type: 'file', + * }, + * ); + * ``` + */ + add(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}/resources?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +var Events2; +var init_events2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Events2 = class extends APIResource { + /** + * List Session Thread Events + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.threads.events.list( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * )) { + * // ... + * } + * ``` + */ + list(threadID, params, options) { + const { session_id, betas, workspace_id, ...query } = params; + return this._client.getAPIList(path2`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Stream Session Thread Events + * + * @example + * ```ts + * const betaManagedAgentsStreamSessionThreadEvents = + * await client.beta.sessions.threads.events.stream( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + stream(threadID, params, options) { + const { session_id, betas, workspace_id, ...query } = params; + return this._client.get(path2`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +var Threads; +var init_threads = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs"() { + init_resource(); + init_events2(); + init_events2(); + init_pagination(); + init_headers(); + init_path(); + Threads = /* @__PURE__ */ (() => { + class Threads4 extends APIResource { + constructor() { + super(...arguments); + this.events = new Events2(this._client); + } + /** + * Get Session Thread + * + * @example + * ```ts + * const betaManagedAgentsSessionThread = + * await client.beta.sessions.threads.retrieve( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + retrieve(threadID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Session Threads + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSessionThread of client.beta.sessions.threads.list( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * )) { + * // ... + * } + * ``` + */ + list(sessionID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Session Thread + * + * @example + * ```ts + * const betaManagedAgentsSessionThread = + * await client.beta.sessions.threads.archive( + * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', + * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, + * ); + * ``` + */ + archive(threadID, params, options) { + const { session_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Threads4.Events = Events2; + return Threads4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +var Sessions; +var init_sessions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs"() { + init_resource(); + init_events(); + init_events(); + init_resources(); + init_resources(); + init_threads(); + init_threads(); + init_pagination(); + init_headers(); + init_path(); + Sessions = /* @__PURE__ */ (() => { + class Sessions6 extends APIResource { + constructor() { + super(...arguments); + this.events = new Events(this._client); + this.resources = new Resources(this._client); + this.threads = new Threads(this._client); + } + /** + * Create Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.create({ + * agent: 'agent_011CZkYpogX7uDKUyvBTophP', + * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/sessions?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.retrieve( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + retrieve(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/sessions/${sessionID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.update( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + update(sessionID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/sessions/${sessionID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Sessions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsSession of client.beta.sessions.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/sessions?beta=true", BidirectionalPageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Session + * + * @example + * ```ts + * const betaManagedAgentsDeletedSession = + * await client.beta.sessions.delete( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + delete(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/sessions/${sessionID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Session + * + * @example + * ```ts + * const betaManagedAgentsSession = + * await client.beta.sessions.archive( + * 'sesn_011CZkZAtmR3yMPDzynEDxu7', + * ); + * ``` + */ + archive(sessionID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/sessions/${sessionID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Sessions6.Events = Events; + Sessions6.Resources = Resources; + Sessions6.Threads = Threads; + return Sessions6; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +var Versions2; +var init_versions2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Versions2 = class extends APIResource { + /** + * Create Skill Version + * + * @example + * ```ts + * const betaSkillVersion = + * await client.beta.skills.versions.create('skill_id', { + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(skillID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill Version + * + * @example + * ```ts + * const betaSkillVersion = + * await client.beta.skills.versions.retrieve('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + retrieve(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Skill Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSkillVersion of client.beta.skills.versions.list( + * 'skill_id', + * )) { + * // ... + * } + * ``` + */ + list(skillID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/skills/${skillID}/versions?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Skill Version + * + * @example + * ```ts + * const betaDeletedSkillVersion = + * await client.beta.skills.versions.delete('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + delete(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/skills/${skill_id}/versions/${version}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Download a skill version's content as a zip archive. + * + * @example + * ```ts + * const response = await client.beta.skills.versions.download( + * 'version', + * { skill_id: 'skill_id' }, + * ); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(version, params, options) { + const { skill_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}/content?beta=true`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +var Skills; +var init_skills = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs"() { + init_resource(); + init_versions2(); + init_versions2(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Skills = /* @__PURE__ */ (() => { + class Skills4 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions2(this._client); + } + /** + * Create Skill + * + * @example + * ```ts + * const betaSkill = await client.beta.skills.create({ + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/skills?beta=true", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill + * + * @example + * ```ts + * const betaSkill = await client.beta.skills.retrieve( + * 'skill_id', + * ); + * ``` + */ + retrieve(skillID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/skills/${skillID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Skills + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaSkill of client.beta.skills.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/skills?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Skill + * + * @example + * ```ts + * const betaDeletedSkill = await client.beta.skills.delete( + * 'skill_id', + * ); + * ``` + */ + delete(skillID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/skills/${skillID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Skills4.Versions = Versions2; + return Skills4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +var Certificates; +var init_certificates = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Certificates = class extends APIResource { + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's + * server certificate against this CA when it terminates the inner TLS session. A + * tunnel holds at most two non-archived certificates. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.create( + * 'tunnel_id', + * { ca_certificate_pem: 'ca_certificate_pem' }, + * ); + * ``` + */ + create(tunnelID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/tunnels/${tunnelID}/certificates?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Fetches a tunnel certificate by ID. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.retrieve( + * 'certificate_id', + * { tunnel_id: 'tunnel_id' }, + * ); + * ``` + */ + retrieve(certificateID, params, options) { + const { tunnel_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/tunnels/${tunnel_id}/certificates/${certificateID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Lists the certificates registered on a tunnel. Archived certificates are + * excluded unless include_archived is set. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaTunnelCertificate of client.beta.tunnels.certificates.list( + * 'tunnel_id', + * )) { + * // ... + * } + * ``` + */ + list(tunnelID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/tunnels/${tunnelID}/certificates?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Archives a tunnel certificate, removing it from the set Anthropic trusts for the + * tunnel. The certificate record is retained. Archiving the last non-archived + * certificate is permitted; the tunnel rejects MCP traffic until a new certificate + * is added. + * + * @example + * ```ts + * const betaTunnelCertificate = + * await client.beta.tunnels.certificates.archive( + * 'certificate_id', + * { tunnel_id: 'tunnel_id' }, + * ); + * ``` + */ + archive(certificateID, params, options) { + const { tunnel_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/tunnels/${tunnel_id}/certificates/${certificateID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +var Tunnels; +var init_tunnels = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs"() { + init_resource(); + init_certificates(); + init_certificates(); + init_pagination(); + init_headers(); + init_path(); + Tunnels = /* @__PURE__ */ (() => { + class Tunnels2 extends APIResource { + constructor() { + super(...arguments); + this.certificates = new Certificates(this._client); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; + * it is not idempotent. The new tunnel rejects MCP traffic until at least one CA + * certificate is added. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.create(); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/tunnels?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Fetches a tunnel by ID. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.retrieve( + * 'tunnel_id', + * ); + * ``` + */ + retrieve(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/tunnels/${tunnelID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Lists tunnels. Results are ordered by creation time, newest first; archived + * tunnels are excluded unless include_archived is set. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaTunnel of client.beta.tunnels.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/tunnels?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Archives a tunnel. Archival is irreversible: every non-archived certificate on + * the tunnel is archived in the same operation, the hostname is retired and never + * re-allocated, and the tunnel token is invalidated. Retrying against an + * already-archived tunnel returns the existing record unchanged. + * + * @example + * ```ts + * const betaTunnel = await client.beta.tunnels.archive( + * 'tunnel_id', + * ); + * ``` + */ + archive(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/tunnels/${tunnelID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Reveals a tunnel's connector token. The value is fetched live on each call; + * Anthropic does not store it. Repeated calls return the same value until the + * token is rotated. Exposed as POST so the token does not appear in intermediary + * access logs. + * + * @example + * ```ts + * const betaTunnelToken = + * await client.beta.tunnels.revealToken('tunnel_id'); + * ``` + */ + revealToken(tunnelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/tunnels/${tunnelID}/reveal_token?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * The Tunnels API is in research preview. It requires the + * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a + * deprecation period. It supersedes the Admin API endpoints at + * `/v1/organizations/tunnels`, which remain available during a migration window. + * + * Rotates a tunnel's connector token. Rotation invalidates the current token for + * new connections and returns a fresh value; established connections are not + * severed. A connector restarted after rotation must use the new value. + * + * @example + * ```ts + * const betaTunnelToken = + * await client.beta.tunnels.rotateToken('tunnel_id'); + * ``` + */ + rotateToken(tunnelID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/tunnels/${tunnelID}/rotate_token?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Tunnels2.Certificates = Certificates; + return Tunnels2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +var Credentials; +var init_credentials2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Credentials = class extends APIResource { + /** + * Create Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.create( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * { + * auth: { + * token: 'bearer_exampletoken', + * mcp_server_url: + * 'https://example-server.modelcontextprotocol.io/sse', + * type: 'static_bearer', + * }, + * }, + * ); + * ``` + */ + create(vaultID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vaultID}/credentials?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.retrieve( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + retrieve(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.get(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.update( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + update(credentialID, params, options) { + const { vault_id, betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Credentials + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * )) { + * // ... + * } + * ``` + */ + list(vaultID, params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Credential + * + * @example + * ```ts + * const betaManagedAgentsDeletedCredential = + * await client.beta.vaults.credentials.delete( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + delete(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.delete(path2`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Credential + * + * @example + * ```ts + * const betaManagedAgentsCredential = + * await client.beta.vaults.credentials.archive( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + archive(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Validate Credential + * + * @example + * ```ts + * const betaManagedAgentsCredentialValidation = + * await client.beta.vaults.credentials.mcpOAuthValidate( + * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', + * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, + * ); + * ``` + */ + mcpOAuthValidate(credentialID, params, options) { + const { vault_id, betas, workspace_id } = params; + return this._client.post(path2`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs +var Vaults; +var init_vaults = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs"() { + init_resource(); + init_credentials2(); + init_credentials2(); + init_pagination(); + init_headers(); + init_path(); + Vaults = /* @__PURE__ */ (() => { + class Vaults3 extends APIResource { + constructor() { + super(...arguments); + this.credentials = new Credentials(this._client); + } + /** + * Create Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.create({ + * display_name: 'Example vault', + * }); + * ``` + */ + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/vaults?beta=true", { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Get Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.retrieve( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + retrieve(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/vaults/${vaultID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Update Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.update( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + update(vaultID, params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post(path2`/v1/vaults/${vaultID}?beta=true`, { + body, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List Vaults + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const betaManagedAgentsVault of client.beta.vaults.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/vaults?beta=true", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Delete Vault + * + * @example + * ```ts + * const betaManagedAgentsDeletedVault = + * await client.beta.vaults.delete( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + delete(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/vaults/${vaultID}?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * Archive Vault + * + * @example + * ```ts + * const betaManagedAgentsVault = + * await client.beta.vaults.archive( + * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', + * ); + * ``` + */ + archive(vaultID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.post(path2`/v1/vaults/${vaultID}/archive?beta=true`, { + ...options, + headers: buildHeaders([ + { + "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Vaults3.Credentials = Credentials; + return Vaults3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +var Beta; +var init_beta = __esm({ + "node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs"() { + init_resource(); + init_deployment_runs(); + init_deployment_runs(); + init_deployments(); + init_deployments(); + init_dreams(); + init_dreams(); + init_files(); + init_files(); + init_models2(); + init_models2(); + init_user_profiles(); + init_user_profiles(); + init_webhooks(); + init_webhooks(); + init_agents(); + init_agents(); + init_environments(); + init_environments(); + init_memory_stores(); + init_memory_stores(); + init_messages(); + init_messages(); + init_organization(); + init_organization(); + init_sessions(); + init_sessions(); + init_skills(); + init_skills(); + init_tunnels(); + init_tunnels(); + init_vaults(); + init_vaults(); + Beta = /* @__PURE__ */ (() => { + class Beta3 extends APIResource { + constructor() { + super(...arguments); + this.models = new Models(this._client); + this.messages = new Messages(this._client); + this.agents = new Agents(this._client); + this.environments = new Environments(this._client); + this.sessions = new Sessions(this._client); + this.deployments = new Deployments(this._client); + this.deploymentRuns = new DeploymentRuns(this._client); + this.vaults = new Vaults(this._client); + this.memoryStores = new MemoryStores(this._client); + this.files = new Files(this._client); + this.skills = new Skills(this._client); + this.webhooks = new Webhooks(this._client); + this.userProfiles = new UserProfiles(this._client); + this.dreams = new Dreams(this._client); + this.tunnels = new Tunnels(this._client); + this.organization = new Organization(this._client); + } + } + Beta3.Models = Models; + Beta3.Messages = Messages; + Beta3.Agents = Agents; + Beta3.Environments = Environments; + Beta3.Sessions = Sessions; + Beta3.Deployments = Deployments; + Beta3.DeploymentRuns = DeploymentRuns; + Beta3.Vaults = Vaults; + Beta3.MemoryStores = MemoryStores; + Beta3.Files = Files; + Beta3.Skills = Skills; + Beta3.Webhooks = Webhooks; + Beta3.UserProfiles = UserProfiles; + Beta3.Dreams = Dreams; + Beta3.Tunnels = Tunnels; + Beta3.Organization = Organization; + return Beta3; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/completions.mjs +var Completions; +var init_completions = __esm({ + "node_modules/@anthropic-ai/sdk/resources/completions.mjs"() { + init_resource(); + init_headers(); + Completions = class extends APIResource { + create(params, options) { + const { betas, workspace_id, ...body } = params; + return this._client.post("/v1/complete", { + body, + timeout: this._client._options.timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: params.stream ?? false + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/files.mjs +var Files2; +var init_files2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/files.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_stainless_helper_header(); + init_uploads(); + init_path(); + Files2 = class extends APIResource { + /** + * List Files + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const fileMetadata of client.files.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/files", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete File + * + * @example + * ```ts + * const deletedFile = await client.files.delete('file_id'); + * ``` + */ + delete(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/files/${fileID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Download File + * + * @example + * ```ts + * const response = await client.files.download('file_id'); + * + * const content = await response.blob(); + * console.log(content); + * ``` + */ + download(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}/content`, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + __binaryResponse: true + }); + } + /** + * Get File Metadata + * + * @example + * ```ts + * const fileMetadata = await client.files.retrieveMetadata( + * 'file_id', + * ); + * ``` + */ + retrieveMetadata(fileID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/files/${fileID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Upload File + * + * @example + * ```ts + * const fileMetadata = await client.files.upload({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + upload(params, options) { + const { workspace_id, ...body } = params; + return this._client.post("/v1/files", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + stainlessHelperHeaderFromFile(body.file), + options?.headers + ]) + }, this._client)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/lib/parser.mjs +function getOutputFormat2(params) { + return params?.output_config?.format; +} +function maybeParseMessage(message, params, opts) { + const outputFormat = getOutputFormat2(params); + if (!params || !("parse" in (outputFormat ?? {}))) { + return { + ...message, + content: message.content.map((block) => { + if (block.type === "text") { + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: null, + enumerable: false + }); + return parsedBlock; + } + return block; + }), + parsed_output: null + }; + } + return parseMessage(message, params, opts); +} +function parseMessage(message, params, opts) { + let firstParsedOutput = null; + const content = message.content.map((block) => { + if (block.type === "text") { + const parsedOutput = parseOutputFormat(params, block.text); + if (firstParsedOutput === null) { + firstParsedOutput = parsedOutput; + } + const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { + value: parsedOutput, + enumerable: false + }); + return parsedBlock; + } + return block; + }); + return { + ...message, + content, + parsed_output: firstParsedOutput + }; +} +function parseOutputFormat(params, content) { + const outputFormat = getOutputFormat2(params); + if (outputFormat?.type !== "json_schema") { + return null; + } + try { + if ("parse" in outputFormat) { + return outputFormat.parse(content); + } + return JSON.parse(content); + } catch (error) { + throw new AnthropicError(`Failed to parse structured output: ${error}`); + } +} +var init_parser2 = __esm({ + "node_modules/@anthropic-ai/sdk/lib/parser.mjs"() { + init_error(); + } +}); + +// node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +function tracksToolInput2(content) { + return content.type === "tool_use" || content.type === "server_tool_use"; +} +var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_params, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_workspace_id, _MessageStream_logger, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage, MessageStream; +var init_MessageStream = __esm({ + "node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs"() { + init_tslib(); + init_stainless_helper_header(); + init_errors(); + init_values(); + init_error2(); + init_streaming2(); + init_parser2(); + init_message_stream_utils(); + MessageStream = /* @__PURE__ */ (() => { + class MessageStream2 { + constructor(params, opts) { + _MessageStream_instances.add(this); + this.messages = []; + this.receivedMessages = []; + _MessageStream_currentMessageSnapshot.set(this, void 0); + _MessageStream_params.set(this, null); + this.controller = new AbortController(); + _MessageStream_connectedPromise.set(this, void 0); + _MessageStream_resolveConnectedPromise.set(this, () => { + }); + _MessageStream_rejectConnectedPromise.set(this, () => { + }); + _MessageStream_endPromise.set(this, void 0); + _MessageStream_resolveEndPromise.set(this, () => { + }); + _MessageStream_rejectEndPromise.set(this, () => { + }); + _MessageStream_listeners.set(this, {}); + _MessageStream_ended.set(this, false); + _MessageStream_errored.set(this, false); + _MessageStream_aborted.set(this, false); + _MessageStream_catchingPromiseCreated.set(this, false); + _MessageStream_response.set(this, void 0); + _MessageStream_request_id.set(this, void 0); + _MessageStream_workspace_id.set(this, void 0); + _MessageStream_logger.set(this, void 0); + _MessageStream_handleError.set(this, (error) => { + __classPrivateFieldSet(this, _MessageStream_errored, true, "f"); + if (isAbortError(error)) { + error = new APIUserAbortError(); + } + if (error instanceof APIUserAbortError) { + __classPrivateFieldSet(this, _MessageStream_aborted, true, "f"); + return this._emit("abort", error); + } + if (error instanceof AnthropicError) { + return this._emit("error", error); + } + if (error instanceof Error) { + const anthropicError = new AnthropicError(error.message); + anthropicError.cause = error; + return this._emit("error", anthropicError); + } + return this._emit("error", new AnthropicError(String(error))); + }); + __classPrivateFieldSet(this, _MessageStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet(this, _MessageStream_rejectConnectedPromise, reject2, "f"); + }), "f"); + __classPrivateFieldSet(this, _MessageStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet(this, _MessageStream_rejectEndPromise, reject2, "f"); + }), "f"); + __classPrivateFieldGet(this, _MessageStream_connectedPromise, "f").catch(() => { + }); + __classPrivateFieldGet(this, _MessageStream_endPromise, "f").catch(() => { + }); + __classPrivateFieldSet(this, _MessageStream_params, params, "f"); + __classPrivateFieldSet(this, _MessageStream_logger, opts?.logger ?? console, "f"); + } + get response() { + return __classPrivateFieldGet(this, _MessageStream_response, "f"); + } + get request_id() { + return __classPrivateFieldGet(this, _MessageStream_request_id, "f"); + } + get workspace_id() { + return __classPrivateFieldGet(this, _MessageStream_workspace_id, "f"); + } + /** + * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, + * returned vie the `request-id` header which is useful for debugging requests and resporting + * issues to Anthropic. + * + * This is the same as the `APIPromise.withResponse()` method. + * + * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` + * as no `Response` is available. + */ + async withResponse() { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + const response = await __classPrivateFieldGet(this, _MessageStream_connectedPromise, "f"); + if (!response) { + throw new Error("Could not resolve a `Response` object"); + } + return { + data: this, + response, + request_id: response.headers.get("request-id"), + workspace_id: response.headers.get("anthropic-workspace-id") + }; + } + /** + * Intended for use on the frontend, consuming a stream produced with + * `.toReadableStream()` on the backend. + * + * Note that messages sent to the model do not appear in `.on('message')` + * in this context. + */ + static fromReadableStream(stream5) { + const runner = new MessageStream2(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; + } + static createMessage(messages, params, options, { logger } = {}) { + const runner = new MessageStream2(params, { logger }); + for (const message of params.messages) { + runner._addMessageParam(message); + } + __classPrivateFieldSet(runner, _MessageStream_params, { ...params, stream: true }, "f"); + runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); + return runner; + } + _run(executor) { + executor().then(() => { + this._emitFinal(); + this._emit("end"); + }, __classPrivateFieldGet(this, _MessageStream_handleError, "f")); + } + _addMessageParam(message) { + this.messages.push(message); + } + _addMessage(message, emit = true) { + this.receivedMessages.push(message); + if (emit) { + this._emit("message", message); + } + } + async _createMessage(messages, params, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + const { response, data: stream5 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); + this._connected(response); + for await (const event of stream5) { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + _connected(response) { + if (this.ended) + return; + __classPrivateFieldSet(this, _MessageStream_response, response, "f"); + __classPrivateFieldSet(this, _MessageStream_request_id, response?.headers.get("request-id"), "f"); + __classPrivateFieldSet(this, _MessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); + __classPrivateFieldGet(this, _MessageStream_resolveConnectedPromise, "f").call(this, response); + this._emit("connect"); + } + get ended() { + return __classPrivateFieldGet(this, _MessageStream_ended, "f"); + } + get errored() { + return __classPrivateFieldGet(this, _MessageStream_errored, "f"); + } + get aborted() { + return __classPrivateFieldGet(this, _MessageStream_aborted, "f"); + } + abort() { + this.controller.abort(); + } + /** + * Adds the listener function to the end of the listeners array for the event. + * No checks are made to see if the listener has already been added. Multiple calls passing + * the same combination of event and listener will result in the listener being added, and + * called, multiple times. + * @returns this MessageStream, so that calls can be chained + */ + on(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + listeners.push({ listener }); + return this; + } + /** + * Removes the specified listener from the listener array for the event. + * off() will remove, at most, one instance of a listener from the listener array. If any single + * listener has been added multiple times to the listener array for the specified event, then + * off() must be called multiple times to remove each instance. + * @returns this MessageStream, so that calls can be chained + */ + off(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + if (!listeners) + return this; + const index = listeners.findIndex((l) => l.listener === listener); + if (index >= 0) + listeners.splice(index, 1); + return this; + } + /** + * Adds a one-time listener function for the event. The next time the event is triggered, + * this listener is removed and then invoked. + * @returns this MessageStream, so that calls can be chained + */ + once(event, listener) { + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + listeners.push({ listener, once: true }); + return this; + } + /** + * This is similar to `.once()`, but returns a Promise that resolves the next time + * the event is triggered, instead of calling a listener callback. + * @returns a Promise that resolves the next time given event is triggered, + * or rejects if an error is emitted. (If you request the 'error' event, + * returns a promise that resolves with the error). + * + * Example: + * + * const message = await stream.emitted('message') // rejects if the stream errors + */ + emitted(event) { + return new Promise((resolve2, reject2) => { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + if (event !== "error") + this.once("error", reject2); + this.once(event, resolve2); + }); + } + async done() { + __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet(this, _MessageStream_endPromise, "f"); + } + get currentMessage() { + return __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + } + /** + * @returns a promise that resolves with the the final assistant Message response, + * or rejects if an error occurred or the stream ended prematurely without producing a Message. + * If structured outputs were used, this will be a ParsedMessage with a `parsed_output` field. + */ + async finalMessage() { + await this.done(); + return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); + } + /** + * @returns a promise that resolves with the the final assistant Message's text response, concatenated + * together if there are more than one text blocks. + * Rejects if an error occurred or the stream ended prematurely without producing a Message. + */ + async finalText() { + await this.done(); + return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); + } + _emit(event, ...args) { + if (__classPrivateFieldGet(this, _MessageStream_ended, "f")) + return; + if (event === "end") { + __classPrivateFieldSet(this, _MessageStream_ended, true, "f"); + __classPrivateFieldGet(this, _MessageStream_resolveEndPromise, "f").call(this); + } + const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + if (listeners) { + __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); + listeners.forEach(({ listener }) => listener(...args)); + } + if (event === "abort") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + return; + } + if (event === "error") { + const error = args[0]; + if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error); + } + __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error); + this._emit("end"); + } + } + _emitFinal() { + const finalMessage = this.receivedMessages.at(-1); + if (finalMessage) { + this._emit("finalMessage", __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); + } + } + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + let abortHandler; + if (signal) { + if (signal.aborted) + this.controller.abort(); + abortHandler = this.controller.abort.bind(this.controller); + signal.addEventListener("abort", abortHandler); + } + try { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + this._connected(null); + const stream5 = Stream.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + } + if (stream5.controller.signal?.aborted) { + throw new APIUserAbortError(); + } + __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + } finally { + if (signal && abortHandler) { + signal.removeEventListener("abort", abortHandler); + } + } + } + [(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_params = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_response = /* @__PURE__ */ new WeakMap(), _MessageStream_request_id = /* @__PURE__ */ new WeakMap(), _MessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _MessageStream_logger = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + return this.receivedMessages.at(-1); + }, _MessageStream_getFinalText = function _MessageStream_getFinalText2() { + if (this.receivedMessages.length === 0) { + throw new AnthropicError("stream ended without producing a Message with role=assistant"); + } + const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); + if (textBlocks.length === 0) { + throw new AnthropicError("stream ended without producing a content block with type=text"); + } + return textBlocks.join(" "); + }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { + if (this.ended) + return; + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { + if (this.ended) + return; + const messageSnapshot = __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); + this._emit("streamEvent", event, messageSnapshot); + switch (event.type) { + case "content_block_delta": { + const content = messageSnapshot.content.at(-1); + switch (event.delta.type) { + case "text_delta": { + if (content.type === "text") { + this._emit("text", event.delta.text, content.text || ""); + } + break; + } + case "citations_delta": { + if (content.type === "text") { + this._emit("citation", event.delta.citation, content.citations ?? []); + } + break; + } + case "input_json_delta": { + if (tracksToolInput2(content) && __classPrivateFieldGet(this, _MessageStream_listeners, "f").inputJson?.length) { + this._emit("inputJson", event.delta.partial_json, content.input); + } + break; + } + case "thinking_delta": { + if (content.type === "thinking") { + this._emit("thinking", event.delta.thinking, content.thinking); + } + break; + } + case "signature_delta": { + if (content.type === "thinking") { + this._emit("signature", content.signature); + } + break; + } + default: + checkNever(event.delta); + } + break; + } + case "message_stop": { + this._addMessageParam(messageSnapshot); + this._addMessage(maybeParseMessage(messageSnapshot, __classPrivateFieldGet(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, "f") }), true); + break; + } + case "content_block_stop": { + this._emit("contentBlock", messageSnapshot.content.at(-1)); + break; + } + case "message_start": { + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); + break; + } + case "content_block_start": + case "message_delta": + break; + } + }, _MessageStream_endRequest = function _MessageStream_endRequest2() { + if (this.ended) { + throw new AnthropicError(`stream has ended, this shouldn't happen`); + } + const snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + if (!snapshot) { + throw new AnthropicError(`request ended without sending any chunks`); + } + __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + return maybeParseMessage(snapshot, __classPrivateFieldGet(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, "f") }); + }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { + let snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + if (event.type === "message_start") { + if (snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); + } + return event.message; + } + if (!snapshot) { + throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); + } + switch (event.type) { + case "message_stop": + return snapshot; + case "message_delta": + snapshot.stop_reason = event.delta.stop_reason; + snapshot.stop_sequence = event.delta.stop_sequence; + snapshot.stop_details = event.delta.stop_details; + snapshot.usage.output_tokens = event.usage.output_tokens; + if (event.delta.container != null) { + snapshot.container = event.delta.container; + } + if (event.usage.input_tokens != null) { + snapshot.usage.input_tokens = event.usage.input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; + } + if (event.usage.server_tool_use != null) { + snapshot.usage.server_tool_use = event.usage.server_tool_use; + } + if (event.usage.output_tokens_details != null) { + snapshot.usage.output_tokens_details = event.usage.output_tokens_details; + } + return snapshot; + case "content_block_start": + snapshot.content.push({ ...event.content_block }); + return snapshot; + case "content_block_delta": { + const snapshotContent = snapshot.content.at(event.index); + switch (event.delta.type) { + case "text_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + text: (snapshotContent.text || "") + event.delta.text + }; + } + break; + } + case "citations_delta": { + if (snapshotContent?.type === "text") { + snapshot.content[event.index] = { + ...snapshotContent, + citations: [...snapshotContent.citations ?? [], event.delta.citation] + }; + } + break; + } + case "input_json_delta": { + if (snapshotContent && tracksToolInput2(snapshotContent)) { + const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; + snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); + } + break; + } + case "thinking_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + thinking: snapshotContent.thinking + event.delta.thinking + }; + } + break; + } + case "signature_delta": { + if (snapshotContent?.type === "thinking") { + snapshot.content[event.index] = { + ...snapshotContent, + signature: event.delta.signature + }; + } + break; + } + default: + checkNever(event.delta); + } + return snapshot; + } + case "content_block_stop": { + const snapshotContent = snapshot.content.at(event.index); + if (snapshotContent && tracksToolInput2(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { + Object.defineProperty(snapshotContent, "input", { + value: snapshotContent.input, + enumerable: true, + configurable: true, + writable: true + }); + } + return snapshot; + } + } + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("streamEvent", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); + } else { + pushQueue.push(event); + } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve2, reject2) => readQueue.push({ resolve: resolve2, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; + } + toReadableStream() { + const stream5 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); + } + } + return MessageStream2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +var Batches2; +var init_batches2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_jsonl(); + init_error2(); + init_path(); + Batches2 = class extends APIResource { + /** + * Send a batch of Message creation requests. + * + * The Message Batches API can be used to process multiple Messages API requests at + * once. Once a Message Batch is created, it begins processing immediately. Batches + * can take up to 24 hours to complete. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.create({ + * requests: [ + * { + * custom_id: 'my-custom-id-1', + * params: { + * max_tokens: 1024, + * messages: [ + * { content: 'Hello, world', role: 'user' }, + * ], + * model: 'claude-opus-5', + * }, + * }, + * ], + * }); + * ``` + */ + create(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/batches", { + body, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * This endpoint is idempotent and can be used to poll for Message Batch + * completion. To access the results of a Message Batch, make a request to the + * `results_url` field in the response. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.retrieve( + * 'message_batch_id', + * ); + * ``` + */ + retrieve(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/messages/batches/${messageBatchID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List all Message Batches within a Workspace. Most recently created batches are + * returned first. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const messageBatch of client.messages.batches.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/messages/batches", Page, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete a Message Batch. + * + * Message Batches can only be deleted once they've finished processing. If you'd + * like to delete an in-progress batch, you must first cancel it. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const deletedMessageBatch = + * await client.messages.batches.delete('message_batch_id'); + * ``` + */ + delete(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/messages/batches/${messageBatchID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Batches may be canceled any time before processing ends. Once cancellation is + * initiated, the batch enters a `canceling` state, at which time the system may + * complete any in-progress, non-interruptible requests before finalizing + * cancellation. + * + * The number of canceled requests is specified in `request_counts`. To determine + * which requests were canceled, check the individual results within the batch. + * Note that cancellation may not result in any canceled requests if they were + * non-interruptible. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatch = await client.messages.batches.cancel( + * 'message_batch_id', + * ); + * ``` + */ + cancel(messageBatchID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.post(path2`/v1/messages/batches/${messageBatchID}/cancel`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Streams the results of a Message Batch as a `.jsonl` file. + * + * Each line in the file is a JSON object containing the result of a single request + * in the Message Batch. Results are not guaranteed to be in the same order as + * requests. Use the `custom_id` field to match results to requests. + * + * Learn more about the Message Batches API in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) + * + * @example + * ```ts + * const messageBatchIndividualResponse = + * await client.messages.batches.results('message_batch_id'); + * ``` + */ + async results(messageBatchID, params = {}, options) { + const batch = await this.retrieve(messageBatchID, params, options); + if (!batch.results_url) { + throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); + } + const { workspace_id } = params ?? {}; + return this._client.get(batch.results_url, { + ...options, + headers: buildHeaders([ + { + Accept: "application/binary", + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]), + stream: true, + __binaryResponse: true + })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +var Messages2, DEPRECATED_MODELS2, MODELS_TO_WARN_WITH_THINKING_ENABLED2; +var init_messages2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs"() { + init_resource(); + init_headers(); + init_stainless_helper_header(); + init_MessageStream(); + init_parser2(); + init_batches2(); + init_batches2(); + init_constants(); + Messages2 = /* @__PURE__ */ (() => { + class Messages5 extends APIResource { + constructor() { + super(...arguments); + this.batches = new Batches2(this._client); + } + create(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + if (body.model in DEPRECATED_MODELS2) { + console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS2[body.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); + } + if (MODELS_TO_WARN_WITH_THINKING_ENABLED2.includes(body.model) && body.thinking && body.thinking.type === "enabled") { + console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); + } + let timeout = options?.timeout ?? this._client._options.timeout; + if (!body.stream && timeout == null) { + const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; + timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); + } + const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); + return this._client.post("/v1/messages", { + body, + timeout: timeout ?? 6e5, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + helperHeader2, + options?.headers + ]), + stream: params.stream ?? false + }); + } + /** + * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and + * the response will be automatically parsed and available in the `parsed_output` property of the message. + * + * @example + * ```ts + * const message = await client.messages.parse({ + * model: 'claude-sonnet-4-5-20250929', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_config: { + * format: zodOutputFormat(z.object({ answer: z.number() })), + * }, + * }); + * + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + parse(params, options) { + return this.create(params, options).then((message) => parseMessage(message, params, { logger: this._client.logger ?? console })); + } + /** + * Create a Message stream. + * + * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`), + * the final message will include a `parsed_output` property with the parsed content. + * + * @example + * ```ts + * const stream = client.messages.stream({ + * model: 'claude-sonnet-4-5-20250929', + * max_tokens: 1024, + * messages: [{ role: 'user', content: 'What is 2+2?' }], + * output_config: { + * format: zodOutputFormat(z.object({ answer: z.number() })), + * }, + * }); + * + * const message = await stream.finalMessage(); + * console.log(message.parsed_output?.answer); // 4 + * ``` + */ + stream(body, options) { + return MessageStream.createMessage(this, body, options, { logger: this._client.logger ?? console }); + } + /** + * Count the number of tokens in a Message. + * + * The Token Count API can be used to count the number of tokens in a Message, + * including tools, images, and documents, without creating it. + * + * Learn more about token counting in our + * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) + * + * @example + * ```ts + * const messageTokensCount = + * await client.messages.countTokens({ + * messages: [{ content: 'Hello, world', role: 'user' }], + * model: 'claude-opus-5', + * }); + * ``` + */ + countTokens(params, options) { + const { user_profile_id, workspace_id, ...body } = params; + return this._client.post("/v1/messages/count_tokens", { + body, + ...options, + headers: buildHeaders([ + { + ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + } + Messages5.Batches = Batches2; + return Messages5; + })(); + DEPRECATED_MODELS2 = {}; + MODELS_TO_WARN_WITH_THINKING_ENABLED2 = ["claude-mythos-preview", "claude-opus-4-6"]; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/models.mjs +var Models2; +var init_models3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/models.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_path(); + Models2 = class extends APIResource { + /** + * Get a specific model. + * + * The Models API response can be used to determine information about a specific + * model or resolve a model alias to a model ID. + * + * @example + * ```ts + * const modelInfo = await client.models.retrieve('model_id'); + * ``` + */ + retrieve(modelID, params = {}, options) { + const { betas, workspace_id } = params ?? {}; + return this._client.get(path2`/v1/models/${modelID}`, { + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + /** + * List available models. + * + * The Models API response can be used to determine which models are available for + * use in the API. More recently released models are listed first. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const modelInfo of client.models.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { betas, workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/models", Page, { + query, + ...options, + headers: buildHeaders([ + { + ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, + ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 + }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +var Versions3; +var init_versions3 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs"() { + init_resource(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Versions3 = class extends APIResource { + /** + * Create Skill Version + * + * @example + * ```ts + * const skillVersion = await client.skills.versions.create( + * 'skill_id', + * { files: [fs.createReadStream('path/to/file')] }, + * ); + * ``` + */ + create(skillID, params, options) { + const { workspace_id, ...body } = params; + return this._client.post(path2`/v1/skills/${skillID}/versions`, multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill Version + * + * @example + * ```ts + * const skillVersion = await client.skills.versions.retrieve( + * 'version', + * { skill_id: 'skill_id' }, + * ); + * ``` + */ + retrieve(version, params, options) { + const { skill_id, workspace_id } = params; + return this._client.get(path2`/v1/skills/${skill_id}/versions/${version}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List Skill Versions + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const skillVersion of client.skills.versions.list( + * 'skill_id', + * )) { + * // ... + * } + * ``` + */ + list(skillID, params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList(path2`/v1/skills/${skillID}/versions`, PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete Skill Version + * + * @example + * ```ts + * const deletedSkillVersion = + * await client.skills.versions.delete('version', { + * skill_id: 'skill_id', + * }); + * ``` + */ + delete(version, params, options) { + const { skill_id, workspace_id } = params; + return this._client.delete(path2`/v1/skills/${skill_id}/versions/${version}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + }; + } +}); + +// node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +var Skills2; +var init_skills2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs"() { + init_resource(); + init_versions3(); + init_versions3(); + init_pagination(); + init_headers(); + init_uploads(); + init_path(); + Skills2 = /* @__PURE__ */ (() => { + class Skills4 extends APIResource { + constructor() { + super(...arguments); + this.versions = new Versions3(this._client); + } + /** + * Create Skill + * + * @example + * ```ts + * const skill = await client.skills.create({ + * files: [fs.createReadStream('path/to/file')], + * }); + * ``` + */ + create(params, options) { + const { workspace_id, ...body } = params; + return this._client.post("/v1/skills", multipartFormRequestOptions({ + body, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }, this._client, false)); + } + /** + * Get Skill + * + * @example + * ```ts + * const skill = await client.skills.retrieve('skill_id'); + * ``` + */ + retrieve(skillID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.get(path2`/v1/skills/${skillID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * List Skills + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const skill of client.skills.list()) { + * // ... + * } + * ``` + */ + list(params = {}, options) { + const { workspace_id, ...query } = params ?? {}; + return this._client.getAPIList("/v1/skills", PageCursor, { + query, + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + /** + * Delete Skill + * + * @example + * ```ts + * const deletedSkill = await client.skills.delete('skill_id'); + * ``` + */ + delete(skillID, params = {}, options) { + const { workspace_id } = params ?? {}; + return this._client.delete(path2`/v1/skills/${skillID}`, { + ...options, + headers: buildHeaders([ + { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, + options?.headers + ]) + }); + } + } + Skills4.Versions = Versions3; + return Skills4; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/resources/index.mjs +var init_resources2 = __esm({ + "node_modules/@anthropic-ai/sdk/resources/index.mjs"() { + init_shared(); + init_beta(); + init_completions(); + init_files2(); + init_messages2(); + init_models3(); + init_skills2(); + } +}); + +// node_modules/@anthropic-ai/sdk/client.mjs +var _BaseAnthropic_instances, _a, _BaseAnthropic_encoder, _BaseAnthropic_baseURLOverridden, HUMAN_PROMPT, AI_PROMPT, BaseAnthropic, Anthropic; +var init_client = __esm({ + "node_modules/@anthropic-ai/sdk/client.mjs"() { + init_tslib(); + init_values(); + init_sleep(); + init_errors(); + init_detect_platform(); + init_request_signal(); + init_shims(); + init_request_options(); + init_query(); + init_version2(); + init_error(); + init_types(); + init_token_cache(); + init_credential_chain(); + init_middleware(); + init_pagination(); + init_uploads2(); + init_resources2(); + init_api_promise(); + init_completions(); + init_files2(); + init_models3(); + init_beta(); + init_messages2(); + init_skills2(); + init_detect_platform(); + init_headers(); + init_env(); + init_log(); + init_values(); + HUMAN_PROMPT = "\\n\\nHuman:"; + AI_PROMPT = "\\n\\nAssistant:"; + BaseAnthropic = /* @__PURE__ */ (() => { + class BaseAnthropic2 { + /** + * The active credential provider. Default credential resolution runs once + * at construction time. If it fails, the error is surfaced on every + * request and the client must be reconstructed — there is no retry path. + * + * Clones returned by {@link withOptions} share the parent's auth state + * (provider, token cache, pending resolution, and any resolution error) + * unless the caller passes an explicit `apiKey`, `authToken`, + * `credentials`, `config`, or `profile` override. + */ + get credentials() { + return this._authState.provider; + } + /** + * API Client for interfacing with the Anthropic API. + * + * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null] + * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null] + * @param {string | null | undefined} [opts.webhookKey=process.env['ANTHROPIC_WEBHOOK_SIGNING_KEY'] ?? null] + * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API. + * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. + * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. + * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. + * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. + * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. + */ + constructor({ baseURL = readEnv("ANTHROPIC_BASE_URL"), apiKey, authToken, webhookKey = readEnv("ANTHROPIC_WEBHOOK_SIGNING_KEY") ?? null, ...opts } = {}) { + _BaseAnthropic_instances.add(this); + this._requestAuthFlags = /* @__PURE__ */ new WeakMap(); + _BaseAnthropic_encoder.set(this, void 0); + if (apiKey === void 0) { + apiKey = opts.profile != null ? null : readEnv("ANTHROPIC_API_KEY") ?? null; + } + if (authToken === void 0) { + authToken = opts.profile != null ? null : readEnv("ANTHROPIC_AUTH_TOKEN") ?? null; + } + if (opts.profile != null && (opts.credentials != null || opts.config != null)) { + throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`."); + } + const options = { + apiKey, + authToken, + webhookKey, + ...opts, + baseURL: baseURL || `https://api.anthropic.com` + }; + if (!options.dangerouslyAllowBrowser && isRunningInBrowser()) { + throw new AnthropicError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n"); + } + this.baseURL = options.baseURL; + this._baseURLIsExplicit = opts.__baseURLIsExplicit ?? !!baseURL; + this.timeout = options.timeout ?? _a.DEFAULT_TIMEOUT; + this.logger = options.logger ?? console; + this.logLevel = defaultLogLevel; + this.logLevel = parseLogLevel(options.logLevel, "ClientOptions.logLevel", loggerFor(this)) ?? parseLogLevel(readEnv("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", loggerFor(this)) ?? defaultLogLevel; + this.fetchOptions = options.fetchOptions; + this.maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? 2); + this.fetch = options.fetch ?? getDefaultFetch(); + __classPrivateFieldSet(this, _BaseAnthropic_encoder, FallbackEncoder, "f"); + this.middleware = [...options.middleware ?? []]; + const customHeadersEnv = readEnv("ANTHROPIC_CUSTOM_HEADERS"); + if (customHeadersEnv) { + const parsed = {}; + for (const line of customHeadersEnv.split("\n")) { + const colon = line.indexOf(":"); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + const inherited = opts.__auth; + delete options.__auth; + delete options.__baseURLIsExplicit; + this._options = options; + this.apiKey = typeof apiKey === "string" ? apiKey : null; + this.authToken = authToken; + this.webhookKey = webhookKey; + if (inherited) { + this._authState = inherited; + if (!this._baseURLIsExplicit && inherited.baseURL) { + this.baseURL = inherited.baseURL; + } + } else { + this._authState = { provider: null, tokenCache: null, resolution: null, error: null, extraHeaders: {} }; + if (this.apiKey == null && this.authToken == null) { + const credentials = options.credentials ?? null; + if (credentials) { + this._authState.provider = credentials; + this._authState.tokenCache = this._makeTokenCache(credentials); + } else if (options.config != null) { + const result = resolveCredentialsFromConfig(options.config, this._credentialResolverOptions()); + this._authState.provider = result.provider; + this._authState.tokenCache = this._makeTokenCache(result.provider); + this._authState.extraHeaders = result.extraHeaders; + this._applyCredentialBaseURL(result.baseURL); + } else if (options.profile != null) { + this._authState.resolution = this._resolveDefaultCredentials(options.profile); + } else if (this._shouldResolveDefaultCredentials()) { + this._authState.resolution = this._resolveDefaultCredentials(); + } + } + } + } + /** + * Whether to lazily resolve auth from the default credential chain when no + * explicit auth is configured. Called once from the constructor, so + * overrides must not depend on subclass instance state. Subclasses that + * bring their own auth scheme return false so unrelated local credentials + * are never resolved or allowed to supply a base URL. + */ + _shouldResolveDefaultCredentials() { + return true; + } + /** + * Stores a profile/config-supplied base URL on the shared auth state and, if + * the caller did not pin `baseURL` via constructor option or env, adopts it + * as this client's outbound API host. Precedence: ctor opt > env > profile > + * hardcoded default. + */ + _applyCredentialBaseURL(baseURL) { + if (!baseURL) + return; + const normalized = baseURL.replace(/\/+$/, ""); + this._authState.baseURL = normalized; + if (!this._baseURLIsExplicit) { + this.baseURL = normalized; + } + } + /** + * Options bag passed into the credential chain. `baseURL` here is only the + * fallback host for the token-exchange POST when the config itself omits + * `base_url`; the chain returns the config's own `base_url` (if any) on + * {@link CredentialResult.baseURL}, which {@link _applyCredentialBaseURL} + * then adopts for outbound API requests. The two are deliberately decoupled + * so this fallback never round-trips into precedence. + */ + _credentialResolverOptions() { + return { + baseURL: this.baseURL, + fetch: this._credentialsFetch(), + userAgent: this.getUserAgent(), + onCacheWriteError: (err) => { + loggerFor(this).debug("credential cache write failed (best-effort)", err); + }, + onSafetyWarning: (msg) => { + loggerFor(this).warn(msg); + } + }; + } + /** + * A `Fetch` for first-party credential token-exchange requests (OIDC + * federation jwt-bearer grants, user-OAuth refresh grants) that routes + * through this client's middleware chain, so middleware observes token + * traffic like any other request. Only client-level middleware applies: + * a minted token is shared across requests, so attributing the exchange + * to any one request's per-request middleware would be arbitrary. For the + * same reason, `ctx.options` is undefined for these requests. + */ + _credentialsFetch() { + return wrapFetchWithMiddleware(this.fetch, this.middleware, void 0, this); + } + _makeTokenCache(provider2) { + return new TokenCache(provider2, (err) => { + loggerFor(this).debug("advisory token refresh failed; serving cached token", err); + }); + } + /** + * Create a new client instance re-using the same options given to the + * current client with optional overriding. + */ + withOptions(options) { + const overridesStructuredAuth = "credentials" in options || "config" in options || "profile" in options; + const overridesAuth = "apiKey" in options || "authToken" in options || overridesStructuredAuth; + const internal = { + ...this._options, + // Only forward baseURL when the caller (or env) explicitly chose it. + // For a non-explicit parent, this.baseURL may have been mutated to the + // profile-resolved host; pinning that as the clone's options.baseURL + // would make _options on the clone misreport caller intent and would + // leave the clone stuck on the parent's host across an auth override. + // The clone instead receives the construction-time value via + // ...this._options above and re-adopts the profile host through the + // shared _authState.baseURL + __baseURLIsExplicit=false path. + ...this._baseURLIsExplicit ? { baseURL: this.baseURL } : {}, + maxRetries: this.maxRetries, + timeout: this.timeout, + logger: this.logger, + logLevel: this.logLevel, + fetch: this.fetch, + fetchOptions: this.fetchOptions, + middleware: this.middleware, + apiKey: this.apiKey, + authToken: this.authToken, + webhookKey: this.webhookKey, + // credentials: this.credentials is a no-op when __auth is shared (the + // ctor takes the inherited path and ignores options.credentials); when + // overridesAuth is true via apiKey/authToken only, it lets the clone + // build a fresh TokenCache around the parent's provider. + credentials: this.credentials, + // When the caller passes a structured-credential override, drop inherited + // structured-credential options so only `...options` supplies them — + // otherwise an inherited `credentials`/`config`/`profile` would trip the + // mutual-exclusion check or precedence over the override. + ...overridesStructuredAuth ? { credentials: void 0, config: void 0, profile: void 0 } : {}, + ...options, + // Always set __auth so any stale value from ...this._options is + // overwritten. undefined means "build fresh auth from these options". + __auth: overridesAuth ? void 0 : this._authState, + __baseURLIsExplicit: "baseURL" in options ? true : this._baseURLIsExplicit + }; + return new this.constructor(internal); + } + /** + * Lazily resolves credentials from config files or environment variables. + * Called once from the constructor when no explicit auth is provided, or + * when an explicit `profile` was passed (in which case a missing/unresolved + * profile is surfaced as an error instead of falling through to "no auth"). + * The returned promise is stored and awaited on the first request. + */ + async _resolveDefaultCredentials(profile) { + try { + const result = await defaultCredentials(this._credentialResolverOptions(), profile); + if (result) { + this._authState.provider = result.provider; + this._authState.tokenCache = this._makeTokenCache(result.provider); + this._authState.extraHeaders = result.extraHeaders; + this._applyCredentialBaseURL(result.baseURL); + } else if (profile != null) { + throw new AnthropicError(`Profile "${profile}" could not be resolved (no /configs/${profile}.json found).`); + } + } catch (err) { + this._authState.error = err; + } finally { + this._authState.resolution = null; + } + } + defaultQuery() { + return this._options.defaultQuery; + } + validateHeaders({ values, nulls }) { + if (values.get("x-api-key") || values.get("authorization")) { + return; + } + if (this._authState.error) { + throw this._authState.error; + } + if (this._authState.tokenCache || this._authState.resolution) { + return; + } + if (this.apiKey && values.get("x-api-key")) { + return; + } + if (nulls.has("x-api-key")) { + return; + } + if (this.authToken && values.get("authorization")) { + return; + } + if (nulls.has("authorization")) { + return; + } + throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); + } + _authFlags(opts) { + let flags = this._requestAuthFlags.get(opts); + if (!flags) { + flags = { usedTokenCache: false, didRefreshFor401: false }; + this._requestAuthFlags.set(opts, flags); + } + return flags; + } + async authHeaders(opts) { + if (this._authState.resolution) { + await this._authState.resolution; + } + if (this._authState.error) { + return void 0; + } + if (this._authState.tokenCache && this.apiKey == null) { + const token = await this._authState.tokenCache.getToken(); + this._authFlags(opts).usedTokenCache = true; + return buildHeaders([{ Authorization: `Bearer ${token}` }]); + } + return buildHeaders([await this.apiKeyAuth(opts), await this.bearerAuth(opts)]); + } + async apiKeyAuth(opts) { + if (this.apiKey == null) { + return void 0; + } + return buildHeaders([{ "X-Api-Key": this.apiKey }]); + } + async bearerAuth(opts) { + if (this.authToken == null) { + return void 0; + } + return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]); + } + stringifyQuery(query) { + return stringifyQuery(query); + } + getUserAgent() { + return `Anthropic/JS ${VERSION}`; + } + makeStatusError(status, error, message, headers) { + return APIError.generate(status, error, message, headers); + } + buildURL(path5, query, defaultBaseURL) { + const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; + const url = isAbsoluteURL(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); + const defaultQuery = this.defaultQuery(); + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query }; + } + if (typeof query === "object" && query && !Array.isArray(query)) { + url.search = this.stringifyQuery(query); + } + return url.toString(); + } + _calculateNonstreamingTimeout(maxTokens) { + const defaultTimeout = 10 * 60; + const expectedTimeout = 60 * 60 * maxTokens / 128e3; + if (expectedTimeout > defaultTimeout) { + throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details"); + } + return defaultTimeout * 1e3; + } + /** + * Used as a callback for mutating the given `FinalRequestOptions` object. + */ + async prepareOptions(options) { + } + /** + * Used as a callback for mutating the given `RequestInit` object. + * + * This is useful for cases where you want to add certain headers based off of + * the request properties, e.g. `method` or `url`. + * + * Runs after all middleware (including {@link backendMiddleware}), + * immediately before each underlying fetch call, so it sees exactly what + * goes over the wire. Middleware may replay a request by calling `next()` + * more than once, so this hook can run multiple times per attempt: + * overrides must be idempotent and overwrite headers from a previous + * invocation rather than append to them. + */ + async prepareRequest(request2, { url, options }) { + if (this._authState.tokenCache && this.apiKey == null) { + const headers = request2.headers instanceof Headers ? request2.headers : new Headers(request2.headers); + for (const [k, v] of Object.entries(this._authState.extraHeaders)) { + if (!headers.has(k)) + headers.set(k, v); + } + const existing = headers.get("anthropic-beta")?.split(",").map((s) => s.trim()); + if (!existing?.includes(OAUTH_API_BETA_HEADER)) { + headers.set("anthropic-beta", [...existing ?? [], OAUTH_API_BETA_HEADER].join(",")); + } + request2.headers = headers; + } + } + /** + * Internal {@link Middleware} composed innermost in the chain — inside both + * client-level and per-request middleware, immediately around the underlying + * `fetch`. Subclasses for third-party backends override this to adapt the + * canonical Anthropic-shaped request to the backend's wire shape (URL/body + * rewriting, request signing) and to normalize the wire response back to the + * canonical shape (e.g. AWS EventStream to SSE). + * + * Running inside the user's middleware means user middleware always observes + * canonical Anthropic-shaped traffic, and the adaptation re-runs (e.g. + * re-signs) on every `next()` invocation, covering whatever the middleware + * mutated. + * + * Errors thrown here follow the middleware error policy: they propagate to + * the caller as-is — no retries, no `APIConnectionError` wrapping — unless + * retryable (see {@link Middleware}); throw a `RetryableError` to opt into + * the retry path. + */ + backendMiddleware() { + return []; + } + get(path5, opts) { + return this.methodRequest("get", path5, opts); + } + post(path5, opts) { + return this.methodRequest("post", path5, opts); + } + patch(path5, opts) { + return this.methodRequest("patch", path5, opts); + } + put(path5, opts) { + return this.methodRequest("put", path5, opts); + } + delete(path5, opts) { + return this.methodRequest("delete", path5, opts); + } + methodRequest(method, path5, opts) { + return this.request(Promise.resolve(opts).then((opts2) => { + return { method, path: path5, ...opts2 }; + })); + } + request(options, remainingRetries = null) { + return new APIPromise(this, this.makeRequest(options, remainingRetries, void 0)); + } + async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) { + const options = await optionsInput; + let maxRetries = validatePositiveInteger("maxRetries", options.maxRetries ?? this.maxRetries); + if (this.isStreamBody(options.body)) { + maxRetries = 0; + } + if (retriesRemaining == null) { + retriesRemaining = maxRetries; + this._requestAuthFlags.delete(options); + } + await this.prepareOptions(options); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining + }); + const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); + const retryLogStr = retryOfRequestLogID === void 0 ? "" : `, retryOf: ${retryOfRequestLogID}`; + const startTime = Date.now(); + if (options.signal?.aborted) { + throw new APIUserAbortError(); + } + const controller = new AbortController(); + const response = await this.fetchWithTimeout(url, req, timeout, controller, options, { + requestLogID, + retryOfRequestLogID + }).catch(castToError); + const headersTime = Date.now(); + if (response instanceof globalThis.Error) { + releaseRequestSignal(controller); + const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; + if (options.signal?.aborted) { + throw new APIUserAbortError(); + } + const isTimeout = isAbortError(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); + const hasMiddleware = this.middleware.length > 0 || !!options.middleware?.length || this.backendMiddleware().length > 0; + if (hasMiddleware && !isTimeout && !isRetryableError(response)) { + loggerFor(this).info(`[${requestLogID}] middleware error (not retryable)`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] middleware error (not retryable)`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + throw response; + } + if (retriesRemaining) { + loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); + } + loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, { + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message + }); + if (isTimeout) { + throw new APIConnectionTimeoutError(); + } + if (hasMiddleware && !isFetchOriginError(response)) { + throw response; + } + throw new APIConnectionError({ cause: response }); + } + const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "request-id" || name === "anthropic-workspace-id").map(([name, value2]) => ", " + name + ": " + JSON.stringify(value2)).join(""); + const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; + if (!response.ok) { + const shouldRetry = await this.shouldRetry(response, options); + if (retriesRemaining && shouldRetry) { + const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; + await CancelReadableStream(response.body); + releaseRequestSignal(controller); + loggerFor(this).info(`${responseInfo} - ${retryMessage2}`); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response error (${retryMessage2})`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + }); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers); + } + const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; + loggerFor(this).info(`${responseInfo} - ${retryMessage}`); + const errText = await response.text().catch((err2) => castToError(err2).message); + const errJSON = safeJSON(errText); + const errMessage = errJSON ? void 0 : errText; + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response error (${retryMessage})`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + message: errMessage, + durationMs: Date.now() - startTime + }); + releaseRequestSignal(controller); + const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); + throw err; + } + loggerFor(this).info(responseInfo); + debugLogRequestDetails(loggerFor(this), `[${requestLogID}] response start`, { + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + }); + armAbandonmentBackstop(response.body ?? response, controller); + return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; + } + getAPIList(path5, Page3, opts) { + return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path5, ...opts2 })) : { method: "get", path: path5, ...opts }); + } + requestAPIList(Page3, options) { + const request2 = this.makeRequest(options, null, void 0); + return new PagePromise(this, request2, Page3); + } + async fetchWithTimeout(url, init, ms, controller, requestOptions, logCtx) { + const { signal, method, ...options } = init || {}; + const abort = this._makeAbort(controller); + if (signal) { + signal.addEventListener("abort", abort, { once: true }); + registerRequestSignalCleanup(controller, signal, abort); + } + const isReadableBody = globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream || typeof options.body === "object" && options.body !== null && Symbol.asyncIterator in options.body; + const fetchOptions = { + signal: controller.signal, + ...isReadableBody ? { duplex: "half" } : {}, + method: "GET", + ...options + }; + if (method) { + fetchOptions.method = method.toUpperCase(); + } + const baseFetch = this.fetch; + const timedFetch = async (innerUrl, innerInit) => { + const timeout = setTimeout(abort, ms); + try { + return await baseFetch.call(void 0, innerUrl, innerInit); + } finally { + clearTimeout(timeout); + } + }; + const innerFetch = requestOptions === void 0 ? timedFetch : (async (innerUrl, innerInit = {}) => { + const innerUrlStr = typeof innerUrl === "string" ? innerUrl : innerUrl instanceof URL ? innerUrl.href : innerUrl.url; + innerInit.headers = innerInit.headers instanceof Headers ? innerInit.headers : new Headers(innerInit.headers); + await this.prepareRequest(innerInit, { url: innerUrlStr, options: requestOptions }); + if (logCtx) { + debugLogRequestDetails(loggerFor(this), `[${logCtx.requestLogID}] sending request`, { + retryOfRequestLogID: logCtx.retryOfRequestLogID, + method: innerInit.method, + url: innerUrlStr, + options: requestOptions, + headers: innerInit.headers + }); + } + return timedFetch(innerUrl, innerInit); + }); + const requestMiddleware = requestOptions?.middleware; + const backendMiddleware = this.backendMiddleware(); + const allMiddleware = requestMiddleware?.length || backendMiddleware.length ? [...this.middleware, ...requestMiddleware ?? [], ...backendMiddleware] : this.middleware; + return await wrapFetchWithMiddleware(innerFetch, allMiddleware, requestOptions, this)(url, fetchOptions); + } + async shouldRetry(response, options) { + const flags = this._authFlags(options); + if (response.status === 401 && this._authState.tokenCache && flags.usedTokenCache && !flags.didRefreshFor401) { + flags.didRefreshFor401 = true; + this._authState.tokenCache.invalidate(); + return true; + } + const shouldRetryHeader = response.headers.get("x-should-retry"); + if (shouldRetryHeader === "true") + return true; + if (shouldRetryHeader === "false") + return false; + if (response.status === 408) + return true; + if (response.status === 409) + return true; + if (response.status === 429) + return true; + if (response.status >= 500) + return true; + return false; + } + async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { + let timeoutMillis; + const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); + if (retryAfterMillisHeader) { + const timeoutMs = parseFloat(retryAfterMillisHeader); + if (!Number.isNaN(timeoutMs)) { + timeoutMillis = timeoutMs; + } + } + const retryAfterHeader = responseHeaders?.get("retry-after"); + if (retryAfterHeader && !timeoutMillis) { + const timeoutSeconds = parseFloat(retryAfterHeader); + if (!Number.isNaN(timeoutSeconds)) { + timeoutMillis = timeoutSeconds * 1e3; + } else { + timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); + } + } + if (timeoutMillis === void 0 || !(timeoutMillis > 0 && timeoutMillis <= 2 ** 31 - 1)) { + const maxRetries = options.maxRetries ?? this.maxRetries; + timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); + } + await sleep(timeoutMillis, options.signal ?? void 0); + return this.makeRequest(options, retriesRemaining - 1, requestLogID); + } + calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { + const initialRetryDelay = 0.5; + const maxRetryDelay = 8; + const numRetries = maxRetries - retriesRemaining; + const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay); + const jitter2 = 1 - Math.random() * 0.25; + return sleepSeconds * jitter2 * 1e3; + } + calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) { + const maxTime = 60 * 60 * 1e3; + const defaultTime = 60 * 10 * 1e3; + const expectedTime = maxTime * maxTokens / 128e3; + if (expectedTime > defaultTime || maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens) { + throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details"); + } + return defaultTime; + } + async buildRequest(inputOptions, { retryCount = 0 } = {}) { + const options = { ...inputOptions }; + const { method, path: path5, query, defaultBaseURL } = options; + if (this._authState.resolution) { + await this._authState.resolution; + } + if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) { + this.baseURL = this._authState.baseURL; + } + const url = this.buildURL(path5, query, defaultBaseURL); + if ("timeout" in options) + validatePositiveInteger("timeout", options.timeout); + options.timeout = options.timeout ?? this.timeout; + const { bodyHeaders, body } = this.buildBody({ options }); + const reqHeaders = await this.buildHeaders({ + options: inputOptions, + method, + bodyHeaders, + retryCount, + timeout: options.timeout + }); + const req = { + method, + headers: reqHeaders, + ...options.signal && { signal: options.signal }, + ...globalThis.ReadableStream && body instanceof globalThis.ReadableStream && { duplex: "half" }, + ...body && { body }, + ...this.fetchOptions ?? {}, + ...options.fetchOptions ?? {} + }; + return { req, url, timeout: options.timeout }; + } + async buildHeaders({ options, method, bodyHeaders, retryCount, timeout }) { + const headers = buildHeaders([ + { + Accept: "application/json", + "User-Agent": this.getUserAgent(), + "X-Stainless-Retry-Count": String(retryCount), + "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)), + ...getPlatformHeaders(), + ...this._options.dangerouslyAllowBrowser ? { "anthropic-dangerous-direct-browser-access": "true" } : void 0, + "anthropic-version": "2023-06-01" + }, + await this.authHeaders(options), + this._options.defaultHeaders, + bodyHeaders, + options.headers + ]); + this.validateHeaders(headers); + return headers.values; + } + _makeAbort(controller) { + return () => controller.abort(); + } + buildBody({ options: { body, headers: rawHeaders } }) { + if (!body) { + return { bodyHeaders: void 0, body: void 0 }; + } + const headers = buildHeaders([rawHeaders]); + if ( + // Pass raw type verbatim + ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && // Preserve legacy string encoding behavior for now + headers.values.has("content-type") || // `Blob` is superset of `File` + globalThis.Blob && body instanceof globalThis.Blob || // `FormData` -> `multipart/form-data` + body instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` + body instanceof URLSearchParams || // Send chunked stream (each chunk has own `length`) + globalThis.ReadableStream && body instanceof globalThis.ReadableStream + ) { + return { bodyHeaders: void 0, body }; + } else if (this.isStreamBody(body)) { + return { bodyHeaders: void 0, body: ReadableStreamFrom(body) }; + } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { + return { + bodyHeaders: { "content-type": "application/x-www-form-urlencoded" }, + body: this.stringifyQuery(body) + }; + } else { + return __classPrivateFieldGet(this, _BaseAnthropic_encoder, "f").call(this, { body, headers }); + } + } + /** + * Whether `body` is sent as a stream, which can be read only once: + * a `ReadableStream`, an async iterable or an iterator. + */ + isStreamBody(body) { + if (globalThis.ReadableStream && body instanceof globalThis.ReadableStream) { + return true; + } + return typeof body === "object" && body !== null && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function"); + } + } + _a = BaseAnthropic2, _BaseAnthropic_encoder = /* @__PURE__ */ new WeakMap(), _BaseAnthropic_instances = /* @__PURE__ */ new WeakSet(), _BaseAnthropic_baseURLOverridden = function _BaseAnthropic_baseURLOverridden2() { + return this.baseURL !== "https://api.anthropic.com"; + }; + BaseAnthropic2.Anthropic = _a; + BaseAnthropic2.DEFAULT_TIMEOUT = 6e5; + BaseAnthropic2.AnthropicError = AnthropicError; + BaseAnthropic2.APIError = APIError; + BaseAnthropic2.APIConnectionError = APIConnectionError; + BaseAnthropic2.APIConnectionTimeoutError = APIConnectionTimeoutError; + BaseAnthropic2.APIUserAbortError = APIUserAbortError; + BaseAnthropic2.NotFoundError = NotFoundError; + BaseAnthropic2.ConflictError = ConflictError; + BaseAnthropic2.RateLimitError = RateLimitError; + BaseAnthropic2.BadRequestError = BadRequestError; + BaseAnthropic2.AuthenticationError = AuthenticationError; + BaseAnthropic2.InternalServerError = InternalServerError; + BaseAnthropic2.PermissionDeniedError = PermissionDeniedError; + BaseAnthropic2.UnprocessableEntityError = UnprocessableEntityError; + BaseAnthropic2.toFile = toFile; + BaseAnthropic2.HUMAN_PROMPT = HUMAN_PROMPT; + BaseAnthropic2.AI_PROMPT = AI_PROMPT; + return BaseAnthropic2; + })(); + Anthropic = /* @__PURE__ */ (() => { + class Anthropic2 extends BaseAnthropic { + constructor() { + super(...arguments); + this.completions = new Completions(this); + this.messages = new Messages2(this); + this.models = new Models2(this); + this.files = new Files2(this); + this.skills = new Skills2(this); + this.beta = new Beta(this); + } + } + Anthropic2.Completions = Completions; + Anthropic2.Messages = Messages2; + Anthropic2.Models = Models2; + Anthropic2.Files = Files2; + Anthropic2.Skills = Skills2; + Anthropic2.Beta = Beta; + return Anthropic2; + })(); + } +}); + +// node_modules/@anthropic-ai/sdk/index.mjs +var init_sdk = __esm({ + "node_modules/@anthropic-ai/sdk/index.mjs"() { + init_client(); + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js +function getBunSandboxEnvValue(name) { + if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) { + return void 0; + } + if (procEnvCache === null) { + procEnvCache = /* @__PURE__ */ new Map(); + try { + const { readFileSync } = __require("node:fs"); + const data = readFileSync("/proc/self/environ", "utf-8"); + for (const entry2 of data.split("\0")) { + const idx = entry2.indexOf("="); + if (idx > 0) { + procEnvCache.set(entry2.slice(0, idx), entry2.slice(idx + 1)); + } + } + } catch { + } + } + return procEnvCache.get(name); +} +function getProviderEnvValue(name, env) { + return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0; +} +var procEnvCache; +var init_provider_env = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js"() { + procEnvCache = null; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +var __rewriteRelativeImportExtension2, _existsSync, _homedir, _join, dynamicImport, NODE_FS_SPECIFIER, NODE_OS_SPECIFIER, NODE_PATH_SPECIFIER, ANTHROPIC_FEDERATION_RULE_ID_ENV, ANTHROPIC_ORGANIZATION_ID_ENV, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, ANTHROPIC_WORKSPACE_ID_ENV; +var init_env_api_keys = __esm({ + "node_modules/@earendil-works/pi-ai/dist/env-api-keys.js"() { + __rewriteRelativeImportExtension2 = function(path5, preserveJsx) { + if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { + return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path5; + }; + _existsSync = null; + _homedir = null; + _join = null; + dynamicImport = (specifier) => import(__rewriteRelativeImportExtension2(specifier)); + NODE_FS_SPECIFIER = "node:fs"; + NODE_OS_SPECIFIER = "node:os"; + NODE_PATH_SPECIFIER = "node:path"; + if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) { + dynamicImport(NODE_FS_SPECIFIER).then((m) => { + _existsSync = m.existsSync; + }); + dynamicImport(NODE_OS_SPECIFIER).then((m) => { + _homedir = m.homedir; + }); + dynamicImport(NODE_PATH_SPECIFIER).then((m) => { + _join = m.join; + }); + } + ANTHROPIC_FEDERATION_RULE_ID_ENV = "ANTHROPIC_FEDERATION_RULE_ID"; + ANTHROPIC_ORGANIZATION_ID_ENV = "ANTHROPIC_ORGANIZATION_ID"; + ANTHROPIC_SERVICE_ACCOUNT_ID_ENV = "ANTHROPIC_SERVICE_ACCOUNT_ID"; + ANTHROPIC_IDENTITY_TOKEN_FILE_ENV = "ANTHROPIC_IDENTITY_TOKEN_FILE"; + ANTHROPIC_WORKSPACE_ID_ENV = "ANTHROPIC_WORKSPACE_ID"; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/headers.js +function headersToRecord(headers) { + const result = {}; + for (const [key, value2] of headers.entries()) { + result[key] = value2; + } + return result; +} +var init_headers2 = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/headers.js"() { + } +}); + +// node_modules/partial-json/dist/options.js +var require_options = __commonJS({ + "node_modules/partial-json/dist/options.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Allow = exports.ALL = exports.COLLECTION = exports.ATOM = exports.SPECIAL = exports.INF = exports._INFINITY = exports.INFINITY = exports.NAN = exports.BOOL = exports.NULL = exports.OBJ = exports.ARR = exports.NUM = exports.STR = void 0; + exports.STR = 1; + exports.NUM = 2; + exports.ARR = 4; + exports.OBJ = 8; + exports.NULL = 16; + exports.BOOL = 32; + exports.NAN = 64; + exports.INFINITY = 128; + exports._INFINITY = 256; + exports.INF = exports.INFINITY | exports._INFINITY; + exports.SPECIAL = exports.NULL | exports.BOOL | exports.INF | exports.NAN; + exports.ATOM = exports.STR | exports.NUM | exports.SPECIAL; + exports.COLLECTION = exports.ARR | exports.OBJ; + exports.ALL = exports.ATOM | exports.COLLECTION; + exports.Allow = { STR: exports.STR, NUM: exports.NUM, ARR: exports.ARR, OBJ: exports.OBJ, NULL: exports.NULL, BOOL: exports.BOOL, NAN: exports.NAN, INFINITY: exports.INFINITY, _INFINITY: exports._INFINITY, INF: exports.INF, SPECIAL: exports.SPECIAL, ATOM: exports.ATOM, COLLECTION: exports.COLLECTION, ALL: exports.ALL }; + exports.default = exports.Allow; + } +}); + +// node_modules/partial-json/dist/index.js +var require_dist2 = __commonJS({ + "node_modules/partial-json/dist/index.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Allow = exports.MalformedJSON = exports.PartialJSON = exports.parseJSON = exports.parse = void 0; + var options_1 = require_options(); + Object.defineProperty(exports, "Allow", { enumerable: true, get: function() { + return options_1.Allow; + } }); + __exportStar(require_options(), exports); + var PartialJSON2 = class extends Error { + }; + exports.PartialJSON = PartialJSON2; + var MalformedJSON2 = class extends Error { + }; + exports.MalformedJSON = MalformedJSON2; + function parseJSON2(jsonString, allowPartial = options_1.Allow.ALL) { + if (typeof jsonString !== "string") { + throw new TypeError(`expecting str, got ${typeof jsonString}`); + } + if (!jsonString.trim()) { + throw new Error(`${jsonString} is empty`); + } + return _parseJSON2(jsonString.trim(), allowPartial); + } + exports.parseJSON = parseJSON2; + var _parseJSON2 = (jsonString, allow) => { + const length = jsonString.length; + let index = 0; + const markPartialJSON = (msg) => { + throw new PartialJSON2(`${msg} at position ${index}`); + }; + const throwMalformedError = (msg) => { + throw new MalformedJSON2(`${msg} at position ${index}`); + }; + const parseAny = () => { + skipBlank(); + if (index >= length) + markPartialJSON("Unexpected end of input"); + if (jsonString[index] === '"') + return parseStr(); + if (jsonString[index] === "{") + return parseObj(); + if (jsonString[index] === "[") + return parseArr(); + if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) { + index += 4; + return null; + } + if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) { + index += 4; + return true; + } + if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) { + index += 5; + return false; + } + if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) { + index += 8; + return Infinity; + } + if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) { + index += 9; + return -Infinity; + } + if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) { + index += 3; + return NaN; + } + return parseNum(); + }; + const parseStr = () => { + const start = index; + let escape2 = false; + index++; + while (index < length && (jsonString[index] !== '"' || escape2 && jsonString[index - 1] === "\\")) { + escape2 = jsonString[index] === "\\" ? !escape2 : false; + index++; + } + if (jsonString.charAt(index) == '"') { + try { + return JSON.parse(jsonString.substring(start, ++index - Number(escape2))); + } catch (e) { + throwMalformedError(String(e)); + } + } else if (options_1.Allow.STR & allow) { + try { + return JSON.parse(jsonString.substring(start, index - Number(escape2)) + '"'); + } catch (e) { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); + } + } + markPartialJSON("Unterminated string literal"); + }; + const parseObj = () => { + index++; + skipBlank(); + const obj2 = {}; + try { + while (jsonString[index] !== "}") { + skipBlank(); + if (index >= length && options_1.Allow.OBJ & allow) + return obj2; + const key = parseStr(); + skipBlank(); + index++; + try { + const value2 = parseAny(); + obj2[key] = value2; + } catch (e) { + if (options_1.Allow.OBJ & allow) + return obj2; + else + throw e; + } + skipBlank(); + if (jsonString[index] === ",") + index++; + } + } catch (e) { + if (options_1.Allow.OBJ & allow) + return obj2; + else + markPartialJSON("Expected '}' at end of object"); + } + index++; + return obj2; + }; + const parseArr = () => { + index++; + const arr2 = []; + try { + while (jsonString[index] !== "]") { + arr2.push(parseAny()); + skipBlank(); + if (jsonString[index] === ",") { + index++; + } + } + } catch (e) { + if (options_1.Allow.ARR & allow) { + return arr2; + } + markPartialJSON("Expected ']' at end of array"); + } + index++; + return arr2; + }; + const parseNum = () => { + if (index === 0) { + if (jsonString === "-") + throwMalformedError("Not sure what '-' is"); + try { + return JSON.parse(jsonString); + } catch (e) { + if (options_1.Allow.NUM & allow) + try { + return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); + } catch (e2) { + } + throwMalformedError(String(e)); + } + } + const start = index; + if (jsonString[index] === "-") + index++; + while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1) + index++; + if (index == length && !(options_1.Allow.NUM & allow)) + markPartialJSON("Unterminated number literal"); + try { + return JSON.parse(jsonString.substring(start, index)); + } catch (e) { + if (jsonString.substring(start, index) === "-") + markPartialJSON("Not sure what '-' is"); + try { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); + } catch (e2) { + throwMalformedError(String(e2)); + } + } + }; + const skipBlank = () => { + while (index < length && " \n\r ".includes(jsonString[index])) { + index++; + } + }; + return parseAny(); + }; + var parse2 = parseJSON2; + exports.parse = parse2; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +function isControlCharacter(char) { + const codePoint = char.codePointAt(0); + return codePoint !== void 0 && codePoint >= 0 && codePoint <= 31; +} +function escapeControlCharacter(char) { + switch (char) { + case "\b": + return "\\b"; + case "\f": + return "\\f"; + case "\n": + return "\\n"; + case "\r": + return "\\r"; + case " ": + return "\\t"; + default: + return `\\u${char.codePointAt(0)?.toString(16).padStart(4, "0") ?? "0000"}`; + } +} +function repairJson(json) { + let repaired = ""; + let inString = false; + for (let index = 0; index < json.length; index++) { + const char = json[index]; + if (!inString) { + repaired += char; + if (char === '"') { + inString = true; + } + continue; + } + if (char === '"') { + repaired += char; + inString = false; + continue; + } + if (char === "\\") { + const nextChar = json[index + 1]; + if (nextChar === void 0) { + repaired += "\\\\"; + continue; + } + if (nextChar === "u") { + const unicodeDigits = json.slice(index + 2, index + 6); + if (/^[0-9a-fA-F]{4}$/.test(unicodeDigits)) { + repaired += `\\u${unicodeDigits}`; + index += 5; + continue; + } + } + if (VALID_JSON_ESCAPES.has(nextChar)) { + repaired += `\\${nextChar}`; + index += 1; + continue; + } + repaired += "\\\\"; + continue; + } + repaired += isControlCharacter(char) ? escapeControlCharacter(char) : char; + } + return repaired; +} +function parseJsonWithRepair(json) { + try { + return JSON.parse(json); + } catch (error) { + const repairedJson = repairJson(json); + if (repairedJson !== json) { + return JSON.parse(repairedJson); + } + throw error; + } +} +function parseToolCallArguments(json) { + if (!json?.trim()) + return { arguments: {} }; + try { + const parsed = parseJsonWithRepair(json); + if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { + throw new Error("Tool arguments must be a JSON object"); + } + return { arguments: parsed }; + } catch (error) { + return { + arguments: {}, + argumentsError: `${error instanceof Error ? error.message : String(error)} + +Received arguments: +${json}` + }; + } +} +var import_partial_json, VALID_JSON_ESCAPES; +var init_json_parse = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js"() { + import_partial_json = __toESM(require_dist2(), 1); + VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]); + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js +function isValidCost(value2) { + return typeof value2 === "number" && Number.isFinite(value2) && value2 >= 0; +} +function isOpenRouterModel(model2) { + return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); +} +function applyOpenRouterReportedCost(usage, reported) { + if (!isValidCost(reported.cost)) + return; + if (reported.is_byok === false) { + usage.cost.total = reported.cost; + usage.cost.totalFromProvider = true; + return; + } + if (reported.is_byok === true) { + const details = reported.cost_details; + if (!details) + return; + let upstreamCost = details.upstream_inference_cost; + if (upstreamCost === null) { + if (!isValidCost(details.upstream_inference_prompt_cost) || !isValidCost(details.upstream_inference_completions_cost)) { + return; + } + upstreamCost = details.upstream_inference_prompt_cost + details.upstream_inference_completions_cost; + } + if (!isValidCost(upstreamCost)) + return; + usage.cost.total = reported.cost + upstreamCost; + usage.cost.totalFromProvider = true; + } +} +var init_openrouter_cost = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js"() { + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +function isProviderError(error) { + if (!(error instanceof Error) || !("status" in error) || !("headers" in error)) + return false; + return (error.status === void 0 || typeof error.status === "number") && (error.headers === void 0 || error.headers instanceof Headers); +} +function isRetryableProviderError(error) { + const shouldRetry = error.headers?.get("x-should-retry"); + if (shouldRetry === "true") + return true; + if (shouldRetry === "false") + return false; + if (error.status === void 0) + return true; + return error.status === 408 || error.status === 409 || error.status === 429 || typeof error.status === "number" && error.status >= 500; +} +function validateServerRetryDelayMs(delayMs, maxRetryDelayMs, providerErrorMessage) { + const maxDelayMs = maxRetryDelayMs ?? DEFAULT_MAX_RETRY_DELAY_MS; + if (maxDelayMs > 0 && delayMs > maxDelayMs) { + throw new Error(`Server requested ${Math.ceil(delayMs / 1e3)}s retry delay (max: ${Math.ceil(maxDelayMs / 1e3)}s). ${providerErrorMessage}`); + } + return delayMs; +} +function getRetryDelayMs(error, retryIndex, maxRetryDelayMs) { + const retryAfterMs = error.headers?.get("retry-after-ms"); + if (retryAfterMs) { + const value2 = Number.parseFloat(retryAfterMs); + if (Number.isFinite(value2)) + return validateServerRetryDelayMs(value2, maxRetryDelayMs, error.message); + } + const retryAfter = error.headers?.get("retry-after"); + if (retryAfter) { + const seconds = Number.parseFloat(retryAfter); + const delayMs = Number.isNaN(seconds) ? Date.parse(retryAfter) - Date.now() : seconds * 1e3; + if (Number.isFinite(delayMs)) + return validateServerRetryDelayMs(delayMs, maxRetryDelayMs, error.message); + } + const exponentialDelay = Math.min(0.5 * 2 ** retryIndex, 8) * 1e3; + return exponentialDelay * (1 - Math.random() * 0.25); +} +function createAbortError() { + const error = new Error("Request aborted"); + error.name = "AbortError"; + return error; +} +function abortableSleep(ms, signal) { + return new Promise((resolve2, reject2) => { + if (signal?.aborted) { + reject2(createAbortError()); + return; + } + const onAbort = () => { + clearTimeout(timeout); + reject2(createAbortError()); + }; + const timeout = setTimeout(() => { + signal?.removeEventListener("abort", onAbort); + resolve2(); + }, Math.max(0, ms)); + signal?.addEventListener("abort", onAbort, { once: true }); + }); +} +async function retryProviderRequest(request2, options = {}) { + const maxRetries = options.maxRetries ?? 0; + let retriesRemaining = maxRetries; + for (; ; ) { + try { + return await request2(); + } catch (error) { + if (options.signal?.aborted) + throw createAbortError(); + if (retriesRemaining <= 0 || !isProviderError(error) || !isRetryableProviderError(error)) + throw error; + if (error.status !== void 0 && options.noRetryStatuses?.includes(error.status)) + throw error; + const retryIndex = maxRetries - retriesRemaining; + retriesRemaining--; + await abortableSleep(getRetryDelayMs(error, retryIndex, options.maxRetryDelayMs), options.signal); + } + } +} +var DEFAULT_MAX_RETRY_DELAY_MS; +var init_provider_retry = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js"() { + DEFAULT_MAX_RETRY_DELAY_MS = 6e4; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js +function sanitizeSurrogates(text) { + return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F"; +} +function scalarValue(token) { + for (const [literal, value2] of LITERALS) + if (token === literal) + return value2; + return NUMBER.test(token) ? Number(token) : void 0; +} +function pendingScalarValue(token) { + for (const [literal, value2] of LITERALS) + if (literal.startsWith(token)) + return value2; + if (NUMBER.test(token)) + return Number(token); + const mantissa = NUMBER_WITHOUT_EXPONENT_DIGITS.exec(token); + return mantissa === null ? void 0 : Number(mantissa[1]); +} +function setSlot(container, slot, value2) { + if (slot.kind === "element") + container[slot.index] = value2; + else if (slot.kind === "member") + setMember(container, slot.key, value2); +} +function setMember(members, key, value2) { + if (key === "__proto__") { + Object.defineProperty(members, key, { value: value2, writable: true, enumerable: true, configurable: true }); + } else { + members[key] = value2; + } +} +var MAX_REPORTED_DEPTH, ROOT_SLOT, CREDIT_PER_APPEND, CREDIT_PER_CHARACTER, MAX_PENDING_SCALAR_LENGTH, NUMBER, NUMBER_WITHOUT_EXPONENT_DIGITS, LITERALS, QUOTE, BACKSLASH, StreamingJsonParser, ToolCallArgumentsStream, SIMPLE_ESCAPES; +var init_streaming_json = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js"() { + init_json_parse(); + MAX_REPORTED_DEPTH = 32; + ROOT_SLOT = { kind: "root" }; + CREDIT_PER_APPEND = 256; + CREDIT_PER_CHARACTER = 8; + MAX_PENDING_SCALAR_LENGTH = 64; + NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; + NUMBER_WITHOUT_EXPONENT_DIGITS = /^(-?(?:0|[1-9]\d*)(?:\.\d+)?)[eE][+-]?$/; + LITERALS = [ + ["true", true], + ["false", false], + ["null", null] + ]; + QUOTE = 34; + BACKSLASH = 92; + StreamingJsonParser = class { + #root = void 0; + #done = false; + #stack = []; + #string = void 0; + #scalar = ""; + #scalarSlot = void 0; + /** Sum of `size + 1` over the open path: what a fresh snapshot copies. */ + #pathCost = 0; + #credit = 0; + #dirty = false; + #snapshot = void 0; + /** Changes of the piece being read. */ + #changes = []; + /** + * Read the next piece of text; returns the changes it made, in order. Costs time linear in `text.length`. + */ + append(text) { + this.#credit += CREDIT_PER_APPEND + CREDIT_PER_CHARACTER * text.length; + this.#changes = []; + if (this.#string !== void 0) + this.#string.change = void 0; + let index = 0; + while (index < text.length && !this.#done) { + const open = this.#string; + if (open !== void 0) + index = this.#readString(open, text, index); + else if (this.#scalar !== "") + index = this.#readScalar(text, index); + else + this.#structural(text[index++]); + } + return this.#changes; + } + /** + * The value of the text read so far: `undefined` before a value starts, otherwise a plain JSON value that never + * changes afterwards. Returns the previous snapshot while the text read since did not change the value, or while a + * fresh copy of the open path is not yet paid for (see the module comment). + */ + snapshot() { + if (!this.#dirty) + return this.#snapshot; + const pending = this.#pendingScalar(); + const cost = this.#pathCost + (pending === void 0 ? 0 : 1); + if (cost > this.#credit) + return this.#snapshot; + this.#credit -= cost; + this.#dirty = false; + this.#snapshot = this.#copyOpenPath(pending); + return this.#snapshot; + } + /** Read string characters from `start` until the string ends or the text does; returns the next index. */ + #readString(open, text, start) { + let runStart = start; + for (let index = start; index < text.length; index++) { + const code = text.charCodeAt(index); + if (open.escape !== "") { + if (this.#continueEscape(open, text[index])) { + runStart = index + 1; + continue; + } + runStart = index; + } + if (code === QUOTE) { + if (index > runStart) + this.#appendString(open, text.slice(runStart, index)); + this.#endString(open); + return index + 1; + } + if (code === BACKSLASH) { + if (index > runStart) + this.#appendString(open, text.slice(runStart, index)); + open.escape = "\\"; + runStart = index + 1; + } + } + if (text.length > runStart) + this.#appendString(open, text.slice(runStart)); + return text.length; + } + /** Read number or literal characters from `start` up to the next delimiter; returns the delimiter's index. */ + #readScalar(text, start) { + let end = start; + while (end < text.length && !isDelimiter(text[end])) + end++; + if (end > start) { + this.#scalar += text.slice(start, end); + if (this.#scalarSlot !== void 0) + this.#dirty = true; + } + if (end < text.length) + this.#endScalar(); + return end; + } + /** Handle one character outside strings. */ + #structural(char) { + switch (char) { + case " ": + case " ": + case "\n": + case "\r": + return; + case '"': + this.#startString(); + return; + case "{": + case "[": + this.#openContainer(char === "{" ? {} : []); + return; + case "}": + case "]": + this.#closeContainer(); + return; + case ":": { + const frame = this.#stack.at(-1); + if (frame !== void 0 && !Array.isArray(frame.container) && frame.phase === "colon") + frame.phase = "value"; + return; + } + case ",": { + const frame = this.#stack.at(-1); + if (frame !== void 0) + frame.phase = Array.isArray(frame.container) ? "value" : "key"; + return; + } + default: + this.#scalar = char; + this.#scalarSlot = this.#valueSlot(); + if (this.#scalarSlot !== void 0) + this.#dirty = true; + } + } + /** Where a value starting now goes, or `undefined` when this position takes no value. */ + #valueSlot() { + const frame = this.#stack.at(-1); + if (frame === void 0) + return this.#root === void 0 ? ROOT_SLOT : void 0; + if (Array.isArray(frame.container)) + return { kind: "element", index: frame.container.length }; + if ((frame.phase === "value" || frame.phase === "colon") && frame.key !== void 0) { + return { kind: "member", key: frame.key }; + } + return void 0; + } + #startString() { + const frame = this.#stack.at(-1); + if (frame !== void 0 && !Array.isArray(frame.container) && (frame.phase === "key" || frame.phase === "comma")) { + this.#string = { target: "key", slot: void 0, text: "", escape: "", path: void 0, change: void 0 }; + return; + } + const slot = this.#valueSlot(); + const path5 = this.#reportedPath(slot); + this.#string = { target: "value", slot, text: "", escape: "", path: path5, change: void 0 }; + this.#place(slot, ""); + if (path5 !== void 0) + this.#string.change = this.#report({ kind: "set", path: path5, value: "" }); + } + /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ + #reportedPath(slot) { + if (slot === void 0) + return void 0; + if (slot.kind === "root") + return []; + const frame = this.#stack.at(-1); + if (!frame.reportsInside) + return void 0; + return [...frame.path, slot.kind === "member" ? slot.key : slot.index]; + } + #report(change) { + this.#changes.push(change); + return change; + } + /** Continue an escape with `char`; returns false when `char` is not part of it and must be read normally. */ + #continueEscape(open, char) { + if (open.escape === "\\") { + const decoded = SIMPLE_ESCAPES[char]; + if (decoded !== void 0) { + open.escape = ""; + this.#appendString(open, decoded); + return true; + } + if (char === "u") { + open.escape = "\\u"; + return true; + } + open.escape = ""; + this.#appendString(open, "\\"); + return false; + } + if (isHexDigit(char)) { + open.escape += char; + if (open.escape.length < 6) + return true; + const decoded = String.fromCharCode(Number.parseInt(open.escape.slice(2), 16)); + open.escape = ""; + this.#appendString(open, decoded); + return true; + } + const literal = open.escape; + open.escape = ""; + this.#appendString(open, literal); + return false; + } + #appendString(open, text) { + open.text += text; + if (open.target !== "value") + return; + this.#place(open.slot, open.text); + if (open.path === void 0) + return; + const change = open.change; + if (change !== void 0 && this.#changes.at(-1) === change) { + if (change.kind === "set") + change.value = change.value + text; + else + change.text += text; + return; + } + open.change = this.#report({ kind: "append", path: open.path, text }); + } + #endString(open) { + this.#string = void 0; + const frame = this.#stack.at(-1); + if (open.target === "key") { + if (frame === void 0) + return; + frame.key = open.text; + frame.phase = "colon"; + return; + } + this.#valueEnded(frame); + } + #endScalar() { + const token = this.#scalar; + const slot = this.#scalarSlot; + this.#scalar = ""; + this.#scalarSlot = void 0; + const value2 = scalarValue(token); + if (value2 !== void 0) { + this.#place(slot, value2); + const path5 = this.#reportedPath(slot); + if (path5 !== void 0) + this.#report({ kind: "set", path: path5, value: value2 }); + } + this.#valueEnded(this.#stack.at(-1)); + } + /** The value of the unterminated scalar at the end of the text, if it shows. */ + #pendingScalar() { + const slot = this.#scalarSlot; + const token = this.#scalar; + if (slot === void 0 || token === "" || token.length > MAX_PENDING_SCALAR_LENGTH) + return void 0; + const value2 = pendingScalarValue(token); + return value2 === void 0 ? void 0 : { slot, value: value2 }; + } + #openContainer(container) { + const slot = this.#valueSlot(); + const path5 = this.#reportedPath(slot); + this.#place(slot, container); + this.#stack.push({ + container, + slot, + path: path5, + reportsInside: path5 !== void 0 && path5.length < MAX_REPORTED_DEPTH, + size: 0, + key: void 0, + phase: Array.isArray(container) ? "value" : "key" + }); + this.#pathCost += 1; + this.#dirty = true; + if (path5 !== void 0) + this.#report({ kind: "set", path: path5, value: Array.isArray(container) ? [] : {} }); + } + #closeContainer() { + const frame = this.#stack.pop(); + if (frame === void 0) + return; + this.#pathCost -= frame.size + 1; + this.#dirty = true; + if (frame.path !== void 0 && !frame.reportsInside) { + this.#report({ kind: "set", path: frame.path, value: frame.container }); + } + this.#valueEnded(this.#stack.at(-1)); + } + /** A value in `frame`, or the root value when there is no frame, has ended. */ + #valueEnded(frame) { + if (frame === void 0) { + if (this.#root !== void 0) + this.#done = true; + return; + } + frame.phase = "comma"; + } + /** Set the value at `slot` in the open path; nothing for a value in an invalid position. */ + #place(slot, value2) { + if (slot === void 0) + return; + this.#dirty = true; + if (slot.kind === "root") { + this.#root = value2; + return; + } + const frame = this.#stack.at(-1); + if (slot.kind === "element") { + const elements = frame.container; + if (slot.index === elements.length) { + frame.size++; + this.#pathCost++; + } + elements[slot.index] = value2; + return; + } + const members = frame.container; + if (!Object.hasOwn(members, slot.key)) { + frame.size++; + this.#pathCost++; + } + setMember(members, slot.key, value2); + } + /** A fresh snapshot: copies of the open containers, innermost first, each holding the copy of its open child. */ + #copyOpenPath(pending) { + if (this.#stack.length === 0) + return pending?.slot.kind === "root" ? pending.value : this.#root; + let child; + let childSlot; + for (let depth = this.#stack.length - 1; depth >= 0; depth--) { + const frame = this.#stack[depth]; + const copy2 = Array.isArray(frame.container) ? frame.container.slice() : { ...frame.container }; + if (depth === this.#stack.length - 1 && pending !== void 0) + setSlot(copy2, pending.slot, pending.value); + if (child !== void 0 && childSlot !== void 0) + setSlot(copy2, childSlot, child); + child = copy2; + childSlot = frame.slot; + } + return childSlot?.kind === "root" ? child : this.#root; + } + }; + ToolCallArgumentsStream = class { + #text = ""; + #parser = new StreamingJsonParser(); + #snapshot = void 0; + #arguments = {}; + /** The raw argument text received so far. */ + get text() { + return this.#text; + } + /** Append a piece of argument text; returns the partial arguments, a new object whenever they changed. */ + append(delta) { + this.#text += delta; + this.#parser.append(delta); + return this.#partial(); + } + /** + * Take the provider's complete argument text. When it continues the text so far, returns the missing piece as + * `delta`; otherwise starts over with `text`. Either way returns the partial arguments of `text`. + */ + replace(text) { + if (text.startsWith(this.#text)) { + const delta = text.slice(this.#text.length); + return { delta, arguments: delta === "" ? this.#partial() : this.append(delta) }; + } + this.#text = ""; + this.#parser = new StreamingJsonParser(); + return { delta: void 0, arguments: this.append(text) }; + } + /** The final arguments: one full parse of the complete text, which reports malformed arguments. */ + finish() { + return parseToolCallArguments(this.#text); + } + #partial() { + const snapshot = this.#parser.snapshot(); + if (snapshot === this.#snapshot) + return this.#arguments; + this.#snapshot = snapshot; + this.#arguments = typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : {}; + return this.#arguments; + } + }; + SIMPLE_ESCAPES = { + '"': '"', + "\\": "\\", + "/": "/", + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: " " + }; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js +function isJsonSchemaObject(value2) { + return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); +} +function isStructuredSchema(schema4) { + if (!isJsonSchemaObject(schema4)) + return false; + const types = typeof schema4.type === "string" ? [schema4.type] : Array.isArray(schema4.type) ? schema4.type : []; + return types.includes("object") || types.includes("array") || schema4.properties !== void 0 || schema4.items !== void 0; +} +function schemaAllowsNull(schema4) { + if (!isJsonSchemaObject(schema4)) + return false; + if (schema4.type === "null" || Array.isArray(schema4.type) && schema4.type.includes("null")) + return true; + if (schema4.const === null || Array.isArray(schema4.enum) && schema4.enum.includes(null)) + return true; + return Array.isArray(schema4.anyOf) && schema4.anyOf.some((variant) => schemaAllowsNull(variant)); +} +function makeJsonSchemaNodeStrict(schema4, isUnsupportedKeyword) { + if (!isJsonSchemaObject(schema4)) { + throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported"); + } + for (const key of UNSUPPORTED_STRICT_SCHEMA_KEYS) { + if (schema4[key] !== void 0) { + throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`); + } + } + if (isUnsupportedKeyword) { + for (const [key, value2] of Object.entries(schema4)) { + if (isUnsupportedKeyword(key, value2)) { + throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value2)} is unsupported`); + } + } + } + if (schema4.anyOf !== void 0) { + if (!Array.isArray(schema4.anyOf) || schema4.anyOf.length === 0) { + throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema"); + } + for (const variant of schema4.anyOf) { + if (isStructuredSchema(variant)) { + throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported"); + } + makeJsonSchemaNodeStrict(variant, isUnsupportedKeyword); + } + } + if (schema4.items !== void 0) { + if (Array.isArray(schema4.items)) { + throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported"); + } + makeJsonSchemaNodeStrict(schema4.items, isUnsupportedKeyword); + } + const isObjectSchema = schema4.type === "object"; + if (schema4.properties !== void 0 && !isObjectSchema) { + throw new UnsupportedStrictJsonSchemaError("properties require type object"); + } + if (!isObjectSchema) + return; + if (schema4.additionalProperties !== void 0 && schema4.additionalProperties !== false) { + throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported"); + } + if (schema4.properties !== void 0 && !isJsonSchemaObject(schema4.properties)) { + throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map"); + } + if (schema4.required !== void 0 && (!Array.isArray(schema4.required) || schema4.required.some((key) => typeof key !== "string"))) { + throw new UnsupportedStrictJsonSchemaError("object required must be a string array"); + } + const properties = schema4.properties ?? {}; + const propertyNames = Object.keys(properties); + const required = new Set(Array.isArray(schema4.required) ? schema4.required : []); + if ([...required].some((key) => !propertyNames.includes(key))) { + throw new UnsupportedStrictJsonSchemaError("required contains an unknown property"); + } + for (const [key, property] of Object.entries(properties)) { + makeJsonSchemaNodeStrict(property, isUnsupportedKeyword); + if (!required.has(key) && !schemaAllowsNull(property)) { + properties[key] = { anyOf: [property, { type: "null" }] }; + } + } + schema4.required = propertyNames; + schema4.additionalProperties = false; +} +function makeStrictJsonSchema(schema4, isUnsupportedKeyword) { + const cloned = structuredClone(schema4); + if (!isJsonSchemaObject(cloned)) { + throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); + } + makeJsonSchemaNodeStrict(cloned, isUnsupportedKeyword); + if (cloned.type !== "object") { + throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); + } + return cloned; +} +function prefersJsonSchemaStrictSampling(tool) { + const config2 = tool.constrainedSampling; + return !!config2 && config2.type === "json_schema" && config2.strict === "prefer"; +} +function isStrictToolLimitErrorMessage(message) { + return STRICT_TOOL_LIMIT_ERROR_MESSAGES.some((limitMessage) => message.includes(limitMessage)); +} +function getJsonSchemaToolParameters(tool, strict) { + return strict === true ? makeStrictJsonSchema(tool.parameters) : tool.parameters; +} +function getGrammarToolInput(toolName2, arguments_, inputProperty) { + const input = arguments_[inputProperty]; + if (typeof input !== "string") { + throw new Error(`Grammar tool call "${toolName2}" requires argument "${inputProperty}" to be a string.`); + } + return input; +} +function appendGrammarToolInputJsonDelta(buffer, inputProperty, inputDelta) { + if (buffer.closed) { + throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); + } + if (inputDelta.length === 0) + return void 0; + buffer.input += inputDelta; + return grammarToolInputJsonStart(buffer, inputProperty) + JSON.stringify(inputDelta).slice(1, -1); +} +function closeGrammarToolInputJson(buffer, inputProperty, finalInput) { + if (buffer.closed) { + if (finalInput === void 0 || finalInput === buffer.input) + return void 0; + throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); + } + if (finalInput !== void 0 && !finalInput.startsWith(buffer.input)) { + throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`); + } + const rest = finalInput === void 0 ? "" : finalInput.slice(buffer.input.length); + if (finalInput !== void 0) + buffer.input = finalInput; + buffer.closed = true; + return `${grammarToolInputJsonStart(buffer, inputProperty)}${JSON.stringify(rest).slice(1, -1)}"}`; +} +function grammarToolInputJsonStart(buffer, inputProperty) { + if (buffer.started) + return ""; + buffer.started = true; + return `{${JSON.stringify(inputProperty)}:"`; +} +function inferGrammarInputProperty(tool) { + const schema4 = tool.parameters; + if (schema4.type !== "object") { + throw new Error("grammar constrained sampling requires an object parameter schema"); + } + if (!Array.isArray(schema4.required) || schema4.required.length !== 1 || typeof schema4.required[0] !== "string") { + throw new Error("grammar constrained sampling requires exactly one required string property"); + } + const inputProperty = schema4.required[0]; + if (!schema4.properties?.[inputProperty]) { + throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`); + } + if (schema4.properties[inputProperty]?.type !== "string") { + throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`); + } + return inputProperty; +} +function resolveJsonSchemaStrictSampling(tool, supportsStrictMode, isUnsupportedKeyword) { + const config2 = tool.constrainedSampling; + if (!config2 || config2.type !== "json_schema") + return void 0; + if (supportsStrictMode) { + try { + makeStrictJsonSchema(tool.parameters, isUnsupportedKeyword); + return true; + } catch (error) { + if (!(error instanceof UnsupportedStrictJsonSchemaError)) + throw error; + if (config2.strict !== "require") + return void 0; + throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`); + } + } + if (config2.strict === "require") { + throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`); + } + return void 0; +} +function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) { + const config2 = tool.constrainedSampling; + if (!config2 || config2.type !== "grammar") { + return void 0; + } + if (!supportsOpenAIGrammarTools) { + return void 0; + } + const larkDefinition = config2.variants.openai_lark; + const regexDefinition = config2.variants.openai_regex; + const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0; + const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0; + if (!hasLarkDefinition && !hasRegexDefinition) { + throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`); + } + try { + return { + format: hasLarkDefinition ? "lark" : "regex", + definition: hasLarkDefinition ? larkDefinition : regexDefinition, + inputProperty: inferGrammarInputProperty(tool) + }; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`); + } +} +function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) { + const properties = /* @__PURE__ */ new Map(); + for (const tool of tools ?? []) { + const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools); + if (grammar) { + properties.set(tool.name, grammar.inputProperty); + } + } + return properties; +} +var UnsupportedStrictJsonSchemaError, UNSUPPORTED_STRICT_SCHEMA_KEYS, STRICT_TOOL_LIMIT_ERROR_MESSAGES; +var init_constrained_sampling = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js"() { + UnsupportedStrictJsonSchemaError = class extends Error { + }; + UNSUPPORTED_STRICT_SCHEMA_KEYS = [ + "$ref", + "$defs", + "definitions", + "allOf", + "oneOf", + "patternProperties", + "dependentSchemas", + "dependencies", + "unevaluatedProperties", + "propertyNames", + "contains", + "prefixItems", + "not", + "if", + "then", + "else" + ]; + STRICT_TOOL_LIMIT_ERROR_MESSAGES = [ + "The compiled grammar is too large", + "Too many strict tools (", + "Schemas contains too many parameters with union types (" + ]; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js +function inferCopilotInitiator(messages) { + const last = messages[messages.length - 1]; + return last && last.role !== "user" ? "agent" : "user"; +} +function hasCopilotVisionInput(messages) { + return messages.some((msg) => { + if (msg.role === "user" && Array.isArray(msg.content)) { + return msg.content.some((c) => c.type === "image"); + } + if (msg.role === "toolResult" && Array.isArray(msg.content)) { + return msg.content.some((c) => c.type === "image"); + } + return false; + }); +} +function buildCopilotDynamicHeaders(params) { + const headers = { + "X-Initiator": inferCopilotInitiator(params.messages), + "Openai-Intent": "conversation-edits" + }; + if (params.hasImages) { + headers["Copilot-Vision-Request"] = "true"; + } + return headers; +} +var init_github_copilot_headers = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js"() { + } +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +function calculateContextTokens(usage) { + return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite; +} +function safeJsonStringify(value2) { + try { + return JSON.stringify(value2) ?? "undefined"; + } catch { + return "[unserializable]"; + } +} +function estimateTextAndImageContentChars(content) { + if (typeof content === "string") + return content.length; + let chars = 0; + for (const block of content) + chars += block.type === "text" ? block.text.length : ESTIMATED_IMAGE_CHARS; + return chars; +} +function estimateTextTokens(text) { + return Math.ceil(text.length / CHARS_PER_TOKEN); +} +function estimateTextAndImageContentTokens(content) { + return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN); +} +function estimateMessageTokens(message) { + let chars = 0; + if (message.role === "system") { + return estimateTextTokens(getSystemMessageText(message)) + estimateToolsTokens(message.toolsAdded) + estimateToolsTokens(message.toolsRemoved); + } + if (message.role === "user") + return estimateTextAndImageContentTokens(message.content); + if (message.role === "toolResult") + return estimateTextAndImageContentTokens(message.content); + for (const block of message.content) { + if (block.type === "text") { + chars += block.text.length; + } else if (block.type === "thinking") { + chars += block.thinking.length; + } else { + chars += block.name.length + safeJsonStringify(block.arguments).length; + } + } + return Math.ceil(chars / CHARS_PER_TOKEN); +} +function getLastAssistantUsageInfo(messages) { + let latestPrefixTimestamp = Number.NEGATIVE_INFINITY; + let usageInfo; + for (let i = 0; i < messages.length; i++) { + const message = messages[i]; + if (message.role === "assistant") { + const assistant = message; + const usageAppliesToPrefix = assistant.timestamp >= latestPrefixTimestamp; + if (usageAppliesToPrefix && assistant.stopReason !== "aborted" && assistant.stopReason !== "error" && calculateContextTokens(assistant.usage) > 0) { + usageInfo = { usage: assistant.usage, index: i }; + } + } + latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp); + } + return usageInfo; +} +function estimateContextTokens(context) { + const messages = "messages" in context ? context.messages : context; + const usageInfo = getLastAssistantUsageInfo(messages); + if (usageInfo) { + const usageTokens = calculateContextTokens(usageInfo.usage); + let trailingTokens = 0; + for (let i = usageInfo.index + 1; i < messages.length; i++) { + trailingTokens += estimateMessageTokens(messages[i]); + } + return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index }; + } + let tokens = 0; + for (const message of messages) + tokens += estimateMessageTokens(message); + return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null }; +} +function estimateToolsTokens(tools) { + if (!tools || tools.length === 0) + return 0; + return estimateTextTokens(safeJsonStringify(tools)); +} +var CHARS_PER_TOKEN, ESTIMATED_IMAGE_CHARS; +var init_estimate = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/estimate.js"() { + init_text(); + CHARS_PER_TOKEN = 3.5; + ESTIMATED_IMAGE_CHARS = 4800; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +function clampMaxTokensToContext(model2, context, maxTokens) { + if (model2.contextWindow <= 0) + return Math.max(MIN_MAX_TOKENS, maxTokens); + const available = model2.contextWindow - estimateContextTokens(context).tokens - CONTEXT_SAFETY_TOKENS; + return Math.min(maxTokens, Math.max(MIN_MAX_TOKENS, available)); +} +function resolveSamplingParams(model2, thinkingLevel, requestParams) { + const effectiveThinkingLevel = clampThinkingLevel(model2, thinkingLevel); + const thinkingLevelParams = model2.samplingParamsByThinkingLevel?.[effectiveThinkingLevel]; + return model2.samplingParams || thinkingLevelParams || requestParams ? { ...model2.samplingParams, ...thinkingLevelParams, ...requestParams } : void 0; +} +function buildBaseOptions(model2, context, options, apiKey) { + const samplingParams = resolveSamplingParams(model2, options?.reasoning ?? "off", options?.samplingParams); + return { + temperature: options?.temperature, + samplingParams, + maxTokens: clampMaxTokensToContext(model2, context, options?.maxTokens ?? model2.maxTokens), + signal: options?.signal, + telemetry: options?.telemetry, + apiKey: apiKey || options?.apiKey, + fetch: options?.fetch, + transport: options?.transport, + cacheRetention: options?.cacheRetention, + sessionId: options?.sessionId, + headers: options?.headers, + identity: options?.identity, + onPayload: options?.onPayload, + onResponse: options?.onResponse, + onProviderStreamEvent: options?.onProviderStreamEvent, + timeoutMs: options?.timeoutMs, + websocketConnectTimeoutMs: options?.websocketConnectTimeoutMs, + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + metadata: options?.metadata, + env: options?.env + }; +} +function clampReasoning(effort) { + return effort === "xhigh" || effort === "max" ? "high" : effort; +} +function thinkingBudgetForLevel(reasoningLevel, customBudgets) { + const budgets = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets }; + const level = clampReasoning(reasoningLevel); + return budgets[level]; +} +function clampThinkingBudgetToAnswerRoom(thinkingBudget, ceiling) { + return Math.min(thinkingBudget, Math.max(0, ceiling - MIN_ANSWER_TOKENS)); +} +function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) { + let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets); + const maxTokens = baseMaxTokens === void 0 ? modelMaxTokens : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens); + if (maxTokens <= thinkingBudget) { + thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens); + } + return { maxTokens, thinkingBudget }; +} +var CONTEXT_SAFETY_TOKENS, MIN_MAX_TOKENS, MIN_ANSWER_TOKENS, DEFAULT_THINKING_BUDGETS; +var init_simple_options = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/simple-options.js"() { + init_models(); + init_estimate(); + CONTEXT_SAFETY_TOKENS = 4096; + MIN_MAX_TOKENS = 1; + MIN_ANSWER_TOKENS = 1024; + DEFAULT_THINKING_BUDGETS = { + minimal: 1024, + low: 2048, + medium: 8192, + high: 16384 + }; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +function splitErrorToolResultImages(msg) { + if (!msg.isError) + return void 0; + const images = msg.content.filter((block) => block.type === "image"); + if (images.length === 0) + return void 0; + return { + content: replaceImagesWithPlaceholder(msg.content, ERROR_TOOL_IMAGE_PLACEHOLDER), + caption: `Images from the error result of tool call ${msg.toolCallId} (${msg.toolName}):`, + images + }; +} +function replaceImagesWithPlaceholder(content, placeholder) { + const result = []; + let previousWasPlaceholder = false; + for (const block of content) { + if (block.type === "image") { + if (!previousWasPlaceholder) { + result.push({ type: "text", text: placeholder }); + } + previousWasPlaceholder = true; + continue; + } + result.push(block); + previousWasPlaceholder = block.text === placeholder; + } + return result; +} +function downgradeUnsupportedImages(messages, model2) { + if (model2.input.includes("image")) { + return messages; + } + return messages.map((msg) => { + if (msg.role === "user" && Array.isArray(msg.content)) { + return { + ...msg, + content: replaceImagesWithPlaceholder(msg.content, NON_VISION_USER_IMAGE_PLACEHOLDER) + }; + } + if (msg.role === "toolResult") { + return { + ...msg, + content: replaceImagesWithPlaceholder(msg.content, NON_VISION_TOOL_IMAGE_PLACEHOLDER) + }; + } + return msg; + }); +} +function transformMessages(messages, model2, normalizeToolCallId2) { + const toolCallIdMap = /* @__PURE__ */ new Map(); + const normalizedMessages = messages.map((msg) => msg.content == null ? { ...msg, content: [] } : msg); + const imageAwareMessages = downgradeUnsupportedImages(normalizedMessages, model2); + const transformed = imageAwareMessages.map((msg) => { + if (msg.role === "system" || msg.role === "user") { + return msg; + } + if (msg.role === "toolResult") { + const normalizedId = toolCallIdMap.get(msg.toolCallId); + if (normalizedId && normalizedId !== msg.toolCallId) { + return { ...msg, toolCallId: normalizedId }; + } + return msg; + } + if (msg.role === "assistant") { + const assistantMsg = msg; + const isSameModel = assistantMsg.provider === model2.provider && assistantMsg.api === model2.api && assistantMsg.model === model2.id; + const transformedContent = assistantMsg.content.flatMap((block) => { + if (block.type === "thinking") { + if (!isSameModel) + return []; + if (block.redacted || block.thinkingSignature) + return block; + if (!block.thinking || block.thinking.trim() === "") + return []; + return block; + } + if (block.type === "text") { + if (isSameModel) + return block; + return { + type: "text", + text: block.text + }; + } + if (block.type === "toolCall") { + const toolCall = block; + let normalizedToolCall = toolCall; + if (!isSameModel && toolCall.thoughtSignature) { + normalizedToolCall = { ...toolCall }; + delete normalizedToolCall.thoughtSignature; + } + if (!isSameModel && normalizeToolCallId2) { + const normalizedId = normalizeToolCallId2(toolCall.id, model2, assistantMsg); + if (normalizedId !== toolCall.id) { + toolCallIdMap.set(toolCall.id, normalizedId); + normalizedToolCall = { ...normalizedToolCall, id: normalizedId }; + } + } + return normalizedToolCall; + } + return block; + }); + return { + ...assistantMsg, + content: transformedContent + }; + } + return msg; + }); + const result = []; + let pendingToolCalls = []; + let existingToolResultIds = /* @__PURE__ */ new Set(); + const heldSystemMessages = []; + const closePendingToolCalls = () => { + if (pendingToolCalls.length > 0) { + for (const tc of pendingToolCalls) { + if (!existingToolResultIds.has(tc.id)) { + result.push({ + role: "toolResult", + toolCallId: tc.id, + toolName: tc.name, + content: [{ type: "text", text: "No result provided" }], + isError: true, + timestamp: Date.now() + }); + } + } + pendingToolCalls = []; + existingToolResultIds = /* @__PURE__ */ new Set(); + } + result.push(...heldSystemMessages); + heldSystemMessages.length = 0; + }; + for (let i = 0; i < transformed.length; i++) { + const msg = transformed[i]; + if (msg.role === "assistant") { + closePendingToolCalls(); + const assistantMsg = msg; + if (assistantMsg.stopReason === "error" || assistantMsg.stopReason === "aborted") { + continue; + } + const toolCalls = assistantMsg.content.filter((b) => b.type === "toolCall"); + if (toolCalls.length > 0) { + pendingToolCalls = toolCalls; + existingToolResultIds = /* @__PURE__ */ new Set(); + } + result.push(msg); + } else if (msg.role === "toolResult") { + existingToolResultIds.add(msg.toolCallId); + result.push(msg); + } else if (msg.role === "system") { + if (pendingToolCalls.length > 0) { + heldSystemMessages.push(msg); + } else { + result.push(msg); + } + } else if (msg.role === "user") { + closePendingToolCalls(); + result.push(msg); + } else { + result.push(msg); + } + } + closePendingToolCalls(); + return result; +} +var NON_VISION_USER_IMAGE_PLACEHOLDER, NON_VISION_TOOL_IMAGE_PLACEHOLDER, ERROR_TOOL_IMAGE_PLACEHOLDER; +var init_transform_messages = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js"() { + NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)"; + NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)"; + ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)"; + } +}); + +// node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +var anthropic_messages_exports = {}; +__export(anthropic_messages_exports, { + stream: () => stream2, + streamSimple: () => streamSimple +}); +function resolveCacheRetention(cacheRetention, env) { + if (cacheRetention) { + return cacheRetention; + } + if (getProviderEnvValue("PI_CACHE_RETENTION", env) === "long") { + return "long"; + } + return "short"; +} +function getCacheControl(model2, cacheRetention, env) { + const retention = resolveCacheRetention(cacheRetention, env); + if (retention === "none") { + return { retention }; + } + const ttl = retention === "long" && getAnthropicCompat(model2).supportsLongCacheRetention ? "1h" : void 0; + return { + retention, + cacheControl: { type: "ephemeral", ...ttl && { ttl } } + }; +} +function convertImageBlock(image) { + return { + type: "image", + source: { + type: "base64", + media_type: image.mimeType, + data: image.data + } + }; +} +function convertContentBlocks(content) { + const hasImages = content.some((c) => c.type === "image"); + if (!hasImages) { + return sanitizeSurrogates(content.map((c) => c.text).join("\n")); + } + const blocks = content.map((block) => { + if (block.type === "text") { + return { + type: "text", + text: sanitizeSurrogates(block.text) + }; + } + return convertImageBlock(block); + }); + const hasText = blocks.some((b) => b.type === "text"); + if (!hasText) { + blocks.unshift({ + type: "text", + text: "(see attached image)" + }); + } + return blocks; +} +function shouldUseServerSideFallbackBeta(model2) { + return (model2.compat?.allowedFallbackModels?.length ?? 0) > 0; +} +function getAnthropicCompat(model2) { + const isOpenRouter2 = model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); + return { + supportsEagerToolInputStreaming: model2.compat?.supportsEagerToolInputStreaming ?? true, + supportsLongCacheRetention: model2.compat?.supportsLongCacheRetention ?? true, + sendSessionAffinityHeaders: model2.compat?.sendSessionAffinityHeaders ?? isOpenRouter2, + sessionAffinityFormat: model2.compat?.sessionAffinityFormat ?? (isOpenRouter2 ? "openrouter" : void 0), + supportsCacheControlOnTools: model2.compat?.supportsCacheControlOnTools ?? true, + supportsTemperature: model2.compat?.supportsTemperature ?? true, + allowEmptySignature: model2.compat?.allowEmptySignature ?? false, + supportsStrictTools: model2.compat?.supportsStrictTools ?? false, + supportsMidConvoSystemMessages: model2.compat?.supportsMidConvoSystemMessages ?? false, + supportsMidConvoToolChanges: model2.compat?.supportsMidConvoToolChanges ?? false + }; +} +function mergeHeaders2(...headerSources) { + const merged = {}; + for (const headers of headerSources) { + if (headers) { + Object.assign(merged, headers); + } + } + return merged; +} +function hasHeader(headers, name) { + if (!headers) + return false; + const expected = name.toLowerCase(); + for (const [key, value2] of Object.entries(headers)) { + if (key.toLowerCase() === expected && value2 !== null && value2.trim().length > 0) + return true; + } + return false; +} +function hasRequestAuth(apiKey, headers) { + return !!apiKey || hasHeader(headers, "authorization") || hasHeader(headers, "x-api-key") || hasHeader(headers, "cf-aig-authorization"); +} +function assertRequestAuth(provider2, apiKey, headers) { + if (!hasRequestAuth(apiKey, headers)) + throw new Error(`No API key for provider: ${provider2}`); +} +function getAnthropicFederation(model2, apiKey, headers, env) { + if (model2.provider !== "anthropic" || hasRequestAuth(apiKey, headers)) + return void 0; + const federationRuleId = getProviderEnvValue(ANTHROPIC_FEDERATION_RULE_ID_ENV, env); + const organizationId = getProviderEnvValue(ANTHROPIC_ORGANIZATION_ID_ENV, env); + const identityTokenFile = getProviderEnvValue(ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, env); + if (!federationRuleId || !organizationId || !identityTokenFile) + return void 0; + return { + organization_id: organizationId, + workspace_id: getProviderEnvValue(ANTHROPIC_WORKSPACE_ID_ENV, env), + authentication: { + type: "oidc_federation", + federation_rule_id: federationRuleId, + service_account_id: getProviderEnvValue(ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, env), + identity_token: { source: "file", path: identityTokenFile } + } + }; +} +function flushSseEvent(state2) { + if (!state2.event && state2.data.length === 0) { + return null; + } + const event = { + event: state2.event, + data: state2.data.join("\n"), + raw: [...state2.raw] + }; + state2.event = null; + state2.data = []; + state2.raw = []; + return event; +} +function decodeSseLine(line, state2) { + if (line === "") { + return flushSseEvent(state2); + } + state2.raw.push(line); + if (line.startsWith(":")) { + return null; + } + const delimiterIndex = line.indexOf(":"); + const fieldName = delimiterIndex === -1 ? line : line.slice(0, delimiterIndex); + let value2 = delimiterIndex === -1 ? "" : line.slice(delimiterIndex + 1); + if (value2.startsWith(" ")) { + value2 = value2.slice(1); + } + if (fieldName === "event") { + state2.event = value2; + } else if (fieldName === "data") { + state2.data.push(value2); + } + return null; +} +function nextLineBreakIndex(text) { + const carriageReturnIndex = text.indexOf("\r"); + const newlineIndex = text.indexOf("\n"); + if (carriageReturnIndex === -1) { + return newlineIndex; + } + if (newlineIndex === -1) { + return carriageReturnIndex; + } + return Math.min(carriageReturnIndex, newlineIndex); +} +function consumeLine(text) { + const lineBreakIndex = nextLineBreakIndex(text); + if (lineBreakIndex === -1) { + return null; + } + let nextIndex = lineBreakIndex + 1; + if (text[lineBreakIndex] === "\r" && text[nextIndex] === "\n") { + nextIndex += 1; + } + return { + line: text.slice(0, lineBreakIndex), + rest: text.slice(nextIndex) + }; +} +async function* iterateSseMessages(body, signal) { + const reader = body.getReader(); + const decoder3 = new TextDecoder(); + const state2 = { event: null, data: [], raw: [] }; + let buffer = ""; + try { + while (true) { + if (signal?.aborted) { + throw new Error("Request was aborted"); + } + const { value: value2, done } = await reader.read(); + if (done) { + break; + } + buffer += decoder3.decode(value2, { stream: true }); + let consumed2 = consumeLine(buffer); + while (consumed2) { + buffer = consumed2.rest; + const event = decodeSseLine(consumed2.line, state2); + if (event) { + yield event; + } + consumed2 = consumeLine(buffer); + } + } + buffer += decoder3.decode(); + let consumed = consumeLine(buffer); + while (consumed) { + buffer = consumed.rest; + const event = decodeSseLine(consumed.line, state2); + if (event) { + yield event; + } + consumed = consumeLine(buffer); + } + if (buffer.length > 0) { + const event = decodeSseLine(buffer, state2); + if (event) { + yield event; + } + } + const trailingEvent = flushSseEvent(state2); + if (trailingEvent) { + yield trailingEvent; + } + } finally { + reader.releaseLock(); + } +} +async function* iterateAnthropicEvents(response, signal) { + if (!response.body) { + throw new Error("Attempted to iterate over an Anthropic response with no body"); + } + let sawMessageStart = false; + let sawMessageEnd = false; + for await (const sse of iterateSseMessages(response.body, signal)) { + if (sse.event === "error") { + throw new Error(sse.data); + } + if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) { + continue; + } + try { + const event = parseJsonWithRepair(sse.data); + if (event.type === "message_start") { + sawMessageStart = true; + } else if (event.type === "message_stop") { + sawMessageEnd = true; + } + yield event; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error(`Could not parse Anthropic SSE event ${sse.event}: ${message}; data=${sse.data}; raw=${sse.raw.join("\\n")}`); + } + } + if (sawMessageStart && !sawMessageEnd) { + throw new Error("Anthropic stream ended before message_stop"); + } +} +function mapThinkingLevelToEffort(model2, level) { + const mapped = level ? model2.thinkingLevelMap?.[level] : void 0; + if (typeof mapped === "string") + return mapped; + switch (level) { + case "minimal": + case "low": + return "low"; + case "medium": + return "medium"; + case "high": + return "high"; + default: + return "high"; + } +} +function isOAuthToken(apiKey) { + return apiKey.includes("sk-ant-oat"); +} +function createClient(model2, apiKey, optionsHeaders, fetch3, dynamicHeaders, sessionId, federation, identity) { + if (model2.provider === "github-copilot") { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: apiKey ?? null, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch3, + defaultHeaders: mergeHeaders2(getIdentityHeaders(model2, identity), { + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true" + }, model2.headers, dynamicHeaders, optionsHeaders) + }); + return { client: client2, isOAuthToken: false }; + } + if (apiKey && isOAuthToken(apiKey)) { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: apiKey, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch3, + defaultHeaders: mergeHeaders2({ + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "user-agent": `claude-cli/${claudeCodeVersion}`, + "x-app": "cli" + }, model2.headers, optionsHeaders) + }); + return { client: client2, isOAuthToken: true }; + } + const compat = getAnthropicCompat(model2); + const sessionAffinityHeaders = {}; + if (sessionId && compat.sendSessionAffinityHeaders) { + const header = compat.sessionAffinityFormat === "openrouter" ? "x-session-id" : "x-session-affinity"; + sessionAffinityHeaders[header] = sessionId; + } + const defaultHeaders = mergeHeaders2(getIdentityHeaders(model2, identity), { + accept: "application/json", + "anthropic-dangerous-direct-browser-access": "true" + }, sessionAffinityHeaders, model2.headers, optionsHeaders); + if (federation) { + const key = JSON.stringify([model2.baseUrl, federation]); + if (federationClient?.key !== key || federationClient.fetch !== fetch3) { + const client2 = new PiAnthropic({ + apiKey: null, + authToken: null, + config: federation, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch3 + }); + federationClient = { key, fetch: fetch3, client: client2 }; + } + return { client: federationClient.client.withOptions({ defaultHeaders }), isOAuthToken: false }; + } + const client = new PiAnthropic({ + apiKey: apiKey ?? null, + authToken: null, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch3, + defaultHeaders + }); + return { client, isOAuthToken: false }; +} +function getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options) { + let configuredFeatures; + for (const headers of [model2.headers, options?.headers]) { + for (const [name, value2] of Object.entries(headers ?? {})) { + if (name.toLowerCase() === "anthropic-beta") + configuredFeatures = value2; + } + } + if (configuredFeatures === null) + return []; + if (configuredFeatures !== void 0) { + return [ + ...new Set(configuredFeatures.split(",").map((feature) => feature.trim()).filter((feature) => feature.length > 0)) + ]; + } + const features = []; + if (isOAuthToken2) + features.push("claude-code-20250219", "oauth-2025-04-20"); + if (shouldUseFineGrainedToolStreamingBeta(model2, context)) + features.push(FINE_GRAINED_TOOL_STREAMING_BETA); + if (model2.reasoning && options?.thinkingEnabled === true && (options.interleavedThinking ?? true) && model2.compat?.forceAdaptiveThinking !== true) { + features.push(INTERLEAVED_THINKING_BETA); + } + if (shouldUseServerSideFallbackBeta(model2)) + features.push(SERVER_SIDE_FALLBACK_BETA); + if (model2.compat?.supportsMidConvoEffort === true) { + features.push(MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA); + } + if (nativeToolChanges) + features.push(INLINE_TOOLS_BETA); + return [...new Set(features)]; +} +function buildParams(model2, context, isOAuthToken2, options, disablePreferredStrictTools = false) { + const { cacheControl } = getCacheControl(model2, options?.cacheRetention, options?.env); + const compat = getAnthropicCompat(model2); + const initialSystemMessage = getInitialSystemMessage(context.messages); + const initialSystemText = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : ""; + const transformedMessages = transformMessages(context.messages, model2, normalizeToolCallId); + const conversationMessages = initialSystemMessage ? transformedMessages.slice(1) : transformedMessages; + let hasPreferredStrictTools = false; + const convertToolDefinitions = (tools, toolCacheControl2) => { + const definitions = convertTools(tools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl2, disablePreferredStrictTools); + if (definitions.some((definition, index) => definition.strict === true && prefersJsonSchemaStrictSampling(tools[index]))) { + hasPreferredStrictTools = true; + } + return definitions; + }; + const initialTools = initialSystemMessage?.toolsAdded ?? []; + const nativeToolChanges = compat.supportsMidConvoSystemMessages && compat.supportsMidConvoToolChanges && initialTools.length > 0; + const thinkingDisabled = model2.reasoning && options?.thinkingEnabled === false && model2.thinkingLevelMap?.off !== null; + const effortMessages = model2.compat?.supportsMidConvoEffort === true && !thinkingDisabled; + const converted = convertMessages(conversationMessages, isOAuthToken2, cacheControl, compat.allowEmptySignature, effortMessages ? model2.provider : void 0, nativeToolChanges ? convertToolDefinitions : void 0); + const activeEffort = options?.effort ?? "high"; + const betaFeatures = getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options); + const params = { + model: model2.id, + messages: effortMessages ? insertThinkingLevelMessages(converted, activeEffort) : converted.messages, + max_tokens: options?.maxTokens ?? model2.maxTokens, + stream: true, + ...betaFeatures.length > 0 ? { betas: betaFeatures } : {} + }; + if (isOAuthToken2) { + params.system = [ + { + type: "text", + text: "You are Claude Code, Anthropic's official CLI for Claude.", + ...cacheControl ? { cache_control: cacheControl } : {} + } + ]; + if (initialSystemText) { + params.system.push({ + type: "text", + text: sanitizeSurrogates(initialSystemText), + ...cacheControl ? { cache_control: cacheControl } : {} + }); + } + } else if (initialSystemText) { + params.system = [ + { + type: "text", + text: sanitizeSurrogates(initialSystemText), + ...cacheControl ? { cache_control: cacheControl } : {} + } + ]; + } + if (options?.temperature !== void 0 && !options?.thinkingEnabled && model2.compat?.supportsMidConvoEffort !== true && compat.supportsTemperature) { + params.temperature = options.temperature; + } + const toolCacheControl = compat.supportsCacheControlOnTools ? cacheControl : void 0; + if (nativeToolChanges) { + params.tools = [...convertToolDefinitions(initialTools, toolCacheControl), DEFERRED_TOOL_PLACEHOLDER]; + } else { + const tools = getCurrentTools(context.messages); + if (tools.length > 0) { + params.tools = convertToolDefinitions(tools, toolCacheControl); + } + } + if (thinkingDisabled) { + params.thinking = { type: "disabled" }; + } else if (effortMessages) { + params.thinking = { + type: "adaptive", + display: options?.thinkingDisplay ?? "summarized", + block_binding: { prefix_mismatch_behavior: "drop_block" } + }; + params.output_config = { effort: "low" }; + } else if (model2.reasoning && options?.thinkingEnabled) { + const display = options.thinkingDisplay ?? "summarized"; + if (model2.compat?.forceAdaptiveThinking === true) { + params.thinking = { type: "adaptive", display }; + if (options.effort) { + params.output_config = { effort: options.effort }; + } + } else { + params.thinking = { + type: "enabled", + budget_tokens: options.thinkingBudgetTokens || 1024, + display + }; + } + } + if (options?.metadata) { + const userId = options.metadata.user_id; + if (typeof userId === "string") { + params.metadata = { user_id: userId }; + } + } + if (options?.toolChoice) { + if (typeof options.toolChoice === "string") { + params.tool_choice = { type: options.toolChoice }; + } else { + params.tool_choice = options.toolChoice; + } + } + const allowedFallbackModels = model2.compat?.allowedFallbackModels; + if (allowedFallbackModels && allowedFallbackModels.length > 0) { + params.fallbacks = allowedFallbackModels.map((fallback) => ({ model: fallback.model })); + } + return { params, hasPreferredStrictTools, providerThinkingLevel: effortMessages ? activeEffort : void 0 }; +} +function normalizeToolCallId(id) { + return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64); +} +function convertToolResult(msg, content = msg.content) { + return { + type: "tool_result", + tool_use_id: msg.toolCallId, + content: convertContentBlocks(content), + is_error: msg.isError + }; +} +function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, convertToolDefinitions) { + const params = []; + const assistantLevels = /* @__PURE__ */ new Map(); + const pendingSystemMessages = []; + const flushPendingSystemMessages = () => { + params.push(...pendingSystemMessages); + pendingSystemMessages.length = 0; + }; + for (let i = 0; i < transformedMessages.length; i++) { + const msg = transformedMessages[i]; + if (msg.role === "system") { + const text = renderSystemMessageUpdate(msg); + const blocks = []; + if (text.length > 0) + blocks.push({ type: "text", text: sanitizeSurrogates(text) }); + if (convertToolDefinitions) { + const added = msg.toolsAdded ?? []; + const redefined = new Set(added.map((tool) => tool.name)); + for (const tool of msg.toolsRemoved ?? []) { + if (redefined.has(tool.name)) + continue; + blocks.push({ + type: "tool_removal", + tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name } + }); + } + for (const definition of convertToolDefinitions(added)) { + blocks.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); + } + } + if (blocks.length > 0) + pendingSystemMessages.push({ role: "system", content: blocks }); + } else if (msg.role === "user") { + if (typeof msg.content === "string") { + if (msg.content.trim().length > 0) { + params.push({ + role: "user", + content: sanitizeSurrogates(msg.content) + }); + } + } else { + const blocks = msg.content.map((item) => { + if (item.type === "text") { + return { + type: "text", + text: sanitizeSurrogates(item.text) + }; + } else { + return convertImageBlock(item); + } + }); + const filteredBlocks = blocks.filter((b) => { + if (b.type === "text") { + return b.text.trim().length > 0; + } + return true; + }); + if (filteredBlocks.length === 0) + continue; + params.push({ + role: "user", + content: filteredBlocks + }); + } + } else if (msg.role === "assistant") { + const blocks = []; + for (const block of msg.content) { + if (block.type === "text") { + if (block.text.trim().length === 0) + continue; + blocks.push({ + type: "text", + text: sanitizeSurrogates(block.text) + }); + } else if (block.type === "thinking") { + if (block.redacted) { + blocks.push({ + type: "redacted_thinking", + data: block.thinkingSignature + }); + continue; + } + const thinkingSignature = block.thinkingSignature; + const hasThinkingSignature = !!thinkingSignature && thinkingSignature.trim().length > 0; + if (block.thinking.trim().length === 0 && !hasThinkingSignature) + continue; + if (!hasThinkingSignature) { + blocks.push(allowEmptySignature ? { + type: "thinking", + thinking: sanitizeSurrogates(block.thinking), + signature: "" + } : { + type: "text", + text: sanitizeSurrogates(block.thinking) + }); + } else { + blocks.push({ + type: "thinking", + thinking: sanitizeSurrogates(block.thinking), + signature: thinkingSignature + }); + } + } else if (block.type === "toolCall") { + blocks.push({ + type: "tool_use", + id: block.id, + name: isOAuthToken2 ? toClaudeCodeName(block.name) : block.name, + input: block.arguments ?? {} + }); + } + } + if (blocks.length === 0) + continue; + flushPendingSystemMessages(); + const messageIndex = params.length; + params.push({ + role: "assistant", + content: blocks + }); + if (managedProvider !== void 0 && msg.api === "anthropic-messages" && msg.provider === managedProvider && isAnthropicEffort(msg.providerThinkingLevel)) { + assistantLevels.set(messageIndex, msg.providerThinkingLevel); + } + } else if (msg.role === "toolResult") { + const toolResults = []; + const errorImages = []; + let j = i; + while (j < transformedMessages.length && transformedMessages[j].role === "toolResult") { + const toolMsg = transformedMessages[j]; + const split = splitErrorToolResultImages(toolMsg); + toolResults.push(convertToolResult(toolMsg, split?.content)); + if (split) { + errorImages.push({ type: "text", text: split.caption }, ...split.images.map(convertImageBlock)); + } + j++; + } + i = j - 1; + params.push({ + role: "user", + content: [...toolResults, ...errorImages] + }); + } + } + flushPendingSystemMessages(); + if (cacheControl && params.length > 0) { + const lastMessage = params[params.length - 1]; + if (lastMessage.role === "user" || lastMessage.role === "system") { + if (Array.isArray(lastMessage.content)) { + const lastBlock = lastMessage.content[lastMessage.content.length - 1]; + if (lastBlock && (lastBlock.type === "text" || lastBlock.type === "image" || lastBlock.type === "tool_result" || lastBlock.type === "tool_addition" || lastBlock.type === "tool_removal")) { + lastBlock.cache_control = cacheControl; + } + } else if (typeof lastMessage.content === "string") { + lastMessage.content = [ + { + type: "text", + text: lastMessage.content, + cache_control: cacheControl + } + ]; + } + } + } + return { messages: params, assistantLevels }; +} +function isAnthropicEffort(value2) { + return value2 === "low" || value2 === "medium" || value2 === "high" || value2 === "xhigh" || value2 === "max"; +} +function insertThinkingLevelMessages(converted, activeEffort) { + const messages = []; + for (let index = 0; index < converted.messages.length; index++) { + const historicalEffort = converted.assistantLevels.get(index); + if (historicalEffort !== void 0) { + messages.push({ role: "system", content: [], output_config: { effort: historicalEffort } }); + } + messages.push(converted.messages[index]); + } + messages.push({ role: "system", content: [], output_config: { effort: activeEffort } }); + return messages; +} +function shouldUseFineGrainedToolStreamingBeta(model2, context) { + return getCurrentTools(context.messages).length > 0 && !getAnthropicCompat(model2).supportsEagerToolInputStreaming; +} +function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl, disablePreferredStrictTools = false) { + if (!tools) + return []; + return tools.map((tool, index) => { + const strict = disablePreferredStrictTools && prefersJsonSchemaStrictSampling(tool) ? void 0 : resolveJsonSchemaStrictSampling(tool, supportsStrictTools, isAnthropicStrictUnsupportedKeyword); + const parameters = getJsonSchemaToolParameters(tool, strict); + const schema4 = parameters; + const legacyInputSchema = { + type: "object", + properties: schema4.properties ?? {}, + required: schema4.required ?? [] + }; + const inputSchema = strict === true ? { + ...parameters, + ...legacyInputSchema + } : legacyInputSchema; + return { + name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name, + description: tool.description, + ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {}, + ...strict === true ? { strict: true } : {}, + input_schema: inputSchema, + ...cacheControl && index === tools.length - 1 ? { cache_control: cacheControl } : {} + }; + }); +} +function mapStopReason(reason, stopDetails) { + switch (reason) { + case "end_turn": + return { stopReason: "stop" }; + case "max_tokens": + return { stopReason: "length" }; + case "tool_use": + return { stopReason: "toolUse" }; + case "refusal": + return { + stopReason: "error", + errorMessage: stopDetails?.explanation || `The model refused to complete the request` + }; + case "pause_turn": + return { stopReason: "stop" }; + case "stop_sequence": + return { stopReason: "stop" }; + // We don't supply stop sequences, so this should never happen + case "sensitive": + return { stopReason: "error", errorMessage: "Provider stopped with: sensitive" }; + default: + throw new Error(`Unhandled stop reason: ${reason}`); + } +} +var claudeCodeVersion, claudeCodeTools, ccToolLookup, toClaudeCodeName, fromClaudeCodeName, FINE_GRAINED_TOOL_STREAMING_BETA, INTERLEAVED_THINKING_BETA, SERVER_SIDE_FALLBACK_BETA, MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA, INLINE_TOOLS_BETA, DEFERRED_TOOL_PLACEHOLDER, PiAnthropic, federationClient, ANTHROPIC_MESSAGE_EVENTS, stream2, streamSimple, ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS, ANTHROPIC_STRICT_STRING_FORMATS, isAnthropicStrictUnsupportedKeyword; +var init_anthropic_messages = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js"() { + init_sdk(); + init_env_api_keys(); + init_models(); + init_diagnostics(); + init_event_stream(); + init_headers2(); + init_identity(); + init_json_parse(); + init_openrouter_cost(); + init_provider_env(); + init_provider_retry(); + init_sanitize_unicode(); + init_streaming_json(); + init_text(); + init_transcript(); + init_constrained_sampling(); + init_github_copilot_headers(); + init_simple_options(); + init_transform_messages(); + claudeCodeVersion = "2.1.280"; + claudeCodeTools = [ + "Read", + "Write", + "Edit", + "Bash", + "Grep", + "Glob", + "AskUserQuestion", + "EnterPlanMode", + "ExitPlanMode", + "KillShell", + "NotebookEdit", + "Skill", + "Task", + "TaskOutput", + "TodoWrite", + "WebFetch", + "WebSearch" + ]; + ccToolLookup = new Map(claudeCodeTools.map((t) => [t.toLowerCase(), t])); + toClaudeCodeName = (name) => ccToolLookup.get(name.toLowerCase()) ?? name; + fromClaudeCodeName = (name, tools) => { + if (tools && tools.length > 0) { + const lowerName = name.toLowerCase(); + const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName); + if (matchedTool) + return matchedTool.name; + } + return name; + }; + FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14"; + INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14"; + SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01"; + MID_CONVERSATION_OUTPUT_CONFIG_BETA = "mid-conversation-output-config-2026-07-01"; + THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"; + INLINE_TOOLS_BETA = "inline-tools-2026-09-15"; + DEFERRED_TOOL_PLACEHOLDER = { + name: "__pi_deferred_placeholder__", + description: "Reserved placeholder. Never available. Never call this.", + input_schema: { type: "object", properties: {}, required: [] }, + defer_loading: true + }; + PiAnthropic = class extends Anthropic { + _shouldResolveDefaultCredentials() { + return false; + } + }; + ANTHROPIC_MESSAGE_EVENTS = /* @__PURE__ */ new Set([ + "message_start", + "message_delta", + "message_stop", + "content_block_start", + "content_block_delta", + "content_block_stop" + ]); + stream2 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); + const normalizedContext = resolveTranscript(context, getAnthropicCompat(model2).supportsMidConvoSystemMessages); + const currentTools = getCurrentTools(normalizedContext.messages); + (async () => { + const output = { + role: "assistant", + content: [], + api: model2.api, + provider: model2.provider, + model: model2.id, + usage: { + input: 0, + output: 0, + cacheRead: 0, + cacheWrite: 0, + totalTokens: 0, + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } + }, + stopReason: "pending", + timestamp: Date.now() + }; + try { + let client; + let isOAuth; + let usageModel = model2; + let inputTransformations; + if (options?.client) { + client = options.client; + isOAuth = false; + } else { + const apiKey = options?.apiKey; + const federation = getAnthropicFederation(model2, apiKey, options?.headers, options?.env); + if (!federation) + assertRequestAuth(model2.provider, apiKey, options?.headers); + let copilotDynamicHeaders; + if (model2.provider === "github-copilot") { + const hasImages = hasCopilotVisionInput(normalizedContext.messages); + copilotDynamicHeaders = buildCopilotDynamicHeaders({ + messages: normalizedContext.messages, + hasImages + }); + } + const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; + const created = createClient(model2, apiKey, options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId, federation, options?.identity); + client = created.client; + isOAuth = created.isOAuthToken; + } + const requestOptions = { + ...options?.signal ? { signal: options.signal } : {}, + ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {}, + maxRetries: 0 + }; + let disablePreferredStrictTools = false; + let response; + for (; ; ) { + options?.signal?.throwIfAborted(); + const built = buildParams(model2, normalizedContext, isOAuth, options, disablePreferredStrictTools); + if (built.providerThinkingLevel) + output.providerThinkingLevel = built.providerThinkingLevel; + let params = built.params; + const nextParams = await options?.onPayload?.(params, model2); + if (nextParams !== void 0) { + params = { ...nextParams, stream: true }; + } + try { + response = await retryProviderRequest(() => client.beta.messages.create(params, requestOptions).asResponse(), { + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + signal: options?.signal + }); + break; + } catch (error) { + if (options?.signal?.aborted || disablePreferredStrictTools || !built.hasPreferredStrictTools || !(error instanceof Anthropic.APIError) || error.status !== 400 || error.type !== "invalid_request_error" || !isStrictToolLimitErrorMessage(error.message)) { + throw error; + } + disablePreferredStrictTools = true; + appendAssistantMessageDiagnostic(output, { + type: "anthropic_strict_tools_fallback", + timestamp: Date.now(), + error: { message: error.message }, + details: { reason: "strict_tool_limits_exceeded" } + }); + } + } + await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); + stream5.push({ type: "start", partial: output }); + const openBlocks = /* @__PURE__ */ new Map(); + const openBlock = (anthropicIndex) => { + const open = openBlocks.get(anthropicIndex); + return open === void 0 ? void 0 : { ...open, block: output.content[open.contentIndex] }; + }; + for await (const event of iterateAnthropicEvents(response, options?.signal)) { + await options?.onProviderStreamEvent?.(event, model2); + if (event.type === "message_start") { + output.responseId = event.message.id; + const transformations = event.message.input_transformations; + if (Array.isArray(transformations)) + inputTransformations = transformations; + const responseModel = event.message.model; + if (responseModel !== model2.id) + output.responseModel = responseModel; + const fallbackCost = responseModel === model2.id ? void 0 : model2.compat?.allowedFallbackModels?.find((fallback) => fallback.provider === model2.provider && fallback.model === responseModel)?.cost; + usageModel = fallbackCost ? { ...model2, id: responseModel, cost: fallbackCost } : model2; + output.usage.input = event.message.usage.input_tokens || 0; + output.usage.output = event.message.usage.output_tokens || 0; + output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0; + output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0; + output.usage.cacheWrite1h = event.message.usage.cache_creation?.ephemeral_1h_input_tokens || 0; + output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; + calculateCost(usageModel, output.usage); + } else if (event.type === "content_block_start") { + if (event.content_block.type === "fallback") { + if (output.content.length > 0) { + throw new Error("Anthropic performed an unsupported mid-output model fallback"); + } + continue; + } + if (event.content_block.type === "text") { + output.content.push({ type: "text", text: event.content_block.text ?? "" }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "thinking") { + output.content.push({ + type: "thinking", + thinking: event.content_block.thinking ?? "", + thinkingSignature: event.content_block.signature ?? "" + }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "redacted_thinking") { + output.content.push({ + type: "thinking", + thinking: "[Reasoning redacted]", + thinkingSignature: event.content_block.data, + redacted: true + }); + openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); + stream5.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); + } else if (event.content_block.type === "tool_use") { + output.content.push({ + type: "toolCall", + id: event.content_block.id, + name: isOAuth ? fromClaudeCodeName(event.content_block.name, currentTools) : event.content_block.name, + arguments: event.content_block.input ?? {} + }); + openBlocks.set(event.index, { + contentIndex: output.content.length - 1, + arguments: new ToolCallArgumentsStream() + }); + stream5.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output }); + } + } else if (event.type === "content_block_delta") { + const open = openBlock(event.index); + if (event.delta.type === "text_delta") { + if (open?.block.type === "text") { + open.block.text += event.delta.text; + stream5.push({ + type: "text_delta", + contentIndex: open.contentIndex, + delta: event.delta.text, + partial: output + }); + } + } else if (event.delta.type === "thinking_delta") { + if (open?.block.type === "thinking") { + open.block.thinking += event.delta.thinking; + stream5.push({ + type: "thinking_delta", + contentIndex: open.contentIndex, + delta: event.delta.thinking, + partial: output + }); + } + } else if (event.delta.type === "input_json_delta") { + if (open?.block.type === "toolCall" && open.arguments !== void 0) { + open.block.arguments = open.arguments.append(event.delta.partial_json); + stream5.push({ + type: "toolcall_delta", + contentIndex: open.contentIndex, + delta: event.delta.partial_json, + partial: output + }); + } + } else if (event.delta.type === "signature_delta") { + if (open?.block.type === "thinking") { + open.block.thinkingSignature = open.block.thinkingSignature || ""; + open.block.thinkingSignature += event.delta.signature; + } + } + } else if (event.type === "content_block_stop") { + const open = openBlock(event.index); + openBlocks.delete(event.index); + if (open) { + const { block, contentIndex: index } = open; + if (block.type === "text") { + stream5.push({ + type: "text_end", + contentIndex: index, + content: block.text, + partial: output + }); + } else if (block.type === "thinking") { + stream5.push({ + type: "thinking_end", + contentIndex: index, + content: block.thinking, + partial: output + }); + } else if (block.type === "toolCall" && open.arguments !== void 0) { + Object.assign(block, open.arguments.finish()); + stream5.push({ + type: "toolcall_end", + contentIndex: index, + toolCall: block, + partial: output + }); + } + } + } else if (event.type === "message_delta") { + const transformations = event.input_transformations; + if (Array.isArray(transformations)) + inputTransformations = transformations; + if (event.delta.stop_reason) { + output.rawStopReason = event.delta.stop_reason; + const stopReasonResult = mapStopReason(event.delta.stop_reason, event.delta.stop_details); + output.stopReason = stopReasonResult.stopReason; + if (stopReasonResult.errorMessage) { + output.errorMessage = stopReasonResult.errorMessage; + } + } + if (event.usage) { + if (event.usage.input_tokens != null) { + output.usage.input = event.usage.input_tokens; + } + if (event.usage.output_tokens != null) { + output.usage.output = event.usage.output_tokens; + } + if (event.usage.cache_read_input_tokens != null) { + output.usage.cacheRead = event.usage.cache_read_input_tokens; + } + if (event.usage.cache_creation_input_tokens != null) { + output.usage.cacheWrite = event.usage.cache_creation_input_tokens; + } + const cacheCreation = event.usage.cache_creation; + if (cacheCreation?.ephemeral_1h_input_tokens != null) { + output.usage.cacheWrite1h = cacheCreation.ephemeral_1h_input_tokens; + } + const thinkingTokens = event.usage.output_tokens_details?.thinking_tokens; + if (thinkingTokens != null) { + output.usage.reasoning = thinkingTokens; + } + } + output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; + calculateCost(usageModel, output.usage); + if (isOpenRouterModel(model2) && event.usage) { + applyOpenRouterReportedCost(output.usage, event.usage); + } + } + } + if (options?.signal?.aborted) { + throw new Error("Request was aborted"); + } + if (output.stopReason === "pending") { + throw new Error("Anthropic stream ended without a stop reason"); + } + if (output.stopReason === "aborted" || output.stopReason === "error") { + throw new Error(output.errorMessage || "An unknown error occurred"); + } + if (inputTransformations && inputTransformations.length > 0) { + appendAssistantMessageDiagnostic(output, { + type: "anthropic_input_transformations", + timestamp: Date.now(), + details: { + transformations: inputTransformations.map((transformation) => ({ + type: transformation.type ?? void 0, + path: transformation.path ?? void 0, + reason: transformation.reason ?? void 0 + })) + } + }); + } + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); + } catch (error) { + output.stopReason = options?.signal?.aborted ? "aborted" : "error"; + output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error); + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); + } + })(); + return stream5; + }; + streamSimple = (model2, context, options) => { + if (!getAnthropicFederation(model2, options?.apiKey, options?.headers, options?.env)) { + assertRequestAuth(model2.provider, options?.apiKey, options?.headers); + } + const base = { + ...buildBaseOptions(model2, context, options, options?.apiKey), + toolChoice: options?.toolChoice + }; + if (!options?.reasoning) { + return stream2(model2, context, { + ...base, + thinkingEnabled: false + }); + } + if (model2.compat?.forceAdaptiveThinking === true) { + const effort = mapThinkingLevelToEffort(model2, options.reasoning); + return stream2(model2, context, { + ...base, + thinkingEnabled: true, + effort + }); + } + const adjusted = adjustMaxTokensForThinking(base.maxTokens, model2.maxTokens, options.reasoning, options.thinkingBudgets); + const maxTokens = clampMaxTokensToContext(model2, context, adjusted.maxTokens); + return stream2(model2, context, { + ...base, + maxTokens, + thinkingEnabled: true, + thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)) + }); + }; + ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS = /* @__PURE__ */ new Set([ + "minimum", + "maximum", + "exclusiveMinimum", + "exclusiveMaximum", + "multipleOf", + "maxItems", + "uniqueItems", + "minContains", + "maxContains", + "minProperties", + "maxProperties" + ]); + ANTHROPIC_STRICT_STRING_FORMATS = /* @__PURE__ */ new Set([ + "date-time", + "time", + "date", + "duration", + "email", + "hostname", + "uri", + "ipv4", + "ipv6", + "uuid" + ]); + isAnthropicStrictUnsupportedKeyword = (key, value2) => { + if (ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS.has(key)) + return true; + if (key === "minItems") + return value2 !== 0 && value2 !== 1; + if (key === "format") + return typeof value2 !== "string" || !ANTHROPIC_STRICT_STRING_FORMATS.has(value2); + return false; + }; + } +}); + +// node_modules/openai/internal/tslib.mjs +function __classPrivateFieldSet2(receiver, state2, value2, kind, f) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value2) : f ? f.value = value2 : state2.set(receiver, value2), value2; +} +function __classPrivateFieldGet2(receiver, state2, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); +} +var init_tslib2 = __esm({ + "node_modules/openai/internal/tslib.mjs"() { + } +}); + +// node_modules/openai/internal/utils/uuid.mjs +var uuid42; +var init_uuid2 = __esm({ + "node_modules/openai/internal/utils/uuid.mjs"() { + uuid42 = function() { + const { crypto: crypto3 } = globalThis; + if (crypto3?.randomUUID) { + uuid42 = crypto3.randomUUID.bind(crypto3); + return crypto3.randomUUID(); + } + const u8 = new Uint8Array(1); + const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); + }; + } +}); + +// node_modules/openai/internal/errors.mjs +function isAbortError2(err) { + return typeof err === "object" && err !== null && // Spec-compliant fetch implementations + ("name" in err && err.name === "AbortError" || // Expo fetch + "message" in err && String(err.message).includes("FetchRequestCanceledException")); +} +var castToError2; +var init_errors2 = __esm({ + "node_modules/openai/internal/errors.mjs"() { + castToError2 = (err) => { + if (err instanceof Error) + return err; + if (typeof err === "object" && err !== null) { + try { + if (Object.prototype.toString.call(err) === "[object Error]") { + const hasCause = "cause" in err; + const error = new Error(err.message, hasCause ? { cause: err.cause } : {}); + if (err.stack) + error.stack = err.stack; + if (hasCause && !Object.prototype.hasOwnProperty.call(error, "cause")) + error.cause = err.cause; + if (err.name) + error.name = err.name; + return error; + } + } catch { + } + try { + return new Error(JSON.stringify(err)); + } catch { + } + } + return new Error(err); + }; + } +}); + +// node_modules/openai/core/error.mjs +var OpenAIError, APIError2, APIUserAbortError2, APIConnectionError2, APIConnectionTimeoutError2, BadRequestError2, AuthenticationError2, PermissionDeniedError2, NotFoundError2, ConflictError2, UnprocessableEntityError2, RateLimitError2, InternalServerError2, LengthFinishReasonError, ContentFilterFinishReasonError, InvalidWebhookSignatureError, OAuthError, SubjectTokenProviderError; +var init_error3 = __esm({ + "node_modules/openai/core/error.mjs"() { + init_errors2(); + OpenAIError = class extends Error { + }; + APIError2 = class _APIError extends OpenAIError { + constructor(status, error, message, headers) { + super(`${_APIError.makeMessage(status, error, message)}`); + this.status = status; + this.headers = headers; + this.requestID = headers?.get("x-request-id"); + this.error = error; + const data = error; + this.code = data?.["code"]; + this.param = data?.["param"]; + this.type = data?.["type"]; + } + static makeMessage(status, error, message) { + const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message; + if (status && msg) { + return `${status} ${msg}`; + } + if (status) { + return `${status} status code (no body)`; + } + if (msg) { + return msg; + } + return "(no status code or body)"; + } + static generate(status, errorResponse, message, headers) { + if (!status || !headers) { + return new APIConnectionError2({ message, cause: castToError2(errorResponse) }); + } + const error = errorResponse?.["error"]; + if (status === 400) { + return new BadRequestError2(status, error, message, headers); + } + if (status === 401) { + return new AuthenticationError2(status, error, message, headers); + } + if (status === 403) { + return new PermissionDeniedError2(status, error, message, headers); + } + if (status === 404) { + return new NotFoundError2(status, error, message, headers); + } + if (status === 409) { + return new ConflictError2(status, error, message, headers); + } + if (status === 422) { + return new UnprocessableEntityError2(status, error, message, headers); + } + if (status === 429) { + return new RateLimitError2(status, error, message, headers); + } + if (status >= 500) { + return new InternalServerError2(status, error, message, headers); + } + return new _APIError(status, error, message, headers); + } + }; + APIUserAbortError2 = class extends APIError2 { + constructor({ message } = {}) { + super(void 0, void 0, message || "Request was aborted.", void 0); + } + }; + APIConnectionError2 = class extends APIError2 { + constructor({ message, cause }) { + super(void 0, void 0, message || "Connection error.", void 0); + if (cause) + this.cause = cause; + } + }; + APIConnectionTimeoutError2 = class extends APIConnectionError2 { + constructor({ message } = {}) { + super({ message: message ?? "Request timed out." }); + } + }; + BadRequestError2 = class extends APIError2 { + }; + AuthenticationError2 = class extends APIError2 { + }; + PermissionDeniedError2 = class extends APIError2 { + }; + NotFoundError2 = class extends APIError2 { + }; + ConflictError2 = class extends APIError2 { + }; + UnprocessableEntityError2 = class extends APIError2 { + }; + RateLimitError2 = class extends APIError2 { + }; + InternalServerError2 = class extends APIError2 { + }; + LengthFinishReasonError = class extends OpenAIError { + constructor() { + super(`Could not parse response content as the length limit was reached`); + } + }; + ContentFilterFinishReasonError = class extends OpenAIError { + constructor() { + super(`Could not parse response content as the request was rejected by the content filter`); + } + }; + InvalidWebhookSignatureError = class extends Error { + constructor(message) { + super(message); + } + }; + OAuthError = class extends APIError2 { + constructor(status, error, headers) { + let finalMessage = "OAuth2 authentication error"; + let error_code = void 0; + if (error && typeof error === "object") { + const errorData = error; + error_code = errorData["error"]; + const description = errorData["error_description"]; + if (description && typeof description === "string") { + finalMessage = description; + } else if (error_code) { + finalMessage = error_code; + } + } + super(status, error, finalMessage, headers); + this.error_code = error_code; + } + }; + SubjectTokenProviderError = class extends OpenAIError { + constructor(message, provider2, cause) { + super(message); + this.provider = provider2; + this.cause = cause; + } + }; + } +}); + +// node_modules/openai/internal/utils/values.mjs +function maybeObj2(x) { + if (typeof x !== "object") { + return {}; + } + return x ?? {}; +} +function isEmptyObj2(obj2) { + if (!obj2) + return true; + for (const _k in obj2) + return false; + return true; +} +function hasOwn2(obj2, key) { + return Object.prototype.hasOwnProperty.call(obj2, key); +} +function isObj2(obj2) { + return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); +} +var startsWithSchemeRegexp2, isAbsoluteURL2, isArray2, isReadonlyArray2, validatePositiveInteger2, safeJSON2; +var init_values2 = __esm({ + "node_modules/openai/internal/utils/values.mjs"() { + init_error3(); + startsWithSchemeRegexp2 = /^[a-z][a-z0-9+.-]*:/i; + isAbsoluteURL2 = (url) => { + return startsWithSchemeRegexp2.test(url); + }; + isArray2 = (val) => (isArray2 = Array.isArray, isArray2(val)); + isReadonlyArray2 = isArray2; + validatePositiveInteger2 = (name, n) => { + if (typeof n !== "number" || !Number.isInteger(n)) { + throw new OpenAIError(`${name} must be an integer`); + } + if (n < 0) { + throw new OpenAIError(`${name} must be a positive integer`); + } + return n; + }; + safeJSON2 = (text) => { + try { + return JSON.parse(text); + } catch (err) { + return void 0; + } + }; + } +}); + +// node_modules/openai/internal/utils/sleep.mjs +var sleep2; +var init_sleep2 = __esm({ + "node_modules/openai/internal/utils/sleep.mjs"() { + sleep2 = (ms, ...signals) => new Promise((resolve2, reject2) => { + const activeSignals = [...new Set(signals.filter((signal) => signal != null))]; + let timeout; + let settled = false; + const cleanup = () => { + for (const signal of activeSignals) { + try { + signal.removeEventListener("abort", abort); + } catch { + } + } + }; + const settle3 = (callback) => { + if (settled) { + return; + } + settled = true; + if (timeout !== void 0) { + clearTimeout(timeout); + timeout = void 0; + } + cleanup(); + callback(); + }; + const abort = () => { + settle3(() => reject2()); + }; + if (activeSignals.some((signal) => signal.aborted)) { + abort(); + return; + } + timeout = setTimeout(() => { + settle3(resolve2); + }, ms); + for (const signal of activeSignals) { + if (settled) { + break; + } + try { + signal.addEventListener("abort", abort, { once: true }); + } catch (error) { + settle3(() => reject2(error)); + } + } + if (activeSignals.some((signal) => signal.aborted)) { + abort(); + } + }); + } +}); + +// node_modules/openai/internal/utils/abort.mjs +function subscribeWeakly(signal, reference, registry3) { + let subscription = subscriptions.get(signal); + if (!subscription) { + const callbacks = /* @__PURE__ */ new Set(); + const abort = () => { + subscriptions.delete(signal); + for (const callback of callbacks) { + registry3.unregister(callback); + callback.deref()?.(); + } + callbacks.clear(); + }; + subscription = { callbacks, abort }; + signal.addEventListener("abort", abort, { once: true }); + subscriptions.set(signal, subscription); + } + const owner = subscription; + owner.callbacks.add(reference); + return () => { + owner.callbacks.delete(reference); + registry3.unregister(reference); + if (owner.callbacks.size === 0) { + if (subscriptions.get(signal) === owner) { + subscriptions.delete(signal); + } + signal.removeEventListener("abort", owner.abort); + } + }; +} +function releaseOnAbort(signal, callbacks, abort) { + signal.addEventListener("abort", () => callbacks.deref()?.delete(abort), { once: true }); +} +function retainRequestAbortCallback(owner, abort, requestSignal) { + if (typeof weakGlobals.WeakRef === "function" && finalizer && !requestSignal.aborted) { + let callbacks = callbackOwners.get(owner); + if (!callbacks) { + callbacks = /* @__PURE__ */ new Set(); + callbackOwners.set(owner, callbacks); + } + callbacks.add(abort); + releaseOnAbort(requestSignal, new weakGlobals.WeakRef(callbacks), abort); + } +} +function addRequestAbortListener(signal, abort, requestSignal) { + if (signal.aborted) { + abort(); + return () => { + }; + } + if (typeof weakGlobals.WeakRef !== "function" || !finalizer) { + signal.addEventListener("abort", abort, { once: true }); + return () => signal.removeEventListener("abort", abort); + } + const reference = new weakGlobals.WeakRef(abort); + const cleanup = subscribeWeakly(signal, reference, finalizer); + finalizer.register(abort, cleanup, reference); + retainRequestAbortCallback(requestSignal, abort, requestSignal); + return cleanup; +} +var weakGlobals, finalizer, callbackOwners, subscriptions; +var init_abort3 = __esm({ + "node_modules/openai/internal/utils/abort.mjs"() { + weakGlobals = globalThis; + finalizer = // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Weak references and finalizers are optional host capabilities, so probe them before constructing either. + typeof weakGlobals.FinalizationRegistry === "function" ? new weakGlobals.FinalizationRegistry((cleanup) => { + try { + cleanup(); + } catch { + } + }) : void 0; + callbackOwners = /* @__PURE__ */ new WeakMap(); + subscriptions = /* @__PURE__ */ new WeakMap(); + } +}); + +// node_modules/openai/internal/shims.mjs +function getDefaultFetch2() { + if (typeof fetch !== "undefined") { + return fetch; + } + throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); +} +function makeReadableStream2(...args) { + const ReadableStream2 = globalThis.ReadableStream; + if (typeof ReadableStream2 === "undefined") { + throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); + } + return new ReadableStream2(...args); +} +function ReadableStreamFrom2(iterable) { + let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + return makeReadableStream2({ + start() { + }, + async pull(controller) { + const { done, value: value2 } = await iter.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value2); + } + }, + async cancel() { + await iter.return?.(); + } + }); +} +function ReadableStreamToAsyncIterable2(stream5) { + if (stream5[Symbol.asyncIterator]) + return stream5; + const reader = stream5.getReader(); + return { + async next() { + try { + const result = await reader.read(); + if (result?.done) + reader.releaseLock(); + return result; + } catch (e) { + reader.releaseLock(); + throw e; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: void 0 }; + }, + [Symbol.asyncIterator]() { + return this; + } + }; +} +async function CancelReadableStream2(stream5) { + if (stream5 === null || typeof stream5 !== "object") + return; + if (stream5[Symbol.asyncIterator]) { + await stream5[Symbol.asyncIterator]().return?.(); + return; + } + const reader = stream5.getReader(); + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; +} +var init_shims2 = __esm({ + "node_modules/openai/internal/shims.mjs"() { + } +}); + +// node_modules/openai/internal/utils/bytes.mjs +function encodeUTF82(str2) { + let encoder4; + return (encodeUTF8_2 ?? (encoder4 = new globalThis.TextEncoder(), encodeUTF8_2 = encoder4.encode.bind(encoder4)))(str2); +} +function decodeUTF82(bytes2) { + let decoder3; + return (decodeUTF8_2 ?? (decoder3 = new globalThis.TextDecoder(), decodeUTF8_2 = decoder3.decode.bind(decoder3)))(bytes2); +} +var encodeUTF8_2, decodeUTF8_2; +var init_bytes2 = __esm({ + "node_modules/openai/internal/utils/bytes.mjs"() { + } +}); + +// node_modules/openai/internal/decoders/line.mjs +function findNewlineIndex2(buffer, start, end) { + const newline = 10; + const carriage = 13; + for (let i = start; i < end; i++) { + if (buffer[i] === newline) { + return { preceding: i, index: i + 1, carriage: false }; + } + if (buffer[i] === carriage) { + return { preceding: i, index: i + 1, carriage: true }; + } + } + return null; +} +function findDoubleNewlineIndex(buffer) { + for (let i = 0; i < buffer.length - 1; i++) { + const firstEndingLength = lineEndingLength(buffer, i); + if (firstEndingLength > 0) { + const secondEndingIndex = i + firstEndingLength; + const secondEndingLength = lineEndingLength(buffer, secondEndingIndex); + if (secondEndingLength > 0) { + return secondEndingIndex + secondEndingLength; + } + } + } + return -1; +} +function lineEndingLength(buffer, index) { + const newline = 10; + const carriage = 13; + if (buffer[index] === newline) { + return 1; + } + if (buffer[index] === carriage) { + return buffer[index + 1] === newline ? 2 : 1; + } + return 0; +} +var _LineDecoder_instances, _LineDecoder_buffer2, _LineDecoder_start, _LineDecoder_end, _LineDecoder_searchIndex, _LineDecoder_skipLeadingLF, _LineDecoder_append, MAX_RETAINED_BUFFER_BYTES, LineDecoder2; +var init_line2 = __esm({ + "node_modules/openai/internal/decoders/line.mjs"() { + init_tslib2(); + init_bytes2(); + MAX_RETAINED_BUFFER_BYTES = 64 * 1024; + LineDecoder2 = class { + /** Creates a decoder with no buffered bytes or pending newline continuation. */ + constructor() { + _LineDecoder_instances.add(this); + _LineDecoder_buffer2.set(this, void 0); + _LineDecoder_start.set(this, void 0); + _LineDecoder_end.set(this, void 0); + _LineDecoder_searchIndex.set(this, void 0); + _LineDecoder_skipLeadingLF.set(this, void 0); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); + } + /** + * Appends a text or UTF-8 byte chunk and returns every newly completed line. + * + * Incomplete lines remain buffered for the next call. A trailing `\r` + * completes its line immediately, and a following `\n` is consumed as its + * continuation. `null` and `undefined` are ignored and do not flush buffered + * content. + */ + decode(chunk) { + if (chunk == null) { + return []; + } + let binaryChunk; + if (chunk instanceof ArrayBuffer) { + binaryChunk = new Uint8Array(chunk); + } else if (typeof chunk === "string") { + binaryChunk = encodeUTF82(chunk); + } else { + binaryChunk = chunk; + } + if (binaryChunk.length === 0) { + return []; + } + if (__classPrivateFieldGet2(this, _LineDecoder_skipLeadingLF, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); + if (binaryChunk[0] === 10) { + binaryChunk = binaryChunk.subarray(1); + } + if (binaryChunk.length === 0) { + return []; + } + } + __classPrivateFieldGet2(this, _LineDecoder_instances, "m", _LineDecoder_append).call(this, binaryChunk); + const lines2 = []; + let patternIndex; + while ((patternIndex = findNewlineIndex2(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), __classPrivateFieldGet2(this, _LineDecoder_searchIndex, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))) != null) { + const line = decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), patternIndex.preceding)); + lines2.push(line); + __classPrivateFieldSet2(this, _LineDecoder_start, patternIndex.index, "f"); + if (patternIndex.carriage) { + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") < __classPrivateFieldGet2(this, _LineDecoder_end, "f") && __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f")[__classPrivateFieldGet2(this, _LineDecoder_start, "f")] === 10) { + __classPrivateFieldSet2(this, _LineDecoder_start, __classPrivateFieldGet2(this, _LineDecoder_start, "f") + 1, "f"); + } else if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, true, "f"); + } + } + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_start, "f"), "f"); + } + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_end, "f"), "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, 0, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > MAX_RETAINED_BUFFER_BYTES) { + __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); + } + } else if (lines2.length > 0 && __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > MAX_RETAINED_BUFFER_BYTES) { + const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (length <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length > length * 4) { + const capacity = length <= MAX_RETAINED_BUFFER_BYTES ? Math.min(Math.max(length * 2, 256), MAX_RETAINED_BUFFER_BYTES) : length * 2; + const buffer = new Uint8Array(capacity); + buffer.set(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, buffer, "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, length, "f"); + } + } + return lines2; + } + /** Emits the remaining unterminated line, or returns an empty array when idle. */ + flush() { + __classPrivateFieldSet2(this, _LineDecoder_skipLeadingLF, false, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") === __classPrivateFieldGet2(this, _LineDecoder_end, "f")) { + return []; + } + return this.decode("\n"); + } + }; + _LineDecoder_buffer2 = /* @__PURE__ */ new WeakMap(), _LineDecoder_start = /* @__PURE__ */ new WeakMap(), _LineDecoder_end = /* @__PURE__ */ new WeakMap(), _LineDecoder_searchIndex = /* @__PURE__ */ new WeakMap(), _LineDecoder_skipLeadingLF = /* @__PURE__ */ new WeakMap(), _LineDecoder_instances = /* @__PURE__ */ new WeakSet(), _LineDecoder_append = function _LineDecoder_append2(chunk) { + if (__classPrivateFieldGet2(this, _LineDecoder_end, "f") + chunk.length > __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { + const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") >= __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length / 2 && length + chunk.length <= __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { + __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").copyWithin(0, __classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f")); + } else { + const capacity = Math.max(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length * 2, length + chunk.length, 256); + const buffer = new Uint8Array(capacity); + buffer.set(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); + __classPrivateFieldSet2(this, _LineDecoder_buffer2, buffer, "f"); + } + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_searchIndex, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"), "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); + } + __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").set(chunk, __classPrivateFieldGet2(this, _LineDecoder_end, "f")); + __classPrivateFieldSet2(this, _LineDecoder_end, __classPrivateFieldGet2(this, _LineDecoder_end, "f") + chunk.length, "f"); + }; + LineDecoder2.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); + LineDecoder2.NEWLINE_REGEXP = /\r\n|[\n\r]/g; + } +}); + +// node_modules/openai/internal/utils/log.mjs +function noop2() { +} +function makeLogFn2(fnLevel, logger, logLevel) { + if (!logger || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) { + return noop2; + } else { + return logger[fnLevel].bind(logger); + } +} +function loggerFor2(client) { + const logger = client.logger; + const logLevel = client.logLevel ?? "off"; + if (!logger) { + return noopLogger2; + } + const cachedLogger = cachedLoggers2.get(logger); + if (cachedLogger && cachedLogger[0] === logLevel) { + return cachedLogger[1]; + } + const levelLogger = { + error: makeLogFn2("error", logger, logLevel), + warn: makeLogFn2("warn", logger, logLevel), + info: makeLogFn2("info", logger, logLevel), + debug: makeLogFn2("debug", logger, logLevel) + }; + cachedLoggers2.set(logger, [logLevel, levelLogger]); + return levelLogger; +} +function isSensitiveQueryParameter(name) { + const normalized = name.toLowerCase().replace(/[-_]/gu, ""); + return sensitiveQueryNames.has(normalized) || sensitiveQueryNames.has(normalized.replace(/^x/u, "")); +} +function isSensitiveHeader(name) { + return sensitiveHeaderNames.has(name.toLowerCase().replace(/_/gu, "-")) || isSensitiveQueryParameter(name); +} +function redactURL(value2) { + const url = new URL(value2); + url.username = ""; + url.password = ""; + url.hash = ""; + for (const name of url.searchParams.keys()) { + if (isSensitiveQueryParameter(name)) { + url.searchParams.set(name, "***"); + } + } + return url.href; +} +var levelNumbers2, parseLogLevel2, noopLogger2, cachedLoggers2, sensitiveQueryNames, sensitiveHeaderNames, formatRequestDetails2; +var init_log2 = __esm({ + "node_modules/openai/internal/utils/log.mjs"() { + init_values2(); + levelNumbers2 = { + off: 0, + error: 200, + warn: 300, + info: 400, + debug: 500 + }; + parseLogLevel2 = (maybeLevel, sourceName, client) => { + if (!maybeLevel) { + return void 0; + } + if (hasOwn2(levelNumbers2, maybeLevel)) { + return maybeLevel; + } + loggerFor2(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers2))}`); + return void 0; + }; + noopLogger2 = { + error: noop2, + warn: noop2, + info: noop2, + debug: noop2 + }; + cachedLoggers2 = /* @__PURE__ */ new WeakMap(); + sensitiveQueryNames = /* @__PURE__ */ new Set([ + "apikey", + "accesstoken", + "refreshtoken", + "sessiontoken", + "sessionid", + "idtoken", + "authtoken", + "authorization", + "token", + "password", + "clientsecret", + "signingsecret", + "xamzsecuritytoken", + "xamzsignature", + "xamzcredential" + ]); + sensitiveHeaderNames = /* @__PURE__ */ new Set([ + "authorization", + "proxy-authorization", + "api-key", + "x-api-key", + "x-amz-security-token", + "cookie", + "set-cookie", + "x-session-token", + "x-session-id", + "x-auth-token", + "x-id-token" + ]); + formatRequestDetails2 = (details) => { + if (details.options) { + details.options = { ...details.options }; + delete details.options["headers"]; + if (details.options.path) { + const path5 = details.options.path; + const redacted = new URL(redactURL(new URL(path5, "https://redacted.invalid").href)); + details.options.path = redacted.origin === "https://redacted.invalid" ? `${path5.startsWith("/") ? "/" : ""}${redacted.pathname.slice(1)}${redacted.search}` : redacted.href; + } + if (details.options.query) { + details.options.query = Object.fromEntries(Object.entries(details.options.query).map(([name, value2]) => [ + name, + isSensitiveQueryParameter(name) ? "***" : value2 + ])); + } + } + if (details.url) { + details.url = redactURL(details.url); + } + if (details.headers) { + details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value2]) => [name, isSensitiveHeader(name) ? "***" : value2])); + } + if ("retryOfRequestLogID" in details) { + if (details.retryOfRequestLogID) { + details.retryOf = details.retryOfRequestLogID; + } + delete details.retryOfRequestLogID; + } + return details; + }; + } +}); + +// node_modules/openai/core/streaming.mjs +function isTransportAbortError(error) { + return !(error instanceof APIError2) && isAbortError2(error); +} +function createStreamTeeQueue() { + let entries2 = []; + let head = 0; + let canceled = false; + return { + get length() { + return entries2.length - head; + }, + get canceled() { + return canceled; + }, + enqueue(value2) { + if (!canceled) { + entries2.push(value2); + } + }, + dequeue() { + if (head === entries2.length) { + return void 0; + } + const value2 = entries2[head]; + entries2[head] = void 0; + head += 1; + if (head === entries2.length) { + entries2 = []; + head = 0; + } else if (head >= 1024 && head * 2 >= entries2.length) { + entries2 = entries2.slice(head); + head = 0; + } + return value2; + }, + cancel() { + canceled = true; + entries2.length = 0; + head = 0; + } + }; +} +function createAbortableSSESource(body, signal) { + const reader = typeof body.getReader === "function" ? body.getReader() : void 0; + const source = reader ? { + next: () => reader.read(), + return: () => reader.cancel() + } : ReadableStreamToAsyncIterable2(body)[Symbol.asyncIterator](); + const ended = { value: void 0, done: true }; + let closed = false; + let canceled = false; + let cancellation; + let interrupt; + const waitForAbort = () => ( + // oxlint-disable-next-line promise/avoid-new -- AbortSignal callbacks need a portable Promise bridge. + new Promise((resolve2) => { + interrupt = resolve2; + }) + ); + const cancel = () => { + if (canceled || closed) { + return cancellation; + } + canceled = true; + try { + cancellation = Promise.resolve(source.return?.()); + } catch (error) { + cancellation = Promise.reject(error); + } + cancellation.catch(() => void 0); + return cancellation; + }; + const abort = () => { + queueMicrotask(() => { + interrupt?.(); + cancel(); + }); + }; + const iterator = { + async next() { + if (signal.aborted) { + return ended; + } + const aborted = waitForAbort().then(() => ended); + try { + const result = await Promise.race([source.next(), aborted]); + if (signal.aborted) { + return ended; + } + if (result.done) { + closed = true; + return ended; + } + return { value: result.value, done: false }; + } catch (error) { + if (signal.aborted && (isAbortError2(error) || error === signal.reason)) { + return ended; + } + throw error; + } finally { + interrupt = void 0; + } + }, + async return() { + const pending = cancel(); + if (pending && !signal.aborted) { + const aborted = waitForAbort(); + try { + if (!signal.aborted) { + await Promise.race([pending, aborted]); + } + } finally { + interrupt = void 0; + } + } + return ended; + }, + [Symbol.asyncIterator]() { + return this; + } + }; + return { + iterator, + start() { + signal.addEventListener("abort", abort, { once: true }); + if (signal.aborted) { + abort(); + } + }, + async cleanup(failed) { + let cleanupError; + try { + signal.removeEventListener("abort", abort); + } catch (error) { + cleanupError = error; + } + if (!closed) { + const pending = cancel(); + if (pending && !failed && !signal.aborted) { + try { + await pending; + } catch (error) { + cleanupError ?? (cleanupError = error); + } + } + } + if (reader) { + try { + reader.releaseLock(); + } catch (error) { + cleanupError ?? (cleanupError = error); + } + } + if (cleanupError !== void 0 && !failed && !signal.aborted) { + throw cleanupError; + } + } + }; +} +async function* _iterSSEMessages2(response, controller) { + if (!response.body) { + controller.abort(); + if (globalThis.navigator !== void 0 && globalThis.navigator.product === "ReactNative") { + throw new OpenAIError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); + } + throw new OpenAIError(`Attempted to iterate over a response with no body`); + } + const sseDecoder = new SSEDecoder2(); + const lineDecoder = new LineDecoder2(); + const { signal } = controller; + const source = createAbortableSSESource(response.body, signal); + let failed = false; + try { + source.start(); + for await (const sseChunk of iterSSEChunks(source.iterator)) { + if (signal.aborted) { + return; + } + for (const line of lineDecoder.decode(sseChunk)) { + if (signal.aborted) { + return; + } + const sse = sseDecoder.decode(line); + if (sse) { + yield sse; + } + } + } + if (signal.aborted) { + return; + } + for (const line of lineDecoder.flush()) { + if (signal.aborted) { + return; + } + const sse = sseDecoder.decode(line); + if (sse) { + yield sse; + } + } + if (signal.aborted) { + return; + } + const pending = sseDecoder.flush(); + if (pending) { + yield pending; + } + } catch (error) { + failed = true; + if (!signal.aborted || !isAbortError2(error) && error !== signal.reason) { + throw error; + } + } finally { + await source.cleanup(failed); + } +} +async function* iterSSEChunks(iterator) { + let data = new Uint8Array(); + let dataStart = 0; + let dataEnd = 0; + let searchStartIndex = 0; + for await (const chunk of iterator) { + if (chunk == null) { + continue; + } + let binaryChunk; + if (chunk instanceof ArrayBuffer) { + binaryChunk = new Uint8Array(chunk); + } else if (typeof chunk === "string") { + binaryChunk = encodeUTF82(chunk); + } else { + binaryChunk = chunk; + } + if (dataEnd + binaryChunk.length > data.length) { + const bufferedLength = dataEnd - dataStart; + if (dataStart >= data.length / 2 && bufferedLength + binaryChunk.length <= data.length) { + data.copyWithin(0, dataStart, dataEnd); + } else { + const newData = new Uint8Array(Math.max(data.length * 2, bufferedLength + binaryChunk.length)); + newData.set(data.subarray(dataStart, dataEnd)); + data = newData; + } + searchStartIndex -= dataStart; + dataStart = 0; + dataEnd = bufferedLength; + } + data.set(binaryChunk, dataEnd); + dataEnd += binaryChunk.length; + let patternIndex; + while ((patternIndex = findDoubleNewlineIndex(data.subarray(searchStartIndex, dataEnd))) !== -1) { + patternIndex += searchStartIndex; + yield data.slice(dataStart, patternIndex); + dataStart = patternIndex; + searchStartIndex = dataStart; + } + searchStartIndex = Math.max(dataStart, dataEnd - DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES); + } + if (dataEnd > dataStart) { + yield data.slice(dataStart, dataEnd); + } +} +function partition2(str2, delimiter) { + const index = str2.indexOf(delimiter); + if (index !== -1) { + return [str2.slice(0, index), delimiter, str2.slice(index + delimiter.length)]; + } + return [str2, "", ""]; +} +var _Stream_instances, _Stream_client2, _Stream_isTeeBranch, _Stream_cancelIterator, Stream2, DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES, SSEDecoder2; +var init_streaming3 = __esm({ + "node_modules/openai/core/streaming.mjs"() { + init_tslib2(); + init_error3(); + init_shims2(); + init_line2(); + init_errors2(); + init_bytes2(); + init_log2(); + Stream2 = class _Stream { + /** Wraps an asynchronous event iterator and the controller that owns its request. */ + constructor(iterator, controller, client) { + _Stream_instances.add(this); + _Stream_client2.set(this, void 0); + _Stream_isTeeBranch.set(this, false); + this.iterator = iterator; + this.controller = controller; + __classPrivateFieldSet2(this, _Stream_client2, client, "f"); + } + /** + * Decodes an SSE response into parsed JSON events. + * + * The resulting stream can be consumed only once, ignores events after `[DONE]`, and + * surfaces API error payloads as `APIError` instances. When + * `synthesizeEventData` is enabled, each item also includes its SSE event name. + */ + static fromSSEResponse(response, controller, client, synthesizeEventData) { + let consumed = false; + const logger = client ? loggerFor2(client) : console; + async function* iterator() { + if (consumed) { + throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + let receivedCompletionSentinel = false; + const messages = _iterSSEMessages2(response, controller); + const closeMessages = messages.return.bind(messages); + messages.return = (value2) => { + if (!receivedCompletionSentinel) { + controller.abort(); + } + return closeMessages(value2); + }; + try { + for await (const sse of messages) { + if (sse.data === "[DONE]") { + receivedCompletionSentinel = true; + break; + } + if (sse.event === null || !sse.event.startsWith("thread.")) { + let data; + try { + data = JSON.parse(sse.data); + } catch { + logger.error(`Could not parse message into JSON:`); + logger.error(`From chunk:`); + throw new SyntaxError("Error reading response: malformed server-sent event JSON."); + } + if (sse.event === "error") { + throw new APIError2(void 0, data?.error ?? data, void 0, response.headers); + } + if (data && data.error) { + throw new APIError2(void 0, data.error, void 0, response.headers); + } + yield synthesizeEventData ? { event: sse.event, data } : data; + } else { + let data; + try { + data = JSON.parse(sse.data); + } catch { + logger.error(`Could not parse message into JSON:`); + logger.error(`From chunk:`); + throw new SyntaxError("Error reading response: malformed server-sent event JSON."); + } + yield { event: sse.event, data }; + } + } + done = true; + } catch (e) { + if (receivedCompletionSentinel || isTransportAbortError(e) || controller.signal.aborted && e === controller.signal.reason) { + return; + } + throw e; + } finally { + if (!done) { + controller.abort(); + } + } + } + return new _Stream(iterator, controller, client); + } + /** + * Generates a Stream from a newline-separated ReadableStream + * where each item is a JSON value. + */ + static fromReadableStream(readableStream, controller, client) { + let consumed = false; + async function* iterLines() { + const lineDecoder = new LineDecoder2(); + const reader = readableStream.getReader(); + let closed = false; + let cancelPromise; + const cancel = () => { + cancelPromise ?? (cancelPromise = reader.cancel()); + cancelPromise.catch(() => void 0); + }; + controller.signal.addEventListener("abort", cancel, { once: true }); + try { + if (controller.signal.aborted) { + cancel(); + return; + } + while (true) { + const { value: chunk, done } = await reader.read(); + if (done) { + closed = true; + break; + } + if (controller.signal.aborted) { + return; + } + for (const line of lineDecoder.decode(chunk)) { + if (controller.signal.aborted) { + return; + } + yield line; + } + } + if (controller.signal.aborted) { + return; + } + for (const line of lineDecoder.flush()) { + if (controller.signal.aborted) { + return; + } + yield line; + } + } finally { + controller.signal.removeEventListener("abort", cancel); + if (!closed) { + cancel(); + } + reader.releaseLock(); + } + } + async function* iterator() { + if (consumed) { + throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const line of iterLines()) { + if (line) { + let data; + try { + data = JSON.parse(line); + } catch (error) { + if (error instanceof SyntaxError) { + throw new SyntaxError("Error reading response: malformed newline-delimited JSON."); + } + throw error; + } + yield data; + } + } + done = true; + } catch (e) { + if (controller.signal.aborted || isAbortError2(e)) { + return; + } + throw e; + } finally { + if (!done) { + controller.abort(); + } + } + } + return new _Stream(iterator, controller, client); + } + /** Starts consuming this stream; attempting to consume it again throws. */ + [(_Stream_client2 = /* @__PURE__ */ new WeakMap(), _Stream_isTeeBranch = /* @__PURE__ */ new WeakMap(), _Stream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + return this.iterator(); + } + /** + * Splits the stream into two streams which can be + * independently read from at different speeds. + * Closing a branch discards its buffered events without stopping its sibling. + * Future reads on that branch finish immediately; previously issued `next()` + * promises remain shared with its sibling and may still resolve with events. + * Closing both branches invokes the source iterator's `return()` when available. + * For {@link Stream.fromReadableStream}, closing both branches before iteration + * starts does not cancel the supplied readable; cancel that readable directly. + */ + tee() { + const { controller } = this; + const left = createStreamTeeQueue(); + const right = createStreamTeeQueue(); + const iterator = this.iterator(); + const teeIterator = (queue) => ({ + next: () => { + if (queue.canceled) { + return Promise.resolve({ value: void 0, done: true }); + } + if (queue.length === 0) { + const result = iterator.next(); + left.enqueue(result); + right.enqueue(result); + } + return queue.dequeue(); + }, + return: async () => { + if (!queue.canceled) { + queue.cancel(); + if (left.canceled && right.canceled) { + await __classPrivateFieldGet2(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iterator, controller); + } + } + return { value: void 0, done: true }; + } + }); + const branch = (queue) => { + const stream5 = new _Stream(() => teeIterator(queue), controller, __classPrivateFieldGet2(this, _Stream_client2, "f")); + __classPrivateFieldSet2(stream5, _Stream_isTeeBranch, true, "f"); + return stream5; + }; + return [branch(left), branch(right)]; + } + /** + * Converts this stream to a newline-separated ReadableStream of + * JSON stringified values in the stream + * which can be turned back into a Stream with `Stream.fromReadableStream()`. + * Canceling a response-backed readable aborts its request. Canceling a tee + * branch discards its buffered events and leaves sibling consumers running. + * Read or serialization failures also release the iterator without replacing the original error. + */ + toReadableStream() { + const { controller } = this; + let iter; + let cancellation; + const cancel = () => cancellation ?? (cancellation = __classPrivateFieldGet2(this, _Stream_instances, "m", _Stream_cancelIterator).call(this, iter, controller)); + return makeReadableStream2({ + start: async () => { + iter = this[Symbol.asyncIterator](); + }, + async pull(ctrl) { + try { + const { value: value2, done } = await iter.next(); + if (done) { + return ctrl.close(); + } + const bytes2 = encodeUTF82(JSON.stringify(value2) + "\n"); + ctrl.enqueue(bytes2); + } catch (err) { + ctrl.error(err); + void cancel().catch(() => void 0); + } + }, + cancel + }); + } + }; + _Stream_cancelIterator = async function _Stream_cancelIterator2(iterator, controller) { + const returnMethod = iterator.return; + if (returnMethod) { + if (!__classPrivateFieldGet2(this, _Stream_isTeeBranch, "f")) { + controller.abort(); + } + await Reflect.apply(returnMethod, iterator, []); + } + }; + DOUBLE_NEWLINE_DELIMITER_MAX_OVERLAP_BYTES = 3; + SSEDecoder2 = class { + constructor() { + this.event = null; + this.data = []; + this.chunks = []; + } + decode(line) { + if (line.endsWith("\r")) { + line = line.slice(0, -1); + } + if (!line) { + if (!this.event && !this.data.length) { + return null; + } + const sse = { + event: this.event, + data: this.data.join("\n"), + raw: this.chunks + }; + this.event = null; + this.data = []; + this.chunks = []; + return sse; + } + this.chunks.push(line); + if (line.startsWith(":")) { + return null; + } + const [fieldname, , initialValue] = partition2(line, ":"); + let value2 = initialValue; + if (value2.startsWith(" ")) { + value2 = value2.slice(1); + } + if (fieldname === "event") { + this.event = value2; + } else if (fieldname === "data") { + this.data.push(value2); + } + return null; + } + /** + * Emits a pending event at EOF when the stream omitted the trailing blank + * line. Returns `null` when no event is in progress so a record that already + * ended with a blank line is not delivered twice. + */ + flush() { + return this.decode(""); + } + }; + } +}); + +// node_modules/openai/internal/parse.mjs +async function defaultParseResponse2(client, props) { + const { response, requestLogID, retryOfRequestLogID, startTime } = props; + let jsonBodyLength; + const body = await (async () => { + if (props.options.stream) { + loggerFor2(client).debug("response", response.status, response.url, response.headers, response.body); + if (props.options.__streamClass) { + return props.options.__streamClass.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); + } + return Stream2.fromSSEResponse(response, props.controller, client, props.options.__synthesizeEventData); + } + if (response.status === 204) { + return null; + } + if (props.options.__binaryResponse) { + return response; + } + const contentType = response.headers.get("content-type"); + const mediaType = contentType?.split(";")[0]?.trim().toLowerCase(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + const contentLength = response.headers.get("content-length"); + if (contentLength === "0") { + return void 0; + } + const bodyText = await response.text(); + if (!bodyText) { + return void 0; + } + const json = JSON.parse(bodyText); + jsonBodyLength = bodyText.length; + return addRequestID(json, response); + } + const text = await response.text(); + return text; + })().catch((error) => { + throw asAbortError(error, props.controller.signal); + }); + if (client.logLevel === "debug") { + loggerFor2(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails2({ + retryOfRequestLogID, + url: response.url, + status: response.status, + body: jsonBodyLength === void 0 ? body : { type: "json", length: jsonBodyLength }, + durationMs: Date.now() - startTime + })); + } + return body; +} +function asAbortError(error, signal) { + if (!signal.aborted || error !== signal.reason || isAbortError2(error)) { + return error; + } + const message = "This operation was aborted"; + const DOMExceptionConstructor = globalThis.DOMException; + return typeof DOMExceptionConstructor === "function" ? new DOMExceptionConstructor(message, "AbortError") : Object.assign(new Error(message), { name: "AbortError" }); +} +function addRequestID(value2, response) { + if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) { + return value2; + } + return Object.defineProperty(value2, "_request_id", { + value: response.headers.get("x-request-id"), + enumerable: false + }); +} +var init_parse2 = __esm({ + "node_modules/openai/internal/parse.mjs"() { + init_streaming3(); + init_errors2(); + init_log2(); + } +}); + +// node_modules/openai/version.mjs +var VERSION2; +var init_version3 = __esm({ + "node_modules/openai/version.mjs"() { + VERSION2 = "7.19.0"; + } +}); + +// node_modules/openai/internal/detect-platform.mjs +function getDetectedPlatform2() { + if (typeof Deno !== "undefined" && Deno.build != null) { + return "deno"; + } + if (typeof EdgeRuntime !== "undefined") { + return "edge"; + } + if (Object.prototype.toString.call(typeof globalThis.process !== "undefined" ? globalThis.process : 0) === "[object process]") { + return "node"; + } + return "unknown"; +} +function getBrowserInfo2() { + if (typeof navigator === "undefined" || !navigator) { + return null; + } + const browserPatterns = [ + { key: "edge", pattern: /\bEdg(?:e|A|iOS)?\b(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } + ]; + for (const { key, pattern } of browserPatterns) { + const match = pattern.exec(navigator.userAgent); + if (match) { + const major = match[1] || 0; + const minor = match[2] || 0; + const patch = match[3] || 0; + return { browser: key, version: `${major}.${minor}.${patch}` }; + } + } + return null; +} +var isRunningInBrowser2, getPlatformProperties2, normalizeArch2, normalizePlatform2, _platformHeaders2, getPlatformHeaders2; +var init_detect_platform2 = __esm({ + "node_modules/openai/internal/detect-platform.mjs"() { + init_version3(); + isRunningInBrowser2 = () => { + return ( + // @ts-ignore + typeof window !== "undefined" && // @ts-ignore + typeof window.document !== "undefined" && // @ts-ignore + typeof navigator !== "undefined" + ); + }; + getPlatformProperties2 = () => { + const detectedPlatform = getDetectedPlatform2(); + if (detectedPlatform === "deno") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": normalizePlatform2(Deno.build.os), + "X-Stainless-Arch": normalizeArch2(Deno.build.arch), + "X-Stainless-Runtime": "deno", + "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" + }; + } + if (typeof EdgeRuntime !== "undefined") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": `other:${EdgeRuntime}`, + "X-Stainless-Runtime": "edge", + "X-Stainless-Runtime-Version": globalThis.process?.version ?? "unknown" + }; + } + if (detectedPlatform === "node") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": normalizePlatform2(globalThis.process.platform ?? "unknown"), + "X-Stainless-Arch": normalizeArch2(globalThis.process.arch ?? "unknown"), + "X-Stainless-Runtime": "node", + "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" + }; + } + const browserInfo = getBrowserInfo2(); + if (browserInfo) { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": `browser:${browserInfo.browser}`, + "X-Stainless-Runtime-Version": browserInfo.version + }; + } + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": VERSION2, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": "unknown", + "X-Stainless-Runtime-Version": "unknown" + }; + }; + normalizeArch2 = (arch) => { + if (arch === "x32") + return "x32"; + if (arch === "x86_64" || arch === "x64") + return "x64"; + if (arch === "arm") + return "arm"; + if (arch === "aarch64" || arch === "arm64") + return "arm64"; + if (arch) + return `other:${arch}`; + return "unknown"; + }; + normalizePlatform2 = (platform) => { + platform = platform.toLowerCase(); + if (platform.includes("ios")) + return "iOS"; + if (platform === "android") + return "Android"; + if (platform === "darwin") + return "MacOS"; + if (platform === "win32") + return "Windows"; + if (platform === "freebsd") + return "FreeBSD"; + if (platform === "openbsd") + return "OpenBSD"; + if (platform === "linux") + return "Linux"; + if (platform) + return `Other:${platform}`; + return "Unknown"; + }; + getPlatformHeaders2 = () => { + return _platformHeaders2 ?? (_platformHeaders2 = getPlatformProperties2()); + }; + } +}); + +// node_modules/openai/internal/request-options.mjs +function observeJSONRequestBody(body, observer) { + let observers = jsonRequestBodyObservers.get(body); + if (!observers) { + observers = /* @__PURE__ */ new Set(); + jsonRequestBodyObservers.set(body, observers); + } + observers.add(observer); + return () => { + const active = jsonRequestBodyObservers.get(body); + if (!active) { + return; + } + active.delete(observer); + if (active.size === 0) { + jsonRequestBodyObservers.delete(body); + } + }; +} +var jsonRequestBodyObservers, FallbackEncoder2; +var init_request_options2 = __esm({ + "node_modules/openai/internal/request-options.mjs"() { + jsonRequestBodyObservers = /* @__PURE__ */ new WeakMap(); + FallbackEncoder2 = ({ headers, body }) => { + const observers = typeof body === "object" && body !== null ? jsonRequestBodyObservers.get(body) : void 0; + let encoded; + if (!observers || observers.size === 0) { + encoded = JSON.stringify(body); + } else { + const active = [...observers]; + encoded = JSON.stringify(body, function(key, value2) { + let observed = value2; + for (const observer of active) { + const replacement = observer.value(this, key, observed); + if (replacement !== void 0) { + observed = replacement; + } + } + return observed; + }); + for (const observer of active) { + observer.complete(); + } + } + return { + bodyHeaders: { + "content-type": "application/json" + }, + body: encoded + }; + }; + } +}); + +// node_modules/openai/internal/qs/formats.mjs +var default_format2, default_formatter2, formatters2, RFC17382; +var init_formats2 = __esm({ + "node_modules/openai/internal/qs/formats.mjs"() { + default_format2 = "RFC3986"; + default_formatter2 = String; + formatters2 = { + RFC1738: (v) => String(v).replace(/%20/g, "+"), + RFC3986: default_formatter2 + }; + RFC17382 = "RFC1738"; + } +}); + +// node_modules/openai/internal/qs/utils.mjs +function is_buffer2(obj2) { + if (!obj2 || typeof obj2 !== "object") { + return false; + } + return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2)); +} +function maybe_map2(val, fn) { + if (isArray2(val)) { + const mapped = []; + for (const item of val) { + mapped.push(fn(item)); + } + return mapped; + } + return fn(val); +} +var cachedHas, has2, hex_table2, limit2, encode2; +var init_utils3 = __esm({ + "node_modules/openai/internal/qs/utils.mjs"() { + init_formats2(); + init_values2(); + has2 = (obj2, key) => { + const resolvedHas = cachedHas ?? Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty); + cachedHas = resolvedHas; + return resolvedHas(obj2, key); + }; + hex_table2 = /* @__PURE__ */ (() => { + const array = []; + for (let i = 0; i < 256; ++i) { + array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); + } + return array; + })(); + limit2 = 1024; + encode2 = (str2, _defaultEncoder, charset, _kind, format) => { + if (str2.length === 0) { + return str2; + } + let string2 = str2; + if (typeof str2 === "symbol") { + string2 = Symbol.prototype.toString.call(str2); + } else if (typeof str2 !== "string") { + string2 = String(str2); + } + if (charset === "iso-8859-1") { + return escape(string2).replace(/%u[0-9a-f]{4}/gi, ($0) => "%26%23" + Number.parseInt($0.slice(2), 16) + "%3B"); + } + let out = ""; + for (let j = 0; j < string2.length; ) { + let segmentEnd = Math.min((Math.floor(j / limit2) + 1) * limit2, string2.length); + if (segmentEnd < string2.length && string2.codePointAt(segmentEnd - 1) > 65535) { + segmentEnd += 1; + } + const segment = string2.length >= limit2 ? string2.slice(j, segmentEnd) : string2; + const arr2 = []; + for (let i = 0; i < segment.length; ++i) { + let c = segment.charCodeAt(i); + if (c === 45 || // - + c === 46 || // . + c === 95 || // _ + c === 126 || // ~ + c >= 48 && c <= 57 || // 0-9 + c >= 65 && c <= 90 || // a-z + c >= 97 && c <= 122 || // A-Z + format === RFC17382 && (c === 40 || c === 41)) { + arr2[arr2.length] = segment.charAt(i); + continue; + } + if (c < 128) { + arr2[arr2.length] = hex_table2[c]; + continue; + } + if (c < 2048) { + arr2[arr2.length] = hex_table2[192 | c >> 6] + hex_table2[128 | c & 63]; + continue; + } + if (c < 55296 || c >= 57344) { + arr2[arr2.length] = hex_table2[224 | c >> 12] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; + continue; + } + i += 1; + c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); + arr2[arr2.length] = hex_table2[240 | c >> 18] + hex_table2[128 | c >> 12 & 63] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; + } + out += arr2.join(""); + j = segmentEnd; + } + return out; + }; + } +}); + +// node_modules/openai/internal/qs/stringify.mjs +function is_non_nullish_primitive2(v) { + return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; +} +function inner_stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder4, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + let obj2 = object; + let tmp_sc = sideChannel; + let step = 0; + let find_flag = false; + while ((tmp_sc = tmp_sc.get(sentinel2)) !== void 0 && !find_flag) { + const pos = tmp_sc.get(object); + step += 1; + if (pos !== void 0) { + if (pos === step) { + throw new RangeError("Cyclic object value"); + } else { + find_flag = true; + } + } + if (tmp_sc.get(sentinel2) === void 0) { + step = 0; + } + } + if (typeof filter === "function") { + obj2 = filter(prefix, obj2); + } else if (obj2 instanceof Date) { + obj2 = serializeDate?.(obj2); + } else if (generateArrayPrefix === "comma" && isArray2(obj2)) { + obj2 = maybe_map2(obj2, (value2) => { + if (value2 instanceof Date) { + return serializeDate?.(value2); + } + return value2; + }); + } + if (obj2 === null) { + if (strictNullHandling) { + return encoder4 && !encodeValuesOnly ? ( + // @ts-expect-error + encoder4(prefix, defaults2.encoder, charset, "key", format) + ) : prefix; + } + obj2 = ""; + } + if (is_non_nullish_primitive2(obj2) || is_buffer2(obj2)) { + if (encoder4) { + const key_value = encodeValuesOnly ? prefix : ( + // @ts-expect-error + encoder4(prefix, defaults2.encoder, charset, "key", format) + ); + return [ + formatter?.(key_value) + "=" + // @ts-expect-error + formatter?.(encoder4(obj2, defaults2.encoder, charset, "value", format)) + ]; + } + return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; + } + const values = []; + if (obj2 === void 0) { + return values; + } + let obj_keys; + if (generateArrayPrefix === "comma" && isArray2(obj2)) { + if (encodeValuesOnly && encoder4) { + obj2 = maybe_map2(obj2, encoder4); + } + obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; + } else if (isArray2(filter)) { + obj_keys = filter; + } else { + const keys = Object.keys(obj2); + if (sort) { + keys.sort(sort); + } + obj_keys = keys; + } + const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); + const adjusted_prefix = commaRoundTrip && isArray2(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; + if (allowEmptyArrays && isArray2(obj2) && obj2.length === 0) { + return adjusted_prefix + "[]"; + } + for (const key of obj_keys) { + const value2 = ( + // @ts-ignore + typeof key === "object" && key.value !== void 0 ? key.value : obj2[key] + ); + if (skipNulls && value2 === null) { + continue; + } + const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + let key_prefix; + if (isArray2(obj2)) { + key_prefix = typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix; + } else { + key_prefix = adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); + } + sideChannel.set(object, step); + const valueSideChannel = new WeakMap([[sentinel2, sideChannel]]); + push_to_array2(values, inner_stringify2( + value2, + key_prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + // @ts-ignore + generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj2) ? null : encoder4, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + return values; +} +function normalize_stringify_options2(opts = defaults2) { + if (opts.allowEmptyArrays !== void 0 && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (opts.encodeDotInKeys !== void 0 && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.encoder !== null && opts.encoder !== void 0 && typeof opts.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + const charset = opts.charset || defaults2.charset; + if (opts.charset !== void 0 && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + let format = default_format2; + if (opts.format !== void 0) { + if (!has2(formatters2, opts.format)) { + throw new TypeError("Unknown format option provided."); + } + format = opts.format; + } + const formatter = formatters2[format]; + let filter = defaults2.filter; + if (typeof opts.filter === "function" || isArray2(opts.filter)) { + filter = opts.filter; + } + let arrayFormat; + if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators2) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults2.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + let allowDots; + if (opts.allowDots === void 0) { + allowDots = !!opts.encodeDotInKeys === true ? true : defaults2.allowDots; + } else { + allowDots = !!opts.allowDots; + } + return { + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, + // @ts-ignore + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + arrayFormat, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: opts.delimiter === void 0 ? defaults2.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, + filter, + format, + formatter, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, + // @ts-ignore + sort: typeof opts.sort === "function" ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; +} +function stringify2(object, opts = {}) { + let obj2 = object; + const options = normalize_stringify_options2(opts); + let obj_keys; + let filter; + if (typeof options.filter === "function") { + filter = options.filter; + obj2 = filter("", obj2); + } else if (isArray2(options.filter)) { + filter = options.filter; + obj_keys = filter; + } + const keys = []; + if (typeof obj2 !== "object" || obj2 === null) { + return ""; + } + const generateArrayPrefix = array_prefix_generators2[options.arrayFormat]; + const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; + if (!obj_keys) { + obj_keys = Object.keys(obj2); + } + if (options.sort) { + obj_keys.sort(options.sort); + } + const sideChannel = /* @__PURE__ */ new WeakMap(); + for (const key of obj_keys) { + if (options.skipNulls && obj2[key] === null) { + continue; + } + push_to_array2(keys, inner_stringify2( + obj2[key], + key, + // @ts-expect-error + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + const joined = keys.join(options.delimiter); + let prefix = options.addQueryPrefix === true ? "?" : ""; if (options.charsetSentinel) { prefix += options.charset === "iso-8859-1" ? ( // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark @@ -4284,13 +21690,13 @@ function stringify(object, opts = {}) { } return joined.length > 0 ? prefix + joined : ""; } -var array_prefix_generators, push_to_array, toISOString, defaults, sentinel; -var init_stringify = __esm({ +var array_prefix_generators2, push_to_array2, toISOString2, defaults2, sentinel2; +var init_stringify2 = __esm({ "node_modules/openai/internal/qs/stringify.mjs"() { - init_utils(); - init_formats(); - init_values(); - array_prefix_generators = { + init_utils3(); + init_formats2(); + init_values2(); + array_prefix_generators2 = { brackets(prefix) { return String(prefix) + "[]"; }, @@ -4302,10 +21708,10 @@ var init_stringify = __esm({ return String(prefix); } }; - push_to_array = function push_to_array2(arr2, value_or_array) { - Array.prototype.push.apply(arr2, isArray(value_or_array) ? value_or_array : [value_or_array]); + push_to_array2 = function push_to_array3(arr2, value_or_array) { + Array.prototype.push.apply(arr2, isArray2(value_or_array) ? value_or_array : [value_or_array]); }; - defaults = { + defaults2 = { addQueryPrefix: false, allowDots: false, allowEmptyArrays: false, @@ -4315,29 +21721,29 @@ var init_stringify = __esm({ delimiter: "&", encode: true, encodeDotInKeys: false, - encoder: encode, + encoder: encode2, encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, + format: default_format2, + formatter: default_formatter2, /** @deprecated */ indices: false, serializeDate(date) { - return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date); + return (toISOString2 ?? (toISOString2 = Function.prototype.call.bind(Date.prototype.toISOString)))(date); }, skipNulls: false, strictNullHandling: false }; - sentinel = {}; + sentinel2 = {}; } }); // node_modules/openai/internal/utils/query.mjs -function stringifyQuery(query) { - return stringify(query, { arrayFormat: "brackets" }); +function stringifyQuery2(query) { + return stringify2(query, { arrayFormat: "brackets" }); } -var init_query = __esm({ +var init_query2 = __esm({ "node_modules/openai/internal/utils/query.mjs"() { - init_stringify(); + init_stringify2(); } }); @@ -4346,7 +21752,7 @@ function resolveDataResidency(options) { if (options.dataResidency === null || options.dataResidency === void 0) { return void 0; } - if (hasOwn(options, "baseURL")) { + if (hasOwn2(options, "baseURL")) { throw new OpenAIError("The `dataResidency` and `baseURL` options are mutually exclusive."); } const endpoint = endpoints.get(options.dataResidency); @@ -4358,8 +21764,8 @@ function resolveDataResidency(options) { var endpoints; var init_data_residency = __esm({ "node_modules/openai/internal/data-residency.mjs"() { - init_error(); - init_values(); + init_error3(); + init_values2(); endpoints = /* @__PURE__ */ new Map([ ["global", "https://api.openai.com/v1"], ["us", "https://us.api.openai.com/v1"], @@ -4370,23 +21776,23 @@ var init_data_residency = __esm({ }); // node_modules/openai/core/api-promise.mjs -var _APIPromise_client, APIPromise; -var init_api_promise = __esm({ +var _APIPromise_client2, APIPromise2; +var init_api_promise2 = __esm({ "node_modules/openai/core/api-promise.mjs"() { - init_tslib(); - init_parse(); - APIPromise = class _APIPromise extends Promise { - constructor(client, responsePromise, parseResponse2 = defaultParseResponse) { - super((resolve) => { - resolve(null); + init_tslib2(); + init_parse2(); + APIPromise2 = class _APIPromise extends Promise { + constructor(client, responsePromise, parseResponse2 = defaultParseResponse2) { + super((resolve2) => { + resolve2(null); }); this.responsePromise = responsePromise; this.parseResponse = parseResponse2; - _APIPromise_client.set(this, void 0); - __classPrivateFieldSet(this, _APIPromise_client, client, "f"); + _APIPromise_client2.set(this, void 0); + __classPrivateFieldSet2(this, _APIPromise_client2, client, "f"); } _thenUnwrap(transform) { - return new _APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response)); + return new _APIPromise(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response)); } /** * Gets the raw `Response` instance instead of parsing the response @@ -4420,7 +21826,7 @@ var init_api_promise = __esm({ } parse() { if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); + this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), data)); } return this.parsedPromise; } @@ -4434,23 +21840,23 @@ var init_api_promise = __esm({ return this.parse().finally(onfinally); } }; - _APIPromise_client = /* @__PURE__ */ new WeakMap(); + _APIPromise_client2 = /* @__PURE__ */ new WeakMap(); } }); // node_modules/openai/core/pagination.mjs -var _AbstractPage_client, AbstractPage, PagePromise, Page, CursorPage, ConversationCursorPage, NextCursorPage, TokenPage; -var init_pagination = __esm({ +var _AbstractPage_client2, AbstractPage2, PagePromise2, Page2, CursorPage, ConversationCursorPage, NextCursorPage, TokenPage; +var init_pagination2 = __esm({ "node_modules/openai/core/pagination.mjs"() { - init_tslib(); - init_error(); - init_parse(); - init_api_promise(); - init_values(); - AbstractPage = class { + init_tslib2(); + init_error3(); + init_parse2(); + init_api_promise2(); + init_values2(); + AbstractPage2 = class { constructor(client, response, body, options) { - _AbstractPage_client.set(this, void 0); - __classPrivateFieldSet(this, _AbstractPage_client, client, "f"); + _AbstractPage_client2.set(this, void 0); + __classPrivateFieldSet2(this, _AbstractPage_client2, client, "f"); this.options = options; this.response = response; this.body = body; @@ -4466,27 +21872,27 @@ var init_pagination = __esm({ if (!nextOptions) { throw new OpenAIError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); } - return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + return await __classPrivateFieldGet2(this, _AbstractPage_client2, "f").requestAPIList(this.constructor, nextOptions); } async *iterPages() { - let page = this; - yield page; - while (page.hasNextPage()) { - page = await page.getNextPage(); - yield page; + let page2 = this; + yield page2; + while (page2.hasNextPage()) { + page2 = await page2.getNextPage(); + yield page2; } } - async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - for await (const page of this.iterPages()) { - for (const item of page.getPaginatedItems()) { + async *[(_AbstractPage_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + for await (const page2 of this.iterPages()) { + for (const item of page2.getPaginatedItems()) { yield item; } } } }; - PagePromise = class extends APIPromise { + PagePromise2 = class extends APIPromise2 { constructor(client, request2, Page3) { - super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse(client2, props), props.options)); + super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse2(client2, props), props.options)); } /** * Allow auto-paginating iteration on an unawaited list call, eg: @@ -4496,13 +21902,13 @@ var init_pagination = __esm({ * } */ async *[Symbol.asyncIterator]() { - const page = await this; - for await (const item of page) { + const page2 = await this; + for await (const item of page2) { yield item; } } }; - Page = class extends AbstractPage { + Page2 = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4515,7 +21921,7 @@ var init_pagination = __esm({ return null; } }; - CursorPage = class extends AbstractPage { + CursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4539,13 +21945,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: id } }; } }; - ConversationCursorPage = class extends AbstractPage { + ConversationCursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4569,13 +21975,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: cursor } }; } }; - NextCursorPage = class extends AbstractPage { + NextCursorPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4599,13 +22005,13 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), after: cursor } }; } }; - TokenPage = class extends AbstractPage { + TokenPage = class extends AbstractPage2 { constructor(client, response, body, options) { super(client, response, body, options); this.data = body.data || []; @@ -4629,7 +22035,7 @@ var init_pagination = __esm({ return { ...this.options, query: { - ...maybeObj(this.options.query), + ...maybeObj2(this.options.query), page: cursor } }; @@ -4719,8 +22125,8 @@ function isUnsafeAccessToken(accessToken) { var SUBJECT_TOKEN_TYPES, TOKEN_EXCHANGE_GRANT_TYPE, MAX_REFRESH_BUFFER_FRACTION, NATIVE_RESPONSE_PROTOTYPE, READ_NATIVE_RESPONSE_BODY, WorkloadIdentityAuth; var init_workload_identity_auth = __esm({ "node_modules/openai/auth/workload-identity-auth.mjs"() { - init_shims(); - init_error(); + init_shims2(); + init_error3(); SUBJECT_TOKEN_TYPES = { jwt: "urn:ietf:params:oauth:token-type:jwt", id: "urn:ietf:params:oauth:token-type:id_token" @@ -4736,12 +22142,12 @@ var init_workload_identity_auth = __esm({ * @param config External identity provider, OpenAI service account, and refresh settings. * @param fetch Optional fetch implementation for calls to the OpenAI token endpoint. */ - constructor(config, fetch2) { + constructor(config2, fetch3) { this.cachedToken = null; this.refreshPromise = null; this.tokenGeneration = 0; this.tokenExchangeUrl = "https://auth.openai.com/oauth/token"; - const { identityProviderId, serviceAccountId, clientId, refreshBufferSeconds, provider: provider2 } = config; + const { identityProviderId, serviceAccountId, clientId, refreshBufferSeconds, provider: provider2 } = config2; this.config = { identityProviderId, serviceAccountId, @@ -4754,7 +22160,7 @@ var init_workload_identity_auth = __esm({ getToken: provider2.getToken.bind(provider2) } }; - this.fetch = fetch2 ?? getDefaultFetch(); + this.fetch = fetch3 ?? getDefaultFetch2(); } /** * Returns a valid OpenAI access token, exchanging or refreshing credentials as needed. @@ -4823,7 +22229,7 @@ var init_workload_identity_auth = __esm({ if (response.status === 400 || response.status === 401 || response.status === 403) { throw new OAuthError(response.status, body2, response.headers); } - throw APIError.generate(response.status, body2, `Token exchange failed with status ${response.status}`, response.headers); + throw APIError2.generate(response.status, body2, `Token exchange failed with status ${response.status}`, response.headers); } const tokenResponse = await parseOAuthTokenResponse(response); const accessToken = typeof tokenResponse === "object" && tokenResponse !== null && "access_token" in tokenResponse ? tokenResponse.access_token : void 0; @@ -4858,10 +22264,10 @@ var init_workload_identity_auth = __esm({ }); // node_modules/openai/internal/auth/x509-api-origin.mjs -function assertX509APIOrigin(value) { +function assertX509APIOrigin(value2) { let target; try { - target = new URL(value); + target = new URL(value2); } catch { throw new OpenAIError("X.509 workload identity requires the approved global mTLS API origin."); } @@ -4878,17 +22284,17 @@ function assertX509APIOrigin(value) { var X509_API_BASE_URL; var init_x509_api_origin = __esm({ "node_modules/openai/internal/auth/x509-api-origin.mjs"() { - init_error(); - init_log(); + init_error3(); + init_log2(); X509_API_BASE_URL = "https://mtls.api.openai.com/v1"; } }); // node_modules/openai/internal/headers.mjs -function* iterateHeaders(headers) { +function* iterateHeaders2(headers) { if (!headers) return; - if (brand_privateNullableHeaders in headers) { + if (brand_privateNullableHeaders2 in headers) { const { values, nulls } = headers; yield* values.entries(); for (const name of nulls) { @@ -4909,31 +22315,31 @@ function* iterateHeaders(headers) { const name = row[0]; if (typeof name !== "string") throw new TypeError("expected header name to be a string"); - const values = isReadonlyArray(row[1]) ? row[1] : [row[1]]; + const values = isReadonlyArray2(row[1]) ? row[1] : [row[1]]; let didClear = false; - for (const value of values) { - if (value === void 0) + for (const value2 of values) { + if (value2 === void 0) continue; if (shouldClear && !didClear) { didClear = true; yield [name, null]; } - yield [name, value]; + yield [name, value2]; } } } -var brand_privateNullableHeaders, httpTokenHeaderName, buildHeaders; -var init_headers2 = __esm({ +var brand_privateNullableHeaders2, httpTokenHeaderName, buildHeaders2; +var init_headers3 = __esm({ "node_modules/openai/internal/headers.mjs"() { - init_values(); - brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders"); + init_values2(); + brand_privateNullableHeaders2 = /* @__PURE__ */ Symbol("brand.privateNullableHeaders"); httpTokenHeaderName = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - buildHeaders = (newHeaders) => { + buildHeaders2 = (newHeaders) => { const targetHeaders = new Headers(); const nullHeaders = /* @__PURE__ */ new Set(); for (const headers of newHeaders) { const seenHeaders = /* @__PURE__ */ new Set(); - for (const [name, value] of iterateHeaders(headers)) { + for (const [name, value2] of iterateHeaders2(headers)) { if (!httpTokenHeaderName.test(name)) { throw new TypeError(`Header name must be a valid HTTP token ["${name}"]`); } @@ -4942,16 +22348,16 @@ var init_headers2 = __esm({ targetHeaders.delete(lowerName); seenHeaders.add(lowerName); } - if (value === null) { + if (value2 === null) { targetHeaders.delete(lowerName); nullHeaders.add(lowerName); } else { - targetHeaders.append(lowerName, value); + targetHeaders.append(lowerName, value2); nullHeaders.delete(lowerName); } } } - return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders }; + return { [brand_privateNullableHeaders2]: true, values: targetHeaders, nulls: nullHeaders }; }; } }); @@ -5050,11 +22456,11 @@ var init_x509_transport_state = __esm({ }); // node_modules/openai/internal/auth/x509-transport-registry.mjs -function resolveX509Transport(value) { - if (!value || typeof value !== "object") { +function resolveX509Transport(value2) { + if (!value2 || typeof value2 !== "object") { throw new OpenAIError("X.509 workload identity requires an approved X.509 transport capability."); } - const registered = findRegisteredX509Transport3(value); + const registered = findRegisteredX509Transport3(value2); if (!registered) { throw new OpenAIError("X.509 workload identity requires an approved X.509 transport capability."); } @@ -5062,7 +22468,7 @@ function resolveX509Transport(value) { } var init_x509_transport_registry = __esm({ "node_modules/openai/internal/auth/x509-transport-registry.mjs"() { - init_error(); + init_error3(); init_x509_transport_state(); } }); @@ -5078,7 +22484,7 @@ function assertSafeHeaders(headers) { } function exchangeDeadline(timeout, callerSignal) { const deadline = new AbortController(); - const timer = timeout === void 0 ? void 0 : setTimeout(() => deadline.abort(new APIConnectionTimeoutError()), timeout); + const timer = timeout === void 0 ? void 0 : setTimeout(() => deadline.abort(new APIConnectionTimeoutError2()), timeout); const timerHandle = timer; if (typeof timerHandle === "object" && timerHandle !== null && "unref" in timerHandle && typeof timerHandle.unref === "function") { timerHandle.unref(); @@ -5100,8 +22506,8 @@ function exchangeDeadline(timeout, callerSignal) { } function waitForRefresh(attempt, signal) { let abort; - const canceled = new Promise((_resolve, reject) => { - abort = () => reject(signal.reason); + const canceled = new Promise((_resolve, reject2) => { + abort = () => reject2(signal.reason); signal.addEventListener("abort", abort, { once: true }); if (signal.aborted) { abort(); @@ -5149,7 +22555,7 @@ function assertX509FetchOptions(options) { return; } for (const name of FORBIDDEN_TRANSPORT_OPTIONS) { - if (hasOwn(options, name)) { + if (hasOwn2(options, name)) { throw new OpenAIError("X.509 workload identity cannot override its approved transport capability."); } } @@ -5160,7 +22566,7 @@ function assertX509FetchOptions(options) { } function assertX509RequestOptions(options) { assertX509FetchOptions(options); - if (options && ["body", "headers", "method", "signal"].some((name) => hasOwn(options, name))) { + if (options && ["body", "headers", "method", "signal"].some((name) => hasOwn2(options, name))) { throw new OpenAIError("X.509 workload identity cannot override its request body, headers, method, or signal through fetch options."); } } @@ -5170,15 +22576,15 @@ function snapshotX509RequestOptions(options) { assertX509RequestOptions(snapshot); return snapshot; } -var _X509WorkloadIdentityAuth_instances, _a, _X509WorkloadIdentityAuth_identityProviderId, _X509WorkloadIdentityAuth_serviceAccountId, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, _X509WorkloadIdentityAuth_organization, _X509WorkloadIdentityAuth_project, _X509WorkloadIdentityAuth_transport, _X509WorkloadIdentityAuth_refreshBufferMs, _X509WorkloadIdentityAuth_cachedToken, _X509WorkloadIdentityAuth_refresh, _X509WorkloadIdentityAuth_tokenGeneration, _X509WorkloadIdentityAuth_cancelRequestBody, _X509WorkloadIdentityAuth_assignToken, _X509WorkloadIdentityAuth_recoverRefreshFailure, _X509WorkloadIdentityAuth_fallbackToken, _X509WorkloadIdentityAuth_retireRefresh, _X509WorkloadIdentityAuth_beginRefresh, _X509WorkloadIdentityAuth_refreshToken, _X509WorkloadIdentityAuth_preflight, _X509WorkloadIdentityAuth_scope, _X509WorkloadIdentityAuth_assertTenantHeaders, FORBIDDEN_TRANSPORT_OPTIONS, headerValue, DEFAULT_REFRESH_BUFFER_MS, FAILED_REFRESH_COOLDOWN_MS, userAbortError, X509WorkloadIdentityAuth; +var _X509WorkloadIdentityAuth_instances, _a2, _X509WorkloadIdentityAuth_identityProviderId, _X509WorkloadIdentityAuth_serviceAccountId, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, _X509WorkloadIdentityAuth_organization, _X509WorkloadIdentityAuth_project, _X509WorkloadIdentityAuth_transport, _X509WorkloadIdentityAuth_refreshBufferMs, _X509WorkloadIdentityAuth_cachedToken, _X509WorkloadIdentityAuth_refresh, _X509WorkloadIdentityAuth_tokenGeneration, _X509WorkloadIdentityAuth_cancelRequestBody, _X509WorkloadIdentityAuth_assignToken, _X509WorkloadIdentityAuth_recoverRefreshFailure, _X509WorkloadIdentityAuth_fallbackToken, _X509WorkloadIdentityAuth_retireRefresh, _X509WorkloadIdentityAuth_beginRefresh, _X509WorkloadIdentityAuth_refreshToken, _X509WorkloadIdentityAuth_preflight, _X509WorkloadIdentityAuth_scope, _X509WorkloadIdentityAuth_assertTenantHeaders, FORBIDDEN_TRANSPORT_OPTIONS, headerValue, DEFAULT_REFRESH_BUFFER_MS, FAILED_REFRESH_COOLDOWN_MS, userAbortError, X509WorkloadIdentityAuth; var init_x509_workload_identity_auth = __esm({ "node_modules/openai/internal/auth/x509-workload-identity-auth.mjs"() { - init_tslib(); - init_error(); - init_headers2(); - init_shims(); - init_log(); - init_values(); + init_tslib2(); + init_error3(); + init_headers3(); + init_shims2(); + init_log2(); + init_values2(); init_x509_api_origin(); init_x509_transport_registry(); init_x509_transport_state(); @@ -5187,7 +22593,7 @@ var init_x509_workload_identity_auth = __esm({ DEFAULT_REFRESH_BUFFER_MS = 20 * 60 * 1e3; FAILED_REFRESH_COOLDOWN_MS = 1e3; userAbortError = (signal) => { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, configurable: true }); return error; }; @@ -5206,80 +22612,80 @@ var init_x509_workload_identity_auth = __esm({ _X509WorkloadIdentityAuth_cachedToken.set(this, void 0); _X509WorkloadIdentityAuth_refresh.set(this, void 0); _X509WorkloadIdentityAuth_tokenGeneration.set(this, 0); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_transport, resolveX509Transport(transport), "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_identityProviderId, identity.identityProviderId, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_serviceAccountId, identity.serviceAccountId, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, identity.refreshBufferMs, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, identity.refreshBufferSeconds, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_organization, organization, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_project, project, "f"); - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_transport, resolveX509Transport(transport), "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_identityProviderId, identity.identityProviderId, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_serviceAccountId, identity.serviceAccountId, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, identity.refreshBufferMs, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, identity.refreshBufferSeconds, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_organization, organization, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_project, project, "f"); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0) { throw new OpenAIError("X.509 workload identity cannot combine refreshBufferSeconds and refreshBufferMs."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f")) || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") < 0)) { + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f")) || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") < 0)) { throw new OpenAIError("X.509 workload identity requires a nonnegative integer refreshBufferMs."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f")) || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") < 0 || !Number.isSafeInteger(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3))) { + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") !== void 0 && (!Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f")) || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") < 0 || !Number.isSafeInteger(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3))) { throw new OpenAIError("X.509 workload identity requires a nonnegative integer refreshBufferSeconds."); } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refreshBufferMs, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") ?? DEFAULT_REFRESH_BUFFER_MS : __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") ?? DEFAULT_REFRESH_BUFFER_MS : __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") * 1e3, "f"); } /** Reconstructs the immutable selectors captured before caller-owned identity mutation. */ identitySnapshot() { return { type: "x509", - identityProviderId: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), - serviceAccountId: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), + identityProviderId: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), + serviceAccountId: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") === void 0 ? {} : { refreshBufferMs: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") }, + ...__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") === void 0 ? {} : { refreshBufferMs: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferMs, "f") }, // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? {} : { refreshBufferSeconds: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") } + ...__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") === void 0 ? {} : { refreshBufferSeconds: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds, "f") } }; } /** Preserves explicitly headerless requests without presenting a certificate to the issuer. */ - static shouldAuthenticate(options, defaultHeaders, requestHeaders2 = options.headers) { - return !buildHeaders([defaultHeaders, requestHeaders2]).nulls.has("authorization"); + static shouldAuthenticate(options, defaultHeaders, requestHeaders = options.headers) { + return !buildHeaders2([defaultHeaders, requestHeaders]).nulls.has("authorization"); } /** Snapshots each caller-owned header layer once while preserving nulls and precedence. */ - snapshotHeaders(defaultHeaders, requestHeaders2) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); - scope.defaultHeaders ?? (scope.defaultHeaders = buildHeaders([defaultHeaders])); - scope.requestHeaders ?? (scope.requestHeaders = buildHeaders([requestHeaders2])); + snapshotHeaders(defaultHeaders, requestHeaders) { + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + scope.defaultHeaders ?? (scope.defaultHeaders = buildHeaders2([defaultHeaders])); + scope.requestHeaders ?? (scope.requestHeaders = buildHeaders2([requestHeaders])); return this.headerSnapshots(); } /** Returns the already rendered caller headers without touching mutable inputs again. */ headerSnapshots() { - const { defaultHeaders, requestHeaders: requestHeaders2 } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); - if (!defaultHeaders || !requestHeaders2) { + const { defaultHeaders, requestHeaders } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + if (!defaultHeaders || !requestHeaders) { throw new OpenAIError("X.509 workload identity requires snapshotted request headers."); } - return { defaultHeaders, requestHeaders: requestHeaders2 }; + return { defaultHeaders, requestHeaders }; } /** Captures enrolled public tenant selectors once before certificate presentation. */ snapshotTenant(organization, project) { - if (organization !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || project !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (organization !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || project !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); scope.tenant = { organization, project }; return scope.tenant; } /** Returns the tenant selectors already approved for this logical request. */ tenantSnapshot() { - const { tenant } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { tenant } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!tenant) { throw new OpenAIError("X.509 workload identity requires snapshotted tenant selectors."); } return tenant; } /** Validates and retains the exact destination that authenticated dispatch will use. */ - snapshotAPIURL(value) { - assertX509APIOrigin(value); - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).apiURL = value; + snapshotAPIURL(value2) { + assertX509APIOrigin(value2); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).apiURL = value2; } /** Reads the already-approved destination without rerendering caller-owned request options. */ requestAPIURL() { - const { apiURL } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { apiURL } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (apiURL === void 0) { throw new OpenAIError("X.509 workload identity requires a snapshotted API destination."); } @@ -5288,11 +22694,11 @@ var init_x509_workload_identity_auth = __esm({ /** Captures the exact caller settings approved for authenticated dispatch. */ snapshotRequest(signal, timeout, fetchOptions) { var _b; - (_b = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this)).request ?? (_b.request = { signal, timeout, fetchOptions }); + (_b = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this)).request ?? (_b.request = { signal, timeout, fetchOptions }); } /** Returns immutable request settings without invoking caller-owned accessors again. */ requestSnapshot() { - const { request: request2 } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { request: request2 } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!request2) { throw new OpenAIError("X.509 workload identity requires snapshotted request settings."); } @@ -5300,7 +22706,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Suspends an already-running network budget during retry-local asynchronous preparation. */ beginRequestPreparation() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (scope.deadlineArmed && scope.preparationStartedAt === void 0) { scope.preparationStartedAt = performance.now(); scope.preparationWallStartedAt = Date.now(); @@ -5308,11 +22714,11 @@ var init_x509_workload_identity_auth = __esm({ } /** Begins local request construction without charging protected hook latency to the network. */ beginRequestPlanning() { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase = "planning"; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase = "planning"; } /** Arms one absolute network deadline only after all local request preparation completes. */ beginRequestNetwork() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (!scope.deadlineArmed) { scope.wallStartedAt = Date.now(); scope.monotonicStartedAt = performance.now(); @@ -5326,11 +22732,11 @@ var init_x509_workload_identity_auth = __esm({ } /** Keeps certificate authentication outside overridable request construction. */ isPlanningRequest() { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase === "planning"; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).phase === "planning"; } /** Approves the final overridden destination and transport before minting a bearer. */ authorizePlannedRequest(url, request2, timeout, allowHookSignal = false) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const headers = Object.getOwnPropertyDescriptor(request2, "headers"); const body = Object.getOwnPropertyDescriptor(request2, "body"); const signal = Object.getOwnPropertyDescriptor(request2, "signal"); @@ -5348,7 +22754,7 @@ var init_x509_workload_identity_auth = __esm({ if (headerValue(headers.value, "Authorization") !== null) { throw new OpenAIError("X.509 workload identity cannot use caller-supplied authorization credentials."); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers.value); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers.value); if (!allowHookSignal && (signal?.value ?? void 0) !== (this.requestSnapshot().signal ?? void 0)) { throw new OpenAIError("X.509 workload identity must preserve its approved request signal."); } @@ -5359,7 +22765,7 @@ var init_x509_workload_identity_auth = __esm({ /** Owns only SDK-created iterator adapters until authenticated dispatch takes responsibility. */ ownRequestBody(body, source) { if (body instanceof ReadableStream && body !== source) { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).materializedBody = body; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).materializedBody = body; } } /** Recognizes every one-shot upload before issuer authentication or request replay. */ @@ -5368,16 +22774,16 @@ var init_x509_workload_identity_auth = __esm({ } /** Retires abandoned upload adapters without masking or blocking their authentication failure. */ retireRequestBody() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const body = scope.materializedBody; delete scope.materializedBody; if (body) { - void __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_cancelRequestBody).call(_a, body); + void __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_cancelRequestBody).call(_a2, body); } } /** Transfers the dispatched upload while retiring any SDK-owned body replaced by a hook. */ releaseRequestBody(body) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); if (scope.materializedBody === body) { delete scope.materializedBody; } else { @@ -5387,21 +22793,21 @@ var init_x509_workload_identity_auth = __esm({ /** Retains caller-only cancellation separately from SDK-created deadline controllers. */ setEffectiveSignal(signal) { if (signal) { - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal = signal; + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal = signal; } else { - delete __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal; + delete __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this).effectiveSignal; } } /** Uses protected-hook cancellation when an authenticated attempt enters retry backoff. */ effectiveSignal() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); return scope.effectiveSignal ?? scope.request?.signal; } /** Establishes an independent scope even when concurrent requests share caller options. */ // oxlint-disable-next-line anti-slop/no-object-parameters -- Logical request owners are opaque identity tokens; their properties are never read. runRequest(operation, requestOwner) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").run(async () => { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").run(async () => { + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope) { throw new OpenAIError("X.509 workload identity requires an active certificate request scope."); } @@ -5420,16 +22826,16 @@ var init_x509_workload_identity_auth = __esm({ /** Reports whether a public request-building call already belongs to an active logical operation. */ // oxlint-disable-next-line anti-slop/no-object-parameters -- Request scope membership compares the opaque caller token by identity only. inRequest(requestOwner) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); return scope?.owner === this && scope.requestOwner === requestOwner && scope.phase !== "authorizing"; } /** Shares a cache only when the complete, privately snapshotted credential identity matches. */ matches(other) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_transport, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_identityProviderId, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_serviceAccountId, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_organization, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_project, "f") && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f") === __classPrivateFieldGet(other, _X509WorkloadIdentityAuth_refreshBufferMs, "f"); + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_transport, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_identityProviderId, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_serviceAccountId, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_organization, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_project, "f") && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f") === __classPrivateFieldGet2(other, _X509WorkloadIdentityAuth_refreshBufferMs, "f"); } /** Binds deferred response parsing to the original logical request and its unchanged deadline. */ continuation() { - const { wallStartedAt, monotonicStartedAt, deadlineArmed, request: request2, requestOwner, effectiveSignal } = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const { wallStartedAt, monotonicStartedAt, deadlineArmed, request: request2, requestOwner, effectiveSignal } = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const scope = { wallStartedAt, monotonicStartedAt, @@ -5443,7 +22849,7 @@ var init_x509_workload_identity_auth = __esm({ // Spread creates an own data property without invoking inherited setters or changing the object prototype. ...requestOwner ? { requestOwner } : {} }; - return (operation) => __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").resume(scope, async () => { + return (operation) => __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").resume(scope, async () => { try { return await operation(); } finally { @@ -5455,7 +22861,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Removes dispatched bearer material before settled request promises can retain their scope. */ releaseRequestCredentials() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); delete scope.request; delete scope.phase; delete scope.deadlineArmed; @@ -5474,28 +22880,28 @@ var init_x509_workload_identity_auth = __esm({ } /** Returns the original authentication start so response consumption shares its request deadline. */ requestStartedAt(_options) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current()?.wallStartedAt; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current()?.wallStartedAt; } /** Distinguishes issued workload credentials from independent admin or headerless requests. */ usedWorkloadToken(_options) { - return __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current()?.token !== void 0; + return __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current()?.token !== void 0; } /** Returns the budget left after certificate authentication without starting another timeout. */ remainingTimeout(_options, timeout) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (scope === void 0) { return timeout; } const remaining = timeout - (performance.now() - scope.monotonicStartedAt); if (remaining <= 0) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } return remaining; } /** Cancels active retry timers promptly without changing public caller-abort semantics. */ async waitForRetry(duration, signal) { try { - await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").sleep(duration, signal); + await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").sleep(duration, signal); } catch (error) { if (signal?.aborted) { throw userAbortError(signal); @@ -5524,11 +22930,11 @@ var init_x509_workload_identity_auth = __esm({ if (options) { assertX509RequestOptions(context ? context.fetchOptions : options.fetchOptions); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_preflight).call(this, context); - const scope = options ? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this) : void 0; - const cached = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f"); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_preflight).call(this, context); + const scope = options ? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this) : void 0; + const cached = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f"); if (cached && performance.now() < cached.refreshAt && Date.now() < cached.wallRefreshAt) { - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, cached); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached); } const remaining = context && options ? this.remainingTimeout(options, context.timeout) : context?.timeout; const { signal, dispose } = exchangeDeadline(remaining, callerSignal); @@ -5536,43 +22942,43 @@ var init_x509_workload_identity_auth = __esm({ dispose(); throw userAbortError(callerSignal); } - const attempt = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") ?? __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_beginRefresh).call(this); + const attempt = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") ?? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_beginRefresh).call(this); attempt.waiters += 1; const waiter = waitForRefresh(attempt, signal); try { const exchanged = await waiter.result; - const refreshed = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f"); + const refreshed = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f"); if (!refreshed || refreshed.accessToken !== exchanged.accessToken) { - throw new APIUserAbortError(); + throw new APIUserAbortError2(); } - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, refreshed); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, refreshed); } catch (error) { - return await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached, scope, options, context); + return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached, scope, options, context); } finally { waiter.dispose(); dispose(); attempt.waiters -= 1; - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_retireRefresh).call(this, attempt); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_retireRefresh).call(this, attempt); } } /** Invalidates only the workload-token generation actually rejected by the current request. */ invalidateToken() { - const rejected = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); - if (!rejected?.token || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f")?.accessToken !== rejected.token || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f").generation !== rejected.tokenGeneration) { + const rejected = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); + if (!rejected?.token || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f")?.accessToken !== rejected.token || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f").generation !== rejected.tokenGeneration) { return; } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_cachedToken, void 0, "f"); - const refresh = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); - refresh?.controller.abort(new APIUserAbortError()); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_cachedToken, void 0, "f"); + const refresh = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + refresh?.controller.abort(new APIUserAbortError2()); } /** Binds the minted credential to the original headers before protected request hooks run. */ bindRequest(options, request2, adminAPIKey) { if (!(request2.headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity requires the original workload authorization headers."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const { token } = scope; const security = options.__security ?? { bearerAuth: true }; let approvedAuthorization = token ? `Bearer ${token}` : null; @@ -5585,7 +22991,7 @@ var init_x509_workload_identity_auth = __esm({ } /** Rebinds an equivalent protected-hook container without relaxing final dispatch identity checks. */ adoptRequestHeaders(request2) { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this); const original = scope.headers; if (!(original instanceof Headers) || !(request2.headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); @@ -5604,11 +23010,11 @@ var init_x509_workload_identity_auth = __esm({ if (!(headers instanceof Headers)) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); } - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope || scope.headers !== headers || scope.authorization === void 0 || headerValue(headers, "Authorization") !== scope.authorization) { throw new OpenAIError("X.509 workload identity must preserve its issued workload authorization."); } - __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers); + __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_assertTenantHeaders).call(this, headers); assertSafeHeaders(headers); } /** Returns a guarded final dispatcher while preserving all existing request hook object identities. */ @@ -5625,13 +23031,13 @@ var init_x509_workload_identity_auth = __esm({ assertSafeHeaders(headers); init.headers = headers; init.redirect = "manual"; - return await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").dispatch(target, init); + return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").dispatch(target, init); }; } }; - _a = X509WorkloadIdentityAuth, _X509WorkloadIdentityAuth_identityProviderId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_serviceAccountId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_organization = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_project = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_transport = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_cachedToken = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refresh = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_tokenGeneration = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_instances = /* @__PURE__ */ new WeakSet(), _X509WorkloadIdentityAuth_cancelRequestBody = async function _X509WorkloadIdentityAuth_cancelRequestBody2(body) { + _a2 = X509WorkloadIdentityAuth, _X509WorkloadIdentityAuth_identityProviderId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_serviceAccountId = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_configuredRefreshBufferSeconds = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_organization = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_project = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_transport = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refreshBufferMs = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_cachedToken = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_refresh = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_tokenGeneration = /* @__PURE__ */ new WeakMap(), _X509WorkloadIdentityAuth_instances = /* @__PURE__ */ new WeakSet(), _X509WorkloadIdentityAuth_cancelRequestBody = async function _X509WorkloadIdentityAuth_cancelRequestBody2(body) { try { - await CancelReadableStream(body); + await CancelReadableStream2(body); } catch { } }, _X509WorkloadIdentityAuth_assignToken = function _X509WorkloadIdentityAuth_assignToken2(scope, token) { @@ -5645,12 +23051,12 @@ var init_x509_workload_identity_auth = __esm({ if (callerSignal?.aborted) { throw userAbortError(callerSignal); } - if (attempt.controller.signal.aborted && attempt.generation !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f")) { + if (attempt.controller.signal.aborted && attempt.generation !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f")) { return await this.getToken(options, context); } - const fallback2 = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached, scope); - if (fallback2 !== void 0) { - return fallback2; + const fallback = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached, scope); + if (fallback !== void 0) { + return fallback; } if (error && typeof error === "object" && !(error instanceof OAuthError)) { const oauth = findX509OAuthError2(error); @@ -5660,10 +23066,10 @@ var init_x509_workload_identity_auth = __esm({ } throw error; }, _X509WorkloadIdentityAuth_fallbackToken = function _X509WorkloadIdentityAuth_fallbackToken2(error, cached, scope) { - if (!cached || cached !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached.expiresAt || Date.now() >= cached.wallExpiresAt || !_a.isRetryableFailure(error)) { + if (!cached || cached !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached.expiresAt || Date.now() >= cached.wallExpiresAt || !_a2.isRetryableFailure(error)) { return void 0; } - const headers = _a.retryHeaders(error); + const headers = _a2.retryHeaders(error); const milliseconds = headers?.get("retry-after-ms"); let requested = milliseconds ? Number(milliseconds) : void 0; const retryAfter = headers?.get("retry-after"); @@ -5674,73 +23080,73 @@ var init_x509_workload_identity_auth = __esm({ const cooldown = requested !== void 0 && Number.isFinite(requested) && requested >= 0 && requested <= 6e4 ? Math.max(FAILED_REFRESH_COOLDOWN_MS, requested) : FAILED_REFRESH_COOLDOWN_MS; cached.refreshAt = Math.min(cached.expiresAt, performance.now() + cooldown); cached.wallRefreshAt = Math.min(cached.wallExpiresAt, Date.now() + cooldown); - return __classPrivateFieldGet(_a, _a, "m", _X509WorkloadIdentityAuth_assignToken).call(_a, scope, cached); + return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached); }, _X509WorkloadIdentityAuth_retireRefresh = function _X509WorkloadIdentityAuth_retireRefresh2(attempt) { - if (attempt.waiters !== 0 || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") !== attempt) { + if (attempt.waiters !== 0 || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") !== attempt) { return; } queueMicrotask(() => { - if (attempt.waiters === 0 && __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f") === attempt) { - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - attempt.controller.abort(new APIUserAbortError()); + if (attempt.waiters === 0 && __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") === attempt) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + attempt.controller.abort(new APIUserAbortError2()); } }); }, _X509WorkloadIdentityAuth_beginRefresh = function _X509WorkloadIdentityAuth_beginRefresh2() { const controller = new AbortController(); - const generation = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"); + const generation = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"); const attempt = { controller, generation, waiters: 0, - promise: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_refreshToken).call(this, controller, generation) + promise: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_refreshToken).call(this, controller, generation) }; - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, attempt, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, attempt, "f"); return attempt; }, _X509WorkloadIdentityAuth_refreshToken = async function _X509WorkloadIdentityAuth_refreshToken2(controller, generation) { const startedAt = performance.now(); const wallStartedAt = Date.now(); try { - const token = await __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").exchange(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), controller.signal); + const token = await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").exchange(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_identityProviderId, "f"), __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_serviceAccountId, "f"), controller.signal); const lifetime = token.expiresIn * 1e3; const expiresAt = startedAt + lifetime; const wallExpiresAt = wallStartedAt + lifetime; if (performance.now() >= expiresAt || Date.now() >= wallExpiresAt) { throw new OpenAIError("X.509 workload identity token expired before its exchange completed."); } - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") !== generation || controller.signal.aborted || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller !== controller) { - throw new APIUserAbortError(); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") !== generation || controller.signal.aborted || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller !== controller) { + throw new APIUserAbortError2(); } - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_cachedToken, { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_tokenGeneration, __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f") + 1, "f"); + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_cachedToken, { accessToken: token.accessToken, - generation: __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"), + generation: __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f"), expiresAt, - refreshAt: expiresAt - Math.min(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2), + refreshAt: expiresAt - Math.min(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2), wallExpiresAt, - wallRefreshAt: wallExpiresAt - Math.min(__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2) + wallRefreshAt: wallExpiresAt - Math.min(__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refreshBufferMs, "f"), lifetime / 2) }, "f"); return token; } finally { - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller === controller) { - __classPrivateFieldSet(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f")?.controller === controller) { + __classPrivateFieldSet2(this, _X509WorkloadIdentityAuth_refresh, void 0, "f"); } } }, _X509WorkloadIdentityAuth_preflight = function _X509WorkloadIdentityAuth_preflight2(context) { if (!context) { return; } - if (context.organization !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || context.project !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (context.organization !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || context.project !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } assertX509APIOrigin(context.apiURL); - const supplied = buildHeaders([context.defaultHeaders, context.requestHeaders]); - if (__classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") !== null && supplied.nulls.has("openai-organization") || __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f") !== null && supplied.nulls.has("openai-project")) { + const supplied2 = buildHeaders2([context.defaultHeaders, context.requestHeaders]); + if (__classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") !== null && supplied2.nulls.has("openai-organization") || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f") !== null && supplied2.nulls.has("openai-project")) { throw new OpenAIError("X.509 workload identity cannot omit its enrolled organization or project."); } - for (const name of supplied.values.keys()) { + for (const name of supplied2.values.keys()) { const canonical2 = name.toLowerCase().split("_").join("-"); - if ((canonical2 === "openai-organization" || canonical2 === "openai-project") && (name !== canonical2 || headerValue(supplied.values, name) !== (canonical2 === "openai-organization" ? context.organization : context.project))) { + if ((canonical2 === "openai-organization" || canonical2 === "openai-project") && (name !== canonical2 || headerValue(supplied2.values, name) !== (canonical2 === "openai-organization" ? context.organization : context.project))) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } if (isSensitiveHeader(canonical2) || canonical2 === "host") { @@ -5748,13 +23154,13 @@ var init_x509_workload_identity_auth = __esm({ } } }, _X509WorkloadIdentityAuth_scope = function _X509WorkloadIdentityAuth_scope2() { - const scope = __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_transport, "f").current(); + const scope = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_transport, "f").current(); if (!scope || scope.owner !== this) { throw new OpenAIError("X.509 workload identity requires an active certificate request scope."); } return scope; }, _X509WorkloadIdentityAuth_assertTenantHeaders = function _X509WorkloadIdentityAuth_assertTenantHeaders2(headers) { - if (headerValue(headers, "OpenAI-Organization") !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_organization, "f") || headerValue(headers, "OpenAI-Project") !== __classPrivateFieldGet(this, _X509WorkloadIdentityAuth_project, "f")) { + if (headerValue(headers, "OpenAI-Organization") !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_organization, "f") || headerValue(headers, "OpenAI-Project") !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_project, "f")) { throw new OpenAIError("X.509 workload identity cannot override its enrolled organization or project."); } for (const name of Headers.prototype.keys.call(headers)) { @@ -5778,8 +23184,8 @@ function normalizeX509CredentialOptions(options) { throw new OpenAIError("An X.509 credential must be created by the SDK authentication helper."); } const conflicting = ["apiKey", "adminAPIKey", "workloadIdentity", "x509Transport"].filter((name) => { - const value = options[name]; - return value !== null && value !== void 0; + const value2 = options[name]; + return value2 !== null && value2 !== void 0; }); if (conflicting.length > 0) { throw new OpenAIError(`The \`credential\` option cannot be combined with ${conflicting.map((name) => `\`${name}\``).join(", ")}.`); @@ -5825,12 +23231,12 @@ function prepareProviderClone(inherited, overrides) { return provider2; } function prepareX509ClientClone(inherited, overrides, credential, currentlyX509) { - const nextIdentity = hasOwn(overrides, "workloadIdentity") ? overrides.workloadIdentity : inherited.workloadIdentity; + const nextIdentity = hasOwn2(overrides, "workloadIdentity") ? overrides.workloadIdentity : inherited.workloadIdentity; const dropping = credential !== void 0 && (overridesOrdinaryAuthentication(overrides) && overrides.workloadIdentity === void 0 || overrides.provider !== void 0); - if (credential !== void 0 && hasOwn(overrides, "workloadIdentity")) { + if (credential !== void 0 && hasOwn2(overrides, "workloadIdentity")) { delete inherited.x509Transport; } - const inheritedCredential = credential !== void 0 && !dropping && overrides.credential === void 0 && !hasOwn(overrides, "workloadIdentity") && !hasOwn(overrides, "x509Transport") ? credential : void 0; + const inheritedCredential = credential !== void 0 && !dropping && overrides.credential === void 0 && !hasOwn2(overrides, "workloadIdentity") && !hasOwn2(overrides, "x509Transport") ? credential : void 0; const nextCredential = overrides.credential === void 0 ? inheritedCredential : overrides.credential; const nextX509 = nextCredential !== void 0 || !dropping && isX509WorkloadIdentity(nextIdentity); if (currentlyX509 !== nextX509) { @@ -5868,8 +23274,8 @@ function prepareX509ClientClone(inherited, overrides, credential, currentlyX509) } var init_x509_credential_options = __esm({ "node_modules/openai/internal/auth/x509-credential-options.mjs"() { - init_error(); - init_values(); + init_error3(); + init_values2(); init_x509_workload_identity_auth(); init_x509_transport_state(); } @@ -5891,20 +23297,20 @@ function toStreamingFile(data, name, options) { ...type ? { type } : {} }; } -function makeFile(fileBits, fileName, options) { - checkFileSupport(); +function makeFile2(fileBits, fileName, options) { + checkFileSupport2(); return new File(fileBits, fileName ?? "unknown_file", options); } -function getName(value, options) { - if (typeof value !== "object" || value === null) { +function getName2(value2, options) { + if (typeof value2 !== "object" || value2 === null) { return void 0; } - const name = "name" in value ? value.name : void 0; - const explicitName = name && String(name) || "filename" in value && value.filename && String(value.filename); + const name = "name" in value2 ? value2.name : void 0; + const explicitName = name && String(name) || "filename" in value2 && value2.filename && String(value2.filename); if (explicitName) { return options?.stripFilename === false ? normalizeFilenamePath(explicitName) : basename(explicitName); } - const url = "url" in value && value.url && String(value.url); + const url = "url" in value2 && value2.url && String(value2.url); if (url) { try { return basename(new URL(url).pathname); @@ -5912,39 +23318,39 @@ function getName(value, options) { return basename(url); } } - const path4 = "path" in value && value.path && String(value.path); - return path4 ? basename(path4) : void 0; + const path5 = "path" in value2 && value2.path && String(value2.path); + return path5 ? basename(path5) : void 0; } -function basename(value) { - return value.split(/[\\/]/).pop() || void 0; +function basename(value2) { + return value2.split(/[\\/]/).pop() || void 0; } -function normalizeFilenamePath(value) { - const normalized = value.replace(/\\/g, "/"); +function normalizeFilenamePath(value2) { + const normalized = value2.replace(/\\/g, "/"); if (normalized.startsWith("/") || /^[A-Za-z]:/.test(normalized) || normalized.split("/").includes("..")) { throw new TypeError("Upload file name must be a safe relative path without parent directory segments"); } return normalized; } -function isArrayBuffer(value) { +function isArrayBuffer(value2) { try { - return arrayBufferByteLengthGetter?.call(value) !== void 0; + return arrayBufferByteLengthGetter?.call(value2) !== void 0; } catch { return false; } } -function supportsFormData(fetchObject) { - const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; - const cached = supportsFormDataMap.get(fetch2); +function supportsFormData2(fetchObject) { + const fetch3 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; + const cached = supportsFormDataMap2.get(fetch3); if (cached) { return cached; } const promise = (async () => { try { let FetchResponse; - if ("Response" in fetch2) { - FetchResponse = fetch2.Response; + if ("Response" in fetch3) { + FetchResponse = fetch3.Response; } else { - const response = await fetch2("data:,"); + const response = await fetch3("data:,"); await response.arrayBuffer(); FetchResponse = response.constructor; } @@ -5957,78 +23363,78 @@ function supportsFormData(fetchObject) { return true; } })(); - supportsFormDataMap.set(fetch2, promise); + supportsFormDataMap2.set(fetch3, promise); return promise; } -async function* iterateMultipartBody(entries, boundary, options, preservedFilenames) { - for await (const { key, value } of entries) { - if (isUploadable(value)) { - const filename = preservedFilenames?.get(value) ?? getStreamingFileName(value, options); - const type = getStreamingFileType(value); - yield encodeUTF8(`--${boundary}\r +async function* iterateMultipartBody(entries2, boundary, options, preservedFilenames) { + for await (const { key, value: value2 } of entries2) { + if (isUploadable(value2)) { + const filename = preservedFilenames?.get(value2) ?? getStreamingFileName(value2, options); + const type = getStreamingFileType(value2); + yield encodeUTF82(`--${boundary}\r `); - yield encodeUTF8(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"; filename="${escapeHeaderValue(filename)}"\r + yield encodeUTF82(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"; filename="${escapeHeaderValue(filename)}"\r Content-Type: ${type}\r \r `); - yield* iterateBytes(getStreamingFileData(value)); + yield* iterateBytes(getStreamingFileData(value2)); } else { - yield encodeUTF8(`--${boundary}\r + yield encodeUTF82(`--${boundary}\r `); - yield encodeUTF8(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"\r + yield encodeUTF82(`Content-Disposition: form-data; name="${escapeHeaderValue(key)}"\r \r -${String(value)}`); +${String(value2)}`); } - yield encodeUTF8("\r\n"); + yield encodeUTF82("\r\n"); } - yield encodeUTF8(`--${boundary}--\r + yield encodeUTF82(`--${boundary}--\r `); } function* iterateFormEntries(body) { if (!body || typeof body !== "object") { return; } - for (const [key, value] of Object.entries(body)) { - yield* iterateFormValue(key, value); + for (const [key, value2] of Object.entries(body)) { + yield* iterateFormValue(key, value2); } } -function* iterateFormValue(key, value) { - if (value === void 0) { +function* iterateFormValue(key, value2) { + if (value2 === void 0) { return; } - if (value == null) { + if (value2 == null) { throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); } - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || isUploadable(value)) { - yield { key, value }; - } else if (Array.isArray(value)) { - for (const entry of value) { - yield* iterateFormValue(key + "[]", entry); + if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean" || isUploadable(value2)) { + yield { key, value: value2 }; + } else if (Array.isArray(value2)) { + for (const entry2 of value2) { + yield* iterateFormValue(key + "[]", entry2); } - } else if (typeof value === "object") { - for (const [name, prop] of Object.entries(value)) { + } else if (typeof value2 === "object") { + for (const [name, prop] of Object.entries(value2)) { yield* iterateFormValue(`${key}[${name}]`, prop); } } else { - throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`); + throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); } } -function getStreamingFileName(value, options) { - if (isStreamingFile(value)) { - const { name } = value; +function getStreamingFileName(value2, options) { + if (isStreamingFile(value2)) { + const { name } = value2; if (typeof name !== "string" || !name) { throw new TypeError("Streaming upload file name must be a non-empty string"); } return options.stripFilenames === false ? normalizeFilenamePath(name) : basename(name) ?? "unknown_file"; } - return getName(value, { stripFilename: options.stripFilenames }) ?? "unknown_file"; + return getName2(value2, { stripFilename: options.stripFilenames }) ?? "unknown_file"; } -function getStreamingFileType(value) { +function getStreamingFileType(value2) { let type; - if (isStreamingFile(value) || isBlob(value)) { - ({ type } = value); - } else if (value instanceof Response) { - type = value.headers.get("content-type") ?? void 0; + if (isStreamingFile(value2) || isBlob(value2)) { + ({ type } = value2); + } else if (value2 instanceof Response) { + type = value2.headers.get("content-type") ?? void 0; } return validateStreamingFileType(type || "application/octet-stream"); } @@ -6044,53 +23450,53 @@ function validateStreamingFileType(type) { } return type; } -function getStreamingFileData(value) { - if (isStreamingFile(value)) { - return value.data; +function getStreamingFileData(value2) { + if (isStreamingFile(value2)) { + return value2.data; } - return value; + return value2; } -async function* iterateBytes(value) { - if (typeof value === "string") { - yield encodeUTF8(value); - } else if (ArrayBuffer.isView(value)) { - yield new Uint8Array(value.buffer, value.byteOffset, value.byteLength); - } else if (isArrayBuffer(value)) { - yield new Uint8Array(value); - } else if (value instanceof Response) { - yield* iterateBytes(value.body || await value.blob()); - } else if (value instanceof Blob) { - if (typeof value.stream === "function") { - yield* iterateBytes(value.stream()); +async function* iterateBytes(value2) { + if (typeof value2 === "string") { + yield encodeUTF82(value2); + } else if (ArrayBuffer.isView(value2)) { + yield new Uint8Array(value2.buffer, value2.byteOffset, value2.byteLength); + } else if (isArrayBuffer(value2)) { + yield new Uint8Array(value2); + } else if (value2 instanceof Response) { + yield* iterateBytes(value2.body || await value2.blob()); + } else if (value2 instanceof Blob) { + if (typeof value2.stream === "function") { + yield* iterateBytes(value2.stream()); } else { - yield new Uint8Array(await value.arrayBuffer()); + yield new Uint8Array(await value2.arrayBuffer()); } - } else if (isReadableStream(value)) { - for await (const chunk of ReadableStreamToAsyncIterable(value)) { + } else if (isReadableStream(value2)) { + for await (const chunk of ReadableStreamToAsyncIterable2(value2)) { yield* iterateBytes(chunk); } - } else if (isAsyncIterable(value)) { - for await (const chunk of value) { + } else if (isAsyncIterable2(value2)) { + for await (const chunk of value2) { yield* iterateBytes(chunk); } } else { - throw new TypeError(`Invalid streaming file chunk: ${String(value)}`); + throw new TypeError(`Invalid streaming file chunk: ${String(value2)}`); } } -function escapeHeaderValue(value) { - return Array.from(value, (character) => { +function escapeHeaderValue(value2) { + return Array.from(value2, (character) => { const codePoint = character.codePointAt(0) ?? 0; return codePoint <= 31 || codePoint === 127 || character === '"' || character === "\\" ? encodeURIComponent(character) : character; }).join(""); } -var brand_privateStreamingFile, checkFileSupport, arrayBufferByteLengthGetter, isAsyncIterable, maybeMultipartFormRequestOptions, multipartFormRequestOptions, supportsFormDataMap, createForm, isBlob, isReadableStream, isStreamingFile, isUploadable, hasStreamingUploadableValue, hasUploadableValue, snapshotPreservedUploadEntries, createStreamingFormRequestOptions, addFormValue; -var init_uploads = __esm({ +var brand_privateStreamingFile, checkFileSupport2, arrayBufferByteLengthGetter, isAsyncIterable2, maybeMultipartFormRequestOptions, multipartFormRequestOptions2, supportsFormDataMap2, createForm2, isBlob, isReadableStream, isStreamingFile, isUploadable, hasStreamingUploadableValue, hasUploadableValue, snapshotPreservedUploadEntries, createStreamingFormRequestOptions, addFormValue2; +var init_uploads3 = __esm({ "node_modules/openai/internal/uploads.mjs"() { - init_headers2(); - init_shims(); - init_bytes(); + init_headers3(); + init_shims2(); + init_bytes2(); brand_privateStreamingFile = /* @__PURE__ */ Symbol("brand.privateStreamingFile"); - checkFileSupport = () => { + checkFileSupport2 = () => { if (typeof File === "undefined") { const { process: process2 } = globalThis; const isOldNode = typeof process2?.versions?.node === "string" && Number.parseInt(process2.versions.node.split("."), 10) < 20; @@ -6098,216 +23504,216 @@ var init_uploads = __esm({ } }; arrayBufferByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get; - isAsyncIterable = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function"; - maybeMultipartFormRequestOptions = async (opts, fetch2, formOptions) => { + isAsyncIterable2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2[Symbol.asyncIterator] === "function"; + maybeMultipartFormRequestOptions = async (opts, fetch3, formOptions) => { if (!hasUploadableValue(opts.body)) { return opts; } if (hasStreamingUploadableValue(opts.body)) { return createStreamingFormRequestOptions(opts, formOptions); } - return { ...opts, body: await createForm(opts.body, fetch2, formOptions) }; + return { ...opts, body: await createForm2(opts.body, fetch3, formOptions) }; }; - multipartFormRequestOptions = async (opts, fetch2, formOptions) => { + multipartFormRequestOptions2 = async (opts, fetch3, formOptions) => { if (hasStreamingUploadableValue(opts.body)) { return createStreamingFormRequestOptions(opts, formOptions); } - return { ...opts, body: await createForm(opts.body, fetch2, formOptions) }; + return { ...opts, body: await createForm2(opts.body, fetch3, formOptions) }; }; - supportsFormDataMap = /* @__PURE__ */ new WeakMap(); - createForm = async (body, fetch2, options = {}) => { - if (!await supportsFormData(fetch2)) { + supportsFormDataMap2 = /* @__PURE__ */ new WeakMap(); + createForm2 = async (body, fetch3, options = {}) => { + if (!await supportsFormData2(fetch3)) { throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); } const form = new FormData(); - await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value, options))); + await Promise.all(Object.entries(body || {}).map(([key, value2]) => addFormValue2(form, key, value2, options))); return form; }; - isBlob = (value) => value instanceof Blob; - isReadableStream = (value) => typeof value === "object" && value !== null && "getReader" in value && typeof value.getReader === "function"; - isStreamingFile = (value) => typeof value === "object" && value !== null && brand_privateStreamingFile in value; - isUploadable = (value) => typeof value === "object" && value !== null && (value instanceof Response || isAsyncIterable(value) || isReadableStream(value) || isStreamingFile(value) || isBlob(value)); - hasStreamingUploadableValue = (value) => { - if (isStreamingFile(value) || isAsyncIterable(value) || isReadableStream(value)) { + isBlob = (value2) => value2 instanceof Blob; + isReadableStream = (value2) => typeof value2 === "object" && value2 !== null && "getReader" in value2 && typeof value2.getReader === "function"; + isStreamingFile = (value2) => typeof value2 === "object" && value2 !== null && brand_privateStreamingFile in value2; + isUploadable = (value2) => typeof value2 === "object" && value2 !== null && (value2 instanceof Response || isAsyncIterable2(value2) || isReadableStream(value2) || isStreamingFile(value2) || isBlob(value2)); + hasStreamingUploadableValue = (value2) => { + if (isStreamingFile(value2) || isAsyncIterable2(value2) || isReadableStream(value2)) { return true; } - if (Array.isArray(value)) { - return value.some(hasStreamingUploadableValue); + if (Array.isArray(value2)) { + return value2.some(hasStreamingUploadableValue); } - if (value && typeof value === "object" && !isBlob(value) && !(value instanceof Response)) { - for (const k of Object.keys(value)) { - if (hasStreamingUploadableValue(value[k])) { + if (value2 && typeof value2 === "object" && !isBlob(value2) && !(value2 instanceof Response)) { + for (const k of Object.keys(value2)) { + if (hasStreamingUploadableValue(value2[k])) { return true; } } } return false; }; - hasUploadableValue = (value) => { - if (isUploadable(value)) { + hasUploadableValue = (value2) => { + if (isUploadable(value2)) { return true; } - if (Array.isArray(value)) { - return value.some(hasUploadableValue); + if (Array.isArray(value2)) { + return value2.some(hasUploadableValue); } - if (value && typeof value === "object") { - for (const k of Object.keys(value)) { - if (hasUploadableValue(value[k])) { + if (value2 && typeof value2 === "object") { + for (const k of Object.keys(value2)) { + if (hasUploadableValue(value2[k])) { return true; } } } return false; }; - snapshotPreservedUploadEntries = (entries, filenames) => { + snapshotPreservedUploadEntries = (entries2, filenames) => { const snapshot = []; - for (const entry of entries) { - if (isUploadable(entry.value) && !filenames.has(entry.value)) { - filenames.set(entry.value, getStreamingFileName(entry.value, { stripFilenames: false })); + for (const entry2 of entries2) { + if (isUploadable(entry2.value) && !filenames.has(entry2.value)) { + filenames.set(entry2.value, getStreamingFileName(entry2.value, { stripFilenames: false })); } - snapshot.push(entry); + snapshot.push(entry2); } return snapshot; }; createStreamingFormRequestOptions = (opts, options = {}) => { - const entries = iterateFormEntries(opts.body); + const entries2 = iterateFormEntries(opts.body); const preservedFilenames = options.stripFilenames === false ? /* @__PURE__ */ new WeakMap() : void 0; - const multipartEntries = preservedFilenames ? snapshotPreservedUploadEntries(entries, preservedFilenames) : entries; + const multipartEntries = preservedFilenames ? snapshotPreservedUploadEntries(entries2, preservedFilenames) : entries2; const boundary = `openai-${Math.random().toString(36).slice(2)}`; - const body = ReadableStreamFrom(iterateMultipartBody(multipartEntries, boundary, options, preservedFilenames)); + const body = ReadableStreamFrom2(iterateMultipartBody(multipartEntries, boundary, options, preservedFilenames)); return { ...opts, body, - headers: buildHeaders([{ "content-type": `multipart/form-data; boundary=${boundary}` }, opts.headers]) + headers: buildHeaders2([{ "content-type": `multipart/form-data; boundary=${boundary}` }, opts.headers]) }; }; - addFormValue = async (form, key, value, options) => { - if (value === void 0) { + addFormValue2 = async (form, key, value2, options) => { + if (value2 === void 0) { return; } - if (value == null) { + if (value2 == null) { throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); } - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - form.append(key, String(value)); - } else if (value instanceof Response) { - const blob = await value.blob(); - form.append(key, makeFile([blob], getName(value, { stripFilename: options.stripFilenames }), { type: blob.type })); - } else if (isAsyncIterable(value)) { - form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value, { stripFilename: options.stripFilenames }))); - } else if (isBlob(value)) { - const filename = getName(value, { stripFilename: options.stripFilenames }); + if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean") { + form.append(key, String(value2)); + } else if (value2 instanceof Response) { + const blob = await value2.blob(); + form.append(key, makeFile2([blob], getName2(value2, { stripFilename: options.stripFilenames }), { type: blob.type })); + } else if (isAsyncIterable2(value2)) { + form.append(key, makeFile2([await new Response(ReadableStreamFrom2(value2)).blob()], getName2(value2, { stripFilename: options.stripFilenames }))); + } else if (isBlob(value2)) { + const filename = getName2(value2, { stripFilename: options.stripFilenames }); if (filename === void 0) { - form.append(key, value); + form.append(key, value2); } else { - form.append(key, value, filename); + form.append(key, value2, filename); } - } else if (Array.isArray(value)) { - const entries = await Promise.all(value.map(async (entry) => { + } else if (Array.isArray(value2)) { + const entries2 = await Promise.all(value2.map(async (entry2) => { const entryForm = new FormData(); - await addFormValue(entryForm, key + "[]", entry, options); + await addFormValue2(entryForm, key + "[]", entry2, options); return entryForm; })); - for (const entryForm of entries) { + for (const entryForm of entries2) { if (!entryForm) { continue; } - for (const [entryKey, entryValue] of entryForm.entries()) { - form.append(entryKey, entryValue); + for (const [entryKey2, entryValue] of entryForm.entries()) { + form.append(entryKey2, entryValue); } } - } else if (typeof value === "object") { - await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop, options))); + } else if (typeof value2 === "object") { + await Promise.all(Object.entries(value2).map(([name, prop]) => addFormValue2(form, `${key}[${name}]`, prop, options))); } else { - throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`); + throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value2} instead`); } }; } }); // node_modules/openai/internal/to-file.mjs -async function toFile(value, name, options) { - checkFileSupport(); - value = await value; - if (isFileLike(value)) { +async function toFile2(value2, name, options) { + checkFileSupport2(); + value2 = await value2; + if (isFileLike2(value2)) { const fileOptions = { ...options, - type: options?.type ?? value.type, - lastModified: options?.lastModified ?? value.lastModified + type: options?.type ?? value2.type, + lastModified: options?.lastModified ?? value2.lastModified }; - if (value instanceof File) { - if (canReuseNativeFile(value, name, options)) { - return value; + if (value2 instanceof File) { + if (canReuseNativeFile(value2, name, options)) { + return value2; } - return makeFile([value], name ?? value.name, fileOptions); + return makeFile2([value2], name ?? value2.name, fileOptions); } - return makeFile([await value.arrayBuffer()], name ?? value.name, fileOptions); + return makeFile2([await value2.arrayBuffer()], name ?? value2.name, fileOptions); } - if (isResponseLike(value)) { - const blob = await value.blob(); - name ?? (name = getName(value)); + if (isResponseLike2(value2)) { + const blob = await value2.blob(); + name ?? (name = getName2(value2)); const responseOptions = options?.type === void 0 && blob.type ? { ...options, type: blob.type } : options; - return makeFile(await getBytes(blob), name, responseOptions); + return makeFile2(await getBytes2(blob), name, responseOptions); } - const parts = await getBytes(value); - name ?? (name = getName(value)); + const parts = await getBytes2(value2); + name ?? (name = getName2(value2)); if (options?.type === void 0) { const typedPart = parts.find((part) => typeof part === "object" && "type" in part && !!part.type); if (typedPart) { options = { ...options, type: typedPart.type }; } } - return makeFile(parts, name, options); + return makeFile2(parts, name, options); } -async function getBytes(value) { +async function getBytes2(value2) { const parts = []; - if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc. - isArrayBuffer(value)) { - parts.push(value); - } else if (isBlobLike(value)) { - parts.push(value instanceof Blob ? value : new Blob([await value.arrayBuffer()], { type: value.type })); - } else if (isAsyncIterable(value)) { - for await (const chunk of value) { - parts.push(...await getBytes(chunk)); + if (typeof value2 === "string" || ArrayBuffer.isView(value2) || // includes Uint8Array, Buffer, etc. + isArrayBuffer(value2)) { + parts.push(value2); + } else if (isBlobLike2(value2)) { + parts.push(value2 instanceof Blob ? value2 : new Blob([await value2.arrayBuffer()], { type: value2.type })); + } else if (isAsyncIterable2(value2)) { + for await (const chunk of value2) { + parts.push(...await getBytes2(chunk)); } } else { - const constructor = value?.constructor?.name; - throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ""}${propsForError(value)}`); + const constructor = value2?.constructor?.name; + throw new Error(`Unexpected data type: ${typeof value2}${constructor ? `; constructor: ${constructor}` : ""}${propsForError2(value2)}`); } return parts; } -function propsForError(value) { - if (typeof value !== "object" || value === null) { +function propsForError2(value2) { + if (typeof value2 !== "object" || value2 === null) { return ""; } - const props = Object.getOwnPropertyNames(value); + const props = Object.getOwnPropertyNames(value2); return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; } -var isBlobLike, isFileLike, isResponseLike, hasFilePropertyOverrides, canReuseNativeFile; -var init_to_file = __esm({ +var isBlobLike2, isFileLike2, isResponseLike2, hasFilePropertyOverrides, canReuseNativeFile; +var init_to_file2 = __esm({ "node_modules/openai/internal/to-file.mjs"() { - init_uploads(); - isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function"; - isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value); - isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function"; - hasFilePropertyOverrides = (value, options) => options?.type != null && options.type !== value.type || options?.lastModified != null && options.lastModified !== value.lastModified || options?.endings != null; - canReuseNativeFile = (value, name, options) => (name == null || name === value.name) && !hasFilePropertyOverrides(value, options); + init_uploads3(); + isBlobLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.size === "number" && typeof value2.type === "string" && typeof value2.text === "function" && typeof value2.slice === "function" && typeof value2.arrayBuffer === "function"; + isFileLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.lastModified === "number" && isBlobLike2(value2); + isResponseLike2 = (value2) => value2 != null && typeof value2 === "object" && typeof value2.url === "string" && typeof value2.blob === "function"; + hasFilePropertyOverrides = (value2, options) => options?.type != null && options.type !== value2.type || options?.lastModified != null && options.lastModified !== value2.lastModified || options?.endings != null; + canReuseNativeFile = (value2, name, options) => (name == null || name === value2.name) && !hasFilePropertyOverrides(value2, options); } }); // node_modules/openai/core/uploads.mjs -var init_uploads2 = __esm({ +var init_uploads4 = __esm({ "node_modules/openai/core/uploads.mjs"() { - init_uploads(); - init_to_file(); + init_uploads3(); + init_to_file2(); } }); // node_modules/openai/core/resource.mjs -var APIResource; -var init_resource = __esm({ +var APIResource2; +var init_resource2 = __esm({ "node_modules/openai/core/resource.mjs"() { - APIResource = class { + APIResource2 = class { constructor(client) { this._client = client; } @@ -6316,43 +23722,43 @@ var init_resource = __esm({ }); // node_modules/openai/internal/utils/path.mjs -function encodeURIPath(str2) { +function encodeURIPath2(str2) { return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); } -var EMPTY, createPathTagFunction, path; -var init_path = __esm({ +var EMPTY2, createPathTagFunction2, path3; +var init_path2 = __esm({ "node_modules/openai/internal/utils/path.mjs"() { - init_error(); - EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); - createPathTagFunction = (pathEncoder = encodeURIPath) => function path4(statics, ...params) { + init_error3(); + EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path5(statics, ...params) { if (statics.length === 1) { return statics[0]; } let postPath = false; const invalidSegments = []; - let path5 = ""; + let path6 = ""; for (let index = 0; index < statics.length; index += 1) { if (index in statics) { const currentValue = statics[index]; if (/[?#]/.test(currentValue)) { postPath = true; } - const value = params[index]; - let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value); - if (index !== params.length && (value == null || // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Path parameters may arrive from JavaScript callers and require runtime validation before URL encoding. - typeof value === "object" && // handle values from other realms - value.toString === Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)?.toString)) { - encoded = value + ""; + const value2 = params[index]; + let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value2); + if (index !== params.length && (value2 == null || // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Path parameters may arrive from JavaScript callers and require runtime validation before URL encoding. + typeof value2 === "object" && // handle values from other realms + value2.toString === Object.getPrototypeOf(Object.getPrototypeOf(value2.hasOwnProperty ?? EMPTY2) ?? EMPTY2)?.toString)) { + encoded = value2 + ""; invalidSegments.push({ - start: path5.length + currentValue.length, + start: path6.length + currentValue.length, length: encoded.length, - error: `Value of type ${Object.prototype.toString.call(value).slice(8, -1)} is not a valid path parameter` + error: `Value of type ${Object.prototype.toString.call(value2).slice(8, -1)} is not a valid path parameter` }); } - path5 += currentValue + (index === params.length ? "" : encoded); + path6 += currentValue + (index === params.length ? "" : encoded); } } - const pathOnly = path5.split(/[?#]/, 1)[0]; + const pathOnly = path6.split(/[?#]/, 1)[0]; const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; let match; while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { @@ -6374,23 +23780,23 @@ var init_path = __esm({ } throw new OpenAIError(`Path parameters result in path with invalid segments: ${invalidSegments.map((e) => e.error).join("\n")} -${path5} +${path6} ${underline}`); } - return path5; + return path6; }; - path = /* @__PURE__ */ createPathTagFunction(encodeURIPath); + path3 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2); } }); // node_modules/openai/resources/chat/completions/messages.mjs -var Messages; -var init_messages = __esm({ +var Messages3; +var init_messages3 = __esm({ "node_modules/openai/resources/chat/completions/messages.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Messages = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Messages3 = class extends APIResource2 { /** * Get the messages in a stored chat completion. Only Chat Completions that have * been created with the `store` parameter set to `true` will be returned. @@ -6406,16 +23812,16 @@ var init_messages = __esm({ * ``` */ list(completionID, query = {}, options) { - return this._client.getAPIList(path`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } }); // node_modules/openai/error.mjs -var init_error2 = __esm({ +var init_error4 = __esm({ "node_modules/openai/error.mjs"() { - init_error(); + init_error3(); } }); @@ -6540,9 +23946,9 @@ function validateInputTools(tools) { } } } -var init_parser = __esm({ +var init_parser3 = __esm({ "node_modules/openai/lib/parser.mjs"() { - init_error2(); + init_error4(); } }); @@ -6624,18 +24030,18 @@ function getTrustedForeignIntrinsic(prototype) { function isTrustedIntrinsicPrototype(prototype) { return trustedIntrinsicPrototypes.has(prototype) || getTrustedForeignIntrinsic(prototype) !== void 0; } -function isCanonicalIntrinsicFunction(value, canonical2, functionPrototype) { +function isCanonicalIntrinsicFunction(value2, canonical2, functionPrototype) { if (canonical2 === void 0) { - return value === void 0; + return value2 === void 0; } - if (typeof value !== "function" || typeof canonical2 !== "function") { + if (typeof value2 !== "function" || typeof canonical2 !== "function") { return false; } const source = functionToString.call(canonical2); - if (functionToString.call(value) !== source) { + if (functionToString.call(value2) !== source) { return false; } - const actualFunctionPrototype = Object.getPrototypeOf(value); + const actualFunctionPrototype = Object.getPrototypeOf(value2); if (actualFunctionPrototype === functionPrototype) { return true; } @@ -6723,33 +24129,33 @@ function isTrustedNativeErrorStack(current, descriptor) { return descriptor.get === canonicalDescriptor.get && descriptor.set === canonicalDescriptor.set; } function createEventQueue() { - let entries = []; + let entries2 = []; let head = 0; return { get length() { - return entries.length - head; + return entries2.length - head; }, - enqueue(value) { - entries.push(value); + enqueue(value2) { + entries2.push(value2); }, dequeue() { - if (head === entries.length) { + if (head === entries2.length) { return void 0; } - const value = entries[head]; - entries[head] = void 0; + const value2 = entries2[head]; + entries2[head] = void 0; head += 1; - if (head === entries.length) { - entries = []; + if (head === entries2.length) { + entries2 = []; head = 0; - } else if (head >= 1024 && head * 2 >= entries.length) { - entries = entries.slice(head); + } else if (head >= 1024 && head * 2 >= entries2.length) { + entries2 = entries2.slice(head); head = 0; } - return value; + return value2; }, clear() { - entries = []; + entries2 = []; head = 0; } }; @@ -6834,15 +24240,15 @@ function estimateRetainedBufferBytes(current, visit3, depth) { } function visitHiddenEventValues(current, kind, visit3) { if (kind === "map") { - for (const [key, entry] of mapEntries.call(current)) { - if (!visit3(key, 8) || !visit3(entry, 8)) { + for (const [key, entry2] of mapEntries.call(current)) { + if (!visit3(key, 8) || !visit3(entry2, 8)) { return false; } } } if (kind === "set") { - for (const entry of setValues.call(current)) { - if (!visit3(entry, 8)) { + for (const entry2 of setValues.call(current)) { + if (!visit3(entry2, 8)) { return false; } } @@ -6851,8 +24257,8 @@ function visitHiddenEventValues(current, kind, visit3) { if (!headersEntries) { return false; } - for (const [name, value] of headersEntries.call(current)) { - if (!visit3(name, 8) || !visit3(value, 8)) { + for (const [name, value2] of headersEntries.call(current)) { + if (!visit3(name, 8) || !visit3(value2, 8)) { return false; } } @@ -6956,7 +24362,7 @@ function visitRetainedEventPrototypes(current, depth, isBlobInternalHandle, visi } return true; } -function inspectBufferedEventGraph(value, remainingBytes) { +function inspectBufferedEventGraph(value2, remainingBytes) { let bytes2 = 0; let scalarBytes = 0; const visited = /* @__PURE__ */ new WeakSet(); @@ -7074,7 +24480,7 @@ function inspectBufferedEventGraph(value, remainingBytes) { } }; try { - visit3(value, 0); + visit3(value2, 0); } catch { return void 0; } @@ -7094,8 +24500,8 @@ function areBufferedRetainedEdgesEqual(first, second) { function getBufferedLedgerNodeBytes(node, owners) { return node.bytes + BUFFERED_LEDGER_NODE_BYTES + node.edges.size * BUFFERED_LEDGER_EDGE_BYTES + owners * BUFFERED_LEDGER_OWNER_BYTES; } -function getBufferedLedgerEntryBytes(entry) { - return BUFFERED_LEDGER_ENTRY_BYTES + entry.scalarBytes + entry.roots.size * BUFFERED_LEDGER_EDGE_BYTES; +function getBufferedLedgerEntryBytes(entry2) { + return BUFFERED_LEDGER_ENTRY_BYTES + entry2.scalarBytes + entry2.roots.size * BUFFERED_LEDGER_EDGE_BYTES; } function collectBufferedLedgerIdentities(roots, candidate, records, work) { const identities = /* @__PURE__ */ new Set(); @@ -7136,8 +24542,8 @@ function getBufferedLedgerChange(identity, graph, records, changes, node) { changes.set(identity, update); return update; } -function findBufferedLedgerAffectedOwners(entry, graph, records, changes, work) { - const affected = /* @__PURE__ */ new Set([entry]); +function findBufferedLedgerAffectedOwners(entry2, graph, records, changes, work) { + const affected = /* @__PURE__ */ new Set([entry2]); for (const [identity, node] of graph.nodes) { work.remaining -= 1; if (work.remaining < 0) { @@ -7193,10 +24599,10 @@ function updateBufferedLedgerMembershipChanges(owner, next, graph, records, chan } return true; } -function collectBufferedLedgerMemberships(entry, graph, affected, records, changes, work) { +function collectBufferedLedgerMemberships(entry2, graph, affected, records, changes, work) { const memberships = /* @__PURE__ */ new Map(); for (const owner of affected) { - const roots = owner === entry ? graph.roots : owner.roots; + const roots = owner === entry2 ? graph.roots : owner.roots; const next = collectBufferedLedgerIdentities(roots, graph.nodes, records, work); if (!next || !updateBufferedLedgerMembershipChanges(owner, next, graph, records, changes, work)) { return void 0; @@ -7205,8 +24611,8 @@ function collectBufferedLedgerMemberships(entry, graph, affected, records, chang } return memberships; } -function projectBufferedLedgerBytes(currentBytes, entry, graph, isNew, changes, records) { - let projected = currentBytes - (isNew ? 0 : getBufferedLedgerEntryBytes(entry)) + getBufferedLedgerEntryBytes(graph); +function projectBufferedLedgerBytes(currentBytes, entry2, graph, isNew, changes, records) { + let projected = currentBytes - (isNew ? 0 : getBufferedLedgerEntryBytes(entry2)) + getBufferedLedgerEntryBytes(graph); for (const [identity, update] of changes) { const previous = records.get(identity); const owners = (previous?.owners.size ?? 0) + update.ownerDelta; @@ -7262,32 +24668,32 @@ function applyBufferedLedgerChanges(records, changes, memberships) { function createBufferedEventLedger() { const records = /* @__PURE__ */ new Map(); let bytes2 = 0; - const reconcile = (entry, graph, isNew) => { + const reconcile = (entry2, graph, isNew) => { const work = { remaining: MAX_BUFFERED_LEDGER_RECONCILIATION_WORK }; const changes = /* @__PURE__ */ new Map(); - const affected = findBufferedLedgerAffectedOwners(entry, graph, records, changes, work); + const affected = findBufferedLedgerAffectedOwners(entry2, graph, records, changes, work); if (!affected) { return false; } - const memberships = collectBufferedLedgerMemberships(entry, graph, affected, records, changes, work); + const memberships = collectBufferedLedgerMemberships(entry2, graph, affected, records, changes, work); if (!memberships) { return false; } - const projectedBytes = projectBufferedLedgerBytes(bytes2, entry, graph, isNew, changes, records); + const projectedBytes = projectBufferedLedgerBytes(bytes2, entry2, graph, isNew, changes, records); if (projectedBytes === void 0) { return false; } applyBufferedLedgerChanges(records, changes, memberships); - entry.scalarBytes = graph.scalarBytes; - entry.roots = graph.roots; + entry2.scalarBytes = graph.scalarBytes; + entry2.roots = graph.roots; bytes2 = projectedBytes; return true; }; - const release = (entry) => { - bytes2 -= getBufferedLedgerEntryBytes(entry); - for (const identity of entry.identities) { + const release = (entry2) => { + bytes2 -= getBufferedLedgerEntryBytes(entry2); + for (const identity of entry2.identities) { const record = records.get(identity); - if (!record?.owners.delete(entry)) { + if (!record?.owners.delete(entry2)) { continue; } bytes2 -= BUFFERED_LEDGER_OWNER_BYTES; @@ -7296,15 +24702,15 @@ function createBufferedEventLedger() { records.delete(identity); } } - entry.identities.clear(); + entry2.identities.clear(); }; return { retain(graph) { - const entry = { scalarBytes: 0, roots: /* @__PURE__ */ new Set(), identities: /* @__PURE__ */ new Set() }; - return reconcile(entry, graph, true) ? entry : void 0; + const entry2 = { scalarBytes: 0, roots: /* @__PURE__ */ new Set(), identities: /* @__PURE__ */ new Set() }; + return reconcile(entry2, graph, true) ? entry2 : void 0; }, - refresh(entry, graph) { - return reconcile(entry, graph, false); + refresh(entry2, graph) { + return reconcile(entry2, graph, false); }, release, clear() { @@ -7316,8 +24722,8 @@ function createBufferedEventLedger() { var _EventStream_instances, _EventStream_connectedPromise, _EventStream_resolveConnectedPromise, _EventStream_rejectConnectedPromise, _EventStream_endPromise, _EventStream_resolveEndPromise, _EventStream_rejectEndPromise, _EventStream_listeners, _EventStream_abortListeners, _EventStream_emittedListenerRegistrations, _EventStream_pendingListenerCleanup, _EventStream_pendingBufferedEventChecks, _EventStream_listenerDispatchDepth, _EventStream_ended, _EventStream_errored, _EventStream_aborted, _EventStream_catchingPromiseCreated, _EventStream_terminalFailure, _EventStream_abortFromSignal, _EventStream_removeAbortListeners, _EventStream_onceForEmitted, _EventStream_removeEmittedListener, _EventStream_cleanupEmittedListeners, _EventStream_handleError, _EventStream_settleTerminalEvent, MAX_BUFFERED_ITERATOR_EVENTS, MAX_BUFFERED_ITERATOR_BYTES, MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS, MAX_BUFFERED_EVENT_DEPTH, bufferedJSONStringify, bufferedJSONParse, sdkOwnedBufferedEventArguments, typedArrayBufferGetter, typedArrayLengthGetter, dataViewBufferGetter, symbolDescriptionGetter, dateTimestampGetter, arrayBufferByteLengthGetter2, sharedArrayBufferByteLengthGetter, errorStackDescriptor, functionToString, objectToString, errorBrandDescriptor, nativeErrorBrand, nativeErrorConstructorSource, nativeDateConstructorSource, nativeFunctionConstructorSource, trustedIntrinsicPrototypes, trustedNativeConstructorSources, canonicalIntrinsicDescriptors, foreignErrorStackDescriptors, nativeProxyDetector, typedArrayConstructorDescriptor, blobInternalHandlePrototype, mapEntries, setValues, headersEntriesDescriptor, headersEntries, retainedStorageBrands, BUFFERED_LEDGER_ENTRY_BYTES, BUFFERED_LEDGER_NODE_BYTES, BUFFERED_LEDGER_EDGE_BYTES, BUFFERED_LEDGER_OWNER_BYTES, MAX_BUFFERED_LEDGER_RECONCILIATION_WORK, EventStream2; var init_EventStream = __esm({ "node_modules/openai/lib/EventStream.mjs"() { - init_tslib(); - init_error2(); + init_tslib2(); + init_error4(); MAX_BUFFERED_ITERATOR_EVENTS = 4096; MAX_BUFFERED_ITERATOR_BYTES = 8 * 1024 * 1024; MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS = 4096; @@ -7341,24 +24747,24 @@ var init_EventStream = __esm({ nativeDateConstructorSource = functionToString.call(Date); nativeFunctionConstructorSource = functionToString.call(Function); trustedIntrinsicPrototypes = /* @__PURE__ */ new Set([ - APIConnectionError.prototype, - APIConnectionTimeoutError.prototype, - APIError.prototype, + APIConnectionError2.prototype, + APIConnectionTimeoutError2.prototype, + APIError2.prototype, OpenAIError.prototype, - APIUserAbortError.prototype, - AuthenticationError.prototype, - BadRequestError.prototype, - ConflictError.prototype, + APIUserAbortError2.prototype, + AuthenticationError2.prototype, + BadRequestError2.prototype, + ConflictError2.prototype, ContentFilterFinishReasonError.prototype, - InternalServerError.prototype, + InternalServerError2.prototype, InvalidWebhookSignatureError.prototype, LengthFinishReasonError.prototype, - NotFoundError.prototype, + NotFoundError2.prototype, OAuthError.prototype, - PermissionDeniedError.prototype, - RateLimitError.prototype, + PermissionDeniedError2.prototype, + RateLimitError2.prototype, SubjectTokenProviderError.prototype, - UnprocessableEntityError.prototype + UnprocessableEntityError2.prototype ]); trustedNativeConstructorSources = /* @__PURE__ */ new Set(); canonicalIntrinsicDescriptors = /* @__PURE__ */ new Map(); @@ -7472,23 +24878,23 @@ var init_EventStream = __esm({ _EventStream_aborted.set(this, false); _EventStream_catchingPromiseCreated.set(this, false); _EventStream_terminalFailure.set(this, void 0); - __classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet(this, _EventStream_resolveConnectedPromise, resolve, "f"); - __classPrivateFieldSet(this, _EventStream_rejectConnectedPromise, reject, "f"); + __classPrivateFieldSet2(this, _EventStream_connectedPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet2(this, _EventStream_resolveConnectedPromise, resolve2, "f"); + __classPrivateFieldSet2(this, _EventStream_rejectConnectedPromise, reject2, "f"); }), "f"); - __classPrivateFieldSet(this, _EventStream_endPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet(this, _EventStream_resolveEndPromise, resolve, "f"); - __classPrivateFieldSet(this, _EventStream_rejectEndPromise, reject, "f"); + __classPrivateFieldSet2(this, _EventStream_endPromise, new Promise((resolve2, reject2) => { + __classPrivateFieldSet2(this, _EventStream_resolveEndPromise, resolve2, "f"); + __classPrivateFieldSet2(this, _EventStream_rejectEndPromise, reject2, "f"); }), "f"); - __classPrivateFieldGet(this, _EventStream_connectedPromise, "f").catch(() => void 0); - __classPrivateFieldGet(this, _EventStream_endPromise, "f").catch(() => void 0); + __classPrivateFieldGet2(this, _EventStream_connectedPromise, "f").catch(() => void 0); + __classPrivateFieldGet2(this, _EventStream_endPromise, "f").catch(() => void 0); } _run(executor) { setTimeout(() => { let failed = false; Promise.resolve().then(executor).catch((error) => { failed = true; - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); }).then(() => { if (failed) { return; @@ -7496,7 +24902,7 @@ var init_EventStream = __esm({ try { this._emitFinal(); } catch (error) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); return; } this._emit("end"); @@ -7507,20 +24913,20 @@ var init_EventStream = __esm({ if (this.ended) { return; } - __classPrivateFieldGet(this, _EventStream_resolveConnectedPromise, "f").call(this); + __classPrivateFieldGet2(this, _EventStream_resolveConnectedPromise, "f").call(this); this._emit("connect"); } /** Whether the stream has finished successfully, failed, or been aborted. */ get ended() { - return __classPrivateFieldGet(this, _EventStream_ended, "f"); + return __classPrivateFieldGet2(this, _EventStream_ended, "f"); } /** Whether an error or user cancellation has been observed. */ get errored() { - return __classPrivateFieldGet(this, _EventStream_errored, "f"); + return __classPrivateFieldGet2(this, _EventStream_errored, "f"); } /** Whether the stream ended because its request was cancelled. */ get aborted() { - return __classPrivateFieldGet(this, _EventStream_aborted, "f"); + return __classPrivateFieldGet2(this, _EventStream_aborted, "f"); } /** * Cancels the underlying request; {@link done} and {@link events} observe cancellation. @@ -7531,7 +24937,7 @@ var init_EventStream = __esm({ } /** Creates a user-abort error retaining this runner's cancellation reason. */ _userAbortError() { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: this.controller.signal.reason, writable: true, @@ -7544,15 +24950,15 @@ var init_EventStream = __esm({ return; } if (signal.aborted) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); return; } - if (__classPrivateFieldGet(this, _EventStream_abortListeners, "f").some((registration) => registration.signal === signal)) { + if (__classPrivateFieldGet2(this, _EventStream_abortListeners, "f").some((registration) => registration.signal === signal)) { return; } - const listener = () => __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); + const listener = () => __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_abortFromSignal).call(this, signal); signal.addEventListener("abort", listener, { once: true }); - __classPrivateFieldGet(this, _EventStream_abortListeners, "f").push({ signal, listener }); + __classPrivateFieldGet2(this, _EventStream_abortListeners, "f").push({ signal, listener }); } /** * Adds the listener function to the end of the listeners array for the event. @@ -7563,7 +24969,7 @@ var init_EventStream = __esm({ */ on(event, listener) { var _a6; - const listeners = (_a6 = __classPrivateFieldGet(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); + const listeners = (_a6 = __classPrivateFieldGet2(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); listeners.push({ listener }); return this; } @@ -7575,13 +24981,13 @@ var init_EventStream = __esm({ * @returns This stream, so that listener registration calls can be chained. */ off(event, listener) { - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; if (!listeners) { return this; } - const emittedRegistration = __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").get(listener); + const emittedRegistration = __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").get(listener); if (emittedRegistration?.event === event && !emittedRegistration.registration.removed && !emittedRegistration.registration.detached) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_removeEmittedListener).call(this, event, emittedRegistration.registration); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_removeEmittedListener).call(this, event, emittedRegistration.registration); return this; } const index = listeners.findIndex((l) => !l.removed && l.listener === listener); @@ -7597,7 +25003,7 @@ var init_EventStream = __esm({ */ once(event, listener) { var _a6; - const listeners = (_a6 = __classPrivateFieldGet(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); + const listeners = (_a6 = __classPrivateFieldGet2(this, _EventStream_listeners, "f"))[event] || (_a6[event] = []); listeners.push({ listener, once: true }); return this; } @@ -7615,22 +25021,22 @@ var init_EventStream = __esm({ * const message = await stream.emitted('message') // rejects if the stream errors */ emitted(event) { - return new Promise((resolve, reject) => { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); + return new Promise((resolve2, reject2) => { + __classPrivateFieldSet2(this, _EventStream_catchingPromiseCreated, true, "f"); const onError = (error) => { this.off(event, onEvent); - reject(error); + reject2(error); }; const onEvent = (...values) => { if (event !== "error") { this.off("error", onError); } - resolve(values.length > 1 ? values : values[0]); + resolve2(values.length > 1 ? values : values[0]); }; if (event !== "error") { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, "error", onError); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, "error", onError); } - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, event, onEvent); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_onceForEmitted).call(this, event, onEvent); }); } /** @@ -7709,11 +25115,11 @@ var init_EventStream = __esm({ this.off("abort", onFailure); } }; - const deactivateBufferedEvent = (entry) => { - entry.active = false; - if (entry.check) { - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").delete(entry.check); - entry.check = void 0; + const deactivateBufferedEvent = (entry2) => { + entry2.active = false; + if (entry2.check) { + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").delete(entry2.check); + entry2.check = void 0; } }; const failBufferedEvents = (discardRetained = false) => { @@ -7726,41 +25132,41 @@ var init_EventStream = __esm({ } const error = new OpenAIError(`Event stream iterator buffer limit exceeded (${MAX_BUFFERED_ITERATOR_EVENTS} events or ${MAX_BUFFERED_ITERATOR_BYTES} bytes); consume events as they arrive.`); try { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_handleError).call(this, error); } finally { this.controller.abort(); } return error; }; - const revalidateBufferedEvent = (value, entry) => { - if (!entry.active || __classPrivateFieldGet(this, _EventStream_ended, "f")) { + const revalidateBufferedEvent = (value2, entry2) => { + if (!entry2.active || __classPrivateFieldGet2(this, _EventStream_ended, "f")) { return; } - const graph = inspectBufferedEventGraph(value, MAX_BUFFERED_ITERATOR_BYTES); - if (!graph || !bufferedLedger.refresh(entry.retention, graph)) { + const graph = inspectBufferedEventGraph(value2, MAX_BUFFERED_ITERATOR_BYTES); + if (!graph || !bufferedLedger.refresh(entry2.retention, graph)) { failBufferedEvents(true); } }; - const push = (value) => { + const push = (value2) => { if (ended) { return; } const reader = readQueue.dequeue(); if (reader) { - reader.resolve({ value, done: false }); + reader.resolve({ value: value2, done: false }); } else { if (pushQueue.length >= MAX_BUFFERED_ITERATOR_EVENTS) { failBufferedEvents(); return; } - const graph = inspectBufferedEventGraph(value, MAX_BUFFERED_ITERATOR_BYTES); + const graph = inspectBufferedEventGraph(value2, MAX_BUFFERED_ITERATOR_BYTES); const retention = graph && bufferedLedger.retain(graph); if (!retention) { failBufferedEvents(); return; } - if (typeof value === "object" && value !== null && sdkOwnedBufferedEventArguments.has(value)) { - const argumentsTuple = value; + if (typeof value2 === "object" && value2 !== null && sdkOwnedBufferedEventArguments.has(value2)) { + const argumentsTuple = value2; for (let index = 0; index < argumentsTuple.length; index += 1) { const argument = argumentsTuple[index]; if (typeof argument === "string") { @@ -7768,15 +25174,15 @@ var init_EventStream = __esm({ } } } - const entry = { retention, active: true, check: void 0 }; - pushQueue.enqueue(value); - bufferedEventSizes.enqueue(entry); + const entry2 = { retention, active: true, check: void 0 }; + pushQueue.enqueue(value2); + bufferedEventSizes.enqueue(entry2); const check = () => { - entry.check = void 0; - revalidateBufferedEvent(value, entry); + entry2.check = void 0; + revalidateBufferedEvent(value2, entry2); }; - entry.check = check; - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").add(check); + entry2.check = check; + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").add(check); } }; const onFailure = (error) => { @@ -7789,7 +25195,7 @@ var init_EventStream = __esm({ if (failure2) { return; } - const terminal = __classPrivateFieldGet(this, _EventStream_terminalFailure, "f"); + const terminal = __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f"); if (!terminal) { return; } @@ -7819,17 +25225,17 @@ var init_EventStream = __esm({ return { next: () => { if (pushQueue.length) { - const value = pushQueue.dequeue(); - const entry = bufferedEventSizes.dequeue(); - deactivateBufferedEvent(entry); - const graph = inspectBufferedEventGraph(value, MAX_BUFFERED_ITERATOR_BYTES); - if (!graph || !bufferedLedger.refresh(entry.retention, graph)) { + const value2 = pushQueue.dequeue(); + const entry2 = bufferedEventSizes.dequeue(); + deactivateBufferedEvent(entry2); + const graph = inspectBufferedEventGraph(value2, MAX_BUFFERED_ITERATOR_BYTES); + if (!graph || !bufferedLedger.refresh(entry2.retention, graph)) { const error = failBufferedEvents(true); failureDelivered = true; return Promise.reject(error); } - bufferedLedger.release(entry.retention); - return Promise.resolve({ value, done: false }); + bufferedLedger.release(entry2.retention); + return Promise.resolve({ value: value2, done: false }); } if (ended || this.ended) { adoptTerminalFailure(); @@ -7841,8 +25247,8 @@ var init_EventStream = __esm({ if (ended) { return Promise.resolve(doneResult()); } - return new Promise((resolve, reject) => { - readQueue.enqueue({ resolve, reject }); + return new Promise((resolve2, reject2) => { + readQueue.enqueue({ resolve: resolve2, reject: reject2 }); }); }, return: () => { @@ -7868,35 +25274,35 @@ var init_EventStream = __esm({ } /** Resolves when the stream ends successfully or rejects when it fails or is aborted. */ async done() { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet(this, _EventStream_endPromise, "f"); + __classPrivateFieldSet2(this, _EventStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet2(this, _EventStream_endPromise, "f"); } /** Returns whether an event currently has one or more registered listeners. */ _hasListeners(event) { - return Boolean(__classPrivateFieldGet(this, _EventStream_listeners, "f")[event]?.some((listener) => !listener.removed)); + return Boolean(__classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]?.some((listener) => !listener.removed)); } /** Dispatches a stream event and performs the associated lifecycle transitions. */ _emit(event, ...args) { - if (__classPrivateFieldGet(this, _EventStream_ended, "f")) { + if (__classPrivateFieldGet2(this, _EventStream_ended, "f")) { return; } if (event === "end") { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_removeAbortListeners).call(this); - __classPrivateFieldSet(this, _EventStream_ended, true, "f"); - __classPrivateFieldGet(this, _EventStream_resolveEndPromise, "f").call(this); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_removeAbortListeners).call(this); + __classPrivateFieldSet2(this, _EventStream_ended, true, "f"); + __classPrivateFieldGet2(this, _EventStream_resolveEndPromise, "f").call(this); } - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; let dispatchError; let dispatchThrew = false; try { if (listeners) { - __classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = listeners.filter((listener) => { + __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event] = listeners.filter((listener) => { if (listener.once) { listener.detached = true; } return !listener.once && !listener.removed; }); - __classPrivateFieldSet(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") + 1, "f"); + __classPrivateFieldSet2(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") + 1, "f"); try { for (const registration of listeners) { if (!registration.removed) { @@ -7905,12 +25311,12 @@ var init_EventStream = __esm({ } } } finally { - __classPrivateFieldSet(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") - 1, "f"); - if (__classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") === 0) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); - for (const check of __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f")) { - __classPrivateFieldGet(this, _EventStream_pendingBufferedEventChecks, "f").delete(check); - if (!__classPrivateFieldGet(this, _EventStream_ended, "f")) { + __classPrivateFieldSet2(this, _EventStream_listenerDispatchDepth, __classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") - 1, "f"); + if (__classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") === 0) { + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); + for (const check of __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f")) { + __classPrivateFieldGet2(this, _EventStream_pendingBufferedEventChecks, "f").delete(check); + if (!__classPrivateFieldGet2(this, _EventStream_ended, "f")) { check(); } } @@ -7922,7 +25328,7 @@ var init_EventStream = __esm({ dispatchThrew = true; } try { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_settleTerminalEvent).call(this, event, args, Boolean(listeners?.length)); + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_settleTerminalEvent).call(this, event, args, Boolean(listeners?.length)); } catch (error) { if (!dispatchThrew) { dispatchError = error; @@ -7944,44 +25350,44 @@ var init_EventStream = __esm({ this.controller.abort(); } }, _EventStream_removeAbortListeners = function _EventStream_removeAbortListeners2() { - for (const { signal, listener } of __classPrivateFieldGet(this, _EventStream_abortListeners, "f").splice(0)) { + for (const { signal, listener } of __classPrivateFieldGet2(this, _EventStream_abortListeners, "f").splice(0)) { signal.removeEventListener("abort", listener); } }, _EventStream_onceForEmitted = function _EventStream_onceForEmitted2(event, listener) { - const previousListeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const previousListeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; const previousLength = previousListeners?.length ?? 0; this.once(event, listener); - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[event]; const [registration] = listeners?.slice(-1) ?? []; if ((previousListeners === void 0 || listeners === previousListeners) && listeners?.length === previousLength + 1 && registration?.listener === listener && registration.once) { - __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").set(listener, { event, registration }); + __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").set(listener, { event, registration }); } }, _EventStream_removeEmittedListener = function _EventStream_removeEmittedListener2(event, registration) { if (registration.removed) { return; } registration.removed = true; - __classPrivateFieldGet(this, _EventStream_emittedListenerRegistrations, "f").delete(registration.listener); - __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f").add(event); - if (__classPrivateFieldGet(this, _EventStream_listenerDispatchDepth, "f") === 0) { - __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); + __classPrivateFieldGet2(this, _EventStream_emittedListenerRegistrations, "f").delete(registration.listener); + __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f").add(event); + if (__classPrivateFieldGet2(this, _EventStream_listenerDispatchDepth, "f") === 0) { + __classPrivateFieldGet2(this, _EventStream_instances, "m", _EventStream_cleanupEmittedListeners).call(this); } }, _EventStream_cleanupEmittedListeners = function _EventStream_cleanupEmittedListeners2() { - for (const event of __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f")) { + for (const event of __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f")) { const eventType = event; - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[eventType]; + const listeners = __classPrivateFieldGet2(this, _EventStream_listeners, "f")[eventType]; if (listeners) { - __classPrivateFieldGet(this, _EventStream_listeners, "f")[eventType] = listeners.filter((listener) => !listener.removed); + __classPrivateFieldGet2(this, _EventStream_listeners, "f")[eventType] = listeners.filter((listener) => !listener.removed); } } - __classPrivateFieldGet(this, _EventStream_pendingListenerCleanup, "f").clear(); + __classPrivateFieldGet2(this, _EventStream_pendingListenerCleanup, "f").clear(); }, _EventStream_handleError = function _EventStream_handleError2(error) { - __classPrivateFieldSet(this, _EventStream_errored, true, "f"); + __classPrivateFieldSet2(this, _EventStream_errored, true, "f"); if (error instanceof Error && error.name === "AbortError") { error = this._userAbortError(); } - if (error instanceof APIUserAbortError) { - __classPrivateFieldSet(this, _EventStream_aborted, true, "f"); + if (error instanceof APIUserAbortError2) { + __classPrivateFieldSet2(this, _EventStream_aborted, true, "f"); return this._emit("abort", error); } if (error instanceof OpenAIError) { @@ -7996,23 +25402,23 @@ var init_EventStream = __esm({ }, _EventStream_settleTerminalEvent = function _EventStream_settleTerminalEvent2(event, args, hasListeners) { if (event === "abort") { const error = args[0]; - __classPrivateFieldSet(this, _EventStream_terminalFailure, __classPrivateFieldGet(this, _EventStream_terminalFailure, "f") ?? { kind: "abort", error }, "f"); - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { + __classPrivateFieldSet2(this, _EventStream_terminalFailure, __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f") ?? { kind: "abort", error }, "f"); + if (!__classPrivateFieldGet2(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { Promise.reject(error); } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectEndPromise, "f").call(this, error); this._emit("end"); return; } if (event === "error") { const error = args[0]; - __classPrivateFieldSet(this, _EventStream_terminalFailure, __classPrivateFieldGet(this, _EventStream_terminalFailure, "f") ?? { kind: "error", error }, "f"); - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { + __classPrivateFieldSet2(this, _EventStream_terminalFailure, __classPrivateFieldGet2(this, _EventStream_terminalFailure, "f") ?? { kind: "error", error }, "f"); + if (!__classPrivateFieldGet2(this, _EventStream_catchingPromiseCreated, "f") && !hasListeners) { Promise.reject(error); } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectConnectedPromise, "f").call(this, error); + __classPrivateFieldGet2(this, _EventStream_rejectEndPromise, "f").call(this, error); this._emit("end"); } }; @@ -8033,7 +25439,7 @@ function normalizeToolCallIds(chatCompletion) { for (const choice of chatCompletion.choices) { for (const toolCall of choice.message.tool_calls ?? []) { if (!toolCall.id) { - toolCall.id = `call_${uuid4()}`; + toolCall.id = `call_${uuid42()}`; } } } @@ -8082,13 +25488,13 @@ function toRequestMessage(message) { } return requestMessage; } -var _AbstractChatCompletionRunner_instances, _a2, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, _AbstractChatCompletionRunner_afterCompletionInvoked, _AbstractChatCompletionRunner_getFinalContent, _AbstractChatCompletionRunner_getFinalMessage, _AbstractChatCompletionRunner_getFinalFunctionToolCall, _AbstractChatCompletionRunner_getFinalFunctionToolCallResult, _AbstractChatCompletionRunner_calculateTotalUsage, _AbstractChatCompletionRunner_throwIfAborted, _AbstractChatCompletionRunner_validateParams, _AbstractChatCompletionRunner_stringifyFunctionCallResult, DEFAULT_MAX_CHAT_COMPLETIONS, AbstractChatCompletionRunner; +var _AbstractChatCompletionRunner_instances, _a3, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, _AbstractChatCompletionRunner_afterCompletionInvoked, _AbstractChatCompletionRunner_getFinalContent, _AbstractChatCompletionRunner_getFinalMessage, _AbstractChatCompletionRunner_getFinalFunctionToolCall, _AbstractChatCompletionRunner_getFinalFunctionToolCallResult, _AbstractChatCompletionRunner_calculateTotalUsage, _AbstractChatCompletionRunner_throwIfAborted, _AbstractChatCompletionRunner_validateParams, _AbstractChatCompletionRunner_stringifyFunctionCallResult, DEFAULT_MAX_CHAT_COMPLETIONS, AbstractChatCompletionRunner; var init_AbstractChatCompletionRunner = __esm({ "node_modules/openai/lib/AbstractChatCompletionRunner.mjs"() { - init_tslib(); - init_error2(); - init_uuid(); - init_parser(); + init_tslib2(); + init_error4(); + init_uuid2(); + init_parser3(); init_chatCompletionUtils(); init_EventStream(); init_RunnableFunction(); @@ -8103,7 +25509,7 @@ var init_AbstractChatCompletionRunner = __esm({ this.messages = []; } _addChatCompletion(chatCompletion) { - __classPrivateFieldSet(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, !this.controller.signal.aborted, "f"); + __classPrivateFieldSet2(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, !this.controller.signal.aborted, "f"); normalizeToolCallIds(chatCompletion); this._chatCompletions.push(chatCompletion); this._emit("chatCompletion", chatCompletion); @@ -8149,7 +25555,7 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalContent() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); } /** * @returns a promise that resolves with the final assistant ChatCompletionMessage response, @@ -8157,7 +25563,7 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalMessage() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); } /** * Waits for completion and returns the last function-tool call, or `undefined` @@ -8165,53 +25571,53 @@ var init_AbstractChatCompletionRunner = __esm({ */ async finalFunctionToolCall() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); } /** Waits for completion and returns the last matching function-tool result, if any. */ async finalFunctionToolCallResult() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); } /** Waits for completion and sums token usage across every chat completion in the run. */ async totalUsage() { await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); } /** Returns a copy of the chat completions received so far, in request order. */ allChatCompletions() { return [...this._chatCompletions]; } _emitFinal() { - if (__classPrivateFieldGet(this, _AbstractChatCompletionRunner_afterCompletionInvoked, "f")) { - __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); + if (__classPrivateFieldGet2(this, _AbstractChatCompletionRunner_afterCompletionInvoked, "f")) { + __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); } const completion = this._chatCompletions[this._chatCompletions.length - 1]; if (completion) { this._emit("finalChatCompletion", completion); } - const finalMessage = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); + const finalMessage = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); if (finalMessage) { this._emit("finalMessage", finalMessage); } - const finalContent = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); + const finalContent = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); if (finalContent) { this._emit("finalContent", finalContent); } - const finalFunctionCall = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); + const finalFunctionCall = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); if (finalFunctionCall) { this._emit("finalFunctionToolCall", finalFunctionCall); } - const finalFunctionCallResult = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); + const finalFunctionCallResult = __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); if (finalFunctionCallResult != null) { this._emit("finalFunctionToolCallResult", finalFunctionCallResult); } if (this._chatCompletions.some((c) => c.usage)) { - this._emit("totalUsage", __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); + this._emit("totalUsage", __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); } } async _createChatCompletion(client, params, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(_a2, _a2, "m", _AbstractChatCompletionRunner_validateParams).call(_a2, params); + __classPrivateFieldGet2(_a3, _a3, "m", _AbstractChatCompletionRunner_validateParams).call(_a3, params); const chatCompletion = await client.chat.completions.create({ ...params, stream: false }, { ...options, signal: this.controller.signal }); this._connected(); return this._addChatCompletion(parseChatCompletion(chatCompletion, params)); @@ -8224,7 +25630,7 @@ var init_AbstractChatCompletionRunner = __esm({ } async _runTools(client, params, runner, options) { const role = "tool"; - const { tool_choice = "auto", stream: stream4, toolContext: inputToolContext, ...restParams } = params; + const { tool_choice = "auto", stream: stream5, toolContext: inputToolContext, ...restParams } = params; const toolContext = inputToolContext; const singleFunctionToCall = ( // oxlint-disable-next-line anti-slop/no-runtime-typeof -- Chat history and tool-choice inputs can contain runtime variants that select different runner behavior. @@ -8235,9 +25641,9 @@ var init_AbstractChatCompletionRunner = __esm({ if (afterCompletion == null) { return; } - __classPrivateFieldSet(this, _AbstractChatCompletionRunner_afterCompletionInvoked, true, "f"); + __classPrivateFieldSet2(this, _AbstractChatCompletionRunner_afterCompletionInvoked, true, "f"); await afterCompletion(completion, runner); - __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); + __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this); }; const inputTools = params.tools.map((tool) => { if (isAutoParsableTool(tool)) { @@ -8334,7 +25740,7 @@ var init_AbstractChatCompletionRunner = __esm({ throw error; } } - const content = __classPrivateFieldGet(_a2, _a2, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(_a2, rawContent); + const content = __classPrivateFieldGet2(_a3, _a3, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(_a3, rawContent); return { message: { role, tool_call_id, content }, functionCalled: true }; }; for (let i = 0; i < maxChatCompletions; ++i) { @@ -8344,7 +25750,7 @@ var init_AbstractChatCompletionRunner = __esm({ tools, messages: this.messages.map(toRequestMessage) }, options); - allowBufferedToolCall = this.controller.signal.aborted && __classPrivateFieldGet(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, "f"); + allowBufferedToolCall = this.controller.signal.aborted && __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_completionArrivedBeforeAbort, "f"); const message = chatCompletion.choices[0]?.message; if (!message) { throw new OpenAIError(`missing message in ChatCompletion response`); @@ -8389,8 +25795,8 @@ var init_AbstractChatCompletionRunner = __esm({ } } }; - _a2 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArrivedBeforeAbort = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_afterCompletionInvoked = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; + _a3 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArrivedBeforeAbort = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_afterCompletionInvoked = /* @__PURE__ */ new WeakMap(), _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { + return __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { let i = this.messages.length; while (i-- > 0) { @@ -8502,8 +25908,8 @@ function parseJSON(jsonString, allowPartial = Allow.ALL) { } return _parseJSON(jsonString.trim(), allowPartial); } -var STR, NUM, ARR, OBJ, NULL, BOOL, NAN, INFINITY, MINUS_INFINITY, INF, SPECIAL, ATOM, COLLECTION, ALL, Allow, PartialJSON, MalformedJSON, _parseJSON, partialParse; -var init_parser2 = __esm({ +var STR, NUM, ARR, OBJ, NULL, BOOL, NAN, INFINITY, MINUS_INFINITY, INF, SPECIAL, ATOM, COLLECTION, ALL, Allow, PartialJSON, MalformedJSON, _parseJSON, partialParse3; +var init_parser4 = __esm({ "node_modules/openai/_vendor/partial-json-parser/parser.mjs"() { STR = 1; NUM = 2; @@ -8625,8 +26031,8 @@ var init_parser2 = __esm({ skipBlank(); index++; try { - const value = parseAny(); - Object.defineProperty(obj2, key, { value, writable: true, enumerable: true, configurable: true }); + const value2 = parseAny(); + Object.defineProperty(obj2, key, { value: value2, writable: true, enumerable: true, configurable: true }); } catch (e) { if (Allow.OBJ & allow) { return obj2; @@ -8697,15 +26103,15 @@ var init_parser2 = __esm({ if (index === length && !(Allow.NUM & allow)) { markPartialJSON("Unterminated number literal"); } - const number = jsonString.substring(start, index); + const number2 = jsonString.substring(start, index); try { - return JSON.parse(number); + return JSON.parse(number2); } catch { - if (number === "-" && Allow.NUM & allow) { + if (number2 === "-" && Allow.NUM & allow) { markPartialJSON("Not sure what '-' is"); } try { - return JSON.parse(number.substring(0, number.lastIndexOf("e"))); + return JSON.parse(number2.substring(0, number2.lastIndexOf("e"))); } catch (e) { throwMalformedError(String(e)); } @@ -8718,21 +26124,21 @@ var init_parser2 = __esm({ }; return parseAny(); }; - partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); + partialParse3 = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); } }); // node_modules/openai/streaming.mjs -var init_streaming2 = __esm({ +var init_streaming4 = __esm({ "node_modules/openai/streaming.mjs"() { - init_streaming(); + init_streaming3(); } }); // node_modules/openai/lib/ChatCompletionStream.mjs function parseStructuredStreamingJSON(content) { try { - return partialParse(content); + return partialParse3(content); } catch (error) { if (error instanceof MalformedJSON || error instanceof SyntaxError) { return parseResponseFormatContent({ type: "json_schema", $parseRaw: void 0 }, content); @@ -8941,14 +26347,14 @@ function mapCapturedSnapshotArray(array, maximum, kind, map3) { } return mapped; } -function validateStructuredJSONSnapshot(value, budget, validationWorkBudget) { +function validateStructuredJSONSnapshot(value2, budget, validationWorkBudget) { const state2 = createPartialJSONParseState(); const parseBudget = budget ?? { bytes: 0, fragments: 0, work: 0 }; - recordPartialJSONFragment(state2, parseBudget, value, validationWorkBudget); + recordPartialJSONFragment(state2, parseBudget, value2, validationWorkBudget); if (!reservePartialJSONParse(state2, parseBudget)) { throw new OpenAIError("Chat completion stream exceeded its structured JSON parse-work limit"); } - return value; + return value2; } function ownFunctionToolIdentity(toolCall) { const type = Object.getOwnPropertyDescriptor(toolCall, "type"); @@ -8972,7 +26378,7 @@ function assertBoundToolCallIdentity(toolCall, identity) { } } function assignOwnProperties(target, source) { - if (Object.prototype.propertyIsEnumerable.call(source, "__proto__") && !hasOwn(target, "__proto__")) { + if (Object.prototype.propertyIsEnumerable.call(source, "__proto__") && !hasOwn2(target, "__proto__")) { Object.defineProperty(target, "__proto__", { value: void 0, writable: true, @@ -8982,22 +26388,22 @@ function assignOwnProperties(target, source) { } return Object.assign(target, source); } -function cloneParserConfigObject(value, stableFields = []) { - const descriptors = Object.getOwnPropertyDescriptors(value); +function cloneParserConfigObject(value2, stableFields = []) { + const descriptors = Object.getOwnPropertyDescriptors(value2); for (const field of stableFields) { const descriptor = descriptors[field]; - if (!descriptor && !(field in value)) { + if (!descriptor && !(field in value2)) { continue; } descriptors[field] = { // oxlint-disable-next-line anti-slop/no-reflect-get -- Generic config cloning must resolve inherited/accessor keys outside the declared config shape. - value: descriptor && "value" in descriptor ? descriptor.value : Reflect.get(value, field, value), + value: descriptor && "value" in descriptor ? descriptor.value : Reflect.get(value2, field, value2), enumerable: descriptor?.enumerable ?? false, configurable: descriptor?.configurable ?? true, writable: descriptor && "writable" in descriptor ? descriptor.writable : false }; } - return Object.create(Object.getPrototypeOf(value), descriptors); + return Object.create(Object.getPrototypeOf(value2), descriptors); } function snapshotChatCompletionParserParams(params) { const snapshot = cloneParserConfigObject(params); @@ -9041,7 +26447,7 @@ function snapshotChatCompletionParserParams(params) { } return snapshot; } -function canonicalSerializedParserSchema(value, budget) { +function canonicalSerializedParserSchema(value2, budget) { const ancestors = /* @__PURE__ */ new WeakSet(); const charge = (bytes2) => { if (!Number.isSafeInteger(bytes2) || bytes2 < 0 || budget.bytes + bytes2 > MAX_SERIALIZED_PARSER_SCHEMA_BYTES) { @@ -9130,7 +26536,7 @@ function canonicalSerializedParserSchema(value, budget) { if (keys.length > MAX_SERIALIZED_PARSER_SCHEMA_NODES - budget.nodes) { return UNSAFE_SERIALIZED_PARSER_VALUE; } - const entries = []; + const entries2 = []; for (const key of keys) { if (typeof key !== "string") { continue; @@ -9145,17 +26551,17 @@ function canonicalSerializedParserSchema(value, budget) { if (!("value" in descriptor)) { return UNSAFE_SERIALIZED_PARSER_VALUE; } - entries.push([key, descriptor.value]); + entries2.push([key, descriptor.value]); } - entries.sort(([left], [right]) => { + entries2.sort(([left], [right]) => { if (left === right) { return 0; } return left < right ? -1 : 1; }); const fields = []; - for (const [key, entry] of entries) { - const normalized = visit3(entry, depth + 1); + for (const [key, entry2] of entries2) { + const normalized = visit3(entry2, depth + 1); if (normalized === UNSAFE_SERIALIZED_PARSER_VALUE) { return normalized; } @@ -9173,7 +26579,7 @@ function canonicalSerializedParserSchema(value, budget) { } }; try { - const normalized = visit3(value, 0); + const normalized = visit3(value2, 0); return typeof normalized === "string" ? normalized : void 0; } catch { return void 0; @@ -9190,13 +26596,13 @@ function rememberSerializedParserSchema(signatures, source, holder, key) { signatures.set(source, normalized); } } -function hasMatchingSerializedParserSchema(signatures, source, holder, key, value) { +function hasMatchingSerializedParserSchema(signatures, source, holder, key, value2) { const expected = source && signatures.get(source); const descriptor = Object.getOwnPropertyDescriptor(holder, key); - return expected !== void 0 && descriptor !== void 0 && "value" in descriptor && canonicalSerializedParserSchema(value, { nodes: 0, bytes: 0 }) === expected; + return expected !== void 0 && descriptor !== void 0 && "value" in descriptor && canonicalSerializedParserSchema(value2, { nodes: 0, bytes: 0 }) === expected; } -function serializedParserDescriptor(descriptor, value) { - return descriptor && "value" in descriptor ? { ...descriptor, value } : { configurable: true, enumerable: true, writable: true, value }; +function serializedParserDescriptor(descriptor, value2) { + return descriptor && "value" in descriptor ? { ...descriptor, value: value2 } : { configurable: true, enumerable: true, writable: true, value: value2 }; } function shadowSerializedParserMetadata(descriptors, source, fields) { for (const field of fields) { @@ -9251,8 +26657,8 @@ function ownSerializedParserObject(holder, key) { if (!descriptor || !("value" in descriptor)) { return void 0; } - const { value } = descriptor; - return typeof value === "object" && value !== null ? value : void 0; + const { value: value2 } = descriptor; + return typeof value2 === "object" && value2 !== null ? value2 : void 0; } function observeSerializedChatCompletionParserParams(body, initial, update) { const originalToolOwners = /* @__PURE__ */ new WeakMap(); @@ -9273,7 +26679,7 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { if (initial.response_format) { rememberSerializedParserSchema(originalSchemaSignatures, initial.response_format, initial.response_format, "json_schema"); } - let root; + let root2; let tools; let responseFormat; let responseFrame; @@ -9282,9 +26688,9 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { let actualToolOwners = /* @__PURE__ */ new Map(); let functionFrames = /* @__PURE__ */ new WeakMap(); return observeJSONRequestBody(body, { - value(holder, key, value) { - if (!root && key === "" && typeof value === "object" && value !== null) { - root = value; + value(holder, key, value2) { + if (!root2 && key === "" && typeof value2 === "object" && value2 !== null) { + root2 = value2; tools = void 0; responseFormat = void 0; responseFrame = void 0; @@ -9294,9 +26700,9 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { functionFrames = /* @__PURE__ */ new WeakMap(); return; } - if (holder === root && key === "response_format") { - if (typeof value === "object" && value !== null) { - responseFormat = value; + if (holder === root2 && key === "response_format") { + if (typeof value2 === "object" && value2 !== null) { + responseFormat = value2; const owner = ownSerializedParserObject(holder, key); responseFrame = { source: owner === body.response_format ? initial.response_format : void 0, @@ -9305,9 +26711,9 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { } return; } - if (holder === root && key === "tools") { - if (Array.isArray(value)) { - tools = new Proxy(value, { + if (holder === root2 && key === "tools") { + if (Array.isArray(value2)) { + tools = new Proxy(value2, { get(target, property) { const actual = Reflect.get(target, property, target); if (typeof property === "string") { @@ -9325,49 +26731,49 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { } if (holder === tools) { const index = Number(key); - if (!Number.isSafeInteger(index) || index < 0 || index >= MAX_STREAM_TOOL_CALLS || typeof value !== "object" || value === null) { + if (!Number.isSafeInteger(index) || index < 0 || index >= MAX_STREAM_TOOL_CALLS || typeof value2 !== "object" || value2 === null) { return; } const owner = actualToolOwners.get(index); const source = owner ? originalToolOwners.get(owner) : void 0; const frame = { source }; frames[index] = frame; - toolFrames.set(value, frame); + toolFrames.set(value2, frame); return; } const tool = toolFrames.get(holder); if (tool) { - if (key === "type" && typeof value === "string") { - tool.type = value; - } else if (key === "function" && typeof value === "object" && value !== null) { + if (key === "type" && typeof value2 === "string") { + tool.type = value2; + } else if (key === "function" && typeof value2 === "object" && value2 !== null) { const fn2 = { source: tool.source, schemaMatches: false }; tool.function = fn2; - functionFrames.set(value, fn2); + functionFrames.set(value2, fn2); } return; } if (holder === responseFormat && responseFrame) { - if (key === "type" && typeof value === "string") { - responseFrame.type = value; + if (key === "type" && typeof value2 === "string") { + responseFrame.type = value2; } else if (key === "json_schema") { - responseFrame.schemaMatches = hasMatchingSerializedParserSchema(originalSchemaSignatures, responseFrame.source, holder, key, value); + responseFrame.schemaMatches = hasMatchingSerializedParserSchema(originalSchemaSignatures, responseFrame.source, holder, key, value2); } return; } const fn = functionFrames.get(holder); if (fn) { - if (key === "name" && typeof value === "string") { - fn.name = value; - } else if (key === "strict" && typeof value === "boolean") { - fn.strict = value; + if (key === "name" && typeof value2 === "string") { + fn.name = value2; + } else if (key === "strict" && typeof value2 === "boolean") { + fn.strict = value2; } else if (key === "parameters") { - fn.schemaMatches = hasMatchingSerializedParserSchema(originalSchemaSignatures, fn.source, holder, key, value); + fn.schemaMatches = hasMatchingSerializedParserSchema(originalSchemaSignatures, fn.source, holder, key, value2); } } return void 0; }, complete() { - if (!root) { + if (!root2) { return; } const snapshot = cloneParserConfigObject(initial); @@ -9389,7 +26795,7 @@ function observeSerializedChatCompletionParserParams(body, initial, update) { delete snapshot.response_format; } update(snapshot); - root = void 0; + root2 = void 0; tools = void 0; responseFormat = void 0; responseFrame = void 0; @@ -9521,7 +26927,7 @@ function finalizeChatCompletion(snapshot, params, audioDoneChoiceIndexes, valida } return { ...toolRest2, - id: id3 || `call_${uuid4()}`, + id: id3 || `call_${uuid42()}`, type: type2, custom: { ...customRest, name: name2, input } }; @@ -9536,7 +26942,7 @@ function finalizeChatCompletion(snapshot, params, audioDoneChoiceIndexes, valida } return { ...toolRest, - id: id2 || `call_${uuid4()}`, + id: id2 || `call_${uuid42()}`, type, function: { ...fnRest, name, arguments: args } }; @@ -9572,14 +26978,14 @@ function assertNever(_x) { var _ChatCompletionStream_instances, _ChatCompletionStream_params, _ChatCompletionStream_rejectsUnfinishedTurns, _ChatCompletionStream_audioDoneChoiceIndexes, _ChatCompletionStream_choiceEventStates, _ChatCompletionStream_currentChatCompletionSnapshot, _ChatCompletionStream_hasAutoParseableTool, _ChatCompletionStream_partialJSONParseBudget, _ChatCompletionStream_beginRequest, _ChatCompletionStream_getChoiceEventState, _ChatCompletionStream_addChunk, _ChatCompletionStream_emitToolCallDoneEvent, _ChatCompletionStream_emitContentDoneEvents, _ChatCompletionStream_validateStructuredSnapshots, _ChatCompletionStream_endRequest, _ChatCompletionStream_accumulateChatCompletion, CHAT_COMPLETION_READABLE_STREAM_MESSAGE_PREFIX, MAX_STREAM_CHOICES, MAX_STREAM_TOOL_CALLS, MAX_PARTIAL_JSON_BYTES, MAX_PARTIAL_JSON_FRAGMENTS, MAX_PARTIAL_JSON_DEPTH, MAX_PARTIAL_JSON_PARSE_WORK, EAGER_PARTIAL_JSON_BYTES, MAX_SERIALIZED_PARSER_SCHEMA_NODES, stringifyParserSchemaValue, MAX_SERIALIZED_PARSER_SCHEMA_BYTES, MAX_SERIALIZED_PARSER_SCHEMA_DEPTH, OMITTED_SERIALIZED_PARSER_VALUE, UNSAFE_SERIALIZED_PARSER_VALUE, ChatCompletionStream; var init_ChatCompletionStream = __esm({ "node_modules/openai/lib/ChatCompletionStream.mjs"() { - init_tslib(); - init_parser2(); - init_error2(); - init_request_options(); - init_uuid(); - init_values(); - init_parser(); - init_streaming2(); + init_tslib2(); + init_parser4(); + init_error4(); + init_request_options2(); + init_uuid2(); + init_values2(); + init_parser3(); + init_streaming4(); init_AbstractChatCompletionRunner(); CHAT_COMPLETION_READABLE_STREAM_MESSAGE_PREFIX = "chat.completion.chunk.message:"; MAX_STREAM_CHOICES = 128; @@ -9607,10 +27013,10 @@ var init_ChatCompletionStream = __esm({ _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0); _ChatCompletionStream_hasAutoParseableTool.set(this, void 0); _ChatCompletionStream_partialJSONParseBudget.set(this, void 0); - __classPrivateFieldSet(this, _ChatCompletionStream_params, params, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, params, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_choiceEventStates, [], "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, false, "f"); const tools = params?.tools; const lengthDescriptor = tools && Object.getOwnPropertyDescriptor(tools, "length"); const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; @@ -9622,16 +27028,16 @@ var init_ChatCompletionStream = __esm({ } const tool = descriptor.value; if (isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) { - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, true, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, true, "f"); break; } } } - __classPrivateFieldSet(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); } /** The latest accumulated completion, or `undefined` before a chunk arrives or after finalization. */ get currentChatCompletionSnapshot() { - return __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + return __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); } /** * Intended for use on the frontend, consuming a stream produced with @@ -9640,9 +27046,9 @@ var init_ChatCompletionStream = __esm({ * Original input messages are not included in the serialized stream. Tool-result * messages explicitly serialized by a streaming tool runner are replayed. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ChatCompletionStream(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } /** Starts a streaming chat completion request and returns its event-driven helper. */ @@ -9653,55 +27059,55 @@ var init_ChatCompletionStream = __esm({ } /** Rejects unfinished turns before tool callbacks while preserving ordinary stream and replay behavior. */ _runTools(client, params, runner, options) { - __classPrivateFieldSet(this, _ChatCompletionStream_rejectsUnfinishedTurns, true, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_rejectsUnfinishedTurns, true, "f"); return super._runTools(client, params, runner, options); } async _createChatCompletion(client, params, options) { this._listenForAbort(options?.signal); const requestParams = { ...params, stream: true }; - __classPrivateFieldSet(this, _ChatCompletionStream_params, requestParams, "f"); - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, requestParams, "f"); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); const parserParams = snapshotChatCompletionParserParams(requestParams); - __classPrivateFieldSet(this, _ChatCompletionStream_params, parserParams, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, parserParams, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); const stopObserving = requestParams.tools || requestParams.response_format ? observeSerializedChatCompletionParserParams(requestParams, parserParams, (serialized) => { - __classPrivateFieldSet(this, _ChatCompletionStream_params, serialized, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_params, serialized, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f"); }) : void 0; - const stream4 = await client.chat.completions.create(requestParams, { + const stream5 = await client.chat.completions.create(requestParams, { ...options, signal: this.controller.signal }).finally(stopObserving); this._connected(); - for await (const chunk of stream4) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + for await (const chunk of stream5) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + return this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); let chatId; - for await (const item of stream4) { - if ("error" in item && hasOwn(item, "error") && typeof item.error === "object" && item.error !== null) { - throw new APIError(void 0, item.error, void 0, void 0); + for await (const item of stream5) { + if ("error" in item && hasOwn2(item, "error") && typeof item.error === "object" && item.error !== null) { + throw new APIError2(void 0, item.error, void 0, void 0); } if (isChatCompletionReadableStreamMessage(item)) { const message = getChatCompletionReadableStreamMessage(item); - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - const toolCalls = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f").choices[0]?.message.tool_calls; + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + const toolCalls = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f").choices[0]?.message.tool_calls; for (const [index, id] of message.tool_call_ids?.entries() ?? []) { const toolCall = toolCalls?.[index]; if (toolCall && id) { toolCall.id = id; } } - this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); chatId = void 0; } this._addMessage(message.message); @@ -9709,18 +27115,18 @@ var init_ChatCompletionStream = __esm({ } const chunk = item; if (chatId && chunk.id && chatId !== chunk.id) { - this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); if (chunk.id) { chatId = chunk.id; } } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + return this._addChatCompletion(__classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } const lastChatCompletion = this._chatCompletions[this._chatCompletions.length - 1]; if (lastChatCompletion) { @@ -9733,11 +27139,11 @@ var init_ChatCompletionStream = __esm({ if (this.ended) { return; } - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_partialJSONParseBudget, { bytes: 0, fragments: 0, work: 0 }, "f"); }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) { - let state2 = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; + let state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; if (state2) { return state2; } @@ -9752,22 +27158,22 @@ var init_ChatCompletionStream = __esm({ tool_call_parse_states: /* @__PURE__ */ new Map(), tool_call_identities: /* @__PURE__ */ new Map() }; - __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state2; + __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state2; return state2; }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) { if (this.ended) { return; } const capturedChoiceFrames = /* @__PURE__ */ new WeakMap(); - const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk, capturedChoiceFrames); + const completion = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk, capturedChoiceFrames); this._emit("chunk", chunk, completion); for (const choice of chunk.choices) { const capturedChoice = capturedChoiceFrames.get(choice); const choiceSnapshot = completion.choices[capturedChoice?.index ?? choice.index]; const capturedToolCalls = capturedChoice?.tool_calls ?? []; const { delta } = choice; - const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); - const boundedSnapshot = structuredResponse || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f"); + const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); + const boundedSnapshot = structuredResponse || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f"); const messageSnapshot = boundedSnapshot ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const refusal = boundedSnapshot ? captureStructuredJSONSnapshot(messageSnapshot, "refusal") : messageSnapshot.refusal; const parseableContent = !refusal && structuredResponse; @@ -9798,18 +27204,18 @@ var init_ChatCompletionStream = __esm({ snapshot: choiceSnapshot.logprobs?.refusal ?? [] }); } - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); if (choiceSnapshot.finish_reason) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); if (state2.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); } } for (const toolCall of capturedToolCalls) { if (state2.current_tool_call_index !== toolCall.index) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); if (state2.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state2.current_tool_call_index); } } state2.current_tool_call_index = toolCall.index; @@ -9844,11 +27250,11 @@ var init_ChatCompletionStream = __esm({ } } }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) { - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); if (state2.done_tool_calls.has(toolCallIndex)) { return; } - const messageSnapshot = __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; + const messageSnapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const toolCallSnapshot = messageSnapshot.tool_calls?.[toolCallIndex]; if (!toolCallSnapshot) { throw new Error("no tool call snapshot"); @@ -9861,13 +27267,13 @@ var init_ChatCompletionStream = __esm({ throw new Error("tool call snapshot missing `type`"); } if (toolCallSnapshot.type === "function") { - const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name); + const inputTool = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name); let parsedArguments = null; const parseable = isAutoParsableTool(inputTool) || inputTool?.function.strict === true; let argumentsSnapshot; if (parseable) { - if (__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); + if (__classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); } const capturedArguments = captureStructuredJSONSnapshot(toolCallSnapshot.function, "arguments"); if (typeof capturedArguments !== "string") { @@ -9895,21 +27301,21 @@ var init_ChatCompletionStream = __esm({ assertNever(toolCallSnapshot); } }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) { - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); - const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); - const boundedSnapshot = structuredResponse || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f"); + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + const structuredResponse = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); + const boundedSnapshot = structuredResponse || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f"); const messageSnapshot = boundedSnapshot ? captureStructuredMessageSnapshot(choiceSnapshot) : choiceSnapshot.message; const refusal = boundedSnapshot ? captureStructuredJSONSnapshot(messageSnapshot, "refusal") : messageSnapshot.refusal; const parseableContent = !refusal && structuredResponse; const content = parseableContent ? captureStructuredJSONSnapshot(messageSnapshot, "content") : messageSnapshot.content; if (content != null && (content !== "" || !refusal && !messageSnapshot.tool_calls?.length && !messageSnapshot.function_call) && !state2.content_done) { - if (parseableContent && __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); + if (parseableContent && __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f")); } state2.content_done = true; this._emit("content.done", { content, - parsed: refusal ? null : parseResponseFormatContent(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format, parseableContent ? validateStructuredJSONSnapshot(content) : content) + parsed: refusal ? null : parseResponseFormatContent(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format, parseableContent ? validateStructuredJSONSnapshot(content) : content) }); } if (refusal && !state2.refusal_done) { @@ -9926,7 +27332,7 @@ var init_ChatCompletionStream = __esm({ } }, _ChatCompletionStream_validateStructuredSnapshots = function _ChatCompletionStream_validateStructuredSnapshots2(snapshot) { const finalJSONBudget = { bytes: 0, fragments: 0, work: 0 }; - const parseableContent = isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format); + const parseableContent = isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format); const validatedMessages = /* @__PURE__ */ new WeakMap(); const choices = captureSnapshotArray(snapshot, "choices", MAX_STREAM_CHOICES, "choice"); if (!choices) { @@ -9949,9 +27355,9 @@ var init_ChatCompletionStream = __esm({ toolCallCollection: toolCalls, toolCalls: validatedTools })); - const state2 = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; + const state2 = __classPrivateFieldGet2(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; if (parseableContent && !refusal && typeof content === "string") { - validateStructuredJSONSnapshot(content, finalJSONBudget, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f")); + validateStructuredJSONSnapshot(content, finalJSONBudget, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f")); } for (const [index, identity] of state2?.tool_call_identities ?? []) { const toolCall = toolCalls && captureSnapshotArrayItem(toolCalls, index); @@ -9960,7 +27366,7 @@ var init_ChatCompletionStream = __esm({ } assertBoundToolCallIdentity(toolCall, identity); } - if (!__classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { + if (!__classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { continue; } for (let toolCallIndex = 0; toolCallIndex < (toolCalls?.length ?? 0); toolCallIndex += 1) { @@ -9989,7 +27395,7 @@ var init_ChatCompletionStream = __esm({ } continue; } - if (!shouldParseToolCall(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), { + if (!shouldParseToolCall(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), { type: identity.type, function: { name: identity.name } })) { @@ -10004,7 +27410,7 @@ var init_ChatCompletionStream = __esm({ if (typeof argumentsSnapshot !== "string") { throw new OpenAIError("Chat completion stream contains an unsafe structured JSON snapshot"); } - validateStructuredJSONSnapshot(argumentsSnapshot, finalJSONBudget, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f")); + validateStructuredJSONSnapshot(argumentsSnapshot, finalJSONBudget, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f")); validatedTools.set(toolCallIndex, Object.freeze({ tool: toolCall, function: fn, @@ -10019,31 +27425,31 @@ var init_ChatCompletionStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - const snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + const snapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); if (!snapshot) { throw new OpenAIError(`request ended without sending any chunks`); } - const validatedMessages = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); - const audioDoneChoiceIndexes = __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); - return finalizeChatCompletion(snapshot, __classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), audioDoneChoiceIndexes, validatedMessages); + const validatedMessages = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + const audioDoneChoiceIndexes = __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, /* @__PURE__ */ new Set(), "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_choiceEventStates, [], "f"); + return finalizeChatCompletion(snapshot, __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), audioDoneChoiceIndexes, validatedMessages); }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk, capturedChoiceFrames) { var _a6, _b, _c, _d, _e; - let snapshot = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + let snapshot = __classPrivateFieldGet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); const { choices, obfuscation: _obfuscation, ...rest } = chunk; if (!snapshot) { const newSnapshot = { ...rest, choices: [] }; - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, newSnapshot, "f"); + __classPrivateFieldSet2(this, _ChatCompletionStream_currentChatCompletionSnapshot, newSnapshot, "f"); snapshot = newSnapshot; } else if (chunk.id) { assignOwnProperties(snapshot, rest); } - const requestedChoiceCount = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.n; + const requestedChoiceCount = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.n; const maxChoices = typeof requestedChoiceCount === "number" && Number.isSafeInteger(requestedChoiceCount) && requestedChoiceCount > 0 ? Math.min(requestedChoiceCount, MAX_STREAM_CHOICES) : MAX_STREAM_CHOICES; for (const chunkChoice of chunk.choices) { const { delta, finish_reason, index, logprobs = null, ...other } = chunkChoice; @@ -10058,7 +27464,7 @@ var init_ChatCompletionStream = __esm({ snapshot.choices[index] = newChoice; choice = newChoice; } - if (isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format) || __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { + if (isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format) || __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f")) { captureStructuredJSONSnapshot(captureStructuredMessageSnapshot(choice), "refusal"); } if (logprobs) { @@ -10086,7 +27492,7 @@ var init_ChatCompletionStream = __esm({ } if (finish_reason) { choice.finish_reason = finish_reason; - if (__classPrivateFieldGet(this, _ChatCompletionStream_params, "f") && (__classPrivateFieldGet(this, _ChatCompletionStream_rejectsUnfinishedTurns, "f") || hasAutoParseableInput(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")))) { + if (__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f") && (__classPrivateFieldGet2(this, _ChatCompletionStream_rejectsUnfinishedTurns, "f") || hasAutoParseableInput(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")))) { if (finish_reason === "length") { throw new LengthFinishReasonError(); } @@ -10100,14 +27506,14 @@ var init_ChatCompletionStream = __esm({ Object.freeze(capturedToolCalls); continue; } - __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").delete(index); + __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").delete(index); const { audio, content, refusal, function_call, role, ...capturedDeltaFields } = delta; const { tool_calls: capturedToolCallDelta, ...rest2 } = capturedDeltaFields; - const tool_calls = hasOwn(capturedDeltaFields, "tool_calls") ? capturedToolCallDelta : delta.tool_calls; + const tool_calls = hasOwn2(capturedDeltaFields, "tool_calls") ? capturedToolCallDelta : delta.tool_calls; assertIsEmpty(rest2); assignOwnProperties(choice.message, rest2); if (audio?.expires_at != null && audio.id == null && audio.data == null && audio.transcript == null && content == null && refusal == null && function_call == null && role == null && tool_calls == null && Object.keys(rest2).length === 0) { - __classPrivateFieldGet(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").add(index); + __classPrivateFieldGet2(this, _ChatCompletionStream_audioDoneChoiceIndexes, "f").add(index); } if (refusal) { choice.message.refusal = (choice.message.refusal || "") + refusal; @@ -10144,15 +27550,15 @@ var init_ChatCompletionStream = __esm({ } } if (content != null) { - if (!choice.message.refusal && isParseableResponseFormat(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format)) { - const eventState = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice); + if (!choice.message.refusal && isParseableResponseFormat(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.response_format)) { + const eventState = __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice); const parseState = eventState.content_parse_state ?? (eventState.content_parse_state = createPartialJSONParseState()); - const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"), content); + const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"), content); choice.message.content = (captureStructuredJSONSnapshot(choice.message, "content") || "") + content; if (!parseState.has_non_whitespace) { choice.message.parsed = null; - } else if (shouldParse && reservePartialJSONParse(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + } else if (shouldParse && reservePartialJSONParse(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); choice.message.parsed = parseStructuredStreamingJSON(validateStructuredJSONSnapshot(choice.message.content)); } else if (content.length > 0) { choice.message.parsed = null; @@ -10171,7 +27577,7 @@ var init_ChatCompletionStream = __esm({ let argumentsDelta = ""; const tool_call = toolCallSnapshots[index2] ?? (toolCallSnapshots[index2] = {}); const functionName = fn?.name; - const eventState = __classPrivateFieldGet(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice) : void 0; + const eventState = __classPrivateFieldGet2(this, _ChatCompletionStream_hasAutoParseableTool, "f") ? __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choice) : void 0; let boundIdentity = eventState?.tool_call_identities.get(index2); if (boundIdentity) { assertBoundToolCallIdentity(tool_call, boundIdentity); @@ -10202,11 +27608,11 @@ var init_ChatCompletionStream = __esm({ } if (eventState && !boundIdentity) { const identity = ownFunctionToolIdentity(tool_call); - const configuredTool = identity && __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === identity.name); + const configuredTool = identity && __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === identity.name); if (identity) { boundIdentity = { ...identity, - parseable: configuredTool !== void 0 && shouldParseToolCall(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), { + parseable: configuredTool !== void 0 && shouldParseToolCall(__classPrivateFieldGet2(this, _ChatCompletionStream_params, "f"), { type: identity.type, function: { name: identity.name } }) @@ -10215,9 +27621,9 @@ var init_ChatCompletionStream = __esm({ if (!boundIdentity.parseable) { const provisionalState = eventState.tool_call_parse_states.get(index2); if (provisionalState) { - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").bytes -= provisionalState.bytes; - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").fragments -= provisionalState.fragments; - __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f").work -= provisionalState.work; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").bytes -= provisionalState.bytes; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").fragments -= provisionalState.fragments; + __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f").work -= provisionalState.work; eventState.tool_call_parse_states.delete(index2); } } @@ -10232,16 +27638,16 @@ var init_ChatCompletionStream = __esm({ parseState = createPartialJSONParseState(); eventState.tool_call_parse_states.set(index2, parseState); } - const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"), argumentFragment); + const shouldParse = recordPartialJSONFragment(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"), argumentFragment); const previousArguments = captureStructuredJSONSnapshot(functionSnapshot, "arguments"); if (typeof previousArguments !== "string") { throw new OpenAIError("Chat completion stream contains an unsafe structured JSON snapshot"); } functionSnapshot.arguments = previousArguments + argumentFragment; - if (shouldParse && boundIdentity?.parseable === true && reservePartialJSONParse(parseState, __classPrivateFieldGet(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); + if (shouldParse && boundIdentity?.parseable === true && reservePartialJSONParse(parseState, __classPrivateFieldGet2(this, _ChatCompletionStream_partialJSONParseBudget, "f"))) { + __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_validateStructuredSnapshots).call(this, snapshot); functionSnapshot.parsed_arguments = parseStructuredStreamingJSON(validateStructuredJSONSnapshot(functionSnapshot.arguments)); - } else if (argumentFragment.length > 0 && hasOwn(functionSnapshot, "parsed_arguments")) { + } else if (argumentFragment.length > 0 && hasOwn2(functionSnapshot, "parsed_arguments")) { functionSnapshot.parsed_arguments = void 0; } } else { @@ -10264,8 +27670,8 @@ var init_ChatCompletionStream = __esm({ } /** Serializes raw completion chunks into a readable stream for transfer to another runtime. */ toReadableStream() { - const stream4 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); } }; } @@ -10276,14 +27682,14 @@ var ChatCompletionStreamingRunner; var init_ChatCompletionStreamingRunner = __esm({ "node_modules/openai/lib/ChatCompletionStreamingRunner.mjs"() { init_ChatCompletionStream(); - init_error2(); - init_streaming2(); + init_error4(); + init_streaming4(); init_chatCompletionUtils(); ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends ChatCompletionStream { /** Restores a serialized tool run, including intermediate completions and tool-result messages. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ChatCompletionStreamingRunner(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } /** Serializes completion chunks and tool-result messages for replay in another runtime. */ @@ -10315,8 +27721,8 @@ var init_ChatCompletionStreamingRunner = __esm({ this.off("message", onMessage); }; }, { onReturn: () => this.abort() }); - const stream4 = new Stream(() => iterator, this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(() => iterator, this.controller); + return stream5.toReadableStream(); } /** Starts a streaming tool loop and returns its event-driven conversation runner. */ static runTools(client, params, options) { @@ -10336,26 +27742,26 @@ var init_ChatCompletionStreamingRunner = __esm({ }); // node_modules/openai/resources/chat/completions/completions.mjs -var Completions; -var init_completions = __esm({ +var Completions2; +var init_completions2 = __esm({ "node_modules/openai/resources/chat/completions/completions.mjs"() { - init_resource(); - init_messages(); - init_messages(); - init_pagination(); - init_path(); + init_resource2(); + init_messages3(); + init_messages3(); + init_pagination2(); + init_path2(); init_ChatCompletionRunner(); init_ChatCompletionStreamingRunner(); init_ChatCompletionStream(); - init_parser(); + init_parser3(); init_ChatCompletionStreamingRunner(); init_RunnableFunction(); init_ChatCompletionStream(); init_ChatCompletionRunner(); - Completions = class extends APIResource { + Completions2 = class extends APIResource2 { constructor() { super(...arguments); - this.messages = new Messages(this._client); + this.messages = new Messages3(this._client); } create(body, options) { return this._client.post("/chat/completions", { @@ -10376,7 +27782,7 @@ var init_completions = __esm({ * ``` */ retrieve(completionID, options) { - return this._client.get(path`/chat/completions/${completionID}`, { + return this._client.get(path3`/chat/completions/${completionID}`, { ...options, __security: { bearerAuth: true } }); @@ -10395,7 +27801,7 @@ var init_completions = __esm({ * ``` */ update(completionID, body, options) { - return this._client.post(path`/chat/completions/${completionID}`, { + return this._client.post(path3`/chat/completions/${completionID}`, { body, ...options, __security: { bearerAuth: true } @@ -10431,7 +27837,7 @@ var init_completions = __esm({ * ``` */ delete(completionID, options) { - return this._client.delete(path`/chat/completions/${completionID}`, { + return this._client.delete(path3`/chat/completions/${completionID}`, { ...options, __security: { bearerAuth: true } }); @@ -10456,7 +27862,7 @@ var init_completions = __esm({ return ChatCompletionStream.createChatCompletion(this._client, body, options); } }; - Completions.Messages = Messages; + Completions2.Messages = Messages3; } }); @@ -10464,25 +27870,25 @@ var init_completions = __esm({ var Chat; var init_chat = __esm({ "node_modules/openai/resources/chat/chat.mjs"() { - init_resource(); - init_completions(); - init_completions(); - Chat = class extends APIResource { + init_resource2(); + init_completions2(); + init_completions2(); + Chat = class extends APIResource2 { constructor() { super(...arguments); - this.completions = new Completions(this._client); + this.completions = new Completions2(this._client); } }; - Chat.Completions = Completions; + Chat.Completions = Completions2; } }); // node_modules/openai/resources/chat/completions/index.mjs -var init_completions2 = __esm({ +var init_completions3 = __esm({ "node_modules/openai/resources/chat/completions/index.mjs"() { - init_completions(); - init_completions(); - init_messages(); + init_completions2(); + init_completions2(); + init_messages3(); } }); @@ -10490,12 +27896,12 @@ var init_completions2 = __esm({ var init_chat2 = __esm({ "node_modules/openai/resources/chat/index.mjs"() { init_chat(); - init_completions2(); + init_completions3(); } }); // node_modules/openai/resources/shared.mjs -var init_shared = __esm({ +var init_shared2 = __esm({ "node_modules/openai/resources/shared.mjs"() { } }); @@ -10504,10 +27910,10 @@ var init_shared = __esm({ var AdminAPIKeys; var init_admin_api_keys = __esm({ "node_modules/openai/resources/admin/organization/admin-api-keys.mjs"() { - init_resource(); - init_pagination(); - init_path(); - AdminAPIKeys = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + AdminAPIKeys = class extends APIResource2 { /** * Create an organization admin API key * @@ -10538,7 +27944,7 @@ var init_admin_api_keys = __esm({ * ``` */ retrieve(keyID, options) { - return this._client.get(path`/organization/admin_api_keys/${keyID}`, { + return this._client.get(path3`/organization/admin_api_keys/${keyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10573,7 +27979,7 @@ var init_admin_api_keys = __esm({ * ``` */ delete(keyID, options) { - return this._client.delete(path`/organization/admin_api_keys/${keyID}`, { + return this._client.delete(path3`/organization/admin_api_keys/${keyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10586,9 +27992,9 @@ var init_admin_api_keys = __esm({ var AuditLogs; var init_audit_logs = __esm({ "node_modules/openai/resources/admin/organization/audit-logs.mjs"() { - init_resource(); - init_pagination(); - AuditLogs = class extends APIResource { + init_resource2(); + init_pagination2(); + AuditLogs = class extends APIResource2 { /** * List user actions and configuration changes within this organization. * @@ -10612,13 +28018,13 @@ var init_audit_logs = __esm({ }); // node_modules/openai/resources/admin/organization/certificates.mjs -var Certificates; -var init_certificates = __esm({ +var Certificates2; +var init_certificates2 = __esm({ "node_modules/openai/resources/admin/organization/certificates.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Certificates = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Certificates2 = class extends APIResource2 { /** * Upload a certificate to the organization. This does **not** automatically * activate the certificate. @@ -10654,7 +28060,7 @@ var init_certificates = __esm({ * ``` */ retrieve(certificateID, query = {}, options) { - return this._client.get(path`/organization/certificates/${certificateID}`, { + return this._client.get(path3`/organization/certificates/${certificateID}`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -10672,7 +28078,7 @@ var init_certificates = __esm({ * ``` */ update(certificateID, body, options) { - return this._client.post(path`/organization/certificates/${certificateID}`, { + return this._client.post(path3`/organization/certificates/${certificateID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -10706,7 +28112,7 @@ var init_certificates = __esm({ * ``` */ delete(certificateID, options) { - return this._client.delete(path`/organization/certificates/${certificateID}`, { + return this._client.delete(path3`/organization/certificates/${certificateID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10727,7 +28133,7 @@ var init_certificates = __esm({ * ``` */ activate(body, options) { - return this._client.getAPIList("/organization/certificates/activate", Page, { + return this._client.getAPIList("/organization/certificates/activate", Page2, { body, method: "post", ...options, @@ -10750,7 +28156,7 @@ var init_certificates = __esm({ * ``` */ deactivate(body, options) { - return this._client.getAPIList("/organization/certificates/deactivate", Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList("/organization/certificates/deactivate", Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -10760,8 +28166,8 @@ var init_certificates = __esm({ var DataRetention; var init_data_retention = __esm({ "node_modules/openai/resources/admin/organization/data-retention.mjs"() { - init_resource(); - DataRetention = class extends APIResource { + init_resource2(); + DataRetention = class extends APIResource2 { /** * Retrieves organization data retention controls. * @@ -10800,13 +28206,13 @@ var init_data_retention = __esm({ }); // node_modules/openai/resources/admin/organization/invites.mjs -var Invites; -var init_invites = __esm({ +var Invites2; +var init_invites2 = __esm({ "node_modules/openai/resources/admin/organization/invites.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Invites = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Invites2 = class extends APIResource2 { /** * Create an invite for a user to the organization. The invite must be accepted by * the user before they have access to the organization. @@ -10839,7 +28245,7 @@ var init_invites = __esm({ * ``` */ retrieve(inviteID, options) { - return this._client.get(path`/organization/invites/${inviteID}`, { + return this._client.get(path3`/organization/invites/${inviteID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10874,7 +28280,7 @@ var init_invites = __esm({ * ``` */ delete(inviteID, options) { - return this._client.delete(path`/organization/invites/${inviteID}`, { + return this._client.delete(path3`/organization/invites/${inviteID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10887,10 +28293,10 @@ var init_invites = __esm({ var Roles; var init_roles = __esm({ "node_modules/openai/resources/admin/organization/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles = class extends APIResource2 { /** * Creates a custom role for the organization. * @@ -10920,7 +28326,7 @@ var init_roles = __esm({ * ``` */ retrieve(roleID, options) { - return this._client.get(path`/organization/roles/${roleID}`, { + return this._client.get(path3`/organization/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10936,7 +28342,7 @@ var init_roles = __esm({ * ``` */ update(roleID, body, options) { - return this._client.post(path`/organization/roles/${roleID}`, { + return this._client.post(path3`/organization/roles/${roleID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -10971,7 +28377,7 @@ var init_roles = __esm({ * ``` */ delete(roleID, options) { - return this._client.delete(path`/organization/roles/${roleID}`, { + return this._client.delete(path3`/organization/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -10984,10 +28390,10 @@ var init_roles = __esm({ var SpendAlerts; var init_spend_alerts = __esm({ "node_modules/openai/resources/admin/organization/spend-alerts.mjs"() { - init_resource(); - init_pagination(); - init_path(); - SpendAlerts = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + SpendAlerts = class extends APIResource2 { /** * Creates an organization spend alert. * @@ -11024,7 +28430,7 @@ var init_spend_alerts = __esm({ * ``` */ retrieve(alertID, options) { - return this._client.get(path`/organization/spend_alerts/${alertID}`, { + return this._client.get(path3`/organization/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11050,7 +28456,7 @@ var init_spend_alerts = __esm({ * ``` */ update(alertID, body, options) { - return this._client.post(path`/organization/spend_alerts/${alertID}`, { + return this._client.post(path3`/organization/spend_alerts/${alertID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11082,7 +28488,7 @@ var init_spend_alerts = __esm({ * ``` */ delete(alertID, options) { - return this._client.delete(path`/organization/spend_alerts/${alertID}`, { + return this._client.delete(path3`/organization/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11095,8 +28501,8 @@ var init_spend_alerts = __esm({ var SpendLimit; var init_spend_limit = __esm({ "node_modules/openai/resources/admin/organization/spend-limit.mjs"() { - init_resource(); - SpendLimit = class extends APIResource { + init_resource2(); + SpendLimit = class extends APIResource2 { /** * Get the organization's hard spend limit. * @@ -11155,8 +28561,8 @@ var init_spend_limit = __esm({ var Usage; var init_usage = __esm({ "node_modules/openai/resources/admin/organization/usage.mjs"() { - init_resource(); - Usage = class extends APIResource { + init_resource2(); + Usage = class extends APIResource2 { /** * Get audio speeches usage details for the organization. * @@ -11363,10 +28769,10 @@ var init_usage = __esm({ var Roles2; var init_roles2 = __esm({ "node_modules/openai/resources/admin/organization/groups/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles2 = class extends APIResource2 { /** * Assigns an organization role to a group within the organization. * @@ -11380,7 +28786,7 @@ var init_roles2 = __esm({ * ``` */ create(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}/roles`, { + return this._client.post(path3`/organization/groups/${groupID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11400,7 +28806,7 @@ var init_roles2 = __esm({ */ retrieve(roleID, params, options) { const { group_id } = params; - return this._client.get(path`/organization/groups/${group_id}/roles/${roleID}`, { + return this._client.get(path3`/organization/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11419,7 +28825,7 @@ var init_roles2 = __esm({ * ``` */ list(groupID, query = {}, options) { - return this._client.getAPIList(path`/organization/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns an organization role from a group within the organization. @@ -11435,7 +28841,7 @@ var init_roles2 = __esm({ */ delete(roleID, params, options) { const { group_id } = params; - return this._client.delete(path`/organization/groups/${group_id}/roles/${roleID}`, { + return this._client.delete(path3`/organization/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11445,13 +28851,13 @@ var init_roles2 = __esm({ }); // node_modules/openai/resources/admin/organization/groups/users.mjs -var Users; -var init_users = __esm({ +var Users2; +var init_users2 = __esm({ "node_modules/openai/resources/admin/organization/groups/users.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Users = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Users2 = class extends APIResource2 { /** * Adds a user to a group. * @@ -11465,7 +28871,7 @@ var init_users = __esm({ * ``` */ create(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}/users`, { + return this._client.post(path3`/organization/groups/${groupID}/users`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11485,7 +28891,7 @@ var init_users = __esm({ */ retrieve(userID, params, options) { const { group_id } = params; - return this._client.get(path`/organization/groups/${group_id}/users/${userID}`, { + return this._client.get(path3`/organization/groups/${group_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11504,7 +28910,7 @@ var init_users = __esm({ * ``` */ list(groupID, query = {}, options) { - return this._client.getAPIList(path`/organization/groups/${groupID}/users`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/groups/${groupID}/users`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Removes a user from a group. @@ -11520,7 +28926,7 @@ var init_users = __esm({ */ delete(userID, params, options) { const { group_id } = params; - return this._client.delete(path`/organization/groups/${group_id}/users/${userID}`, { + return this._client.delete(path3`/organization/groups/${group_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11533,17 +28939,17 @@ var init_users = __esm({ var Groups; var init_groups = __esm({ "node_modules/openai/resources/admin/organization/groups/groups.mjs"() { - init_resource(); + init_resource2(); init_roles2(); init_roles2(); - init_users(); - init_users(); - init_pagination(); - init_path(); - Groups = class extends APIResource { + init_users2(); + init_users2(); + init_pagination2(); + init_path2(); + Groups = class extends APIResource2 { constructor() { super(...arguments); - this.users = new Users(this._client); + this.users = new Users2(this._client); this.roles = new Roles2(this._client); } /** @@ -11575,7 +28981,7 @@ var init_groups = __esm({ * ``` */ retrieve(groupID, options) { - return this._client.get(path`/organization/groups/${groupID}`, { + return this._client.get(path3`/organization/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11592,7 +28998,7 @@ var init_groups = __esm({ * ``` */ update(groupID, body, options) { - return this._client.post(path`/organization/groups/${groupID}`, { + return this._client.post(path3`/organization/groups/${groupID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11627,25 +29033,25 @@ var init_groups = __esm({ * ``` */ delete(groupID, options) { - return this._client.delete(path`/organization/groups/${groupID}`, { + return this._client.delete(path3`/organization/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Groups.Users = Users; + Groups.Users = Users2; Groups.Roles = Roles2; } }); // node_modules/openai/resources/admin/organization/projects/api-keys.mjs -var APIKeys; -var init_api_keys = __esm({ +var APIKeys2; +var init_api_keys2 = __esm({ "node_modules/openai/resources/admin/organization/projects/api-keys.mjs"() { - init_resource(); - init_pagination(); - init_path(); - APIKeys = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + APIKeys2 = class extends APIResource2 { /** * Retrieves an API key in the project. * @@ -11660,7 +29066,7 @@ var init_api_keys = __esm({ */ retrieve(apiKeyID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + return this._client.get(path3`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11679,7 +29085,7 @@ var init_api_keys = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes an API key from the project. @@ -11698,7 +29104,7 @@ var init_api_keys = __esm({ */ delete(apiKeyID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11708,13 +29114,13 @@ var init_api_keys = __esm({ }); // node_modules/openai/resources/admin/organization/projects/certificates.mjs -var Certificates2; -var init_certificates2 = __esm({ +var Certificates3; +var init_certificates3 = __esm({ "node_modules/openai/resources/admin/organization/projects/certificates.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Certificates2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Certificates3 = class extends APIResource2 { /** * List certificates for this project. * @@ -11729,7 +29135,7 @@ var init_certificates2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Activate certificates at the project level. @@ -11748,7 +29154,7 @@ var init_certificates2 = __esm({ * ``` */ activate(projectID, body, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates/activate`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates/activate`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deactivate certificates at the project level. You can atomically and @@ -11766,7 +29172,7 @@ var init_certificates2 = __esm({ * ``` */ deactivate(projectID, body, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/certificates/deactivate`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/certificates/deactivate`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -11776,9 +29182,9 @@ var init_certificates2 = __esm({ var DataRetention2; var init_data_retention2 = __esm({ "node_modules/openai/resources/admin/organization/projects/data-retention.mjs"() { - init_resource(); - init_path(); - DataRetention2 = class extends APIResource { + init_resource2(); + init_path2(); + DataRetention2 = class extends APIResource2 { /** * Retrieves project data retention controls. * @@ -11791,7 +29197,7 @@ var init_data_retention2 = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/data_retention`, { + return this._client.get(path3`/organization/projects/${projectID}/data_retention`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11809,7 +29215,7 @@ var init_data_retention2 = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/data_retention`, { + return this._client.post(path3`/organization/projects/${projectID}/data_retention`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11823,9 +29229,9 @@ var init_data_retention2 = __esm({ var HostedToolPermissions; var init_hosted_tool_permissions = __esm({ "node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs"() { - init_resource(); - init_path(); - HostedToolPermissions = class extends APIResource { + init_resource2(); + init_path2(); + HostedToolPermissions = class extends APIResource2 { /** * Returns hosted tool permissions for a project. * @@ -11838,7 +29244,7 @@ var init_hosted_tool_permissions = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/hosted_tool_permissions`, { + return this._client.get(path3`/organization/projects/${projectID}/hosted_tool_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11855,7 +29261,7 @@ var init_hosted_tool_permissions = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/hosted_tool_permissions`, { + return this._client.post(path3`/organization/projects/${projectID}/hosted_tool_permissions`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11869,9 +29275,9 @@ var init_hosted_tool_permissions = __esm({ var ModelPermissions; var init_model_permissions = __esm({ "node_modules/openai/resources/admin/organization/projects/model-permissions.mjs"() { - init_resource(); - init_path(); - ModelPermissions = class extends APIResource { + init_resource2(); + init_path2(); + ModelPermissions = class extends APIResource2 { /** * Returns model permissions for a project. * @@ -11884,7 +29290,7 @@ var init_model_permissions = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.get(path3`/organization/projects/${projectID}/model_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11902,7 +29308,7 @@ var init_model_permissions = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.post(path3`/organization/projects/${projectID}/model_permissions`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11920,7 +29326,7 @@ var init_model_permissions = __esm({ * ``` */ delete(projectID, options) { - return this._client.delete(path`/organization/projects/${projectID}/model_permissions`, { + return this._client.delete(path3`/organization/projects/${projectID}/model_permissions`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -11930,13 +29336,13 @@ var init_model_permissions = __esm({ }); // node_modules/openai/resources/admin/organization/projects/rate-limits.mjs -var RateLimits; -var init_rate_limits = __esm({ +var RateLimits3; +var init_rate_limits3 = __esm({ "node_modules/openai/resources/admin/organization/projects/rate-limits.mjs"() { - init_resource(); - init_pagination(); - init_path(); - RateLimits = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + RateLimits3 = class extends APIResource2 { /** * Returns the rate limits per model for a project. * @@ -11951,7 +29357,7 @@ var init_rate_limits = __esm({ * ``` */ listRateLimits(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Updates a project rate limit. @@ -11967,7 +29373,7 @@ var init_rate_limits = __esm({ */ updateRateLimit(rateLimitID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/rate_limits/${rateLimitID}`, { + return this._client.post(path3`/organization/projects/${project_id}/rate_limits/${rateLimitID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -11981,10 +29387,10 @@ var init_rate_limits = __esm({ var Roles3; var init_roles3 = __esm({ "node_modules/openai/resources/admin/organization/projects/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles3 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles3 = class extends APIResource2 { /** * Creates a custom role for a project. * @@ -11998,7 +29404,7 @@ var init_roles3 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/projects/${projectID}/roles`, { + return this._client.post(path3`/projects/${projectID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12018,7 +29424,7 @@ var init_roles3 = __esm({ */ retrieve(roleID, params, options) { const { project_id } = params; - return this._client.get(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12037,7 +29443,7 @@ var init_roles3 = __esm({ */ update(roleID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.post(path3`/projects/${project_id}/roles/${roleID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12057,7 +29463,7 @@ var init_roles3 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/projects/${projectID}/roles`, NextCursorPage, { + return this._client.getAPIList(path3`/projects/${projectID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -12077,7 +29483,7 @@ var init_roles3 = __esm({ */ delete(roleID, params, options) { const { project_id } = params; - return this._client.delete(path`/projects/${project_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12090,10 +29496,10 @@ var init_roles3 = __esm({ var SpendAlerts2; var init_spend_alerts2 = __esm({ "node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs"() { - init_resource(); - init_pagination(); - init_path(); - SpendAlerts2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + SpendAlerts2 = class extends APIResource2 { /** * Creates a project spend alert. * @@ -12115,7 +29521,7 @@ var init_spend_alerts2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/spend_alerts`, { + return this._client.post(path3`/organization/projects/${projectID}/spend_alerts`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12135,7 +29541,7 @@ var init_spend_alerts2 = __esm({ */ retrieve(alertID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.get(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12163,7 +29569,7 @@ var init_spend_alerts2 = __esm({ */ update(alertID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.post(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12183,7 +29589,7 @@ var init_spend_alerts2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a project spend alert. @@ -12199,7 +29605,7 @@ var init_spend_alerts2 = __esm({ */ delete(alertID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/spend_alerts/${alertID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12212,9 +29618,9 @@ var init_spend_alerts2 = __esm({ var SpendLimit2; var init_spend_limit2 = __esm({ "node_modules/openai/resources/admin/organization/projects/spend-limit.mjs"() { - init_resource(); - init_path(); - SpendLimit2 = class extends APIResource { + init_resource2(); + init_path2(); + SpendLimit2 = class extends APIResource2 { /** * Get a project's hard spend limit. * @@ -12227,7 +29633,7 @@ var init_spend_limit2 = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.get(path3`/organization/projects/${projectID}/spend_limit`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12249,7 +29655,7 @@ var init_spend_limit2 = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.post(path3`/organization/projects/${projectID}/spend_limit`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12267,7 +29673,7 @@ var init_spend_limit2 = __esm({ * ``` */ delete(projectID, options) { - return this._client.delete(path`/organization/projects/${projectID}/spend_limit`, { + return this._client.delete(path3`/organization/projects/${projectID}/spend_limit`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12280,10 +29686,10 @@ var init_spend_limit2 = __esm({ var Roles4; var init_roles4 = __esm({ "node_modules/openai/resources/admin/organization/projects/groups/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles4 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles4 = class extends APIResource2 { /** * Assigns a project role to a group within a project. * @@ -12298,7 +29704,7 @@ var init_roles4 = __esm({ */ create(groupID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/groups/${groupID}/roles`, { + return this._client.post(path3`/projects/${project_id}/groups/${groupID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12318,7 +29724,7 @@ var init_roles4 = __esm({ */ retrieve(roleID, params, options) { const { project_id, group_id } = params; - return this._client.get(path`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12339,7 +29745,7 @@ var init_roles4 = __esm({ */ list(groupID, params, options) { const { project_id, ...query } = params; - return this._client.getAPIList(path`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns a project role from a group within a project. @@ -12355,7 +29761,7 @@ var init_roles4 = __esm({ */ delete(roleID, params, options) { const { project_id, group_id } = params; - return this._client.delete(path`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12368,12 +29774,12 @@ var init_roles4 = __esm({ var Groups2; var init_groups2 = __esm({ "node_modules/openai/resources/admin/organization/projects/groups/groups.mjs"() { - init_resource(); + init_resource2(); init_roles4(); init_roles4(); - init_pagination(); - init_path(); - Groups2 = class extends APIResource { + init_pagination2(); + init_path2(); + Groups2 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles4(this._client); @@ -12391,7 +29797,7 @@ var init_groups2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/groups`, { + return this._client.post(path3`/organization/projects/${projectID}/groups`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12411,7 +29817,7 @@ var init_groups2 = __esm({ */ retrieve(groupID, params, options) { const { project_id, ...query } = params; - return this._client.get(path`/organization/projects/${project_id}/groups/${groupID}`, { + return this._client.get(path3`/organization/projects/${project_id}/groups/${groupID}`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -12431,7 +29837,7 @@ var init_groups2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/groups`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/groups`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Revokes a group's access to a project. @@ -12447,7 +29853,7 @@ var init_groups2 = __esm({ */ delete(groupID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/groups/${groupID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/groups/${groupID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12458,12 +29864,12 @@ var init_groups2 = __esm({ }); // node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs -var APIKeys2; -var init_api_keys2 = __esm({ +var APIKeys3; +var init_api_keys3 = __esm({ "node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs"() { - init_resource(); - init_path(); - APIKeys2 = class extends APIResource { + init_resource2(); + init_path2(); + APIKeys3 = class extends APIResource2 { /** * Creates an API key for a service account in the project. * @@ -12478,25 +29884,25 @@ var init_api_keys2 = __esm({ */ create(serviceAccountID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}/api_keys`, { body, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.post(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}/api_keys`, { body, ...options, __security: { adminAPIKeyAuth: true } }); } }; } }); // node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs -var ServiceAccounts; -var init_service_accounts = __esm({ +var ServiceAccounts3; +var init_service_accounts3 = __esm({ "node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs"() { - init_resource(); - init_api_keys2(); - init_api_keys2(); - init_pagination(); - init_path(); - ServiceAccounts = class extends APIResource { + init_resource2(); + init_api_keys3(); + init_api_keys3(); + init_pagination2(); + init_path2(); + ServiceAccounts3 = class extends APIResource2 { constructor() { super(...arguments); - this.apiKeys = new APIKeys2(this._client); + this.apiKeys = new APIKeys3(this._client); } /** * Creates a new service account in the project. By default, this also returns an @@ -12512,7 +29918,7 @@ var init_service_accounts = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/service_accounts`, { + return this._client.post(path3`/organization/projects/${projectID}/service_accounts`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12532,7 +29938,7 @@ var init_service_accounts = __esm({ */ retrieve(serviceAccountID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { + return this._client.get(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12551,7 +29957,7 @@ var init_service_accounts = __esm({ */ update(serviceAccountID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.post(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Returns a list of service accounts in the project. @@ -12567,7 +29973,7 @@ var init_service_accounts = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a service account from the project. @@ -12586,10 +29992,10 @@ var init_service_accounts = __esm({ */ delete(serviceAccountID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.delete(path3`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - ServiceAccounts.APIKeys = APIKeys2; + ServiceAccounts3.APIKeys = APIKeys3; } }); @@ -12597,10 +30003,10 @@ var init_service_accounts = __esm({ var Roles5; var init_roles5 = __esm({ "node_modules/openai/resources/admin/organization/projects/users/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles5 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles5 = class extends APIResource2 { /** * Assigns a project role to a user within a project. * @@ -12615,7 +30021,7 @@ var init_roles5 = __esm({ */ create(userID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/projects/${project_id}/users/${userID}/roles`, { + return this._client.post(path3`/projects/${project_id}/users/${userID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12635,7 +30041,7 @@ var init_roles5 = __esm({ */ retrieve(roleID, params, options) { const { project_id, user_id } = params; - return this._client.get(path`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + return this._client.get(path3`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12656,7 +30062,7 @@ var init_roles5 = __esm({ */ list(userID, params, options) { const { project_id, ...query } = params; - return this._client.getAPIList(path`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns a project role from a user within a project. @@ -12672,7 +30078,7 @@ var init_roles5 = __esm({ */ delete(roleID, params, options) { const { project_id, user_id } = params; - return this._client.delete(path`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + return this._client.delete(path3`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12682,15 +30088,15 @@ var init_roles5 = __esm({ }); // node_modules/openai/resources/admin/organization/projects/users/users.mjs -var Users2; -var init_users2 = __esm({ +var Users3; +var init_users3 = __esm({ "node_modules/openai/resources/admin/organization/projects/users/users.mjs"() { - init_resource(); + init_resource2(); init_roles5(); init_roles5(); - init_pagination(); - init_path(); - Users2 = class extends APIResource { + init_pagination2(); + init_path2(); + Users3 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles5(this._client); @@ -12709,7 +30115,7 @@ var init_users2 = __esm({ * ``` */ create(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}/users`, { + return this._client.post(path3`/organization/projects/${projectID}/users`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12729,7 +30135,7 @@ var init_users2 = __esm({ */ retrieve(userID, params, options) { const { project_id } = params; - return this._client.get(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.get(path3`/organization/projects/${project_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12748,7 +30154,7 @@ var init_users2 = __esm({ */ update(userID, params, options) { const { project_id, ...body } = params; - return this._client.post(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.post(path3`/organization/projects/${project_id}/users/${userID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12768,7 +30174,7 @@ var init_users2 = __esm({ * ``` */ list(projectID, query = {}, options) { - return this._client.getAPIList(path`/organization/projects/${projectID}/users`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/projects/${projectID}/users`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Deletes a user from the project. @@ -12787,13 +30193,13 @@ var init_users2 = __esm({ */ delete(userID, params, options) { const { project_id } = params; - return this._client.delete(path`/organization/projects/${project_id}/users/${userID}`, { + return this._client.delete(path3`/organization/projects/${project_id}/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Users2.Roles = Roles5; + Users3.Roles = Roles5; } }); @@ -12801,19 +30207,19 @@ var init_users2 = __esm({ var Projects; var init_projects = __esm({ "node_modules/openai/resources/admin/organization/projects/projects.mjs"() { - init_resource(); - init_api_keys(); - init_api_keys(); - init_certificates2(); - init_certificates2(); + init_resource2(); + init_api_keys2(); + init_api_keys2(); + init_certificates3(); + init_certificates3(); init_data_retention2(); init_data_retention2(); init_hosted_tool_permissions(); init_hosted_tool_permissions(); init_model_permissions(); init_model_permissions(); - init_rate_limits(); - init_rate_limits(); + init_rate_limits3(); + init_rate_limits3(); init_roles3(); init_roles3(); init_spend_alerts2(); @@ -12822,19 +30228,19 @@ var init_projects = __esm({ init_spend_limit2(); init_groups2(); init_groups2(); - init_service_accounts(); - init_service_accounts(); - init_users2(); - init_users2(); - init_pagination(); - init_path(); - Projects = class extends APIResource { + init_service_accounts3(); + init_service_accounts3(); + init_users3(); + init_users3(); + init_pagination2(); + init_path2(); + Projects = class extends APIResource2 { constructor() { super(...arguments); - this.users = new Users2(this._client); - this.serviceAccounts = new ServiceAccounts(this._client); - this.apiKeys = new APIKeys(this._client); - this.rateLimits = new RateLimits(this._client); + this.users = new Users3(this._client); + this.serviceAccounts = new ServiceAccounts3(this._client); + this.apiKeys = new APIKeys2(this._client); + this.rateLimits = new RateLimits3(this._client); this.modelPermissions = new ModelPermissions(this._client); this.hostedToolPermissions = new HostedToolPermissions(this._client); this.groups = new Groups2(this._client); @@ -12842,7 +30248,7 @@ var init_projects = __esm({ this.dataRetention = new DataRetention2(this._client); this.spendLimit = new SpendLimit2(this._client); this.spendAlerts = new SpendAlerts2(this._client); - this.certificates = new Certificates2(this._client); + this.certificates = new Certificates3(this._client); } /** * Create a new project in the organization. Projects can be created and archived, @@ -12875,7 +30281,7 @@ var init_projects = __esm({ * ``` */ retrieve(projectID, options) { - return this._client.get(path`/organization/projects/${projectID}`, { + return this._client.get(path3`/organization/projects/${projectID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -12892,7 +30298,7 @@ var init_projects = __esm({ * ``` */ update(projectID, body, options) { - return this._client.post(path`/organization/projects/${projectID}`, { + return this._client.post(path3`/organization/projects/${projectID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12929,16 +30335,16 @@ var init_projects = __esm({ * ``` */ archive(projectID, options) { - return this._client.post(path`/organization/projects/${projectID}/archive`, { + return this._client.post(path3`/organization/projects/${projectID}/archive`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Projects.Users = Users2; - Projects.ServiceAccounts = ServiceAccounts; - Projects.APIKeys = APIKeys; - Projects.RateLimits = RateLimits; + Projects.Users = Users3; + Projects.ServiceAccounts = ServiceAccounts3; + Projects.APIKeys = APIKeys2; + Projects.RateLimits = RateLimits3; Projects.ModelPermissions = ModelPermissions; Projects.HostedToolPermissions = HostedToolPermissions; Projects.Groups = Groups2; @@ -12946,7 +30352,7 @@ var init_projects = __esm({ Projects.DataRetention = DataRetention2; Projects.SpendLimit = SpendLimit2; Projects.SpendAlerts = SpendAlerts2; - Projects.Certificates = Certificates2; + Projects.Certificates = Certificates3; } }); @@ -12954,10 +30360,10 @@ var init_projects = __esm({ var Roles6; var init_roles6 = __esm({ "node_modules/openai/resources/admin/organization/users/roles.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Roles6 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Roles6 = class extends APIResource2 { /** * Assigns an organization role to a user within the organization. * @@ -12971,7 +30377,7 @@ var init_roles6 = __esm({ * ``` */ create(userID, body, options) { - return this._client.post(path`/organization/users/${userID}/roles`, { + return this._client.post(path3`/organization/users/${userID}/roles`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -12991,7 +30397,7 @@ var init_roles6 = __esm({ */ retrieve(roleID, params, options) { const { user_id } = params; - return this._client.get(path`/organization/users/${user_id}/roles/${roleID}`, { + return this._client.get(path3`/organization/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13010,7 +30416,7 @@ var init_roles6 = __esm({ * ``` */ list(userID, query = {}, options) { - return this._client.getAPIList(path`/organization/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/organization/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * Unassigns an organization role from a user within the organization. @@ -13026,7 +30432,7 @@ var init_roles6 = __esm({ */ delete(roleID, params, options) { const { user_id } = params; - return this._client.delete(path`/organization/users/${user_id}/roles/${roleID}`, { + return this._client.delete(path3`/organization/users/${user_id}/roles/${roleID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13036,15 +30442,15 @@ var init_roles6 = __esm({ }); // node_modules/openai/resources/admin/organization/users/users.mjs -var Users3; -var init_users3 = __esm({ +var Users4; +var init_users4 = __esm({ "node_modules/openai/resources/admin/organization/users/users.mjs"() { - init_resource(); + init_resource2(); init_roles6(); init_roles6(); - init_pagination(); - init_path(); - Users3 = class extends APIResource { + init_pagination2(); + init_path2(); + Users4 = class extends APIResource2 { constructor() { super(...arguments); this.roles = new Roles6(this._client); @@ -13059,7 +30465,7 @@ var init_users3 = __esm({ * ``` */ retrieve(userID, options) { - return this._client.get(path`/organization/users/${userID}`, { + return this._client.get(path3`/organization/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); @@ -13074,7 +30480,7 @@ var init_users3 = __esm({ * ``` */ update(userID, body, options) { - return this._client.post(path`/organization/users/${userID}`, { + return this._client.post(path3`/organization/users/${userID}`, { body, ...options, __security: { adminAPIKeyAuth: true } @@ -13109,31 +30515,31 @@ var init_users3 = __esm({ * ``` */ delete(userID, options) { - return this._client.delete(path`/organization/users/${userID}`, { + return this._client.delete(path3`/organization/users/${userID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; - Users3.Roles = Roles6; + Users4.Roles = Roles6; } }); // node_modules/openai/resources/admin/organization/organization.mjs -var Organization; -var init_organization = __esm({ +var Organization2; +var init_organization2 = __esm({ "node_modules/openai/resources/admin/organization/organization.mjs"() { - init_resource(); + init_resource2(); init_admin_api_keys(); init_admin_api_keys(); init_audit_logs(); init_audit_logs(); - init_certificates(); - init_certificates(); + init_certificates2(); + init_certificates2(); init_data_retention(); init_data_retention(); - init_invites(); - init_invites(); + init_invites2(); + init_invites2(); init_roles(); init_roles(); init_spend_alerts(); @@ -13146,37 +30552,37 @@ var init_organization = __esm({ init_groups(); init_projects(); init_projects(); - init_users3(); - init_users3(); - Organization = class extends APIResource { + init_users4(); + init_users4(); + Organization2 = class extends APIResource2 { constructor() { super(...arguments); this.auditLogs = new AuditLogs(this._client); this.adminAPIKeys = new AdminAPIKeys(this._client); this.usage = new Usage(this._client); - this.invites = new Invites(this._client); - this.users = new Users3(this._client); + this.invites = new Invites2(this._client); + this.users = new Users4(this._client); this.groups = new Groups(this._client); this.roles = new Roles(this._client); this.dataRetention = new DataRetention(this._client); this.spendLimit = new SpendLimit(this._client); this.spendAlerts = new SpendAlerts(this._client); - this.certificates = new Certificates(this._client); + this.certificates = new Certificates2(this._client); this.projects = new Projects(this._client); } }; - Organization.AuditLogs = AuditLogs; - Organization.AdminAPIKeys = AdminAPIKeys; - Organization.Usage = Usage; - Organization.Invites = Invites; - Organization.Users = Users3; - Organization.Groups = Groups; - Organization.Roles = Roles; - Organization.DataRetention = DataRetention; - Organization.SpendLimit = SpendLimit; - Organization.SpendAlerts = SpendAlerts; - Organization.Certificates = Certificates; - Organization.Projects = Projects; + Organization2.AuditLogs = AuditLogs; + Organization2.AdminAPIKeys = AdminAPIKeys; + Organization2.Usage = Usage; + Organization2.Invites = Invites2; + Organization2.Users = Users4; + Organization2.Groups = Groups; + Organization2.Roles = Roles; + Organization2.DataRetention = DataRetention; + Organization2.SpendLimit = SpendLimit; + Organization2.SpendAlerts = SpendAlerts; + Organization2.Certificates = Certificates2; + Organization2.Projects = Projects; } }); @@ -13184,16 +30590,16 @@ var init_organization = __esm({ var Admin; var init_admin = __esm({ "node_modules/openai/resources/admin/admin.mjs"() { - init_resource(); - init_organization(); - init_organization(); - Admin = class extends APIResource { + init_resource2(); + init_organization2(); + init_organization2(); + Admin = class extends APIResource2 { constructor() { super(...arguments); - this.organization = new Organization(this._client); + this.organization = new Organization2(this._client); } }; - Admin.Organization = Organization; + Admin.Organization = Organization2; } }); @@ -13201,9 +30607,9 @@ var init_admin = __esm({ var Speech; var init_speech = __esm({ "node_modules/openai/resources/audio/speech.mjs"() { - init_resource(); - init_headers2(); - Speech = class extends APIResource { + init_resource2(); + init_headers3(); + Speech = class extends APIResource2 { /** * Generates audio from the input text. * @@ -13225,7 +30631,7 @@ var init_speech = __esm({ return this._client.post("/audio/speech", { body, ...options, - headers: buildHeaders([{ Accept: "application/octet-stream" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/octet-stream" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -13238,11 +30644,11 @@ var init_speech = __esm({ var Transcriptions; var init_transcriptions = __esm({ "node_modules/openai/resources/audio/transcriptions.mjs"() { - init_resource(); - init_uploads(); - Transcriptions = class extends APIResource { + init_resource2(); + init_uploads3(); + Transcriptions = class extends APIResource2 { create(body, options) { - return this._client.post("/audio/transcriptions", multipartFormRequestOptions({ + return this._client.post("/audio/transcriptions", multipartFormRequestOptions2({ body, ...options, stream: body.stream ?? false, @@ -13258,11 +30664,11 @@ var init_transcriptions = __esm({ var Translations; var init_translations = __esm({ "node_modules/openai/resources/audio/translations.mjs"() { - init_resource(); - init_uploads(); - Translations = class extends APIResource { + init_resource2(); + init_uploads3(); + Translations = class extends APIResource2 { create(body, options) { - return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/audio/translations", multipartFormRequestOptions2({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client)); } }; } @@ -13272,14 +30678,14 @@ var init_translations = __esm({ var Audio; var init_audio = __esm({ "node_modules/openai/resources/audio/audio.mjs"() { - init_resource(); + init_resource2(); init_speech(); init_speech(); init_transcriptions(); init_transcriptions(); init_translations(); init_translations(); - Audio = class extends APIResource { + Audio = class extends APIResource2 { constructor() { super(...arguments); this.transcriptions = new Transcriptions(this._client); @@ -13294,13 +30700,13 @@ var init_audio = __esm({ }); // node_modules/openai/resources/batches.mjs -var Batches; -var init_batches = __esm({ +var Batches3; +var init_batches3 = __esm({ "node_modules/openai/resources/batches.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Batches = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Batches3 = class extends APIResource2 { /** * Creates and executes a batch from an uploaded file of requests */ @@ -13311,7 +30717,7 @@ var init_batches = __esm({ * Retrieves a batch. */ retrieve(batchID, options) { - return this._client.get(path`/batches/${batchID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/batches/${batchID}`, { ...options, __security: { bearerAuth: true } }); } /** * List your organization's batches. @@ -13329,7 +30735,7 @@ var init_batches = __esm({ * (if any) available in the output file. */ cancel(batchID, options) { - return this._client.post(path`/batches/${batchID}/cancel`, { + return this._client.post(path3`/batches/${batchID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -13342,11 +30748,11 @@ var init_batches = __esm({ var Assistants; var init_assistants = __esm({ "node_modules/openai/resources/beta/assistants.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Assistants = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Assistants = class extends APIResource2 { /** * Create an assistant with a model and instructions. * @@ -13356,7 +30762,7 @@ var init_assistants = __esm({ return this._client.post("/assistants", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13366,9 +30772,9 @@ var init_assistants = __esm({ * @deprecated */ retrieve(assistantID, options) { - return this._client.get(path`/assistants/${assistantID}`, { + return this._client.get(path3`/assistants/${assistantID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13378,10 +30784,10 @@ var init_assistants = __esm({ * @deprecated */ update(assistantID, body, options) { - return this._client.post(path`/assistants/${assistantID}`, { + return this._client.post(path3`/assistants/${assistantID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13394,7 +30800,7 @@ var init_assistants = __esm({ return this._client.getAPIList("/assistants", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13404,9 +30810,9 @@ var init_assistants = __esm({ * @deprecated */ delete(assistantID, options) { - return this._client.delete(path`/assistants/${assistantID}`, { + return this._client.delete(path3`/assistants/${assistantID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13415,12 +30821,12 @@ var init_assistants = __esm({ }); // node_modules/openai/resources/beta/realtime/sessions.mjs -var Sessions; -var init_sessions = __esm({ +var Sessions2; +var init_sessions2 = __esm({ "node_modules/openai/resources/beta/realtime/sessions.mjs"() { - init_resource(); - init_headers2(); - Sessions = class extends APIResource { + init_resource2(); + init_headers3(); + Sessions2 = class extends APIResource2 { /** * Create an ephemeral API token for use in client-side applications with the * Realtime API. Can be configured with the same session parameters as the @@ -13440,7 +30846,7 @@ var init_sessions = __esm({ return this._client.post("/realtime/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13452,9 +30858,9 @@ var init_sessions = __esm({ var TranscriptionSessions; var init_transcription_sessions = __esm({ "node_modules/openai/resources/beta/realtime/transcription-sessions.mjs"() { - init_resource(); - init_headers2(); - TranscriptionSessions = class extends APIResource { + init_resource2(); + init_headers3(); + TranscriptionSessions = class extends APIResource2 { /** * Create an ephemeral API token for use in client-side applications with the * Realtime API specifically for realtime transcriptions. Can be configured with @@ -13474,7 +30880,7 @@ var init_transcription_sessions = __esm({ return this._client.post("/realtime/transcription_sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13486,32 +30892,32 @@ var init_transcription_sessions = __esm({ var Realtime; var init_realtime = __esm({ "node_modules/openai/resources/beta/realtime/realtime.mjs"() { - init_resource(); - init_sessions(); - init_sessions(); + init_resource2(); + init_sessions2(); + init_sessions2(); init_transcription_sessions(); init_transcription_sessions(); - Realtime = class extends APIResource { + Realtime = class extends APIResource2 { constructor() { super(...arguments); - this.sessions = new Sessions(this._client); + this.sessions = new Sessions2(this._client); this.transcriptionSessions = new TranscriptionSessions(this._client); } }; - Realtime.Sessions = Sessions; + Realtime.Sessions = Sessions2; Realtime.TranscriptionSessions = TranscriptionSessions; } }); // node_modules/openai/resources/beta/agents/environments/files.mjs -var Files; -var init_files = __esm({ +var Files3; +var init_files3 = __esm({ "node_modules/openai/resources/beta/agents/environments/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Files = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Files3 = class extends APIResource2 { /** * Copies inline bytes or a Files API file into a connected execution environment. * See @@ -13531,10 +30937,10 @@ var init_files = __esm({ * ``` */ create(environmentID, body, options) { - return this._client.post(path`/agents/environments/${environmentID}/files`, { + return this._client.post(path3`/agents/environments/${environmentID}/files`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13554,10 +30960,10 @@ var init_files = __esm({ * ``` */ list(environmentID, query = {}, options) { - return this._client.getAPIList(path`/agents/environments/${environmentID}/files`, TokenPage, { + return this._client.getAPIList(path3`/agents/environments/${environmentID}/files`, TokenPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13569,11 +30975,11 @@ var init_files = __esm({ var Templates; var init_templates = __esm({ "node_modules/openai/resources/beta/agents/environments/templates.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Templates = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Templates = class extends APIResource2 { /** * Creates reusable environment configuration without returning confidential setup * commands or environment values. See @@ -13589,7 +30995,7 @@ var init_templates = __esm({ return this._client.post("/agents/environments/templates", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13607,9 +31013,9 @@ var init_templates = __esm({ * ``` */ retrieve(environmentTemplateID, options) { - return this._client.get(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.get(path3`/agents/environments/templates/${environmentTemplateID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13627,10 +31033,10 @@ var init_templates = __esm({ * ``` */ update(environmentTemplateID, body = {}, options) { - return this._client.post(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.post(path3`/agents/environments/templates/${environmentTemplateID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13650,7 +31056,7 @@ var init_templates = __esm({ return this._client.getAPIList("/agents/environments/templates", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13668,9 +31074,9 @@ var init_templates = __esm({ * ``` */ delete(environmentTemplateID, options) { - return this._client.delete(path`/agents/environments/templates/${environmentTemplateID}`, { + return this._client.delete(path3`/agents/environments/templates/${environmentTemplateID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -13679,20 +31085,20 @@ var init_templates = __esm({ }); // node_modules/openai/resources/beta/agents/environments/environments.mjs -var Environments; -var init_environments = __esm({ +var Environments2; +var init_environments2 = __esm({ "node_modules/openai/resources/beta/agents/environments/environments.mjs"() { - init_resource(); - init_files(); - init_files(); + init_resource2(); + init_files3(); + init_files3(); init_templates(); init_templates(); - init_headers2(); - init_path(); - Environments = class extends APIResource { + init_headers3(); + init_path2(); + Environments2 = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files(this._client); + this.files = new Files3(this._client); this.templates = new Templates(this._client); } /** @@ -13709,15 +31115,15 @@ var init_environments = __esm({ * ``` */ retrieve(environmentID, options) { - return this._client.get(path`/agents/environments/${environmentID}`, { + return this._client.get(path3`/agents/environments/${environmentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Environments.Files = Files; - Environments.Templates = Templates; + Environments2.Files = Files3; + Environments2.Templates = Templates; } }); @@ -13725,7 +31131,7 @@ var init_environments = __esm({ var _TurnState_turnID, _TurnState_turnEnded, _TurnState_eventIDs, _TurnState_calls, TurnState; var init_turn_state = __esm({ "node_modules/openai/lib/agents/turn-state.mjs"() { - init_tslib(); + init_tslib2(); TurnState = class { constructor() { _TurnState_turnID.set(this, void 0); @@ -13735,27 +31141,27 @@ var init_turn_state = __esm({ } /** Records a delivery unless its event ID is in the bounded recent window. */ accept(event) { - if (__classPrivateFieldGet(this, _TurnState_eventIDs, "f").has(event.event_id)) { + if (__classPrivateFieldGet2(this, _TurnState_eventIDs, "f").has(event.event_id)) { return false; } - if (__classPrivateFieldGet(this, _TurnState_eventIDs, "f").size === 1024) { - const oldest = __classPrivateFieldGet(this, _TurnState_eventIDs, "f").values().next(); + if (__classPrivateFieldGet2(this, _TurnState_eventIDs, "f").size === 1024) { + const oldest = __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").values().next(); if (!oldest.done) { - __classPrivateFieldGet(this, _TurnState_eventIDs, "f").delete(oldest.value); + __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").delete(oldest.value); } } - __classPrivateFieldGet(this, _TurnState_eventIDs, "f").add(event.event_id); - if (event.type === "agent.session.turn.created" && event.turn.subagent_id === null && __classPrivateFieldGet(this, _TurnState_turnID, "f") === void 0) { - __classPrivateFieldSet(this, _TurnState_turnID, event.turn_id, "f"); + __classPrivateFieldGet2(this, _TurnState_eventIDs, "f").add(event.event_id); + if (event.type === "agent.session.turn.created" && event.turn.subagent_id === null && __classPrivateFieldGet2(this, _TurnState_turnID, "f") === void 0) { + __classPrivateFieldSet2(this, _TurnState_turnID, event.turn_id, "f"); } - if ((event.type === "agent.session.turn.completed" || event.type === "agent.session.turn.failed" || event.type === "agent.session.turn.cancelled") && __classPrivateFieldGet(this, _TurnState_turnID, "f") !== void 0 && event.turn_id === __classPrivateFieldGet(this, _TurnState_turnID, "f")) { - __classPrivateFieldSet(this, _TurnState_turnEnded, true, "f"); + if ((event.type === "agent.session.turn.completed" || event.type === "agent.session.turn.failed" || event.type === "agent.session.turn.cancelled") && __classPrivateFieldGet2(this, _TurnState_turnID, "f") !== void 0 && event.turn_id === __classPrivateFieldGet2(this, _TurnState_turnID, "f")) { + __classPrivateFieldSet2(this, _TurnState_turnEnded, true, "f"); } return true; } /** Checks session termination after updating the selected turn state. */ terminal(event) { - return event.type === "agent.session.failed" || event.type === "agent.session.idle" && __classPrivateFieldGet(this, _TurnState_turnEnded, "f"); + return event.type === "agent.session.failed" || event.type === "agent.session.idle" && __classPrivateFieldGet2(this, _TurnState_turnEnded, "f"); } /** Returns each tool call once for the full invocation, including subagent turns. */ call(event) { @@ -13764,10 +31170,10 @@ var init_turn_state = __esm({ } const call = event.item; const key = JSON.stringify([call.turn_id, call.call_id]); - if (__classPrivateFieldGet(this, _TurnState_calls, "f").has(key)) { + if (__classPrivateFieldGet2(this, _TurnState_calls, "f").has(key)) { return; } - __classPrivateFieldGet(this, _TurnState_calls, "f").add(key); + __classPrivateFieldGet2(this, _TurnState_calls, "f").add(key); return call; } }; @@ -13776,11 +31182,11 @@ var init_turn_state = __esm({ }); // node_modules/openai/lib/agents/agent-session-stream.mjs -function isInputContent(value) { - if (!isObj(value)) { +function isInputContent(value2) { + if (!isObj2(value2)) { return false; } - const content = value; + const content = value2; let field; if (content["type"] === "input_text") { field = "text"; @@ -13789,19 +31195,19 @@ function isInputContent(value) { } else { return false; } - return hasOwn(content, "type") && hasOwn(content, field) && typeof content[field] === "string"; + return hasOwn2(content, "type") && hasOwn2(content, field) && typeof content[field] === "string"; } -function normalizedOutput(value) { - if (value === null) { +function normalizedOutput(value2) { + if (value2 === null) { return null; } - if (typeof value === "string" || Array.isArray(value) && value.every(isInputContent)) { - return value; + if (typeof value2 === "string" || Array.isArray(value2) && value2.every(isInputContent)) { + return value2; } throw new OpenAIError("Tool output must be text, content, a JSON object, or null"); } -function toolResult(call, value) { - const output = isObj(value) ? JSON.stringify(value) : value; +function toolResult(call, value2) { + const output = isObj2(value2) ? JSON.stringify(value2) : value2; const serialized = JSON.stringify(output); if (serialized === void 0) { throw new OpenAIError("Tool output must be JSON serializable"); @@ -13823,12 +31229,12 @@ async function cancelBody(response) { var _AgentSessionStream_instances, _AgentSessionStream_consumed, _AgentSessionStream_stream, _AgentSessionStream_response, _AgentSessionStream_reading, _AgentSessionStream_sessions, _AgentSessionStream_sessionID, _AgentSessionStream_input, _AgentSessionStream_handlers, _AgentSessionStream_inputKey, _AgentSessionStream_options, _AgentSessionStream_iterate, _AgentSessionStream_result, _AgentSessionStream_checkAbort, _AgentSessionStream_abortError, _AgentSessionStream_wait, _AgentSessionStream_submit, AgentSessionStream; var init_agent_session_stream = __esm({ "node_modules/openai/lib/agents/agent-session-stream.mjs"() { - init_tslib(); + init_tslib2(); init_turn_state(); - init_error(); - init_headers2(); - init_uuid(); - init_values(); + init_error3(); + init_headers3(); + init_uuid2(); + init_values2(); AgentSessionStream = class { /** Creates an unstarted helper. Prefer client.beta.agents.sessions.stream(). */ constructor(sessions, sessionID, params, options) { @@ -13848,89 +31254,89 @@ var init_agent_session_stream = __esm({ if (params.input.length === 0) { throw new OpenAIError("input must not be empty"); } - __classPrivateFieldSet(this, _AgentSessionStream_sessions, sessions, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_sessionID, sessionID, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_input, { type: "agent.session.input.message", input }, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_handlers, new Map(Object.entries(params.toolHandlers ?? {})), "f"); - const headers = buildHeaders([options?.headers]); - __classPrivateFieldSet(this, _AgentSessionStream_inputKey, headers.nulls.has("idempotency-key") ? void 0 : headers.values.get("idempotency-key") ?? params.idempotencyKey ?? options?.idempotencyKey ?? uuid4(), "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_sessions, sessions, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_sessionID, sessionID, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_input, { type: "agent.session.input.message", input }, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_handlers, new Map(Object.entries(params.toolHandlers ?? {})), "f"); + const headers = buildHeaders2([options?.headers]); + __classPrivateFieldSet2(this, _AgentSessionStream_inputKey, headers.nulls.has("idempotency-key") ? void 0 : headers.values.get("idempotency-key") ?? params.idempotencyKey ?? options?.idempotencyKey ?? uuid42(), "f"); headers.values.delete("idempotency-key"); headers.nulls.delete("idempotency-key"); const { idempotencyKey: _key, ...rest } = options ?? {}; - __classPrivateFieldSet(this, _AgentSessionStream_options, { ...rest, headers }, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_options, { ...rest, headers }, "f"); } /** Closes local requests without cancelling the turn; an optional reason becomes the abort error's cause. */ abort(reason) { this.controller.abort(reason); - __classPrivateFieldGet(this, _AgentSessionStream_stream, "f")?.controller.abort(this.controller.signal.reason); - if (!__classPrivateFieldGet(this, _AgentSessionStream_reading, "f")) { - void cancelBody(__classPrivateFieldGet(this, _AgentSessionStream_response, "f")); + __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f")?.controller.abort(this.controller.signal.reason); + if (!__classPrivateFieldGet2(this, _AgentSessionStream_reading, "f")) { + void cancelBody(__classPrivateFieldGet2(this, _AgentSessionStream_response, "f")); } } /** Starts iteration once; use for await to ensure early exits close the connection. */ [(_AgentSessionStream_consumed = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_stream = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_response = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_reading = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_sessions = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_sessionID = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_input = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_handlers = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_inputKey = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_options = /* @__PURE__ */ new WeakMap(), _AgentSessionStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet(this, _AgentSessionStream_consumed, "f")) { + if (__classPrivateFieldGet2(this, _AgentSessionStream_consumed, "f")) { throw new OpenAIError("An AgentSessionStream can only be consumed once"); } - __classPrivateFieldSet(this, _AgentSessionStream_consumed, true, "f"); - return __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_iterate).call(this); + __classPrivateFieldSet2(this, _AgentSessionStream_consumed, true, "f"); + return __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_iterate).call(this); } }; _AgentSessionStream_iterate = async function* _AgentSessionStream_iterate2() { - const externalSignal = __classPrivateFieldGet(this, _AgentSessionStream_options, "f").signal; + const externalSignal = __classPrivateFieldGet2(this, _AgentSessionStream_options, "f").signal; const abort = () => this.abort(externalSignal?.aborted ? externalSignal.reason : this.controller.signal.reason); externalSignal?.addEventListener("abort", abort, { once: true }); this.controller.signal.addEventListener("abort", abort, { once: true }); - const options = { ...__classPrivateFieldGet(this, _AgentSessionStream_options, "f"), signal: this.controller.signal }; + const options = { ...__classPrivateFieldGet2(this, _AgentSessionStream_options, "f"), signal: this.controller.signal }; const state2 = new TurnState(); try { if (externalSignal?.aborted) { this.abort(externalSignal.reason); } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - const session = await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").retrieve(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), options); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + const session = await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").retrieve(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), options); if (session.status !== "idle") { throw new OpenAIError("sessions.stream requires an idle session; use sessions.events.stream for active sessions"); } - const subscription = await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.stream(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), options).withResponse(); - __classPrivateFieldSet(this, _AgentSessionStream_stream, subscription.data, "f"); - __classPrivateFieldSet(this, _AgentSessionStream_response, subscription.response, "f"); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), { - events: [__classPrivateFieldGet(this, _AgentSessionStream_input, "f")], + const subscription = await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.stream(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), options).withResponse(); + __classPrivateFieldSet2(this, _AgentSessionStream_stream, subscription.data, "f"); + __classPrivateFieldSet2(this, _AgentSessionStream_response, subscription.response, "f"); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), { + events: [__classPrivateFieldGet2(this, _AgentSessionStream_input, "f")], // Spread creates an own data property without invoking inherited setters or changing the object prototype. - ...__classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") === void 0 ? {} : { "Idempotency-Key": __classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") } + ...__classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") === void 0 ? {} : { "Idempotency-Key": __classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") } }, { ...options, - headers: buildHeaders([options.headers, { "Idempotency-Key": __classPrivateFieldGet(this, _AgentSessionStream_inputKey, "f") ?? null }]) + headers: buildHeaders2([options.headers, { "Idempotency-Key": __classPrivateFieldGet2(this, _AgentSessionStream_inputKey, "f") ?? null }]) }); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - __classPrivateFieldSet(this, _AgentSessionStream_reading, true, "f"); - for await (const event of __classPrivateFieldGet(this, _AgentSessionStream_stream, "f")) { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldSet2(this, _AgentSessionStream_reading, true, "f"); + for await (const event of __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f")) { + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); if (!state2.accept(event)) { continue; } const terminal = state2.terminal(event); const pendingCall = state2.call(event); - const handler = pendingCall && __classPrivateFieldGet(this, _AgentSessionStream_handlers, "f").get(pendingCall.name); + const handler = pendingCall && __classPrivateFieldGet2(this, _AgentSessionStream_handlers, "f").get(pendingCall.name); const call = pendingCall && handler ? structuredClone(pendingCall) : void 0; if (terminal) { - __classPrivateFieldGet(this, _AgentSessionStream_stream, "f").controller.abort(); + __classPrivateFieldGet2(this, _AgentSessionStream_stream, "f").controller.abort(); } yield event; if (terminal) { return; } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); if (!call || !handler) { continue; } - const result = await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_result).call(this, call, handler); - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit).call(this, result, options); + const result = await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_result).call(this, call, handler); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit).call(this, result, options); } - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); throw new OpenAIError("Session event stream ended before the turn reached idle or failed"); } finally { externalSignal?.removeEventListener("abort", abort); @@ -13940,12 +31346,12 @@ var init_agent_session_stream = __esm({ }, _AgentSessionStream_result = async function _AgentSessionStream_result2(call, handler) { try { const args = typeof call.arguments === "string" ? JSON.parse(call.arguments) : call.arguments; - if (!isObj(args)) { + if (!isObj2(args)) { throw new OpenAIError("Function arguments must be a JSON object"); } - return toolResult(call, await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => handler(args))); + return toolResult(call, await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => handler(args))); } catch { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); return { type: "agent.session.input.tool_result", turn_id: call.turn_id, @@ -13956,10 +31362,10 @@ var init_agent_session_stream = __esm({ } }, _AgentSessionStream_checkAbort = function _AgentSessionStream_checkAbort2() { if (this.controller.signal.aborted) { - throw __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this); + throw __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this); } }, _AgentSessionStream_abortError = function _AgentSessionStream_abortError2() { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: this.controller.signal.reason, writable: true, @@ -13968,12 +31374,12 @@ var init_agent_session_stream = __esm({ return error; }, _AgentSessionStream_wait = async function _AgentSessionStream_wait2(action) { let onAbort; - const aborted = new Promise((_resolve, reject) => { - onAbort = () => reject(__classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this)); + const aborted = new Promise((_resolve, reject2) => { + onAbort = () => reject2(__classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_abortError).call(this)); this.controller.signal.addEventListener("abort", onAbort, { once: true }); }); try { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); const invoke = async () => await action(); return await Promise.race([invoke(), aborted]); } finally { @@ -13981,21 +31387,21 @@ var init_agent_session_stream = __esm({ this.controller.signal.removeEventListener("abort", onAbort); } } - }, _AgentSessionStream_submit = async function _AgentSessionStream_submit2(result, options, key = uuid4(), attempt = 0) { - __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); + }, _AgentSessionStream_submit = async function _AgentSessionStream_submit2(result, options, key = uuid42(), attempt = 0) { + __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_checkAbort).call(this); try { - await __classPrivateFieldGet(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet(this, _AgentSessionStream_sessionID, "f"), { events: [result], "Idempotency-Key": key }, options); + await __classPrivateFieldGet2(this, _AgentSessionStream_sessions, "f").events.create(__classPrivateFieldGet2(this, _AgentSessionStream_sessionID, "f"), { events: [result], "Idempotency-Key": key }, options); } catch (error) { const delay = [100, 300, 600][attempt]; - if (delay === void 0 || !(error instanceof BadRequestError) || error.code !== "invalid_request_error" || !error.error || !("message" in error.error) || error.error.message !== `Unknown pending tool call: ${result.call_id}`) { + if (delay === void 0 || !(error instanceof BadRequestError2) || error.code !== "invalid_request_error" || !error.error || !("message" in error.error) || error.error.message !== `Unknown pending tool call: ${result.call_id}`) { throw error; } let timer; try { - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => ( + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_wait).call(this, () => ( // oxlint-disable-next-line promise/avoid-new -- Own the registration timer so cancellation clears it promptly. - new Promise((resolve) => { - timer = setTimeout(resolve, delay); + new Promise((resolve2) => { + timer = setTimeout(resolve2, delay); }) )); } finally { @@ -14003,7 +31409,7 @@ var init_agent_session_stream = __esm({ clearTimeout(timer); } } - await __classPrivateFieldGet(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit2).call(this, result, options, key, attempt + 1); + await __classPrivateFieldGet2(this, _AgentSessionStream_instances, "m", _AgentSessionStream_submit2).call(this, result, options, key, attempt + 1); } }; } @@ -14013,11 +31419,11 @@ var init_agent_session_stream = __esm({ var Artifacts; var init_artifacts = __esm({ "node_modules/openai/resources/beta/agents/sessions/artifacts.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Artifacts = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Artifacts = class extends APIResource2 { /** * Retrieves immutable metadata for one durable session artifact. See * [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts). @@ -14033,9 +31439,9 @@ var init_artifacts = __esm({ */ retrieve(artifactID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/artifacts/${artifactID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/artifacts/${artifactID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14054,10 +31460,10 @@ var init_artifacts = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/artifacts`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/artifacts`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14077,9 +31483,9 @@ var init_artifacts = __esm({ */ delete(artifactID, params, options) { const { session_id } = params; - return this._client.delete(path`/agents/sessions/${session_id}/artifacts/${artifactID}`, { + return this._client.delete(path3`/agents/sessions/${session_id}/artifacts/${artifactID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14102,9 +31508,9 @@ var init_artifacts = __esm({ */ content(artifactID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/artifacts/${artifactID}/content`, { + return this._client.get(path3`/agents/sessions/${session_id}/artifacts/${artifactID}/content`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { "OpenAI-Beta": "agents=v1", Accept: "application/octet-stream" }, options?.headers ]), @@ -14117,13 +31523,13 @@ var init_artifacts = __esm({ }); // node_modules/openai/resources/beta/agents/sessions/events.mjs -var Events; -var init_events = __esm({ +var Events3; +var init_events3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/events.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Events = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Events3 = class extends APIResource2 { /** * Submits message, cancellation, or tool-result events to a managed agent session. * Cancellation can recover a still-open turn whose backend execution has ended by @@ -14154,10 +31560,10 @@ var init_events = __esm({ */ create(sessionID, params, options) { const { "Idempotency-Key": idempotencyKey, ...body } = params; - return this._client.post(path`/agents/sessions/${sessionID}/events`, { + return this._client.post(path3`/agents/sessions/${sessionID}/events`, { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { "OpenAI-Beta": "agents=v1", Accept: "*/*", @@ -14181,9 +31587,9 @@ var init_events = __esm({ * ``` */ stream(sessionID, options) { - return this._client.get(path`/agents/sessions/${sessionID}/events`, { + return this._client.get(path3`/agents/sessions/${sessionID}/events`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1", Accept: "text/event-stream" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1", Accept: "text/event-stream" }, options?.headers]), stream: true, __security: { bearerAuth: true } }); @@ -14196,11 +31602,11 @@ var init_events = __esm({ var Items; var init_items = __esm({ "node_modules/openai/resources/beta/agents/sessions/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items = class extends APIResource2 { /** * Lists items produced by the session's root agent, including its interactions * with subagents. Each subagent has its own item history. See @@ -14217,10 +31623,10 @@ var init_items = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14232,11 +31638,11 @@ var init_items = __esm({ var Turns; var init_turns = __esm({ "node_modules/openai/resources/beta/agents/sessions/turns.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Turns = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Turns = class extends APIResource2 { /** * Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if * the turn does not belong to the session. See @@ -14253,9 +31659,9 @@ var init_turns = __esm({ */ retrieve(turnID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/turns/${turnID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/turns/${turnID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14275,10 +31681,10 @@ var init_turns = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/turns`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/turns`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14290,11 +31696,11 @@ var init_turns = __esm({ var Items2; var init_items2 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items2 = class extends APIResource2 { /** * Lists this subagent's own items across all of its turns. See * [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent). @@ -14312,10 +31718,10 @@ var init_items2 = __esm({ */ list(subagentID, params, options) { const { session_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagentID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagentID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14327,11 +31733,11 @@ var init_items2 = __esm({ var Items3; var init_items3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/turns/items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Items3 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Items3 = class extends APIResource2 { /** * Lists items belonging to one turn of this subagent. See * [subagent workflows](https://developers.openai.com/api/docs/guides/agents-api/multi-agent). @@ -14349,10 +31755,10 @@ var init_items3 = __esm({ */ list(turnID, params, options) { const { session_id, subagent_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}/items`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}/items`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14364,13 +31770,13 @@ var init_items3 = __esm({ var Turns2; var init_turns2 = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/turns/turns.mjs"() { - init_resource(); + init_resource2(); init_items3(); init_items3(); - init_pagination(); - init_headers2(); - init_path(); - Turns2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Turns2 = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items3(this._client); @@ -14393,9 +31799,9 @@ var init_turns2 = __esm({ */ retrieve(turnID, params, options) { const { session_id, subagent_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14416,10 +31822,10 @@ var init_turns2 = __esm({ */ list(subagentID, params, options) { const { session_id, ...query } = params; - return this._client.getAPIList(path`/agents/sessions/${session_id}/subagents/${subagentID}/turns`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${session_id}/subagents/${subagentID}/turns`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14432,15 +31838,15 @@ var init_turns2 = __esm({ var Subagents; var init_subagents = __esm({ "node_modules/openai/resources/beta/agents/sessions/subagents/subagents.mjs"() { - init_resource(); + init_resource2(); init_items2(); init_items2(); init_turns2(); init_turns2(); - init_pagination(); - init_headers2(); - init_path(); - Subagents = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Subagents = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items2(this._client); @@ -14461,9 +31867,9 @@ var init_subagents = __esm({ */ retrieve(subagentID, params, options) { const { session_id } = params; - return this._client.get(path`/agents/sessions/${session_id}/subagents/${subagentID}`, { + return this._client.get(path3`/agents/sessions/${session_id}/subagents/${subagentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14482,10 +31888,10 @@ var init_subagents = __esm({ * ``` */ list(sessionID, query = {}, options) { - return this._client.getAPIList(path`/agents/sessions/${sessionID}/subagents`, CursorPage, { + return this._client.getAPIList(path3`/agents/sessions/${sessionID}/subagents`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14496,31 +31902,31 @@ var init_subagents = __esm({ }); // node_modules/openai/resources/beta/agents/sessions/sessions.mjs -var Sessions2; -var init_sessions2 = __esm({ +var Sessions3; +var init_sessions3 = __esm({ "node_modules/openai/resources/beta/agents/sessions/sessions.mjs"() { init_agent_session_stream(); - init_resource(); + init_resource2(); init_artifacts(); init_artifacts(); - init_events(); - init_events(); + init_events3(); + init_events3(); init_items(); init_items(); init_turns(); init_turns(); init_subagents(); init_subagents(); - init_pagination(); - init_headers2(); - init_path(); - Sessions2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_path2(); + Sessions3 = class extends APIResource2 { constructor() { super(...arguments); this.subagents = new Subagents(this._client); this.artifacts = new Artifacts(this._client); this.items = new Items(this._client); - this.events = new Events(this._client); + this.events = new Events3(this._client); this.turns = new Turns(this._client); } /** Stream one turn on an idle session with a single input writer. See AgentSessionStream for lifecycle and tool handling. */ @@ -14531,7 +31937,7 @@ var init_sessions2 = __esm({ return this._client.post("/agents/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), stream: body.stream ?? false, __security: { bearerAuth: true } }); @@ -14547,9 +31953,9 @@ var init_sessions2 = __esm({ * ``` */ retrieve(sessionID, options) { - return this._client.get(path`/agents/sessions/${sessionID}`, { + return this._client.get(path3`/agents/sessions/${sessionID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14565,10 +31971,10 @@ var init_sessions2 = __esm({ * ``` */ update(sessionID, body = {}, options) { - return this._client.post(path`/agents/sessions/${sessionID}`, { + return this._client.post(path3`/agents/sessions/${sessionID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14589,7 +31995,7 @@ var init_sessions2 = __esm({ return this._client.getAPIList("/agents/sessions", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14607,30 +32013,30 @@ var init_sessions2 = __esm({ * ``` */ delete(sessionID, options) { - return this._client.delete(path`/agents/sessions/${sessionID}`, { + return this._client.delete(path3`/agents/sessions/${sessionID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Sessions2.Subagents = Subagents; - Sessions2.Artifacts = Artifacts; - Sessions2.Items = Items; - Sessions2.Events = Events; - Sessions2.Turns = Turns; + Sessions3.Subagents = Subagents; + Sessions3.Artifacts = Artifacts; + Sessions3.Items = Items; + Sessions3.Events = Events3; + Sessions3.Turns = Turns; } }); // node_modules/openai/resources/beta/agents/vaults/credentials.mjs -var Credentials; -var init_credentials = __esm({ +var Credentials2; +var init_credentials3 = __esm({ "node_modules/openai/resources/beta/agents/vaults/credentials.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Credentials = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Credentials2 = class extends APIResource2 { /** * Creates a vault credential. Secret values are write-only and are never returned. * See @@ -14653,10 +32059,10 @@ var init_credentials = __esm({ * ``` */ create(vaultID, body, options) { - return this._client.post(path`/vaults/${vaultID}/credentials`, { + return this._client.post(path3`/vaults/${vaultID}/credentials`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14675,9 +32081,9 @@ var init_credentials = __esm({ */ retrieve(credentialID, params, options) { const { vault_id } = params; - return this._client.get(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.get(path3`/vaults/${vault_id}/credentials/${credentialID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14700,10 +32106,10 @@ var init_credentials = __esm({ */ update(credentialID, params, options) { const { vault_id, ...body } = params; - return this._client.post(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.post(path3`/vaults/${vault_id}/credentials/${credentialID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14723,10 +32129,10 @@ var init_credentials = __esm({ * ``` */ list(vaultID, query = {}, options) { - return this._client.getAPIList(path`/vaults/${vaultID}/credentials`, CursorPage, { + return this._client.getAPIList(path3`/vaults/${vaultID}/credentials`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14745,9 +32151,9 @@ var init_credentials = __esm({ */ delete(credentialID, params, options) { const { vault_id } = params; - return this._client.delete(path`/vaults/${vault_id}/credentials/${credentialID}`, { + return this._client.delete(path3`/vaults/${vault_id}/credentials/${credentialID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14756,19 +32162,19 @@ var init_credentials = __esm({ }); // node_modules/openai/resources/beta/agents/vaults/vaults.mjs -var Vaults; -var init_vaults = __esm({ +var Vaults2; +var init_vaults2 = __esm({ "node_modules/openai/resources/beta/agents/vaults/vaults.mjs"() { - init_resource(); - init_credentials(); - init_credentials(); - init_pagination(); - init_headers2(); - init_path(); - Vaults = class extends APIResource { + init_resource2(); + init_credentials3(); + init_credentials3(); + init_pagination2(); + init_headers3(); + init_path2(); + Vaults2 = class extends APIResource2 { constructor() { super(...arguments); - this.credentials = new Credentials(this._client); + this.credentials = new Credentials2(this._client); } /** * Creates a vault for the current project. See @@ -14783,7 +32189,7 @@ var init_vaults = __esm({ return this._client.post("/vaults", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14799,9 +32205,9 @@ var init_vaults = __esm({ * ``` */ retrieve(vaultID, options) { - return this._client.get(path`/vaults/${vaultID}`, { + return this._client.get(path3`/vaults/${vaultID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14821,7 +32227,7 @@ var init_vaults = __esm({ return this._client.getAPIList("/vaults", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14837,37 +32243,37 @@ var init_vaults = __esm({ * ``` */ delete(vaultID, options) { - return this._client.delete(path`/vaults/${vaultID}`, { + return this._client.delete(path3`/vaults/${vaultID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Vaults.Credentials = Credentials; + Vaults2.Credentials = Credentials2; } }); // node_modules/openai/resources/beta/agents/agents.mjs -var Agents; -var init_agents = __esm({ +var Agents2; +var init_agents2 = __esm({ "node_modules/openai/resources/beta/agents/agents.mjs"() { - init_resource(); - init_environments(); - init_environments(); - init_sessions2(); - init_sessions2(); - init_vaults(); - init_vaults(); - init_pagination(); - init_headers2(); - init_path(); - Agents = class extends APIResource { + init_resource2(); + init_environments2(); + init_environments2(); + init_sessions3(); + init_sessions3(); + init_vaults2(); + init_vaults2(); + init_pagination2(); + init_headers3(); + init_path2(); + Agents2 = class extends APIResource2 { constructor() { super(...arguments); - this.environments = new Environments(this._client); - this.vaults = new Vaults(this._client); - this.sessions = new Sessions2(this._client); + this.environments = new Environments2(this._client); + this.vaults = new Vaults2(this._client); + this.sessions = new Sessions3(this._client); } /** * Creates a reusable agent without storing credentials. See @@ -14884,7 +32290,7 @@ var init_agents = __esm({ return this._client.post("/agents", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14898,9 +32304,9 @@ var init_agents = __esm({ * ``` */ retrieve(agentID, options) { - return this._client.get(path`/agents/${agentID}`, { + return this._client.get(path3`/agents/${agentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14914,10 +32320,10 @@ var init_agents = __esm({ * ``` */ update(agentID, body = {}, options) { - return this._client.post(path`/agents/${agentID}`, { + return this._client.post(path3`/agents/${agentID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14937,7 +32343,7 @@ var init_agents = __esm({ return this._client.getAPIList("/agents", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -14953,27 +32359,27 @@ var init_agents = __esm({ * ``` */ delete(agentID, options) { - return this._client.delete(path`/agents/${agentID}`, { + return this._client.delete(path3`/agents/${agentID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Agents.Environments = Environments; - Agents.Vaults = Vaults; - Agents.Sessions = Sessions2; + Agents2.Environments = Environments2; + Agents2.Vaults = Vaults2; + Agents2.Sessions = Sessions3; } }); // node_modules/openai/resources/beta/chatkit/sessions.mjs -var Sessions3; -var init_sessions3 = __esm({ +var Sessions4; +var init_sessions4 = __esm({ "node_modules/openai/resources/beta/chatkit/sessions.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Sessions3 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Sessions4 = class extends APIResource2 { /** * Create a ChatKit session. * @@ -14990,7 +32396,7 @@ var init_sessions3 = __esm({ return this._client.post("/chatkit/sessions", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15006,9 +32412,9 @@ var init_sessions3 = __esm({ * ``` */ cancel(sessionID, options) { - return this._client.post(path`/chatkit/sessions/${sessionID}/cancel`, { + return this._client.post(path3`/chatkit/sessions/${sessionID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15017,14 +32423,14 @@ var init_sessions3 = __esm({ }); // node_modules/openai/resources/beta/chatkit/threads.mjs -var Threads; -var init_threads = __esm({ +var Threads2; +var init_threads2 = __esm({ "node_modules/openai/resources/beta/chatkit/threads.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Threads = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Threads2 = class extends APIResource2 { /** * Retrieve a ChatKit thread by its identifier. * @@ -15035,9 +32441,9 @@ var init_threads = __esm({ * ``` */ retrieve(threadID, options) { - return this._client.get(path`/chatkit/threads/${threadID}`, { + return this._client.get(path3`/chatkit/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15056,7 +32462,7 @@ var init_threads = __esm({ return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15071,9 +32477,9 @@ var init_threads = __esm({ * ``` */ delete(threadID, options) { - return this._client.delete(path`/chatkit/threads/${threadID}`, { + return this._client.delete(path3`/chatkit/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15091,10 +32497,10 @@ var init_threads = __esm({ * ``` */ listItems(threadID, query = {}, options) { - return this._client.getAPIList(path`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { + return this._client.getAPIList(path3`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15106,20 +32512,20 @@ var init_threads = __esm({ var ChatKit; var init_chatkit = __esm({ "node_modules/openai/resources/beta/chatkit/chatkit.mjs"() { - init_resource(); - init_sessions3(); - init_sessions3(); - init_threads(); - init_threads(); - ChatKit = class extends APIResource { + init_resource2(); + init_sessions4(); + init_sessions4(); + init_threads2(); + init_threads2(); + ChatKit = class extends APIResource2 { constructor() { super(...arguments); - this.sessions = new Sessions3(this._client); - this.threads = new Threads(this._client); + this.sessions = new Sessions4(this._client); + this.threads = new Threads2(this._client); } }; - ChatKit.Sessions = Sessions3; - ChatKit.Threads = Threads; + ChatKit.Sessions = Sessions4; + ChatKit.Threads = Threads2; } }); @@ -15127,11 +32533,11 @@ var init_chatkit = __esm({ var InputItems; var init_input_items = __esm({ "node_modules/openai/resources/beta/responses/input-items.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - InputItems = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + InputItems = class extends APIResource2 { /** * Returns a list of input items for a given response. * @@ -15147,10 +32553,10 @@ var init_input_items = __esm({ */ list(responseID, params = {}, options) { const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path`/responses/${responseID}/input_items?beta=true`, CursorPage, { + return this._client.getAPIList(path3`/responses/${responseID}/input_items?beta=true`, CursorPage, { query, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15165,9 +32571,9 @@ var init_input_items = __esm({ var InputTokens; var init_input_tokens = __esm({ "node_modules/openai/resources/beta/responses/input-tokens.mjs"() { - init_resource(); - init_headers2(); - InputTokens = class extends APIResource { + init_resource2(); + init_headers3(); + InputTokens = class extends APIResource2 { /** * Returns input token counts of the request. * @@ -15185,7 +32591,7 @@ var init_input_tokens = __esm({ return this._client.post("/responses/input_tokens?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15200,14 +32606,14 @@ var init_input_tokens = __esm({ var Responses; var init_responses = __esm({ "node_modules/openai/resources/beta/responses/responses.mjs"() { - init_resource(); + init_resource2(); init_input_items(); init_input_items(); init_input_tokens(); init_input_tokens(); - init_headers2(); - init_path(); - Responses = class extends APIResource { + init_headers3(); + init_path2(); + Responses = class extends APIResource2 { constructor() { super(...arguments); this.inputItems = new InputItems(this._client); @@ -15218,7 +32624,7 @@ var init_responses = __esm({ return this._client.post("/responses?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15228,10 +32634,10 @@ var init_responses = __esm({ } retrieve(responseID, params = {}, options) { const { betas, ...query } = params ?? {}; - return this._client.get(path`/responses/${responseID}?beta=true`, { + return this._client.get(path3`/responses/${responseID}?beta=true`, { query, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15251,9 +32657,9 @@ var init_responses = __esm({ */ delete(responseID, params = {}, options) { const { betas } = params ?? {}; - return this._client.delete(path`/responses/${responseID}?beta=true`, { + return this._client.delete(path3`/responses/${responseID}?beta=true`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { Accept: "*/*", ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15274,9 +32680,9 @@ var init_responses = __esm({ */ cancel(responseID, params = {}, options) { const { betas } = params ?? {}; - return this._client.post(path`/responses/${responseID}/cancel?beta=true`, { + return this._client.post(path3`/responses/${responseID}/cancel?beta=true`, { ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15304,7 +32710,7 @@ var init_responses = __esm({ return this._client.post("/responses/compact?beta=true", { body, ...options, - headers: buildHeaders([ + headers: buildHeaders2([ { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 }, options?.headers ]), @@ -15318,24 +32724,24 @@ var init_responses = __esm({ }); // node_modules/openai/resources/beta/threads/messages.mjs -var Messages2; -var init_messages2 = __esm({ +var Messages4; +var init_messages4 = __esm({ "node_modules/openai/resources/beta/threads/messages.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Messages2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Messages4 = class extends APIResource2 { /** * Create a message. * * @deprecated The Assistants API is deprecated in favor of the Responses API */ create(threadID, body, options) { - return this._client.post(path`/threads/${threadID}/messages`, { + return this._client.post(path3`/threads/${threadID}/messages`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15346,9 +32752,9 @@ var init_messages2 = __esm({ */ retrieve(messageID, params, options) { const { thread_id } = params; - return this._client.get(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.get(path3`/threads/${thread_id}/messages/${messageID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15359,10 +32765,10 @@ var init_messages2 = __esm({ */ update(messageID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.post(path3`/threads/${thread_id}/messages/${messageID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15372,10 +32778,10 @@ var init_messages2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ list(threadID, query = {}, options) { - return this._client.getAPIList(path`/threads/${threadID}/messages`, CursorPage, { + return this._client.getAPIList(path3`/threads/${threadID}/messages`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15386,9 +32792,9 @@ var init_messages2 = __esm({ */ delete(messageID, params, options) { const { thread_id } = params; - return this._client.delete(path`/threads/${thread_id}/messages/${messageID}`, { + return this._client.delete(path3`/threads/${thread_id}/messages/${messageID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15400,11 +32806,11 @@ var init_messages2 = __esm({ var Steps; var init_steps = __esm({ "node_modules/openai/resources/beta/threads/runs/steps.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_path(); - Steps = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_path2(); + Steps = class extends APIResource2 { /** * Retrieves a run step. * @@ -15412,10 +32818,10 @@ var init_steps = __esm({ */ retrieve(stepID, params, options) { const { thread_id, run_id, ...query } = params; - return this._client.get(path`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, { + return this._client.get(path3`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15426,10 +32832,10 @@ var init_steps = __esm({ */ list(runID, params, options) { const { thread_id, ...query } = params; - return this._client.getAPIList(path`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, { + return this._client.getAPIList(path3`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -15438,12 +32844,12 @@ var init_steps = __esm({ }); // node_modules/openai/internal/utils/base64.mjs -var fromBase64, toFloat32Array; -var init_base64 = __esm({ +var fromBase642, toFloat32Array; +var init_base642 = __esm({ "node_modules/openai/internal/utils/base64.mjs"() { - init_error(); - init_bytes(); - fromBase64 = (str2) => { + init_error3(); + init_bytes2(); + fromBase642 = (str2) => { if (typeof globalThis.Buffer !== "undefined") { const buf = globalThis.Buffer.from(str2, "base64"); return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); @@ -15479,10 +32885,10 @@ var init_base64 = __esm({ }); // node_modules/openai/internal/utils/env.mjs -var readEnv; -var init_env = __esm({ +var readEnv2; +var init_env2 = __esm({ "node_modules/openai/internal/utils/env.mjs"() { - readEnv = (env) => { + readEnv2 = (env) => { try { if (typeof globalThis.process !== "undefined") { return globalThis.process.env?.[env]?.trim() || void 0; @@ -15499,15 +32905,15 @@ var init_env = __esm({ }); // node_modules/openai/internal/utils.mjs -var init_utils2 = __esm({ +var init_utils4 = __esm({ "node_modules/openai/internal/utils.mjs"() { - init_values(); - init_base64(); - init_env(); - init_log(); - init_uuid(); - init_sleep(); - init_query(); + init_values2(); + init_base642(); + init_env2(); + init_log2(); + init_uuid2(); + init_sleep2(); + init_query2(); } }); @@ -15548,8 +32954,8 @@ function commitAssistantStreamArrayProjection(projection) { } } } -function isPrimitiveAssistantStreamValue(value) { - return typeof value === "string" || typeof value === "number"; +function isPrimitiveAssistantStreamValue(value2) { + return typeof value2 === "string" || typeof value2 === "number"; } function isPrimitiveAssistantStreamArrayDelta(accumulator, delta) { return delta.every(isPrimitiveAssistantStreamValue) && accumulator.every(isPrimitiveAssistantStreamValue); @@ -15603,14 +33009,14 @@ function assertValidAssistantStreamArrayDelta(accumulator, delta, kind, projecti projection.arrays.set(accumulator, projectedArray); } for (const deltaEntry of delta) { - if (!isObj(deltaEntry)) { + if (!isObj2(deltaEntry)) { throw new Error("Expected array delta entry to be an object but got an invalid value"); } const validatedIndex = getAssistantStreamDeltaIndex(deltaEntry, kind, projectedArray.baselineLength); let accumulatedEntry; if (projectedArray.entries.has(validatedIndex)) { accumulatedEntry = projectedArray.entries.get(validatedIndex); - } else if (hasOwn(accumulator, validatedIndex)) { + } else if (hasOwn2(accumulator, validatedIndex)) { accumulatedEntry = accumulator[validatedIndex]; if (accumulatedEntry === null || accumulatedEntry === void 0) { projectedArray.entries.set(validatedIndex, deltaEntry); @@ -15623,7 +33029,7 @@ function assertValidAssistantStreamArrayDelta(accumulator, delta, kind, projecti if (projectedArray.enforceSparseHoleBudget && projectedLength - projectedArray.ownEntryCount > MAX_ASSISTANT_STREAM_ARRAY_GROWTH) { throw new OpenAIError(`Assistant stream delta contains an invalid ${kind} index: ${validatedIndex}`); } - if (isObj(accumulatedEntry)) { + if (isObj2(accumulatedEntry)) { validateRecord(accumulatedEntry, deltaEntry, projection); } projectedArray.length = projectedLength; @@ -15638,7 +33044,7 @@ function assertValidAssistantStreamDeltaIndices(accumulator, delta, projection) let accumulatedValue; if (projectedValues?.has(key)) { accumulatedValue = projectedValues.get(key); - } else if (hasOwn(accumulator, key)) { + } else if (hasOwn2(accumulator, key)) { accumulatedValue = accumulator[key]; } if (accumulatedValue === null || accumulatedValue === void 0) { @@ -15649,39 +33055,39 @@ function assertValidAssistantStreamDeltaIndices(accumulator, delta, projection) projectedValues.set(key, deltaValue); continue; } - if (isObj(accumulatedValue) && isObj(deltaValue)) { + if (isObj2(accumulatedValue) && isObj2(deltaValue)) { assertValidAssistantStreamDeltaIndices(accumulatedValue, deltaValue, projection); } else if (Array.isArray(accumulatedValue) && Array.isArray(deltaValue) && !isPrimitiveAssistantStreamArrayDelta(accumulatedValue, deltaValue)) { assertValidAssistantStreamArrayDelta(accumulatedValue, deltaValue, "array", projection, assertValidAssistantStreamDeltaIndices); } } } -function isAssistantStreamValueExternallyMutable(value) { - return (isObj(value) || Array.isArray(value)) && externallyMutableAssistantStreamValues.has(value); +function isAssistantStreamValueExternallyMutable(value2) { + return (isObj2(value2) || Array.isArray(value2)) && externallyMutableAssistantStreamValues.has(value2); } -function markAssistantStreamValueExternallyMutable(value) { - if (!isObj(value) && !Array.isArray(value) || externallyMutableAssistantStreamValues.has(value)) { +function markAssistantStreamValueExternallyMutable(value2) { + if (!isObj2(value2) && !Array.isArray(value2) || externallyMutableAssistantStreamValues.has(value2)) { return; } - externallyMutableAssistantStreamValues.add(value); - if (Array.isArray(value)) { - assistantStreamArrayStates.delete(value); + externallyMutableAssistantStreamValues.add(value2); + if (Array.isArray(value2)) { + assistantStreamArrayStates.delete(value2); } - for (const key of Reflect.ownKeys(value)) { - const descriptor = Object.getOwnPropertyDescriptor(value, key); + for (const key of Reflect.ownKeys(value2)) { + const descriptor = Object.getOwnPropertyDescriptor(value2, key); if (descriptor && "value" in descriptor) { markAssistantStreamValueExternallyMutable(descriptor.value); } } } -function defineAssistantStreamArrayEntry(accumulator, index, value) { +function defineAssistantStreamArrayEntry(accumulator, index, value2) { if (externallyMutableAssistantStreamValues.has(accumulator)) { - markAssistantStreamValueExternallyMutable(value); + markAssistantStreamValueExternallyMutable(value2); } Object.defineProperty(accumulator, index, { configurable: true, enumerable: true, - value, + value: value2, writable: true }); } @@ -15702,11 +33108,11 @@ function applyAssistantStreamArrayDelta(accumulator, delta, applyRecord) { return; } for (const deltaEntry of delta) { - if (!isObj(deltaEntry)) { + if (!isObj2(deltaEntry)) { throw new Error("Expected array delta entry to be an object but got an invalid value"); } const index = getRequiredAssistantStreamArrayIndex(deltaEntry); - if (hasOwn(accumulator, index)) { + if (hasOwn2(accumulator, index)) { const accumulatedEntry = accumulator[index]; if (accumulatedEntry === null || accumulatedEntry === void 0) { if (externallyMutableAssistantStreamValues.has(accumulator)) { @@ -15727,7 +33133,7 @@ function applyAssistantStreamDelta(accumulator, delta) { if (key === "__proto__" || key === "constructor" || key === "prototype") { throw new OpenAIError(`Assistant stream delta contains an unsafe property: ${key}`); } - if (!hasOwn(accumulator, key)) { + if (!hasOwn2(accumulator, key)) { if (externallyMutable) { markAssistantStreamValueExternallyMutable(deltaValue); } @@ -15750,7 +33156,7 @@ function applyAssistantStreamDelta(accumulator, delta) { accumulatedValue += deltaValue; } else if (typeof accumulatedValue === "number" && typeof deltaValue === "number") { accumulatedValue += deltaValue; - } else if (isObj(accumulatedValue) && isObj(deltaValue)) { + } else if (isObj2(accumulatedValue) && isObj2(deltaValue)) { accumulatedValue = applyAssistantStreamDelta(accumulatedValue, deltaValue); } else if (Array.isArray(accumulatedValue) && Array.isArray(deltaValue)) { applyAssistantStreamArrayDelta(accumulatedValue, deltaValue, applyAssistantStreamDelta); @@ -15762,11 +33168,11 @@ function applyAssistantStreamDelta(accumulator, delta) { } return accumulator; } -function assertSafeAssistantStreamDelta(value) { - if (!isObj(value) && !Array.isArray(value)) { +function assertSafeAssistantStreamDelta(value2) { + if (!isObj2(value2) && !Array.isArray(value2)) { return; } - for (const [key, nestedValue] of Object.entries(value)) { + for (const [key, nestedValue] of Object.entries(value2)) { if (key === "__proto__" || key === "constructor" || key === "prototype") { throw new OpenAIError(`Assistant stream delta contains an unsafe property: ${key}`); } @@ -15792,8 +33198,8 @@ function createAssistantStreamArrayDeltaCommit(accumulator, delta, kind, cacheAr var MAX_ASSISTANT_STREAM_ARRAY_GROWTH, MAX_EXTERNALLY_MUTABLE_ASSISTANT_STREAM_ARRAY_LENGTH, assistantStreamArrayStates, externallyMutableAssistantStreamValues; var init_assistant_stream_delta = __esm({ "node_modules/openai/internal/assistant-stream-delta.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); MAX_ASSISTANT_STREAM_ARRAY_GROWTH = 1024; MAX_EXTERNALLY_MUTABLE_ASSISTANT_STREAM_ARRAY_LENGTH = 65536; assistantStreamArrayStates = /* @__PURE__ */ new WeakMap(); @@ -15833,11 +33239,11 @@ function assertNever2(_x) { var _AssistantStream_instances, _AssistantStream_runStepSnapshots, _AssistantStream_runStepIDOwners, _AssistantStream_activeRunStepID, _AssistantStream_messageSnapshots, _AssistantStream_messageIDOwners, _AssistantStream_messageSnapshot, _AssistantStream_activeMessageID, _AssistantStream_finalRun, _AssistantStream_currentContentIndex, _AssistantStream_currentContent, _AssistantStream_currentToolCallIndex, _AssistantStream_currentToolCall, _AssistantStream_currentEvent, _AssistantStream_currentRunSnapshot, _AssistantStream_currentRunStepSnapshot, _AssistantStream_addEvent, _AssistantStream_endRequest, _AssistantStream_validateRunStepEvent, _AssistantStream_reserveRunStepAlias, _AssistantStream_validateMessageEvent, _AssistantStream_reserveMessageAlias, _AssistantStream_handleMessage, _AssistantStream_handleRunStep, _AssistantStream_emitExposed, _AssistantStream_handleEvent, _AssistantStream_accumulateRunStep, _AssistantStream_accumulateMessage, _AssistantStream_accumulateContent, _AssistantStream_handleRun, AssistantStream; var init_AssistantStream = __esm({ "node_modules/openai/lib/AssistantStream.mjs"() { - init_tslib(); - init_streaming2(); - init_error2(); + init_tslib2(); + init_streaming4(); + init_error4(); init_EventStream(); - init_utils2(); + init_utils4(); init_assistant_stream_delta(); AssistantStream = class _AssistantStream extends EventStream2 { constructor() { @@ -15868,27 +33274,27 @@ var init_AssistantStream = __esm({ }, { onReturn: () => this.abort() }); } /** Restores an assistant stream from events serialized by `toReadableStream()`. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _AssistantStream(); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** Serializes assistant events into a readable stream for transfer to another runtime. */ toReadableStream() { - const stream4 = new Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); + const stream5 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); } /** Submits tool outputs and starts streaming the continuation of an existing assistant run. */ static createToolAssistantStream(runId, runs, params, options) { @@ -15899,21 +33305,21 @@ var init_AssistantStream = __esm({ })); return runner; } - async _createToolAssistantStream(run, runId, params, options) { + async _createToolAssistantStream(run2, runId, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await run.submitToolOutputs(runId, body, { + const stream5 = await run2.submitToolOutputs(runId, body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** Creates an assistant thread and starts streaming its newly created run. */ static createThreadAssistantStream(params, thread, options) { @@ -15935,28 +33341,28 @@ var init_AssistantStream = __esm({ } /** Returns the most recent raw event, or `undefined` before any event arrives. */ currentEvent() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentEvent, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentEvent, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentEvent, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentEvent, "f"); } /** Returns the latest run snapshot, or `undefined` before a run event arrives. */ currentRun() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentRunSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentRunSnapshot, "f"); } /** Returns the message currently being accumulated, or `undefined` before message creation. */ currentMessageSnapshot() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f"); } /** Returns the run step currently being accumulated, or `undefined` before a step begins. */ currentRunStepSnapshot() { - markAssistantStreamValueExternallyMutable(__classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f")); - return __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"); + markAssistantStreamValueExternallyMutable(__classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f")); + return __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f"); } /** Waits for successful completion and returns the final snapshot of every observed run step. */ async finalRunSteps() { await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")); + return Object.values(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")); } /** * Waits for successful completion and returns the final snapshot of every observed message. @@ -15964,41 +33370,41 @@ var init_AssistantStream = __esm({ */ async finalMessages() { await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")); + return Object.values(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")); } /** Waits for completion and returns the final run, or rejects if no terminal run was received. */ async finalRun() { await this.done(); - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_finalRun, "f")) { throw new Error("Final run was not received."); } - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + return __classPrivateFieldGet2(this, _AssistantStream_finalRun, "f"); } async _createThreadAssistantStream(thread, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await thread.createAndRun(body, { ...options, signal: this.controller.signal }); + const stream5 = await thread.createAndRun(body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } - async _createAssistantStream(run, threadId, params, options) { + async _createAssistantStream(run2, threadId, params, options) { this._listenForAbort(options?.signal); const body = { ...params, stream: true }; - const stream4 = await run.create(threadId, body, { ...options, signal: this.controller.signal }); + const stream5 = await run2.create(threadId, body, { ...options, signal: this.controller.signal }); this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return this._addRun(__classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } /** * Applies an assistant delta to its mutable snapshot, concatenating text and @@ -16007,9 +33413,9 @@ var init_AssistantStream = __esm({ static accumulateDelta(acc, delta) { return accumulateAssistantStreamDelta(acc, delta); } - _addRun(run) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "run", run); - return run; + _addRun(run2) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "run", run2); + return run2; } async _threadAssistantStream(params, thread, options) { return await this._createThreadAssistantStream(thread, params, options); @@ -16036,7 +33442,7 @@ var init_AssistantStream = __esm({ case "thread.message.delta": case "thread.message.completed": case "thread.message.incomplete": { - messageID = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_validateMessageEvent).call(this, stableEvent); + messageID = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_validateMessageEvent).call(this, stableEvent); messageData = stableEvent.data; break; } @@ -16047,21 +33453,21 @@ var init_AssistantStream = __esm({ case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": { - runStepID = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_validateRunStepEvent).call(this, stableEvent); + runStepID = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_validateRunStepEvent).call(this, stableEvent); runStepData = stableEvent.data; break; } } - __classPrivateFieldSet(this, _AssistantStream_currentEvent, exposedEvent, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, exposedEvent); + __classPrivateFieldSet2(this, _AssistantStream_currentEvent, exposedEvent, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, exposedEvent); if (messageID !== void 0 && messageData !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, messageData, messageID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, messageData, messageID); } if (runStepID !== void 0 && runStepData !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, runStepData, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, runStepData, runStepID); } - if (runStepID === void 0 && __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0 && __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"), __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")); + if (runStepID === void 0 && __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0 && __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, __classPrivateFieldGet2(this, _AssistantStream_currentRunStepSnapshot, "f"), __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")); } switch (stableEvent.event) { case "thread.created": { @@ -16077,7 +33483,7 @@ var init_AssistantStream = __esm({ case "thread.run.cancelling": case "thread.run.cancelled": case "thread.run.expired": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, stableEvent); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, stableEvent); break; } case "thread.run.step.created": @@ -16090,15 +33496,15 @@ var init_AssistantStream = __esm({ if (runStepID === void 0) { throw new OpenAIError("Received assistant run-step event without a canonical run-step ID"); } - const activeRunStep = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + const activeRunStep = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (activeRunStep) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, activeRunStep, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, activeRunStep, runStepID); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, stableEvent, runStepID); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, stableEvent.data, runStepID); - const retainedRunStep = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, stableEvent, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, stableEvent.data, runStepID); + const retainedRunStep = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (retainedRunStep) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, retainedRunStep, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveRunStepAlias).call(this, retainedRunStep, runStepID); } break; } @@ -16107,21 +33513,21 @@ var init_AssistantStream = __esm({ case "thread.message.delta": case "thread.message.completed": case "thread.message.incomplete": { - if (messageID !== void 0 && __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"), messageID); + if (messageID !== void 0 && __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f"), messageID); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, stableEvent); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, stableEvent); if (messageID !== void 0) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, stableEvent.data, messageID); - const retainedMessage = __classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[messageID]; + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, stableEvent.data, messageID); + const retainedMessage = __classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")[messageID]; if (retainedMessage) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, retainedMessage, messageID); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_reserveMessageAlias).call(this, retainedMessage, messageID); } } break; } case "error": { - throw new APIError(void 0, stableEvent.data, void 0, void 0); + throw new APIError2(void 0, stableEvent.data, void 0, void 0); } default: { assertNever2(stableEvent); @@ -16131,10 +33537,10 @@ var init_AssistantStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_finalRun, "f")) { throw new Error("Final run has not been received"); } - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + return __classPrivateFieldGet2(this, _AssistantStream_finalRun, "f"); }, _AssistantStream_validateRunStepEvent = function _AssistantStream_validateRunStepEvent2(event) { const descriptor = Object.getOwnPropertyDescriptor(event.data, "id"); const runStepID = descriptor && "value" in descriptor ? descriptor.value : void 0; @@ -16143,39 +33549,39 @@ var init_AssistantStream = __esm({ } if (event.event === "thread.run.step.delta") { const delta = event.data.delta; - if (delta && hasOwn(delta, "id")) { + if (delta && hasOwn2(delta, "id")) { throw new OpenAIError("Run-step deltas must not contain an id field"); } } if (event.event === "thread.run.step.created") { - if (__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0) { - throw new OpenAIError(`Received run-step creation for "${runStepID}" before the active run step "${__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")}" reached a terminal state`); + if (__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0) { + throw new OpenAIError(`Received run-step creation for "${runStepID}" before the active run step "${__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")}" reached a terminal state`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { throw new OpenAIError(`Received run-step creation for run step "${runStepID}", which has already been created`); } - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, runStepID, "f"); - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, runStepID, "f"); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); return runStepID; } - if (__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f") !== void 0) { - if (runStepID !== __classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")) { - throw new OpenAIError(`Received ${event.event} for run step "${runStepID}", which does not match the active run step "${__classPrivateFieldGet(this, _AssistantStream_activeRunStepID, "f")}"`); + if (__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f") !== void 0) { + if (runStepID !== __classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")) { + throw new OpenAIError(`Received ${event.event} for run step "${runStepID}", which does not match the active run step "${__classPrivateFieldGet2(this, _AssistantStream_activeRunStepID, "f")}"`); } return runStepID; } if (event.event === "thread.run.step.delta") { - if (!hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID)) { + if (!hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID)) { throw new OpenAIError("Received a RunStepDelta before creation of a snapshot"); } throw new OpenAIError(`Received run-step delta for "${runStepID}" with no active run step`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f"), runStepID) || __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").has(runStepID)) { throw new OpenAIError(`Received run-step event for run step "${runStepID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, runStepID); if (event.event === "thread.run.step.in_progress") { - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, runStepID, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, runStepID, "f"); } return runStepID; }, _AssistantStream_reserveRunStepAlias = function _AssistantStream_reserveRunStepAlias2(data, canonicalID) { @@ -16184,11 +33590,11 @@ var init_AssistantStream = __esm({ if (typeof runStepID !== "string" || runStepID.length === 0) { throw new OpenAIError("Received assistant run-step event with an invalid run-step ID"); } - const owner = __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").get(runStepID); + const owner = __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").get(runStepID); if (owner !== void 0 && owner !== canonicalID) { throw new OpenAIError(`Received run-step creation for run step "${runStepID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, canonicalID); + __classPrivateFieldGet2(this, _AssistantStream_runStepIDOwners, "f").set(runStepID, canonicalID); }, _AssistantStream_validateMessageEvent = function _AssistantStream_validateMessageEvent2(event) { const descriptor = Object.getOwnPropertyDescriptor(event.data, "id"); const messageID = descriptor && "value" in descriptor ? descriptor.value : void 0; @@ -16196,24 +33602,24 @@ var init_AssistantStream = __esm({ throw new OpenAIError("Received assistant message event with an invalid message ID"); } if (event.event === "thread.message.created") { - if (__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - throw new OpenAIError(`Received message creation for "${messageID}" before the active message "${__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")}" reached a terminal state`); + if (__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + throw new OpenAIError(`Received message creation for "${messageID}" before the active message "${__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")}" reached a terminal state`); } - if (hasOwn(__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f"), messageID) || __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").has(messageID)) { + if (hasOwn2(__classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f"), messageID) || __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").has(messageID)) { throw new OpenAIError(`Received message creation for message "${messageID}", which has already been created`); } - __classPrivateFieldSet(this, _AssistantStream_activeMessageID, messageID, "f"); - __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").set(messageID, messageID); + __classPrivateFieldSet2(this, _AssistantStream_activeMessageID, messageID, "f"); + __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").set(messageID, messageID); return messageID; } - if (!__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { + if (!__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { if (event.event === "thread.message.delta") { throw new OpenAIError("Received a delta with no existing snapshot (there should be one from message creation)"); } throw new OpenAIError("Received thread message event with no existing snapshot"); } - if (messageID !== __classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")) { - throw new OpenAIError(`Received ${event.event} for message "${messageID}", which does not match the active message "${__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")}"`); + if (messageID !== __classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")) { + throw new OpenAIError(`Received ${event.event} for message "${messageID}", which does not match the active message "${__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")}"`); } return messageID; }, _AssistantStream_reserveMessageAlias = function _AssistantStream_reserveMessageAlias2(data, canonicalID) { @@ -16222,137 +33628,137 @@ var init_AssistantStream = __esm({ if (typeof messageID !== "string" || messageID.length === 0) { throw new OpenAIError("Received assistant message event with an invalid message ID"); } - const owner = __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").get(messageID); + const owner = __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").get(messageID); if (owner !== void 0 && owner !== canonicalID) { throw new OpenAIError(`Received message creation for message "${messageID}", which has already been created`); } - __classPrivateFieldGet(this, _AssistantStream_messageIDOwners, "f").set(messageID, canonicalID); + __classPrivateFieldGet2(this, _AssistantStream_messageIDOwners, "f").set(messageID, canonicalID); }, _AssistantStream_handleMessage = function _AssistantStream_handleMessage2(event) { - const [accumulatedMessage, newContent] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); - if (!__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")) { + const [accumulatedMessage, newContent] = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldSet2(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); + if (!__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")) { throw new OpenAIError("Received thread message event with no active message ID"); } - __classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[__classPrivateFieldGet(this, _AssistantStream_activeMessageID, "f")] = accumulatedMessage; + __classPrivateFieldGet2(this, _AssistantStream_messageSnapshots, "f")[__classPrivateFieldGet2(this, _AssistantStream_activeMessageID, "f")] = accumulatedMessage; for (const content of newContent) { const snapshotContent = accumulatedMessage.content[content.index]; if (snapshotContent?.type === "text") { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textCreated", snapshotContent.text); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textCreated", snapshotContent.text); } } switch (event.event) { case "thread.message.created": { - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentContent, void 0, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageCreated", event.data); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageCreated", event.data); break; } case "thread.message.in_progress": { break; } case "thread.message.delta": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDelta", event.data.delta, accumulatedMessage); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDelta", event.data.delta, accumulatedMessage); if (event.data.delta.content) { for (const content of event.data.delta.content) { if (content.type === "text" && content.text) { const textDelta = content.text; const snapshot = accumulatedMessage.content[content.index]; if (snapshot && snapshot.type === "text") { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDelta", textDelta, snapshot.text); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDelta", textDelta, snapshot.text); } else { throw new Error("The snapshot associated with this text delta is not text or missing"); } } - if (content.index !== __classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")) { - if (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f")) { - switch (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").type) { + if (content.index !== __classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f")) { + if (__classPrivateFieldGet2(this, _AssistantStream_currentContent, "f")) { + switch (__classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").type) { case "text": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", __classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").text, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } case "image_file": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", __classPrivateFieldGet2(this, _AssistantStream_currentContent, "f").image_file, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } } } - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, content.index, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, content.index, "f"); } - __classPrivateFieldSet(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); } } break; } case "thread.message.completed": case "thread.message.incomplete": { - if (__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f") !== void 0) { - const currentContent = event.data.content[__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")]; + if (__classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f") !== void 0) { + const currentContent = event.data.content[__classPrivateFieldGet2(this, _AssistantStream_currentContentIndex, "f")]; if (currentContent) { switch (currentContent.type) { case "image_file": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", currentContent.image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "imageFileDone", currentContent.image_file, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } case "text": { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", currentContent.text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "textDone", currentContent.text, __classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")); break; } } } } - if (__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDone", event.data); + if (__classPrivateFieldGet2(this, _AssistantStream_messageSnapshot, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "messageDone", event.data); } - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentContent, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_activeMessageID, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContentIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentContent, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_messageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeMessageID, void 0, "f"); } } }, _AssistantStream_handleRunStep = function _AssistantStream_handleRunStep2(event, runStepID) { - const accumulatedRunStep = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event, runStepID); - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); + const accumulatedRunStep = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event, runStepID); + __classPrivateFieldSet2(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); switch (event.event) { case "thread.run.step.created": { - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepCreated", event.data); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepCreated", event.data); break; } case "thread.run.step.delta": { const delta = event.data.delta; if (delta.step_details && delta.step_details.type === "tool_calls" && delta.step_details.tool_calls && accumulatedRunStep.step_details.type === "tool_calls") { for (const toolCall of delta.step_details.tool_calls) { - if (toolCall.index === __classPrivateFieldGet(this, _AssistantStream_currentToolCallIndex, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); + if (toolCall.index === __classPrivateFieldGet2(this, _AssistantStream_currentToolCallIndex, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); } else { - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallCreated", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallCreated", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } } } } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDelta", event.data.delta, accumulatedRunStep); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDelta", event.data.delta, accumulatedRunStep); break; } case "thread.run.step.completed": case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": { - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_activeRunStepID, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_activeRunStepID, void 0, "f"); const details = event.data.step_details; - if (details.type === "tool_calls" && __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + if (details.type === "tool_calls" && __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDone", event.data, accumulatedRunStep); - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "runStepDone", event.data, accumulatedRunStep); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); break; } case "thread.run.step.in_progress": { @@ -16361,45 +33767,45 @@ var init_AssistantStream = __esm({ } }, _AssistantStream_emitExposed = function _AssistantStream_emitExposed2(event, ...args) { if (this._hasListeners(event)) { - for (const value of args) { - markAssistantStreamValueExternallyMutable(value); + for (const value2 of args) { + markAssistantStreamValueExternallyMutable(value2); } } this._emit(event, ...args); }, _AssistantStream_handleEvent = function _AssistantStream_handleEvent2(event) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "event", event); + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "event", event); }, _AssistantStream_accumulateRunStep = function _AssistantStream_accumulateRunStep2(event, runStepID) { switch (event.event) { case "thread.run.step.created": { - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; return event.data; } case "thread.run.step.delta": { - const snapshot = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + const snapshot = __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; if (!snapshot) { throw new Error("Received a RunStepDelta before creation of a snapshot"); } const delta = event.data.delta; if (delta) { - if (hasOwn(delta, "id")) { + if (hasOwn2(delta, "id")) { throw new OpenAIError("Run-step deltas must not contain an id field"); } const accumulated = accumulateAssistantStreamDelta(snapshot, delta, true); - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = accumulated; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = accumulated; } - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + return __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; } case "thread.run.step.completed": case "thread.run.step.failed": case "thread.run.step.cancelled": case "thread.run.step.expired": case "thread.run.step.in_progress": { - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; + __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID] = event.data; break; } } - if (__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]) { - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; + if (__classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]) { + return __classPrivateFieldGet2(this, _AssistantStream_runStepSnapshots, "f")[runStepID]; } throw new Error("No snapshot available"); }, _AssistantStream_accumulateMessage = function _AssistantStream_accumulateMessage2(event, snapshot) { @@ -16418,9 +33824,9 @@ var init_AssistantStream = __esm({ const cacheArrays = !isAssistantStreamValueExternallyMutable(snapshot); const commitProjection = createAssistantStreamArrayDeltaCommit(snapshot.content, data.delta.content, "content", cacheArrays); for (const contentElement of data.delta.content) { - if (hasOwn(snapshot.content, contentElement.index)) { + if (hasOwn2(snapshot.content, contentElement.index)) { const currentContent = snapshot.content[contentElement.index]; - snapshot.content[contentElement.index] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent, cacheArrays); + snapshot.content[contentElement.index] = __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent, cacheArrays); } else { defineAssistantStreamArrayEntry(snapshot.content, contentElement.index, contentElement); newContent.push(contentElement); @@ -16443,7 +33849,7 @@ var init_AssistantStream = __esm({ }, _AssistantStream_accumulateContent = function _AssistantStream_accumulateContent2(contentElement, currentContent, cacheArrays) { return accumulateAssistantStreamDelta(currentContent, contentElement, cacheArrays); }, _AssistantStream_handleRun = function _AssistantStream_handleRun2(event) { - __classPrivateFieldSet(this, _AssistantStream_currentRunSnapshot, event.data, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentRunSnapshot, event.data, "f"); switch (event.event) { case "thread.run.created": { break; @@ -16460,12 +33866,12 @@ var init_AssistantStream = __esm({ case "thread.run.completed": case "thread.run.expired": case "thread.run.incomplete": { - __classPrivateFieldSet(this, _AssistantStream_finalRun, event.data, "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + __classPrivateFieldSet2(this, _AssistantStream_finalRun, event.data, "f"); + if (__classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")) { + __classPrivateFieldGet2(this, _AssistantStream_instances, "m", _AssistantStream_emitExposed).call(this, "toolCallDone", __classPrivateFieldGet2(this, _AssistantStream_currentToolCall, "f")); } - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, void 0, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCallIndex, void 0, "f"); + __classPrivateFieldSet2(this, _AssistantStream_currentToolCall, void 0, "f"); break; } case "thread.run.cancelling": { @@ -16478,7 +33884,7 @@ var init_AssistantStream = __esm({ // node_modules/openai/lib/polling.mjs function sleepUntilAborted(milliseconds, signal) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject2) => { let timer; let registered; let settled = false; @@ -16506,15 +33912,15 @@ function sleepUntilAborted(milliseconds, signal) { settled = true; cleanup(); try { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, configurable: true }); - reject(error); + reject2(error); } catch (error) { - reject(error); + reject2(error); } }; if (signal.aborted) { @@ -16527,7 +33933,7 @@ function sleepUntilAborted(milliseconds, signal) { } settled = true; cleanup(); - resolve(); + resolve2(); }, milliseconds); registered = abort; try { @@ -16543,13 +33949,13 @@ function sleepUntilAborted(milliseconds, signal) { } else { settled = true; cleanup(); - reject(error); + reject2(error); } } }); } async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses, options) { - const headers = buildHeaders([ + const headers = buildHeaders2([ options?.headers, { "X-Stainless-Poll-Helper": "true", @@ -16574,7 +33980,7 @@ async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses } } const signal = options && Object.prototype.propertyIsEnumerable.call(options, "signal") ? options.signal : void 0; - await (signal ? sleepUntilAborted(sleepInterval, signal) : sleep(sleepInterval)); + await (signal ? sleepUntilAborted(sleepInterval, signal) : sleep2(sleepInterval)); } else if (terminalStatuses.includes(status)) { return data; } @@ -16582,9 +33988,9 @@ async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses } var init_polling = __esm({ "node_modules/openai/lib/polling.mjs"() { - init_error(); - init_headers2(); - init_sleep(); + init_error3(); + init_headers3(); + init_sleep2(); } }); @@ -16605,26 +34011,26 @@ var init_assistant_run_polling = __esm({ var Runs; var init_runs = __esm({ "node_modules/openai/resources/beta/threads/runs/runs.mjs"() { - init_resource(); + init_resource2(); init_steps(); init_steps(); - init_pagination(); - init_headers2(); + init_pagination2(); + init_headers3(); init_AssistantStream(); init_assistant_run_polling(); - init_path(); - Runs = class extends APIResource { + init_path2(); + Runs = class extends APIResource2 { constructor() { super(...arguments); this.steps = new Steps(this._client); } create(threadID, params, options) { const { include, ...body } = params; - return this._client.post(path`/threads/${threadID}/runs`, { + return this._client.post(path3`/threads/${threadID}/runs`, { query: { include }, body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: params.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16637,9 +34043,9 @@ var init_runs = __esm({ */ retrieve(runID, params, options) { const { thread_id } = params; - return this._client.get(path`/threads/${thread_id}/runs/${runID}`, { + return this._client.get(path3`/threads/${thread_id}/runs/${runID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16650,10 +34056,10 @@ var init_runs = __esm({ */ update(runID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16663,10 +34069,10 @@ var init_runs = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ list(threadID, query = {}, options) { - return this._client.getAPIList(path`/threads/${threadID}/runs`, CursorPage, { + return this._client.getAPIList(path3`/threads/${threadID}/runs`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16677,9 +34083,9 @@ var init_runs = __esm({ */ cancel(runID, params, options) { const { thread_id } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}/cancel`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16689,8 +34095,8 @@ var init_runs = __esm({ * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps */ async createAndPoll(threadId, body, options) { - const run = await this.create(threadId, body, options); - return await this.poll(run.id, { thread_id: threadId }, options); + const run2 = await this.create(threadId, body, options); + return await this.poll(run2.id, { thread_id: threadId }, options); } /** * Create a Run stream @@ -16716,10 +34122,10 @@ var init_runs = __esm({ } submitToolOutputs(runID, params, options) { const { thread_id, ...body } = params; - return this._client.post(path`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, { + return this._client.post(path3`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: params.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16731,8 +34137,8 @@ var init_runs = __esm({ * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps */ async submitToolOutputsAndPoll(runId, params, options) { - const run = await this.submitToolOutputs(runId, params, options); - return await this.poll(run.id, params, options); + const run2 = await this.submitToolOutputs(runId, params, options); + return await this.poll(run2.id, params, options); } /** * Submit the tool outputs from a previous run and stream the run to a terminal @@ -16748,22 +34154,22 @@ var init_runs = __esm({ }); // node_modules/openai/resources/beta/threads/threads.mjs -var Threads2; -var init_threads2 = __esm({ +var Threads3; +var init_threads3 = __esm({ "node_modules/openai/resources/beta/threads/threads.mjs"() { - init_resource(); - init_messages2(); - init_messages2(); + init_resource2(); + init_messages4(); + init_messages4(); init_runs(); init_runs(); - init_headers2(); + init_headers3(); init_AssistantStream(); - init_path(); - Threads2 = class extends APIResource { + init_path2(); + Threads3 = class extends APIResource2 { constructor() { super(...arguments); this.runs = new Runs(this._client); - this.messages = new Messages2(this._client); + this.messages = new Messages4(this._client); } /** * Create a thread. @@ -16774,7 +34180,7 @@ var init_threads2 = __esm({ return this._client.post("/threads", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16784,9 +34190,9 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ retrieve(threadID, options) { - return this._client.get(path`/threads/${threadID}`, { + return this._client.get(path3`/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16796,10 +34202,10 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ update(threadID, body, options) { - return this._client.post(path`/threads/${threadID}`, { + return this._client.post(path3`/threads/${threadID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16809,9 +34215,9 @@ var init_threads2 = __esm({ * @deprecated The Assistants API is deprecated in favor of the Responses API */ delete(threadID, options) { - return this._client.delete(path`/threads/${threadID}`, { + return this._client.delete(path3`/threads/${threadID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -16819,7 +34225,7 @@ var init_threads2 = __esm({ return this._client.post("/threads/runs", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), stream: body.stream ?? false, __synthesizeEventData: true, __security: { bearerAuth: true } @@ -16831,8 +34237,8 @@ var init_threads2 = __esm({ * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps */ async createAndRunPoll(body, options) { - const run = await this.createAndRun(body, options); - return await this.runs.poll(run.id, { thread_id: run.thread_id }, options); + const run2 = await this.createAndRun(body, options); + return await this.runs.poll(run2.id, { thread_id: run2.thread_id }, options); } /** * Create a thread and stream the run back @@ -16841,54 +34247,54 @@ var init_threads2 = __esm({ return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options); } }; - Threads2.Runs = Runs; - Threads2.Messages = Messages2; + Threads3.Runs = Runs; + Threads3.Messages = Messages4; } }); // node_modules/openai/resources/beta/beta.mjs -var Beta; -var init_beta = __esm({ +var Beta2; +var init_beta2 = __esm({ "node_modules/openai/resources/beta/beta.mjs"() { - init_resource(); + init_resource2(); init_assistants(); init_assistants(); init_realtime(); init_realtime(); - init_agents(); - init_agents(); + init_agents2(); + init_agents2(); init_chatkit(); init_chatkit(); init_responses(); init_responses(); - init_threads2(); - init_threads2(); - Beta = class extends APIResource { + init_threads3(); + init_threads3(); + Beta2 = class extends APIResource2 { constructor() { super(...arguments); this.realtime = new Realtime(this._client); - this.agents = new Agents(this._client); + this.agents = new Agents2(this._client); this.responses = new Responses(this._client); this.chatkit = new ChatKit(this._client); this.assistants = new Assistants(this._client); - this.threads = new Threads2(this._client); + this.threads = new Threads3(this._client); } }; - Beta.Realtime = Realtime; - Beta.Agents = Agents; - Beta.Responses = Responses; - Beta.ChatKit = ChatKit; - Beta.Assistants = Assistants; - Beta.Threads = Threads2; + Beta2.Realtime = Realtime; + Beta2.Agents = Agents2; + Beta2.Responses = Responses; + Beta2.ChatKit = ChatKit; + Beta2.Assistants = Assistants; + Beta2.Threads = Threads3; } }); // node_modules/openai/resources/completions.mjs -var Completions2; -var init_completions3 = __esm({ +var Completions3; +var init_completions4 = __esm({ "node_modules/openai/resources/completions.mjs"() { - init_resource(); - Completions2 = class extends APIResource { + init_resource2(); + Completions3 = class extends APIResource2 { create(body, options) { return this._client.post("/completions", { body, @@ -16905,18 +34311,18 @@ var init_completions3 = __esm({ var Content; var init_content = __esm({ "node_modules/openai/resources/containers/files/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content = class extends APIResource2 { /** * Retrieve Container File Content */ retrieve(fileID, params, options) { const { container_id } = params; - return this._client.get(path`/containers/${container_id}/files/${fileID}/content`, { + return this._client.get(path3`/containers/${container_id}/files/${fileID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -16926,17 +34332,17 @@ var init_content = __esm({ }); // node_modules/openai/resources/containers/files/files.mjs -var Files2; -var init_files2 = __esm({ +var Files4; +var init_files4 = __esm({ "node_modules/openai/resources/containers/files/files.mjs"() { - init_resource(); + init_resource2(); init_content(); init_content(); - init_pagination(); - init_headers2(); - init_uploads(); - init_path(); - Files2 = class extends APIResource { + init_pagination2(); + init_headers3(); + init_uploads3(); + init_path2(); + Files4 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content(this._client); @@ -16948,14 +34354,14 @@ var init_files2 = __esm({ * a JSON request with a file ID. */ create(containerID, body, options) { - return this._client.post(path`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Retrieve Container File */ retrieve(fileID, params, options) { const { container_id } = params; - return this._client.get(path`/containers/${container_id}/files/${fileID}`, { + return this._client.get(path3`/containers/${container_id}/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); @@ -16964,7 +34370,7 @@ var init_files2 = __esm({ * List Container files */ list(containerID, query = {}, options) { - return this._client.getAPIList(path`/containers/${containerID}/files`, CursorPage, { + return this._client.getAPIList(path3`/containers/${containerID}/files`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -16975,14 +34381,14 @@ var init_files2 = __esm({ */ delete(fileID, params, options) { const { container_id } = params; - return this._client.delete(path`/containers/${container_id}/files/${fileID}`, { + return this._client.delete(path3`/containers/${container_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Files2.Content = Content; + Files4.Content = Content; } }); @@ -16990,16 +34396,16 @@ var init_files2 = __esm({ var Containers; var init_containers = __esm({ "node_modules/openai/resources/containers/containers.mjs"() { - init_resource(); - init_files2(); - init_files2(); - init_pagination(); - init_headers2(); - init_path(); - Containers = class extends APIResource { + init_resource2(); + init_files4(); + init_files4(); + init_pagination2(); + init_headers3(); + init_path2(); + Containers = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files2(this._client); + this.files = new Files4(this._client); } /** * Create Container @@ -17011,7 +34417,7 @@ var init_containers = __esm({ * Retrieve Container */ retrieve(containerID, options) { - return this._client.get(path`/containers/${containerID}`, { + return this._client.get(path3`/containers/${containerID}`, { ...options, __security: { bearerAuth: true } }); @@ -17030,14 +34436,14 @@ var init_containers = __esm({ * Delete Container */ delete(containerID, options) { - return this._client.delete(path`/containers/${containerID}`, { + return this._client.delete(path3`/containers/${containerID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } }; - Containers.Files = Files2; + Containers.Files = Files4; } }); @@ -17045,9 +34451,9 @@ var init_containers = __esm({ var ContentProvenanceChecks; var init_content_provenance_checks = __esm({ "node_modules/openai/resources/content-provenance-checks.mjs"() { - init_resource(); - init_uploads(); - ContentProvenanceChecks = class extends APIResource { + init_resource2(); + init_uploads3(); + ContentProvenanceChecks = class extends APIResource2 { /** * Check whether an image or audio file contains known OpenAI provenance signals. * [Learn more about content provenance](https://developers.openai.com/api/docs/guides/content-provenance). @@ -17060,7 +34466,7 @@ var init_content_provenance_checks = __esm({ * company's model, which the tool currently does not detect. */ create(body, options) { - return this._client.post("/content_provenance_checks", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/content_provenance_checks", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -17070,16 +34476,16 @@ var init_content_provenance_checks = __esm({ var Items4; var init_items4 = __esm({ "node_modules/openai/resources/conversations/items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Items4 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Items4 = class extends APIResource2 { /** * Create items in a conversation with the given ID. */ create(conversationID, params, options) { const { include, ...body } = params; - return this._client.post(path`/conversations/${conversationID}/items`, { + return this._client.post(path3`/conversations/${conversationID}/items`, { query: { include }, body, ...options, @@ -17091,7 +34497,7 @@ var init_items4 = __esm({ */ retrieve(itemID, params, options) { const { conversation_id, ...query } = params; - return this._client.get(path`/conversations/${conversation_id}/items/${itemID}`, { + return this._client.get(path3`/conversations/${conversation_id}/items/${itemID}`, { query, ...options, __security: { bearerAuth: true } @@ -17101,14 +34507,14 @@ var init_items4 = __esm({ * List all items for a conversation with the given ID. */ list(conversationID, query = {}, options) { - return this._client.getAPIList(path`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } }); } /** * Delete an item from a conversation with the given IDs. */ delete(itemID, params, options) { const { conversation_id } = params; - return this._client.delete(path`/conversations/${conversation_id}/items/${itemID}`, { + return this._client.delete(path3`/conversations/${conversation_id}/items/${itemID}`, { ...options, __security: { bearerAuth: true } }); @@ -17121,11 +34527,11 @@ var init_items4 = __esm({ var Conversations; var init_conversations = __esm({ "node_modules/openai/resources/conversations/conversations.mjs"() { - init_resource(); + init_resource2(); init_items4(); init_items4(); - init_path(); - Conversations = class extends APIResource { + init_path2(); + Conversations = class extends APIResource2 { constructor() { super(...arguments); this.items = new Items4(this._client); @@ -17140,7 +34546,7 @@ var init_conversations = __esm({ * Get a conversation */ retrieve(conversationID, options) { - return this._client.get(path`/conversations/${conversationID}`, { + return this._client.get(path3`/conversations/${conversationID}`, { ...options, __security: { bearerAuth: true } }); @@ -17149,7 +34555,7 @@ var init_conversations = __esm({ * Update a conversation */ update(conversationID, body, options) { - return this._client.post(path`/conversations/${conversationID}`, { + return this._client.post(path3`/conversations/${conversationID}`, { body, ...options, __security: { bearerAuth: true } @@ -17159,7 +34565,7 @@ var init_conversations = __esm({ * Delete a conversation. Items in the conversation will not be deleted. */ delete(conversationID, options) { - return this._client.delete(path`/conversations/${conversationID}`, { + return this._client.delete(path3`/conversations/${conversationID}`, { ...options, __security: { bearerAuth: true } }); @@ -17174,7 +34580,7 @@ function createEmbedding(client, body, options) { const hasUserProvidedEncodingFormat = !!body.encoding_format; const encodingFormat = hasUserProvidedEncodingFormat ? body.encoding_format : "base64"; if (hasUserProvidedEncodingFormat) { - loggerFor(client).debug("embeddings/user defined encoding_format:", body.encoding_format); + loggerFor2(client).debug("embeddings/user defined encoding_format:", body.encoding_format); } const optimizedBody = { ...body, encoding_format: encodingFormat }; const requestOptions = { @@ -17186,7 +34592,7 @@ function createEmbedding(client, body, options) { if (hasUserProvidedEncodingFormat) { return response; } - loggerFor(client).debug("embeddings/decoding base64 embeddings from base64"); + loggerFor2(client).debug("embeddings/decoding base64 embeddings from base64"); return response._thenUnwrap((data) => { const embeddings = data?.data; if (embeddings !== void 0) { @@ -17210,7 +34616,7 @@ function createEmbedding(client, body, options) { } var init_embeddings = __esm({ "node_modules/openai/lib/embeddings.mjs"() { - init_utils2(); + init_utils4(); } }); @@ -17218,9 +34624,9 @@ var init_embeddings = __esm({ var Embeddings; var init_embeddings2 = __esm({ "node_modules/openai/resources/embeddings.mjs"() { - init_resource(); + init_resource2(); init_embeddings(); - Embeddings = class extends APIResource { + Embeddings = class extends APIResource2 { create(body, options) { return createEmbedding(this._client, body, options); } @@ -17232,16 +34638,16 @@ var init_embeddings2 = __esm({ var OutputItems; var init_output_items = __esm({ "node_modules/openai/resources/evals/runs/output-items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - OutputItems = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + OutputItems = class extends APIResource2 { /** * Get an evaluation run output item by ID. */ retrieve(outputItemID, params, options) { const { eval_id, run_id } = params; - return this._client.get(path`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, { + return this._client.get(path3`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, { ...options, __security: { bearerAuth: true } }); @@ -17251,7 +34657,7 @@ var init_output_items = __esm({ */ list(runID, params, options) { const { eval_id, ...query } = params; - return this._client.getAPIList(path`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -17261,12 +34667,12 @@ var init_output_items = __esm({ var Runs2; var init_runs2 = __esm({ "node_modules/openai/resources/evals/runs/runs.mjs"() { - init_resource(); + init_resource2(); init_output_items(); init_output_items(); - init_pagination(); - init_path(); - Runs2 = class extends APIResource { + init_pagination2(); + init_path2(); + Runs2 = class extends APIResource2 { constructor() { super(...arguments); this.outputItems = new OutputItems(this._client); @@ -17277,7 +34683,7 @@ var init_runs2 = __esm({ * schema specified in the config of the evaluation. */ create(evalID, body, options) { - return this._client.post(path`/evals/${evalID}/runs`, { + return this._client.post(path3`/evals/${evalID}/runs`, { body, ...options, __security: { bearerAuth: true } @@ -17288,7 +34694,7 @@ var init_runs2 = __esm({ */ retrieve(runID, params, options) { const { eval_id } = params; - return this._client.get(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.get(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17297,7 +34703,7 @@ var init_runs2 = __esm({ * Get a list of runs for an evaluation. */ list(evalID, query = {}, options) { - return this._client.getAPIList(path`/evals/${evalID}/runs`, CursorPage, { + return this._client.getAPIList(path3`/evals/${evalID}/runs`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -17308,7 +34714,7 @@ var init_runs2 = __esm({ */ delete(runID, params, options) { const { eval_id } = params; - return this._client.delete(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.delete(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17318,7 +34724,7 @@ var init_runs2 = __esm({ */ cancel(runID, params, options) { const { eval_id } = params; - return this._client.post(path`/evals/${eval_id}/runs/${runID}`, { + return this._client.post(path3`/evals/${eval_id}/runs/${runID}`, { ...options, __security: { bearerAuth: true } }); @@ -17332,12 +34738,12 @@ var init_runs2 = __esm({ var Evals; var init_evals = __esm({ "node_modules/openai/resources/evals/evals.mjs"() { - init_resource(); + init_resource2(); init_runs2(); init_runs2(); - init_pagination(); - init_path(); - Evals = class extends APIResource { + init_pagination2(); + init_path2(); + Evals = class extends APIResource2 { constructor() { super(...arguments); this.runs = new Runs2(this._client); @@ -17357,13 +34763,13 @@ var init_evals = __esm({ * Get an evaluation by ID. */ retrieve(evalID, options) { - return this._client.get(path`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } /** * Update certain properties of an evaluation. */ update(evalID, body, options) { - return this._client.post(path`/evals/${evalID}`, { body, ...options, __security: { bearerAuth: true } }); + return this._client.post(path3`/evals/${evalID}`, { body, ...options, __security: { bearerAuth: true } }); } /** * List evaluations for a project. @@ -17379,7 +34785,7 @@ var init_evals = __esm({ * Delete an evaluation. */ delete(evalID, options) { - return this._client.delete(path`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } }; Evals.Runs = Runs2; @@ -17392,10 +34798,10 @@ async function waitForFileProcessing(resource, id, pollInterval, maxWait) { const start = performance.now(); let file2 = await resource.retrieve(id); while (!file2.status || !terminalStates.has(file2.status)) { - await sleep(pollInterval); + await sleep2(pollInterval); file2 = await resource.retrieve(id); if (performance.now() - start > maxWait) { - throw new APIConnectionTimeoutError({ + throw new APIConnectionTimeoutError2({ message: `Giving up on waiting for file ${id} to finish processing after ${maxWait} milliseconds.` }); } @@ -17404,22 +34810,22 @@ async function waitForFileProcessing(resource, id, pollInterval, maxWait) { } var init_file_processing = __esm({ "node_modules/openai/lib/file-processing.mjs"() { - init_error2(); - init_sleep(); + init_error4(); + init_sleep2(); } }); // node_modules/openai/resources/files.mjs -var Files3; -var init_files3 = __esm({ +var Files5; +var init_files5 = __esm({ "node_modules/openai/resources/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_uploads(); + init_resource2(); + init_pagination2(); + init_headers3(); + init_uploads3(); init_file_processing(); - init_path(); - Files3 = class extends APIResource { + init_path2(); + Files5 = class extends APIResource2 { /** * Upload a file that can be used across various endpoints. Individual files can be * up to 512 MB, and each project can store up to 2.5 TB of files in total. There @@ -17450,13 +34856,13 @@ var init_files3 = __esm({ * storage limits. */ create(body, options) { - return this._client.post("/files", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/files", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Returns information about a specific file. */ retrieve(fileID, options) { - return this._client.get(path`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } /** * Returns a list of files. @@ -17472,15 +34878,15 @@ var init_files3 = __esm({ * Delete a file and remove it from all vector stores. */ delete(fileID, options) { - return this._client.delete(path`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } /** * Returns a response containing the contents of the specified file. */ content(fileID, options) { - return this._client.get(path`/files/${fileID}/content`, { + return this._client.get(path3`/files/${fileID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -17499,8 +34905,8 @@ var init_files3 = __esm({ var Methods; var init_methods = __esm({ "node_modules/openai/resources/fine-tuning/methods.mjs"() { - init_resource(); - Methods = class extends APIResource { + init_resource2(); + Methods = class extends APIResource2 { }; } }); @@ -17509,8 +34915,8 @@ var init_methods = __esm({ var Graders; var init_graders = __esm({ "node_modules/openai/resources/fine-tuning/alpha/graders.mjs"() { - init_resource(); - Graders = class extends APIResource { + init_resource2(); + Graders = class extends APIResource2 { /** * Run a grader. * @@ -17567,10 +34973,10 @@ var init_graders = __esm({ var Alpha; var init_alpha = __esm({ "node_modules/openai/resources/fine-tuning/alpha/alpha.mjs"() { - init_resource(); + init_resource2(); init_graders(); init_graders(); - Alpha = class extends APIResource { + Alpha = class extends APIResource2 { constructor() { super(...arguments); this.graders = new Graders(this._client); @@ -17584,10 +34990,10 @@ var init_alpha = __esm({ var Permissions; var init_permissions = __esm({ "node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Permissions = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Permissions = class extends APIResource2 { /** * **NOTE:** Calling this endpoint requires an * [admin API key](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys). @@ -17607,7 +35013,7 @@ var init_permissions = __esm({ * ``` */ create(fineTunedModelCheckpoint, body, options) { - return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page2, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } /** * **NOTE:** This endpoint requires an @@ -17619,7 +35025,7 @@ var init_permissions = __esm({ * @deprecated Retrieve is deprecated. Please swap to the paginated list method instead. */ retrieve(fineTunedModelCheckpoint, query = {}, options) { - return this._client.get(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { + return this._client.get(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { query, ...options, __security: { adminAPIKeyAuth: true } @@ -17643,7 +35049,7 @@ var init_permissions = __esm({ * ``` */ list(fineTunedModelCheckpoint, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** * **NOTE:** This endpoint requires an @@ -17666,7 +35072,7 @@ var init_permissions = __esm({ */ delete(permissionID, params, options) { const { fine_tuned_model_checkpoint } = params; - return this._client.delete(path`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, { ...options, __security: { adminAPIKeyAuth: true } }); + return this._client.delete(path3`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } }; } @@ -17676,10 +35082,10 @@ var init_permissions = __esm({ var Checkpoints; var init_checkpoints = __esm({ "node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs"() { - init_resource(); + init_resource2(); init_permissions(); init_permissions(); - Checkpoints = class extends APIResource { + Checkpoints = class extends APIResource2 { constructor() { super(...arguments); this.permissions = new Permissions(this._client); @@ -17693,10 +35099,10 @@ var init_checkpoints = __esm({ var Checkpoints2; var init_checkpoints2 = __esm({ "node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Checkpoints2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Checkpoints2 = class extends APIResource2 { /** * List checkpoints for a fine-tuning job. * @@ -17711,7 +35117,7 @@ var init_checkpoints2 = __esm({ * ``` */ list(fineTuningJobID, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -17721,12 +35127,12 @@ var init_checkpoints2 = __esm({ var Jobs; var init_jobs = __esm({ "node_modules/openai/resources/fine-tuning/jobs/jobs.mjs"() { - init_resource(); + init_resource2(); init_checkpoints2(); init_checkpoints2(); - init_pagination(); - init_path(); - Jobs = class extends APIResource { + init_pagination2(); + init_path2(); + Jobs = class extends APIResource2 { constructor() { super(...arguments); this.checkpoints = new Checkpoints2(this._client); @@ -17764,7 +35170,7 @@ var init_jobs = __esm({ * ``` */ retrieve(fineTuningJobID, options) { - return this._client.get(path`/fine_tuning/jobs/${fineTuningJobID}`, { + return this._client.get(path3`/fine_tuning/jobs/${fineTuningJobID}`, { ...options, __security: { bearerAuth: true } }); @@ -17798,7 +35204,7 @@ var init_jobs = __esm({ * ``` */ cancel(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/cancel`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -17817,7 +35223,7 @@ var init_jobs = __esm({ * ``` */ listEvents(fineTuningJobID, query = {}, options) { - return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } /** * Pause a fine-tune job. @@ -17830,7 +35236,7 @@ var init_jobs = __esm({ * ``` */ pause(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/pause`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/pause`, { ...options, __security: { bearerAuth: true } }); @@ -17846,7 +35252,7 @@ var init_jobs = __esm({ * ``` */ resume(fineTuningJobID, options) { - return this._client.post(path`/fine_tuning/jobs/${fineTuningJobID}/resume`, { + return this._client.post(path3`/fine_tuning/jobs/${fineTuningJobID}/resume`, { ...options, __security: { bearerAuth: true } }); @@ -17860,7 +35266,7 @@ var init_jobs = __esm({ var FineTuning; var init_fine_tuning = __esm({ "node_modules/openai/resources/fine-tuning/fine-tuning.mjs"() { - init_resource(); + init_resource2(); init_methods(); init_methods(); init_alpha(); @@ -17869,7 +35275,7 @@ var init_fine_tuning = __esm({ init_checkpoints(); init_jobs(); init_jobs(); - FineTuning = class extends APIResource { + FineTuning = class extends APIResource2 { constructor() { super(...arguments); this.methods = new Methods(this._client); @@ -17889,8 +35295,8 @@ var init_fine_tuning = __esm({ var GraderModels; var init_grader_models = __esm({ "node_modules/openai/resources/graders/grader-models.mjs"() { - init_resource(); - GraderModels = class extends APIResource { + init_resource2(); + GraderModels = class extends APIResource2 { }; } }); @@ -17899,10 +35305,10 @@ var init_grader_models = __esm({ var Graders2; var init_graders2 = __esm({ "node_modules/openai/resources/graders/graders.mjs"() { - init_resource(); + init_resource2(); init_grader_models(); init_grader_models(); - Graders2 = class extends APIResource { + Graders2 = class extends APIResource2 { constructor() { super(...arguments); this.graderModels = new GraderModels(this._client); @@ -17916,9 +35322,9 @@ var init_graders2 = __esm({ var Images; var init_images = __esm({ "node_modules/openai/resources/images.mjs"() { - init_resource(); - init_uploads(); - Images = class extends APIResource { + init_resource2(); + init_uploads3(); + Images = class extends APIResource2 { /** * Creates a variation of a given image. This endpoint only supports `dall-e-2`. * @@ -17930,10 +35336,10 @@ var init_images = __esm({ * ``` */ createVariation(body, options) { - return this._client.post("/images/variations", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/images/variations", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } edit(body, options) { - return this._client.post("/images/edits", multipartFormRequestOptions({ + return this._client.post("/images/edits", multipartFormRequestOptions2({ body, ...options, stream: body.stream ?? false, @@ -17954,13 +35360,13 @@ var init_images = __esm({ }); // node_modules/openai/resources/live/sessions.mjs -var Sessions4; -var init_sessions4 = __esm({ +var Sessions5; +var init_sessions5 = __esm({ "node_modules/openai/resources/live/sessions.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Sessions4 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Sessions5 = class extends APIResource2 { /** * Accept an incoming SIP call. Supply session with type live, the model, and * startup configuration. Before accepting calls, follow the @@ -17976,10 +35382,10 @@ var init_sessions4 = __esm({ * ``` */ accept(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/accept`, { + return this._client.post(path3`/live/sessions/${sessionID}/accept`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -17996,9 +35402,9 @@ var init_sessions4 = __esm({ * ``` */ downloadRecording(sessionID, options) { - return this._client.get(path`/live/sessions/${sessionID}/content`, { + return this._client.get(path3`/live/sessions/${sessionID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -18015,7 +35421,7 @@ var init_sessions4 = __esm({ * ``` */ fork(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/fork`, { + return this._client.post(path3`/live/sessions/${sessionID}/fork`, { body, ...options, __security: { bearerAuth: true } @@ -18030,9 +35436,9 @@ var init_sessions4 = __esm({ * ``` */ hangup(sessionID, options) { - return this._client.post(path`/live/sessions/${sessionID}/hangup`, { + return this._client.post(path3`/live/sessions/${sessionID}/hangup`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18048,10 +35454,10 @@ var init_sessions4 = __esm({ * ``` */ refer(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/refer`, { + return this._client.post(path3`/live/sessions/${sessionID}/refer`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18067,10 +35473,10 @@ var init_sessions4 = __esm({ * ``` */ reject(sessionID, body, options) { - return this._client.post(path`/live/sessions/${sessionID}/reject`, { + return this._client.post(path3`/live/sessions/${sessionID}/reject`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18082,8 +35488,8 @@ var init_sessions4 = __esm({ var Forks; var init_forks = __esm({ "node_modules/openai/resources/live/forks/forks.mjs"() { - init_resource(); - Forks = class extends APIResource { + init_resource2(); + Forks = class extends APIResource2 { }; } }); @@ -18092,8 +35498,8 @@ var init_forks = __esm({ var Sideband; var init_sideband = __esm({ "node_modules/openai/resources/live/sideband/sideband.mjs"() { - init_resource(); - Sideband = class extends APIResource { + init_resource2(); + Sideband = class extends APIResource2 { }; } }); @@ -18102,19 +35508,19 @@ var init_sideband = __esm({ var Live; var init_live = __esm({ "node_modules/openai/resources/live/live.mjs"() { - init_resource(); - init_sessions4(); - init_sessions4(); + init_resource2(); + init_sessions5(); + init_sessions5(); init_forks(); init_forks(); init_sideband(); init_sideband(); - Live = class extends APIResource { + Live = class extends APIResource2 { constructor() { super(...arguments); this.sideband = new Sideband(this._client); this.forks = new Forks(this._client); - this.sessions = new Sessions4(this._client); + this.sessions = new Sessions5(this._client); } /** * Create a Live WebRTC session. Start with the @@ -18134,38 +35540,38 @@ var init_live = __esm({ }; Live.Sideband = Sideband; Live.Forks = Forks; - Live.Sessions = Sessions4; + Live.Sessions = Sessions5; } }); // node_modules/openai/resources/models.mjs -var Models; -var init_models2 = __esm({ +var Models3; +var init_models4 = __esm({ "node_modules/openai/resources/models.mjs"() { - init_resource(); - init_pagination(); - init_path(); - Models = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + Models3 = class extends APIResource2 { /** * Retrieves a model instance, providing basic information about the model such as * the owner and permissioning. */ retrieve(model2, options) { - return this._client.get(path`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); } /** * Lists the currently available models, and provides basic information about each * one such as the owner and availability. */ list(options) { - return this._client.getAPIList("/models", Page, { ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList("/models", Page2, { ...options, __security: { bearerAuth: true } }); } /** * Delete a fine-tuned model. You must have the Owner role in your organization to * delete a model. */ delete(model2, options) { - return this._client.delete(path`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/models/${model2}`, { ...options, __security: { bearerAuth: true } }); } }; } @@ -18175,8 +35581,8 @@ var init_models2 = __esm({ var Moderations; var init_moderations = __esm({ "node_modules/openai/resources/moderations.mjs"() { - init_resource(); - Moderations = class extends APIResource { + init_resource2(); + Moderations = class extends APIResource2 { /** * Classifies if text and/or image inputs are potentially harmful. Learn more in * the @@ -18194,29 +35600,29 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra if (options.body === null || typeof options.body !== "object" || Array.isArray(options.body)) { throw new TypeError("Multipart request body must be an object"); } - const body = Object.fromEntries(Object.entries(options.body).filter(([, value]) => value !== void 0)); + const body = Object.fromEntries(Object.entries(options.body).filter(([, value2]) => value2 !== void 0)); if (rawBodyField !== null && Object.keys(body).length === 1 && Object.prototype.hasOwnProperty.call(body, rawBodyField)) { - const value = body[rawBodyField]; - if (typeof value !== "string") + const value2 = body[rawBodyField]; + if (typeof value2 !== "string") throw new TypeError("Raw multipart alternative must be a string"); return { ...options, - body: value, - headers: buildHeaders([options.headers, { "content-type": encodings[rawBodyField].content_type }]) + body: value2, + headers: buildHeaders2([options.headers, { "content-type": encodings[rawBodyField].content_type }]) }; } const encoded = []; for (const [name, encoding] of Object.entries(encodings)) { if (!Object.prototype.hasOwnProperty.call(body, name)) continue; - const value = body[name]; - const data = encoding.json ? JSON.stringify(value) : value; + const value2 = body[name]; + const data = encoding.json ? JSON.stringify(value2) : value2; if (typeof data !== "string") throw new TypeError(`Multipart field ${name} must encode as a string`); - encoded.push([name, makeFile([data], "", { type: encoding.content_type })]); + encoded.push([name, makeFile2([data], "", { type: encoding.content_type })]); delete body[name]; } - const multipart = await multipartFormRequestOptions({ ...options, body }, client); + const multipart = await multipartFormRequestOptions2({ ...options, body }, client); const form = multipart.body; if (!(form instanceof FormData)) { await form.cancel(); @@ -18227,13 +35633,13 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra return { ...options, body: form, - headers: buildHeaders([options.headers, { "content-type": null }]) + headers: buildHeaders2([options.headers, { "content-type": null }]) }; } var init_multipart_encoding = __esm({ "node_modules/openai/internal/multipart-encoding.mjs"() { - init_uploads(); - init_headers2(); + init_uploads3(); + init_headers3(); } }); @@ -18241,11 +35647,11 @@ var init_multipart_encoding = __esm({ var Calls; var init_calls = __esm({ "node_modules/openai/resources/realtime/calls.mjs"() { - init_resource(); - init_headers2(); - init_path(); + init_resource2(); + init_headers3(); + init_path2(); init_multipart_encoding(); - Calls = class extends APIResource { + Calls = class extends APIResource2 { /** * Create a new Realtime API call over WebRTC and receive the SDP answer needed to * complete the peer connection. @@ -18261,7 +35667,7 @@ var init_calls = __esm({ return this._client.post("/realtime/calls", encodedMultipartFormRequestOptions({ body, ...options, - headers: buildHeaders([{ Accept: "application/sdp" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/sdp" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }, this._client, { @@ -18281,10 +35687,10 @@ var init_calls = __esm({ * ``` */ accept(callID, body, options) { - return this._client.post(path`/realtime/calls/${callID}/accept`, { + return this._client.post(path3`/realtime/calls/${callID}/accept`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18297,9 +35703,9 @@ var init_calls = __esm({ * ``` */ hangup(callID, options) { - return this._client.post(path`/realtime/calls/${callID}/hangup`, { + return this._client.post(path3`/realtime/calls/${callID}/hangup`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18314,10 +35720,10 @@ var init_calls = __esm({ * ``` */ refer(callID, body, options) { - return this._client.post(path`/realtime/calls/${callID}/refer`, { + return this._client.post(path3`/realtime/calls/${callID}/refer`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18330,10 +35736,10 @@ var init_calls = __esm({ * ``` */ reject(callID, body = {}, options) { - return this._client.post(path`/realtime/calls/${callID}/reject`, { + return this._client.post(path3`/realtime/calls/${callID}/reject`, { body, ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -18345,8 +35751,8 @@ var init_calls = __esm({ var ClientSecrets; var init_client_secrets = __esm({ "node_modules/openai/resources/realtime/client-secrets.mjs"() { - init_resource(); - ClientSecrets = class extends APIResource { + init_resource2(); + ClientSecrets = class extends APIResource2 { /** * Create a Realtime client secret with an associated session configuration. * @@ -18385,12 +35791,12 @@ var init_client_secrets = __esm({ var Realtime2; var init_realtime2 = __esm({ "node_modules/openai/resources/realtime/realtime.mjs"() { - init_resource(); + init_resource2(); init_calls(); init_calls(); init_client_secrets(); init_client_secrets(); - Realtime2 = class extends APIResource { + Realtime2 = class extends APIResource2 { constructor() { super(...arguments); this.clientSecrets = new ClientSecrets(this._client); @@ -18535,8 +35941,8 @@ function addOutputText(rsp) { } var init_ResponsesParser = __esm({ "node_modules/openai/lib/ResponsesParser.mjs"() { - init_error2(); - init_parser(); + init_error4(); + init_parser3(); } }); @@ -18553,20 +35959,20 @@ var init_output_text_index = __esm({ get length() { return this.size; } - append(value) { + append(value2) { if (this.size === this.capacity) { this.grow(); } const index = this.size; this.size += 1; - this.update(index, value); + this.update(index, value2); } - update(index, value) { + update(index, value2) { if (!Number.isSafeInteger(index) || index < 0 || index >= this.size) { throw new RangeError(`missing output at index ${index}`); } let node = this.capacity + index; - const difference = value - (this.values[node] ?? 0); + const difference = value2 - (this.values[node] ?? 0); if (difference === 0) { return; } @@ -18724,7 +36130,7 @@ var init_canonical_output_text = __esm({ // node_modules/openai/internal/responses/response-accumulator.mjs function validateArrayIndex(collection, index, kind, allowAppend = false) { - if (!Array.isArray(collection) || !Number.isSafeInteger(index) || index < 0 || index > collection.length || (index === collection.length ? !allowAppend || index in collection : !hasOwn(collection, index))) { + if (!Array.isArray(collection) || !Number.isSafeInteger(index) || index < 0 || index > collection.length || (index === collection.length ? !allowAppend || index in collection : !hasOwn2(collection, index))) { throw new OpenAIError(`missing ${kind} at index ${index}`); } } @@ -18746,12 +36152,12 @@ function hasRoutedOutputCallIdentity(output) { return output.type === "function_call" || output.type === "custom_tool_call" || output.type === "shell_call" || output.type === "shell_call_output"; } function getOutputItemIdentityKeys(output, eventType) { - if (!hasOwn(output, "type") || typeof output.type !== "string") { + if (!hasOwn2(output, "type") || typeof output.type !== "string") { throw new OpenAIError(`expected an own output item type for ${eventType}`); } const optionalPlatformID = output.type === "function_call" || output.type === "custom_tool_call"; const identities = []; - if (hasOwn(output, "id")) { + if (hasOwn2(output, "id")) { if (typeof output.id !== "string" || output.id.length === 0) { throw new OpenAIError(`expected a non-empty output item id for ${eventType}`); } @@ -18760,7 +36166,7 @@ function getOutputItemIdentityKeys(output, eventType) { throw new OpenAIError(`expected a non-empty output item id for ${eventType}`); } if (hasRoutedOutputCallIdentity(output)) { - if (!hasOwn(output, "call_id") || typeof output.call_id !== "string" || output.call_id.length === 0) { + if (!hasOwn2(output, "call_id") || typeof output.call_id !== "string" || output.call_id.length === 0) { throw new OpenAIError(`expected a non-empty output item call_id for ${eventType}`); } identities.push(`call:${output.type}:${output.call_id}`); @@ -18823,11 +36229,11 @@ function validateCompletedOutputItemIdentity(event, snapshot) { const replacement = event.item; getOutputItemIdentityKeys(output, event.type); getOutputItemIdentityKeys(replacement, event.type); - if (!hasOwn(replacement, "type") || output.type !== replacement.type) { + if (!hasOwn2(replacement, "type") || output.type !== replacement.type) { throw new OpenAIError(`expected output item type '${output.type}', got '${replacement.type}'`); } - const outputID = hasOwn(output, "id") ? output.id : void 0; - const replacementID = hasOwn(replacement, "id") ? replacement.id : void 0; + const outputID = hasOwn2(output, "id") ? output.id : void 0; + const replacementID = hasOwn2(replacement, "id") ? replacement.id : void 0; if (outputID !== replacementID) { throw new OpenAIError(`expected output item id '${outputID}', got '${replacementID}'`); } @@ -18842,20 +36248,20 @@ function validateOutputItemIdentity(event, snapshot, rejectInvalidShellTargets) } if (rejectInvalidShellTargets && (event.type === "response.shell_call_command.added" || event.type === "response.shell_call_command.delta" || event.type === "response.shell_call_command.done")) { const output2 = getOutput(snapshot, event.output_index); - if (!hasOwn(output2, "type") || output2.type !== "shell_call") { + if (!hasOwn2(output2, "type") || output2.type !== "shell_call") { throw new OpenAIError(`expected output item type 'shell_call', got '${output2.type}'`); } return; } - if (event.type !== "response.content_part.added" && event.type !== "response.content_part.done" && !hasOwn(expectedOutputItemTypes, event.type)) { + if (event.type !== "response.content_part.added" && event.type !== "response.content_part.done" && !hasOwn2(expectedOutputItemTypes, event.type)) { return; } const itemEvent = event; - if (!hasOwn(event, "item_id") || typeof itemEvent.item_id !== "string" || itemEvent.item_id.length === 0) { + if (!hasOwn2(event, "item_id") || typeof itemEvent.item_id !== "string" || itemEvent.item_id.length === 0) { throw new OpenAIError(`expected a non-empty item_id for ${event.type}`); } const output = getOutput(snapshot, itemEvent.output_index); - const outputID = hasOwn(output, "id") ? output.id : void 0; + const outputID = hasOwn2(output, "id") ? output.id : void 0; if (outputID !== itemEvent.item_id) { throw new OpenAIError(`expected item_id '${outputID}', got '${itemEvent.item_id}'`); } @@ -18909,7 +36315,7 @@ function sanitizeResponseEvent(event) { return assertNever3(event); } const stableValues = /* @__PURE__ */ new Map([["type", type]]); - const itemScoped = type === "response.output_item.added" || type === "response.output_item.done" || type === "response.content_part.added" || type === "response.content_part.done" || type === "response.shell_call_command.added" || type === "response.shell_call_command.delta" || type === "response.shell_call_command.done" || hasOwn(expectedOutputItemTypes, type); + const itemScoped = type === "response.output_item.added" || type === "response.output_item.done" || type === "response.content_part.added" || type === "response.content_part.done" || type === "response.shell_call_command.added" || type === "response.shell_call_command.delta" || type === "response.shell_call_command.done" || hasOwn2(expectedOutputItemTypes, type); if (itemScoped) { try { for (const field of responseEventRoutingFields) { @@ -19502,8 +36908,8 @@ function accumulateResponseWithContext(event, snapshot, context, rejectInvalidSh var responseOutputIdentityIndexes, expectedOutputItemTypes, supportedResponseEventTypes, responseEventRoutingFields; var init_response_accumulator = __esm({ "node_modules/openai/internal/responses/response-accumulator.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); init_canonical_output_text(); responseOutputIdentityIndexes = /* @__PURE__ */ new WeakMap(); expectedOutputItemTypes = { @@ -19629,12 +37035,12 @@ function finalizeResponse(snapshot, params) { var _ResponseStream_instances, _ResponseStream_params, _ResponseStream_currentResponseSnapshot, _ResponseStream_finalResponse, _ResponseStream_accumulatorContext, _ResponseStream_beginRequest, _ResponseStream_addEvent, _ResponseStream_endRequest, ResponseStream; var init_ResponseStream = __esm({ "node_modules/openai/lib/responses/ResponseStream.mjs"() { - init_tslib(); - init_error2(); + init_tslib2(); + init_error4(); init_EventStream(); init_response_accumulator(); init_ResponsesParser(); - init_streaming2(); + init_streaming4(); ResponseStream = class _ResponseStream extends EventStream2 { /** Creates an unstarted stream, retaining request parameters for structured-output parsing. */ constructor(params) { @@ -19644,7 +37050,7 @@ var init_ResponseStream = __esm({ _ResponseStream_currentResponseSnapshot.set(this, void 0); _ResponseStream_finalResponse.set(this, void 0); _ResponseStream_accumulatorContext.set(this, createResponseContext()); - __classPrivateFieldSet(this, _ResponseStream_params, params, "f"); + __classPrivateFieldSet2(this, _ResponseStream_params, params, "f"); } /** Starts a new response stream or replays an existing response by its identifier. */ static createResponse(client, params, options) { @@ -19656,51 +37062,51 @@ var init_ResponseStream = __esm({ return runner; } /** Consumes serialized response events from a readable stream in another runtime. */ - static fromReadableStream(stream4) { + static fromReadableStream(stream5) { const runner = new _ResponseStream(null); - runner._run(() => runner._fromReadableStream(stream4)); + runner._run(() => runner._fromReadableStream(stream5)); return runner; } async _createOrRetrieveResponse(client, params, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); - let stream4; + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); + let stream5; let starting_after = null; if ("response_id" in params) { - stream4 = await client.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); + stream5 = await client.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); starting_after = params.starting_after ?? null; } else { - stream4 = await client.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); + stream5 = await client.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); } this._connected(); - for await (const event of stream4) { - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); + return __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); } async _fromReadableStream(readableStream, options) { this._listenForAbort(options?.signal); - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); this._connected(); - const stream4 = Stream.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, null); + const stream5 = Stream2.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, null); } - if (stream4.controller.signal?.aborted) { + if (stream5.controller.signal?.aborted) { throw this._userAbortError(); } - return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); + return __classPrivateFieldGet2(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); } /** Iterates over response events; stopping iteration early aborts the underlying request. */ [(_ResponseStream_params = /* @__PURE__ */ new WeakMap(), _ResponseStream_currentResponseSnapshot = /* @__PURE__ */ new WeakMap(), _ResponseStream_finalResponse = /* @__PURE__ */ new WeakMap(), _ResponseStream_accumulatorContext = /* @__PURE__ */ new WeakMap(), _ResponseStream_instances = /* @__PURE__ */ new WeakSet(), _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() { if (this.ended) { return; } - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); }, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) { if (this.ended) { return; @@ -19715,13 +37121,13 @@ var init_ResponseStream = __esm({ // oxlint-disable-next-line anti-slop/no-runtime-typeof -- An error event can contain malformed server data; validate its container before extracting error details. "error" in event && typeof event.error === "object" && event.error !== null ? event.error : event ); - throw new APIError(void 0, error, event.message, void 0); + throw new APIError2(void 0, error, event.message, void 0); } let dispatchEvent = event; - const response = accumulateResponseWithContext(event, __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"), __classPrivateFieldGet(this, _ResponseStream_accumulatorContext, "f"), true, (sanitizedEvent) => { + const response = accumulateResponseWithContext(event, __classPrivateFieldGet2(this, _ResponseStream_currentResponseSnapshot, "f"), __classPrivateFieldGet2(this, _ResponseStream_accumulatorContext, "f"), true, (sanitizedEvent) => { dispatchEvent = sanitizedEvent; }); - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, response, "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, response, "f"); maybeEmit("event", event); switch (dispatchEvent.type) { case "response.output_text.delta": { @@ -19773,14 +37179,14 @@ var init_ResponseStream = __esm({ if (this.ended) { throw new OpenAIError(`stream has ended, this shouldn't happen`); } - const snapshot = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); + const snapshot = __classPrivateFieldGet2(this, _ResponseStream_currentResponseSnapshot, "f"); if (!snapshot) { throw new OpenAIError(`request ended without sending any events`); } - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); - const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet(this, _ResponseStream_params, "f")); - __classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f"); + __classPrivateFieldSet2(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _ResponseStream_accumulatorContext, createResponseContext(), "f"); + const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet2(this, _ResponseStream_params, "f")); + __classPrivateFieldSet2(this, _ResponseStream_finalResponse, parsedResponse, "f"); return parsedResponse; }, Symbol.asyncIterator)]() { return this._createIterator((push) => { @@ -19797,7 +37203,7 @@ var init_ResponseStream = __esm({ */ async finalResponse() { await this.done(); - const response = __classPrivateFieldGet(this, _ResponseStream_finalResponse, "f"); + const response = __classPrivateFieldGet2(this, _ResponseStream_finalResponse, "f"); if (!response) { throw new OpenAIError("stream ended without producing a Response"); } @@ -19811,10 +37217,10 @@ var init_ResponseStream = __esm({ var InputItems2; var init_input_items2 = __esm({ "node_modules/openai/resources/responses/input-items.mjs"() { - init_resource(); - init_pagination(); - init_path(); - InputItems2 = class extends APIResource { + init_resource2(); + init_pagination2(); + init_path2(); + InputItems2 = class extends APIResource2 { /** * Returns a list of input items for a given response. * @@ -19829,7 +37235,7 @@ var init_input_items2 = __esm({ * ``` */ list(responseID, query = {}, options) { - return this._client.getAPIList(path`/responses/${responseID}/input_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); + return this._client.getAPIList(path3`/responses/${responseID}/input_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; } @@ -19839,8 +37245,8 @@ var init_input_items2 = __esm({ var InputTokens2; var init_input_tokens2 = __esm({ "node_modules/openai/resources/responses/input-tokens.mjs"() { - init_resource(); - InputTokens2 = class extends APIResource { + init_resource2(); + InputTokens2 = class extends APIResource2 { /** * Returns input token counts of the request. * @@ -19869,14 +37275,14 @@ var init_responses2 = __esm({ "node_modules/openai/resources/responses/responses.mjs"() { init_ResponsesParser(); init_ResponseStream(); - init_resource(); + init_resource2(); init_input_items2(); init_input_items2(); init_input_tokens2(); init_input_tokens2(); - init_headers2(); - init_path(); - Responses2 = class extends APIResource { + init_headers3(); + init_path2(); + Responses2 = class extends APIResource2 { constructor() { super(...arguments); this.inputItems = new InputItems2(this._client); @@ -19896,7 +37302,7 @@ var init_responses2 = __esm({ }); } retrieve(responseID, query = {}, options) { - return this._client.get(path`/responses/${responseID}`, { + return this._client.get(path3`/responses/${responseID}`, { query, ...options, stream: query?.stream ?? false, @@ -19919,9 +37325,9 @@ var init_responses2 = __esm({ * ``` */ delete(responseID, options) { - return this._client.delete(path`/responses/${responseID}`, { + return this._client.delete(path3`/responses/${responseID}`, { ...options, - headers: buildHeaders([{ Accept: "*/*" }, options?.headers]), + headers: buildHeaders2([{ Accept: "*/*" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -19947,7 +37353,7 @@ var init_responses2 = __esm({ * ``` */ cancel(responseID, options) { - return this._client.post(path`/responses/${responseID}/cancel`, { + return this._client.post(path3`/responses/${responseID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -19980,14 +37386,14 @@ var init_responses2 = __esm({ var Alerts; var init_alerts = __esm({ "node_modules/openai/resources/safety/alerts.mjs"() { - init_resource(); - init_path(); - Alerts = class extends APIResource { + init_resource2(); + init_path2(); + Alerts = class extends APIResource2 { /** * Get a safety alert belonging to the authenticated API project. */ retrieve(id, options) { - return this._client.get(path`/safety/alerts/${id}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/safety/alerts/${id}`, { ...options, __security: { bearerAuth: true } }); } }; } @@ -19997,10 +37403,10 @@ var init_alerts = __esm({ var Safety; var init_safety = __esm({ "node_modules/openai/resources/safety/safety.mjs"() { - init_resource(); + init_resource2(); init_alerts(); init_alerts(); - Safety = class extends APIResource { + Safety = class extends APIResource2 { constructor() { super(...arguments); this.alerts = new Alerts(this._client); @@ -20014,17 +37420,17 @@ var init_safety = __esm({ var Content2; var init_content2 = __esm({ "node_modules/openai/resources/skills/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content2 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content2 = class extends APIResource2 { /** * Download a skill zip bundle by its ID. */ retrieve(skillID, options) { - return this._client.get(path`/skills/${skillID}/content`, { + return this._client.get(path3`/skills/${skillID}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20037,18 +37443,18 @@ var init_content2 = __esm({ var Content3; var init_content3 = __esm({ "node_modules/openai/resources/skills/versions/content.mjs"() { - init_resource(); - init_headers2(); - init_path(); - Content3 = class extends APIResource { + init_resource2(); + init_headers3(); + init_path2(); + Content3 = class extends APIResource2 { /** * Download a skill version zip bundle. */ retrieve(version, params, options) { const { skill_id } = params; - return this._client.get(path`/skills/${skill_id}/versions/${version}/content`, { + return this._client.get(path3`/skills/${skill_id}/versions/${version}/content`, { ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20058,16 +37464,16 @@ var init_content3 = __esm({ }); // node_modules/openai/resources/skills/versions/versions.mjs -var Versions; -var init_versions = __esm({ +var Versions4; +var init_versions4 = __esm({ "node_modules/openai/resources/skills/versions/versions.mjs"() { - init_resource(); + init_resource2(); init_content3(); init_content3(); - init_pagination(); - init_uploads(); - init_path(); - Versions = class extends APIResource { + init_pagination2(); + init_uploads3(); + init_path2(); + Versions4 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content3(this._client); @@ -20076,7 +37482,7 @@ var init_versions = __esm({ * Create a new immutable skill version. */ create(skillID, body = {}, options) { - return this._client.post(path`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client, { + return this._client.post(path3`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client, { stripFilenames: false })); } @@ -20085,7 +37491,7 @@ var init_versions = __esm({ */ retrieve(version, params, options) { const { skill_id } = params; - return this._client.get(path`/skills/${skill_id}/versions/${version}`, { + return this._client.get(path3`/skills/${skill_id}/versions/${version}`, { ...options, __security: { bearerAuth: true } }); @@ -20094,7 +37500,7 @@ var init_versions = __esm({ * List skill versions for a skill. */ list(skillID, query = {}, options) { - return this._client.getAPIList(path`/skills/${skillID}/versions`, CursorPage, { + return this._client.getAPIList(path3`/skills/${skillID}/versions`, CursorPage, { query, ...options, __security: { bearerAuth: true } @@ -20105,33 +37511,33 @@ var init_versions = __esm({ */ delete(version, params, options) { const { skill_id } = params; - return this._client.delete(path`/skills/${skill_id}/versions/${version}`, { + return this._client.delete(path3`/skills/${skill_id}/versions/${version}`, { ...options, __security: { bearerAuth: true } }); } }; - Versions.Content = Content3; + Versions4.Content = Content3; } }); // node_modules/openai/resources/skills/skills.mjs -var Skills; -var init_skills = __esm({ +var Skills3; +var init_skills3 = __esm({ "node_modules/openai/resources/skills/skills.mjs"() { - init_resource(); + init_resource2(); init_content2(); init_content2(); - init_versions(); - init_versions(); - init_pagination(); - init_uploads(); - init_path(); - Skills = class extends APIResource { + init_versions4(); + init_versions4(); + init_pagination2(); + init_uploads3(); + init_path2(); + Skills3 = class extends APIResource2 { constructor() { super(...arguments); this.content = new Content2(this._client); - this.versions = new Versions(this._client); + this.versions = new Versions4(this._client); } /** * Create a new skill. @@ -20145,13 +37551,13 @@ var init_skills = __esm({ * Get a skill by its ID. */ retrieve(skillID, options) { - return this._client.get(path`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } /** * Update the default version pointer for a skill. */ update(skillID, body, options) { - return this._client.post(path`/skills/${skillID}`, { + return this._client.post(path3`/skills/${skillID}`, { body, ...options, __security: { bearerAuth: true } @@ -20171,11 +37577,11 @@ var init_skills = __esm({ * Delete a skill by its ID. */ delete(skillID, options) { - return this._client.delete(path`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } }; - Skills.Content = Content2; - Skills.Versions = Versions; + Skills3.Content = Content2; + Skills3.Versions = Versions4; } }); @@ -20183,10 +37589,10 @@ var init_skills = __esm({ var Parts; var init_parts = __esm({ "node_modules/openai/resources/uploads/parts.mjs"() { - init_resource(); - init_uploads(); - init_path(); - Parts = class extends APIResource { + init_resource2(); + init_uploads3(); + init_path2(); + Parts = class extends APIResource2 { /** * Adds a * [Part](https://developers.openai.com/api/reference/resources/uploads/subresources/parts) @@ -20202,7 +37608,7 @@ var init_parts = __esm({ * [complete the Upload](https://developers.openai.com/api/reference/resources/uploads/methods/complete). */ create(uploadID, body, options) { - return this._client.post(path`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/uploads/${uploadID}/parts`, multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -20210,13 +37616,13 @@ var init_parts = __esm({ // node_modules/openai/resources/uploads/uploads.mjs var Uploads; -var init_uploads3 = __esm({ +var init_uploads5 = __esm({ "node_modules/openai/resources/uploads/uploads.mjs"() { - init_resource(); + init_resource2(); init_parts(); init_parts(); - init_path(); - Uploads = class extends APIResource { + init_path2(); + Uploads = class extends APIResource2 { constructor() { super(...arguments); this.parts = new Parts(this._client); @@ -20253,7 +37659,7 @@ var init_uploads3 = __esm({ * Returns the Upload object with status `cancelled`. */ cancel(uploadID, options) { - return this._client.post(path`/uploads/${uploadID}/cancel`, { + return this._client.post(path3`/uploads/${uploadID}/cancel`, { ...options, __security: { bearerAuth: true } }); @@ -20276,7 +37682,7 @@ var init_uploads3 = __esm({ * object. */ complete(uploadID, body, options) { - return this._client.post(path`/uploads/${uploadID}/complete`, { + return this._client.post(path3`/uploads/${uploadID}/complete`, { body, ...options, __security: { bearerAuth: true } @@ -20361,21 +37767,21 @@ var init_vector_store_upload = __esm({ var FileBatches; var init_file_batches = __esm({ "node_modules/openai/resources/vector-stores/file-batches.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); + init_resource2(); + init_pagination2(); + init_headers3(); init_vector_store_polling(); init_vector_store_upload(); - init_path(); - FileBatches = class extends APIResource { + init_path2(); + FileBatches = class extends APIResource2 { /** * Create a vector store file batch. */ create(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}/file_batches`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}/file_batches`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20384,9 +37790,9 @@ var init_file_batches = __esm({ */ retrieve(batchID, params, options) { const { vector_store_id } = params; - return this._client.get(path`/vector_stores/${vector_store_id}/file_batches/${batchID}`, { + return this._client.get(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20396,9 +37802,9 @@ var init_file_batches = __esm({ */ cancel(batchID, params, options) { const { vector_store_id } = params; - return this._client.post(path`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, { + return this._client.post(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20414,10 +37820,10 @@ var init_file_batches = __esm({ */ listFiles(batchID, params, options) { const { vector_store_id, ...query } = params; - return this._client.getAPIList(path`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { + return this._client.getAPIList(path3`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20443,25 +37849,25 @@ var init_file_batches = __esm({ }); // node_modules/openai/resources/vector-stores/files.mjs -var Files4; -var init_files4 = __esm({ +var Files6; +var init_files6 = __esm({ "node_modules/openai/resources/vector-stores/files.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); + init_resource2(); + init_pagination2(); + init_headers3(); init_vector_store_polling(); - init_path(); - Files4 = class extends APIResource { + init_path2(); + Files6 = class extends APIResource2 { /** * Create a vector store file by attaching a * [File](https://developers.openai.com/api/reference/resources/files) to a * [vector store](https://developers.openai.com/api/reference/resources/vector_stores). */ create(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}/files`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}/files`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20470,9 +37876,9 @@ var init_files4 = __esm({ */ retrieve(fileID, params, options) { const { vector_store_id } = params; - return this._client.get(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.get(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20481,10 +37887,10 @@ var init_files4 = __esm({ */ update(fileID, params, options) { const { vector_store_id, ...body } = params; - return this._client.post(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.post(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20492,10 +37898,10 @@ var init_files4 = __esm({ * Returns a list of vector store files. */ list(vectorStoreID, query = {}, options) { - return this._client.getAPIList(path`/vector_stores/${vectorStoreID}/files`, CursorPage, { + return this._client.getAPIList(path3`/vector_stores/${vectorStoreID}/files`, CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20507,9 +37913,9 @@ var init_files4 = __esm({ */ delete(fileID, params, options) { const { vector_store_id } = params; - return this._client.delete(path`/vector_stores/${vector_store_id}/files/${fileID}`, { + return this._client.delete(path3`/vector_stores/${vector_store_id}/files/${fileID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20551,9 +37957,9 @@ var init_files4 = __esm({ */ content(fileID, params, options) { const { vector_store_id } = params; - return this._client.getAPIList(path`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, { + return this._client.getAPIList(path3`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page2, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20565,18 +37971,18 @@ var init_files4 = __esm({ var VectorStores; var init_vector_stores = __esm({ "node_modules/openai/resources/vector-stores/vector-stores.mjs"() { - init_resource(); + init_resource2(); init_file_batches(); init_file_batches(); - init_files4(); - init_files4(); - init_pagination(); - init_headers2(); - init_path(); - VectorStores = class extends APIResource { + init_files6(); + init_files6(); + init_pagination2(); + init_headers3(); + init_path2(); + VectorStores = class extends APIResource2 { constructor() { super(...arguments); - this.files = new Files4(this._client); + this.files = new Files6(this._client); this.fileBatches = new FileBatches(this._client); } /** @@ -20586,7 +37992,7 @@ var init_vector_stores = __esm({ return this._client.post("/vector_stores", { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20594,9 +38000,9 @@ var init_vector_stores = __esm({ * Retrieves a vector store. */ retrieve(vectorStoreID, options) { - return this._client.get(path`/vector_stores/${vectorStoreID}`, { + return this._client.get(path3`/vector_stores/${vectorStoreID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20604,10 +38010,10 @@ var init_vector_stores = __esm({ * Modifies a vector store. */ update(vectorStoreID, body, options) { - return this._client.post(path`/vector_stores/${vectorStoreID}`, { + return this._client.post(path3`/vector_stores/${vectorStoreID}`, { body, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20618,7 +38024,7 @@ var init_vector_stores = __esm({ return this._client.getAPIList("/vector_stores", CursorPage, { query, ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20626,9 +38032,9 @@ var init_vector_stores = __esm({ * Delete a vector store. */ delete(vectorStoreID, options) { - return this._client.delete(path`/vector_stores/${vectorStoreID}`, { + return this._client.delete(path3`/vector_stores/${vectorStoreID}`, { ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } @@ -20637,16 +38043,16 @@ var init_vector_stores = __esm({ * filter. */ search(vectorStoreID, body, options) { - return this._client.getAPIList(path`/vector_stores/${vectorStoreID}/search`, Page, { + return this._client.getAPIList(path3`/vector_stores/${vectorStoreID}/search`, Page2, { body, method: "post", ...options, - headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), __security: { bearerAuth: true } }); } }; - VectorStores.Files = Files4; + VectorStores.Files = Files6; VectorStores.FileBatches = FileBatches; } }); @@ -20655,19 +38061,19 @@ var init_vector_stores = __esm({ var Videos; var init_videos = __esm({ "node_modules/openai/resources/videos.mjs"() { - init_resource(); - init_pagination(); - init_headers2(); - init_uploads(); - init_path(); - Videos = class extends APIResource { + init_resource2(); + init_pagination2(); + init_headers3(); + init_uploads3(); + init_path2(); + Videos = class extends APIResource2 { /** * Create a new video generation job from a prompt and optional reference assets. * * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ create(body, options) { - return this._client.post("/videos", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Fetch the latest metadata for a generated video. @@ -20675,7 +38081,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ retrieve(videoID, options) { - return this._client.get(path`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.get(path3`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); } /** * List recently generated videos for the current project. @@ -20695,7 +38101,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ delete(videoID, options) { - return this._client.delete(path`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + return this._client.delete(path3`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); } /** * Create a character from an uploaded video. @@ -20703,7 +38109,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ createCharacter(body, options) { - return this._client.post("/videos/characters", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/characters", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Download the generated video bytes or a derived preview asset. @@ -20713,10 +38119,10 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ downloadContent(videoID, query = {}, options) { - return this._client.get(path`/videos/${videoID}/content`, { + return this._client.get(path3`/videos/${videoID}/content`, { query, ...options, - headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]), + headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), __security: { bearerAuth: true }, __binaryResponse: true }); @@ -20728,7 +38134,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ edit(body, options) { - return this._client.post("/videos/edits", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/edits", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Create an extension of a completed video. @@ -20736,7 +38142,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ extend(body, options) { - return this._client.post("/videos/extensions", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post("/videos/extensions", multipartFormRequestOptions2({ body, ...options, __security: { bearerAuth: true } }, this._client)); } /** * Fetch a character. @@ -20744,7 +38150,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ getCharacter(characterID, options) { - return this._client.get(path`/videos/characters/${characterID}`, { + return this._client.get(path3`/videos/characters/${characterID}`, { ...options, __security: { bearerAuth: true } }); @@ -20755,7 +38161,7 @@ var init_videos = __esm({ * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026. */ remix(videoID, body, options) { - return this._client.post(path`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); + return this._client.post(path3`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)); } }; } @@ -20779,7 +38185,7 @@ function* signatureCandidates(signatureHeader) { } function decodeSignature(signature) { try { - const signatureBytes = fromBase64(signature); + const signatureBytes = fromBase642(signature); return signatureBytes.byteLength === SHA256_SIGNATURE_LENGTH ? signatureBytes : void 0; } catch { return void 0; @@ -20828,9 +38234,9 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh if (useBoundedVerification && !firstSignature) { throw new InvalidWebhookSignatureError("The given webhook signature does not match the expected signature"); } - const decodedSecret = Uint8Array.from(secret.startsWith("whsec_") ? fromBase64(secret.slice("whsec_".length)) : encodeUTF8(secret)); + const decodedSecret = Uint8Array.from(secret.startsWith("whsec_") ? fromBase642(secret.slice("whsec_".length)) : encodeUTF82(secret)); const signedPayload = webhookId ? `${webhookId}.${timestamp2}.${payload}` : `${timestamp2}.${payload}`; - const signedPayloadBytes = Uint8Array.from(encodeUTF8(signedPayload)); + const signedPayloadBytes = Uint8Array.from(encodeUTF82(signedPayload)); const key = await crypto.subtle.importKey("raw", decodedSecret, { name: "HMAC", hash: "SHA-256" }, false, useBoundedVerification ? ["sign", "verify"] : ["verify"]); if (useBoundedVerification && firstSignature) { const expectedSignature = new Uint8Array(await crypto.subtle.sign("HMAC", key, signedPayloadBytes)); @@ -20845,7 +38251,7 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh } for (const signature of signatureCandidates(signatureHeader)) { try { - const signatureBytes = Uint8Array.from(fromBase64(signature)); + const signatureBytes = Uint8Array.from(fromBase642(signature)); const isValid = await crypto.subtle.verify("HMAC", key, signatureBytes, signedPayloadBytes); if (isValid) { return; @@ -20858,9 +38264,9 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp2, webh var MAX_DIRECT_WEBHOOK_VERIFICATIONS, SHA256_SIGNATURE_LENGTH; var init_webhook_signature = __esm({ "node_modules/openai/lib/webhook-signature.mjs"() { - init_error2(); - init_base64(); - init_bytes(); + init_error4(); + init_base642(); + init_bytes2(); MAX_DIRECT_WEBHOOK_VERIFICATIONS = 32; SHA256_SIGNATURE_LENGTH = 32; } @@ -20870,8 +38276,8 @@ var init_webhook_signature = __esm({ var EventTypes; var init_event_types = __esm({ "node_modules/openai/resources/webhooks/event-types.mjs"() { - init_resource(); - EventTypes = class extends APIResource { + init_resource2(); + EventTypes = class extends APIResource2 { /** * Returns webhook event types visible to the authenticated project. * @@ -20889,18 +38295,18 @@ var init_event_types = __esm({ }); // node_modules/openai/resources/webhooks/webhooks.mjs -var _Webhooks_instances, _Webhooks_validateSecret, _Webhooks_getRequiredHeader, Webhooks; -var init_webhooks = __esm({ +var _Webhooks_instances, _Webhooks_validateSecret, _Webhooks_getRequiredHeader, Webhooks2; +var init_webhooks2 = __esm({ "node_modules/openai/resources/webhooks/webhooks.mjs"() { - init_tslib(); - init_resource(); - init_headers2(); + init_tslib2(); + init_resource2(); + init_headers3(); init_webhook_signature(); init_event_types(); init_event_types(); - init_pagination(); - init_path(); - Webhooks = class extends APIResource { + init_pagination2(); + init_path2(); + Webhooks2 = class extends APIResource2 { constructor() { super(...arguments); _Webhooks_instances.add(this); @@ -20933,7 +38339,7 @@ var init_webhooks = __esm({ * ``` */ retrieve(webhookEndpointID, options) { - return this._client.get(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.get(path3`/webhook_endpoints/${webhookEndpointID}`, { ...options, __security: { bearerAuth: true } }); @@ -20947,7 +38353,7 @@ var init_webhooks = __esm({ * ``` */ update(webhookEndpointID, body = {}, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}`, { body, ...options, __security: { bearerAuth: true } @@ -20982,7 +38388,7 @@ var init_webhooks = __esm({ * ``` */ delete(webhookEndpointID, options) { - return this._client.delete(path`/webhook_endpoints/${webhookEndpointID}`, { + return this._client.delete(path3`/webhook_endpoints/${webhookEndpointID}`, { ...options, __security: { bearerAuth: true } }); @@ -20997,7 +38403,7 @@ var init_webhooks = __esm({ * ``` */ rotateSecret(webhookEndpointID, body = {}, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}/rotate_secret`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}/rotate_secret`, { body, ...options, __security: { bearerAuth: true } @@ -21015,7 +38421,7 @@ var init_webhooks = __esm({ * ``` */ test(webhookEndpointID, body, options) { - return this._client.post(path`/webhook_endpoints/${webhookEndpointID}/test`, { + return this._client.post(path3`/webhook_endpoints/${webhookEndpointID}/test`, { body, ...options, __security: { bearerAuth: true } @@ -21042,11 +38448,11 @@ var init_webhooks = __esm({ if (typeof crypto === "undefined" || typeof crypto.subtle?.importKey !== "function" || typeof crypto.subtle.verify !== "function") { throw new Error("Webhook signature verification is only supported when the `crypto` global is defined"); } - __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_validateSecret).call(this, secret); - const headersObj = buildHeaders([headers]).values; - const signatureHeader = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-signature"); - const timestamp2 = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-timestamp"); - const webhookId = __classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-id"); + __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_validateSecret).call(this, secret); + const headersObj = buildHeaders2([headers]).values; + const signatureHeader = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-signature"); + const timestamp2 = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-timestamp"); + const webhookId = __classPrivateFieldGet2(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-id"); if (webhookSignatureRequiresSigning(signatureHeader) && typeof crypto.subtle.sign !== "function") { throw new Error("Webhook signature verification is only supported when the `crypto` global is defined"); } @@ -21061,46 +38467,46 @@ var init_webhooks = __esm({ if (!headers) { throw new Error(`Headers are required`); } - const value = headers.get(name); - if (value === null || value === void 0) { + const value2 = headers.get(name); + if (value2 === null || value2 === void 0) { throw new Error(`Missing required header: ${name}`); } - return value; + return value2; }; - Webhooks.EventTypes = EventTypes; + Webhooks2.EventTypes = EventTypes; } }); // node_modules/openai/resources/index.mjs -var init_resources = __esm({ +var init_resources3 = __esm({ "node_modules/openai/resources/index.mjs"() { init_chat2(); - init_shared(); + init_shared2(); init_admin(); init_audio(); - init_batches(); - init_beta(); - init_completions3(); + init_batches3(); + init_beta2(); + init_completions4(); init_containers(); init_content_provenance_checks(); init_conversations(); init_embeddings2(); init_evals(); - init_files3(); + init_files5(); init_fine_tuning(); init_graders2(); init_images(); init_live(); - init_models2(); + init_models4(); init_moderations(); init_realtime2(); init_responses2(); init_safety(); - init_skills(); - init_uploads3(); + init_skills3(); + init_uploads5(); init_vector_stores(); init_videos(); - init_webhooks(); + init_webhooks2(); } }); @@ -21140,7 +38546,7 @@ var init_provider = __esm({ // node_modules/openai/client.mjs function isRunningInBrowserOrBrowserWorker() { - if (isRunningInBrowser()) + if (isRunningInBrowser2()) return true; const scope = globalThis; return typeof scope.WorkerGlobalScope === "function" && scope instanceof scope.WorkerGlobalScope && typeof scope.WorkerNavigator === "function" && scope.navigator instanceof scope.WorkerNavigator && typeof scope.navigator?.userAgent === "string" && scope.navigator.userAgent !== "Cloudflare-Workers" && scope.process?.versions?.node === void 0 && scope.Deno === void 0 && scope.Bun === void 0 && scope.EdgeRuntime === void 0 && scope.WebSocketPair === void 0; @@ -21182,46 +38588,46 @@ function isUndiciDispatcherVersionMismatchError(error) { } return false; } -var _OpenAI_instances, _a3, _OpenAI_encoder, _OpenAI_x509Authentication, _OpenAI_x509Credential, _OpenAI_x509Fetch, _OpenAI_explicitDataResidency, _OpenAI_responseAttempts, _OpenAI_baseURLOverridden, WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER, inheritedDataResidencySelection, OpenAI, composedCallerSignals; -var init_client = __esm({ +var _OpenAI_instances, _a4, _OpenAI_encoder, _OpenAI_x509Authentication, _OpenAI_x509Credential, _OpenAI_x509Fetch, _OpenAI_explicitDataResidency, _OpenAI_responseAttempts, _OpenAI_baseURLOverridden, WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER, inheritedDataResidencySelection, OpenAI, composedCallerSignals; +var init_client2 = __esm({ "node_modules/openai/client.mjs"() { - init_tslib(); - init_uuid(); - init_values(); - init_sleep(); - init_abort2(); - init_errors(); - init_parse(); - init_detect_platform(); - init_shims(); - init_request_options(); - init_query(); - init_version2(); + init_tslib2(); + init_uuid2(); + init_values2(); + init_sleep2(); + init_abort3(); + init_errors2(); + init_parse2(); + init_detect_platform2(); + init_shims2(); + init_request_options2(); + init_query2(); + init_version3(); init_data_residency(); - init_error(); - init_pagination(); + init_error3(); + init_pagination2(); init_workload_identity_auth(); init_x509_api_origin(); init_x509_workload_identity_auth(); init_x509_credential_options(); init_x509_transport_state(); - init_error(); - init_uploads2(); - init_resources(); - init_api_promise(); + init_error3(); + init_uploads4(); + init_resources3(); + init_api_promise2(); init_realtime_credentials(); - init_batches(); - init_completions3(); + init_batches3(); + init_completions4(); init_content_provenance_checks(); init_embeddings2(); - init_files3(); + init_files5(); init_images(); - init_models2(); + init_models4(); init_moderations(); init_videos(); init_admin(); init_audio(); - init_beta(); + init_beta2(); init_chat(); init_containers(); init_conversations(); @@ -21232,16 +38638,16 @@ var init_client = __esm({ init_realtime2(); init_responses2(); init_safety(); - init_skills(); - init_uploads3(); + init_skills3(); + init_uploads5(); init_vector_stores(); - init_webhooks(); - init_detect_platform(); - init_headers2(); + init_webhooks2(); + init_detect_platform2(); + init_headers3(); init_provider(); - init_env(); - init_log(); - init_values(); + init_env2(); + init_log2(); + init_values2(); WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER = "workload-identity-auth"; inheritedDataResidencySelection = /* @__PURE__ */ Symbol("inheritedDataResidencySelection"); OpenAI = class { @@ -21271,22 +38677,22 @@ var init_client = __esm({ _OpenAI_x509Fetch.set(this, void 0); _OpenAI_explicitDataResidency.set(this, false); _OpenAI_responseAttempts.set(this, /* @__PURE__ */ new WeakMap()); - this.completions = new Completions2(this); + this.completions = new Completions3(this); this.chat = new Chat(this); this.embeddings = new Embeddings(this); - this.files = new Files3(this); + this.files = new Files5(this); this.images = new Images(this); this.contentProvenanceChecks = new ContentProvenanceChecks(this); this.audio = new Audio(this); this.moderations = new Moderations(this); - this.models = new Models(this); + this.models = new Models3(this); this.fineTuning = new FineTuning(this); this.graders = new Graders2(this); this.vectorStores = new VectorStores(this); this.safety = new Safety(this); - this.webhooks = new Webhooks(this); - this.beta = new Beta(this); - this.batches = new Batches(this); + this.webhooks = new Webhooks2(this); + this.beta = new Beta2(this); + this.batches = new Batches3(this); this.uploads = new Uploads(this); this.admin = new Admin(this); this.responses = new Responses2(this); @@ -21295,13 +38701,13 @@ var init_client = __esm({ this.conversations = new Conversations(this); this.evals = new Evals(this); this.containers = new Containers(this); - this.skills = new Skills(this); + this.skills = new Skills3(this); this.videos = new Videos(this); const { credential, options: normalizedOptions } = normalizeX509CredentialOptions(clientOptions); clientOptions = normalizedOptions; const residencyBaseURL = resolveDataResidency(clientOptions); const provider2 = clientOptions.provider; - const { baseURL = provider2 ? null : readEnv("OPENAI_BASE_URL"), dataResidency: _dataResidency, [inheritedDataResidencySelection]: inheritedResidencySelection = false, apiKey = provider2 ? null : readEnv("OPENAI_API_KEY") ?? null, adminAPIKey = provider2 ? null : readEnv("OPENAI_ADMIN_KEY") ?? null, organization = provider2 ? null : readEnv("OPENAI_ORG_ID") ?? null, project = provider2 ? null : readEnv("OPENAI_PROJECT_ID") ?? null, webhookSecret = readEnv("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity, x509Transport, credential: _credential, ...opts } = clientOptions; + const { baseURL = provider2 ? null : readEnv2("OPENAI_BASE_URL"), dataResidency: _dataResidency, [inheritedDataResidencySelection]: inheritedResidencySelection = false, apiKey = provider2 ? null : readEnv2("OPENAI_API_KEY") ?? null, adminAPIKey = provider2 ? null : readEnv2("OPENAI_ADMIN_KEY") ?? null, organization = provider2 ? null : readEnv2("OPENAI_ORG_ID") ?? null, project = provider2 ? null : readEnv2("OPENAI_PROJECT_ID") ?? null, webhookSecret = readEnv2("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity, x509Transport, credential: _credential, ...opts } = clientOptions; if (provider2) { const conflictingOptions = ["apiKey", "adminAPIKey", "workloadIdentity", "x509Transport", "baseURL", "dataResidency"].filter((key) => (key === "workloadIdentity" ? workloadIdentity : clientOptions[key]) != null); if (conflictingOptions.length) { @@ -21336,7 +38742,7 @@ var init_client = __esm({ } assertX509APIOrigin(options.baseURL); assertX509RequestOptions(options.fetchOptions); - if (this.fetchWithAuth !== _a3.prototype.fetchWithAuth || this.fetchWithTimeout !== _a3.prototype.fetchWithTimeout) { + if (this.fetchWithAuth !== _a4.prototype.fetchWithAuth || this.fetchWithTimeout !== _a4.prototype.fetchWithTimeout) { throw new OpenAIError("X.509 workload identity does not support overridden fetch dispatch hooks."); } } @@ -21350,17 +38756,17 @@ var init_client = __esm({ throw new OpenAIError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n"); } this.baseURL = options.baseURL; - __classPrivateFieldSet(this, _OpenAI_explicitDataResidency, residencyBaseURL !== void 0 || inheritedResidencySelection, "f"); - this.timeout = options.timeout ?? _a3.DEFAULT_TIMEOUT; + __classPrivateFieldSet2(this, _OpenAI_explicitDataResidency, residencyBaseURL !== void 0 || inheritedResidencySelection, "f"); + this.timeout = options.timeout ?? _a4.DEFAULT_TIMEOUT; this.logger = options.logger ?? console; const defaultLogLevel2 = "warn"; this.logLevel = defaultLogLevel2; - this.logLevel = parseLogLevel(options.logLevel, "ClientOptions.logLevel", this) ?? parseLogLevel(readEnv("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? defaultLogLevel2; + this.logLevel = parseLogLevel2(options.logLevel, "ClientOptions.logLevel", this) ?? parseLogLevel2(readEnv2("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? defaultLogLevel2; this.fetchOptions = options.fetchOptions; this.maxRetries = options.maxRetries ?? 2; - this.fetch = options.fetch ?? getDefaultFetch(); - __classPrivateFieldSet(this, _OpenAI_encoder, FallbackEncoder, "f"); - const customHeadersEnv = provider2 || credential ? void 0 : readEnv("OPENAI_CUSTOM_HEADERS"); + this.fetch = options.fetch ?? getDefaultFetch2(); + __classPrivateFieldSet2(this, _OpenAI_encoder, FallbackEncoder2, "f"); + const customHeadersEnv = provider2 || credential ? void 0 : readEnv2("OPENAI_CUSTOM_HEADERS"); if (customHeadersEnv) { const parsed = {}; for (const line of customHeadersEnv.split("\n")) { @@ -21369,17 +38775,17 @@ var init_client = __esm({ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); } } - options.defaultHeaders = buildHeaders([parsed, options.defaultHeaders]); + options.defaultHeaders = buildHeaders2([parsed, options.defaultHeaders]); } this._options = options; this._provider = providerRuntime; if (x509Identity) { const authentication = new X509WorkloadIdentityAuth(x509Identity, x509Transport, organization, project); this._workloadIdentityAuth = authentication; - __classPrivateFieldSet(this, _OpenAI_x509Authentication, authentication, "f"); - __classPrivateFieldSet(this, _OpenAI_x509Credential, credential, "f"); - __classPrivateFieldSet(this, _OpenAI_x509Fetch, authentication.fetch(), "f"); - this.fetch = __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Authentication, authentication, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Credential, credential, "f"); + __classPrivateFieldSet2(this, _OpenAI_x509Fetch, authentication.fetch(), "f"); + this.fetch = __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f"); markApprovedX509Client2(this); } else if (identity.legacy) { this._workloadIdentityAuth = new WorkloadIdentityAuth(identity.legacy, this.fetch); @@ -21395,7 +38801,7 @@ var init_client = __esm({ */ withOptions(options) { const residencyBaseURL = resolveDataResidency(options); - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); const inheritedOptions = { ...this._options, baseURL: this.baseURL, @@ -21403,7 +38809,7 @@ var init_client = __esm({ timeout: this.timeout, logger: this.logger, logLevel: this.logLevel, - fetch: __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ? void 0 : this.fetch, + fetch: __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ? void 0 : this.fetch, fetchOptions: this.fetchOptions, apiKey: this._options.apiKey, adminAPIKey: this.adminAPIKey, @@ -21413,7 +38819,7 @@ var init_client = __esm({ project: this.project, webhookSecret: this.webhookSecret }; - const { credential, provider: provider2 } = prepareX509ClientClone(inheritedOptions, options, __classPrivateFieldGet(this, _OpenAI_x509Credential, "f"), x509Authentication !== void 0); + const { credential, provider: provider2 } = prepareX509ClientClone(inheritedOptions, options, __classPrivateFieldGet2(this, _OpenAI_x509Credential, "f"), x509Authentication !== void 0); if (residencyBaseURL !== void 0) { delete inheritedOptions.baseURL; } @@ -21422,7 +38828,7 @@ var init_client = __esm({ ...options, credential, provider: provider2, - [inheritedDataResidencySelection]: __classPrivateFieldGet(this, _OpenAI_explicitDataResidency, "f") && residencyBaseURL === void 0 && !hasOwn(options, "baseURL") && options.credential === void 0 && !provider2 + [inheritedDataResidencySelection]: __classPrivateFieldGet2(this, _OpenAI_explicitDataResidency, "f") && residencyBaseURL === void 0 && !hasOwn2(options, "baseURL") && options.credential === void 0 && !provider2 }; const client = new this.constructor(clientOptions); if (provider2 && new URL(client.baseURL).origin !== new URL(this.baseURL).origin) { @@ -21433,14 +38839,14 @@ var init_client = __esm({ fetch: options.fetch }); client.fetchOptions = options.fetchOptions; - client.fetch = options.fetch ?? getDefaultFetch(); + client.fetch = options.fetch ?? getDefaultFetch2(); client.organization = options.organization ?? null; client.project = options.project ?? null; } - if (__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && __classPrivateFieldGet(client, _OpenAI_x509Authentication, "f") && this.baseURL === client.baseURL && __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").matches(__classPrivateFieldGet(client, _OpenAI_x509Authentication, "f"))) { - client._workloadIdentityAuth = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); - __classPrivateFieldSet(client, _OpenAI_x509Authentication, __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"), "f"); - __classPrivateFieldSet(client, _OpenAI_x509Fetch, __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f"), "f"); + if (__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && __classPrivateFieldGet2(client, _OpenAI_x509Authentication, "f") && this.baseURL === client.baseURL && __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").matches(__classPrivateFieldGet2(client, _OpenAI_x509Authentication, "f"))) { + client._workloadIdentityAuth = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); + __classPrivateFieldSet2(client, _OpenAI_x509Authentication, __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"), "f"); + __classPrivateFieldSet2(client, _OpenAI_x509Fetch, __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f"), "f"); } return client; } @@ -21449,7 +38855,7 @@ var init_client = __esm({ } /** @internal Client request headers for each new WebSocket handshake. */ _buildWebSocketHeaders(authHeaders) { - return Object.fromEntries(buildHeaders([ + return Object.fromEntries(buildHeaders2([ { "User-Agent": this.getUserAgent(), "OpenAI-Organization": this.organization, @@ -21478,20 +38884,20 @@ var init_client = __esm({ bearerAuth: true, adminAPIKeyAuth: true }) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; if (authentication instanceof X509WorkloadIdentityAuth && schemes.adminAPIKeyAuth && this.adminAPIKey !== null) { return await this.adminAPIKeyAuth(opts); } - return buildHeaders([ + return buildHeaders2([ schemes.bearerAuth ? await this.bearerAuth(opts) : null, schemes.adminAPIKeyAuth ? await this.adminAPIKeyAuth(opts) : null ]); } async bearerAuth(opts) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; if (authentication) { if (authentication instanceof X509WorkloadIdentityAuth) { - if (authentication === this._workloadIdentityAuth && (this.fetchWithAuth !== _a3.prototype.fetchWithAuth || this.fetchWithTimeout !== _a3.prototype.fetchWithTimeout)) { + if (authentication === this._workloadIdentityAuth && (this.fetchWithAuth !== _a4.prototype.fetchWithAuth || this.fetchWithTimeout !== _a4.prototype.fetchWithTimeout)) { throw new OpenAIError("X.509 workload identity does not support overridden fetch dispatch hooks."); } const snapshots = authentication.headerSnapshots(); @@ -21506,32 +38912,32 @@ var init_client = __esm({ signal: authentication.effectiveSignal(), ...authentication.tenantSnapshot() }) : await authentication.getToken(); - return buildHeaders([{ Authorization: `Bearer ${token}` }]); + return buildHeaders2([{ Authorization: `Bearer ${token}` }]); } const { apiKey } = await resolveRealtimeAPIKey(this); if (apiKey == null) { return void 0; } - return buildHeaders([{ Authorization: `Bearer ${apiKey}` }]); + return buildHeaders2([{ Authorization: `Bearer ${apiKey}` }]); } async adminAPIKeyAuth(opts) { if (this.adminAPIKey == null) { return void 0; } - return buildHeaders([{ Authorization: `Bearer ${this.adminAPIKey}` }]); + return buildHeaders2([{ Authorization: `Bearer ${this.adminAPIKey}` }]); } stringifyQuery(query) { - return stringifyQuery(query); + return stringifyQuery2(query); } getUserAgent() { - return `${this.constructor.name}/JS ${VERSION}`; + return `${this.constructor.name}/JS ${VERSION2}`; } defaultIdempotencyKey() { - return `stainless-node-retry-${uuid4()}`; + return `stainless-node-retry-${uuid42()}`; } makeStatusError(status, error, message, headers) { const normalizedError = error && typeof error === "object" && error.error == null ? { error } : error; - return APIError.generate(status, normalizedError, message, headers); + return APIError2.generate(status, normalizedError, message, headers); } _hasApiKeyProvider() { return typeof this._options.apiKey === "function"; @@ -21573,12 +38979,12 @@ var init_client = __esm({ capture?.(this.apiKey); return true; } - buildURL(path4, query, defaultBaseURL) { - const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; - const url = isAbsoluteURL(path4) ? new URL(path4) : new URL(baseURL + (baseURL.endsWith("/") && path4.startsWith("/") ? path4.slice(1) : path4)); + buildURL(path5, query, defaultBaseURL) { + const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; + const url = isAbsoluteURL2(path5) ? new URL(path5) : new URL(baseURL + (baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); const defaultQuery = this.defaultQuery(); const pathQuery = Object.fromEntries(url.searchParams); - if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) { query = { ...pathQuery, ...defaultQuery, ...query }; } if (typeof query === "object" && query && !Array.isArray(query)) { @@ -21602,34 +39008,34 @@ var init_client = __esm({ */ async prepareRequest(request2, { url, options }) { } - get(path4, opts) { - return this.methodRequest("get", path4, opts); + get(path5, opts) { + return this.methodRequest("get", path5, opts); } - post(path4, opts) { - return this.methodRequest("post", path4, opts); + post(path5, opts) { + return this.methodRequest("post", path5, opts); } - patch(path4, opts) { - return this.methodRequest("patch", path4, opts); + patch(path5, opts) { + return this.methodRequest("patch", path5, opts); } - put(path4, opts) { - return this.methodRequest("put", path4, opts); + put(path5, opts) { + return this.methodRequest("put", path5, opts); } - delete(path4, opts) { - return this.methodRequest("delete", path4, opts); + delete(path5, opts) { + return this.methodRequest("delete", path5, opts); } - methodRequest(method, path4, opts) { + methodRequest(method, path5, opts) { return this.request(Promise.resolve(opts).then((opts2) => { - return { method, path: path4, ...opts2 }; + return { method, path: path5, ...opts2 }; })); } request(options, remainingRetries = null) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; const request2 = authentication instanceof X509WorkloadIdentityAuth ? Promise.resolve(options).then((resolved) => authentication.runRequest(() => this.makeRequest(resolved, remainingRetries, void 0), this)) : this.makeRequest(options, remainingRetries, void 0); return this.responsePromise(request2); } responsePromise(request2, parse2 = (client, props) => this.parseResponseWithTimeout(client, props)) { - const promise = new APIPromise(this, request2, (client, props) => { - const resume = __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").get(props.controller)?.continueRequest; + const promise = new APIPromise2(this, request2, (client, props) => { + const resume = __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").get(props.controller)?.continueRequest; return resume ? resume(() => parse2(client, props)) : parse2(client, props); }); promise.withResponse = async () => { @@ -21642,21 +39048,21 @@ var init_client = __esm({ } async parseResponseWithTimeout(client, props) { if (props.options.stream || props.options.__binaryResponse || props.response.status === 204 || props.response.headers.get("content-length") === "0") { - return defaultParseResponse(client, props); + return defaultParseResponse2(client, props); } while (true) { - const attempt = __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").get(props.controller); + const attempt = __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").get(props.controller); const timeout = attempt?.timeout ?? props.options.timeout ?? this.timeout; const x509Authentication = attempt?.authentication; const callerSignal = x509Authentication ? props.controller.signal : props.options.signal; - const abortError = () => x509Authentication && callerSignal ? this._makeUserAbortError(callerSignal) : new APIUserAbortError(); + const abortError2 = () => x509Authentication && callerSignal ? this._makeUserAbortError(callerSignal) : new APIUserAbortError2(); let remaining; try { remaining = x509Authentication?.remainingTimeout(props.options, timeout) ?? Math.max(0, props.startTime + timeout - Date.now()); } catch (error) { - const cancellation = callerSignal?.aborted ? abortError() : void 0; + const cancellation = callerSignal?.aborted ? abortError2() : void 0; props.controller.abort(); - void CancelReadableStream(props.response.body).catch(() => void 0); + void CancelReadableStream2(props.response.body).catch(() => void 0); throw cancellation ?? error; } let timer; @@ -21664,33 +39070,33 @@ var init_client = __esm({ let timedOut = false; try { if (callerSignal?.aborted && attempt?.helperMethod !== "runTools") { - throw abortError(); + throw abortError2(); } - const timeoutPromise = new Promise((_, reject) => { + const timeoutPromise = new Promise((_, reject2) => { timer = setTimeout(() => { timedOut = true; props.controller.abort(); - reject(new APIConnectionTimeoutError()); + reject2(new APIConnectionTimeoutError2()); }, remaining); if (callerSignal) { abortListener = () => { if (!timedOut) - reject(abortError()); + reject2(abortError2()); }; callerSignal.addEventListener("abort", abortListener, { once: true }); } }); - return await Promise.race([defaultParseResponse(client, props), timeoutPromise]); + return await Promise.race([defaultParseResponse2(client, props), timeoutPromise]); } catch (error) { if (callerSignal?.aborted && !timedOut) { - throw abortError(); + throw abortError2(); } if (!timedOut) { if (x509Authentication && error instanceof SyntaxError) { throw new SyntaxError("X.509 workload identity API response contains invalid JSON."); } if (x509Authentication && !(error instanceof OpenAIError)) { - throw new APIConnectionError({ + throw new APIConnectionError2({ message: "X.509 workload identity API response body could not be read." }); } @@ -21698,7 +39104,7 @@ var init_client = __esm({ } const retriesRemaining = attempt?.retriesRemaining ?? 0; if (!retriesRemaining || attempt?.hasStreamingBody || props.options.__metadata?.["hasStreamingBody"] || globalThis.ReadableStream && props.options.body instanceof globalThis.ReadableStream || typeof props.options.body === "object" && props.options.body !== null && (Symbol.asyncIterator in props.options.body || Symbol.iterator in props.options.body && "next" in props.options.body && typeof props.options.body.next === "function")) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } if (timer !== void 0) clearTimeout(timer); @@ -21728,7 +39134,7 @@ var init_client = __esm({ try { const remaining = authentication.remainingTimeout(options, timeout); const expiration = authentication.waitForRetry(remaining, deadline.signal).then(() => { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); }); const body = await Promise.race([ response.text().catch(() => "X.509 workload identity API response body could not be read."), @@ -21739,10 +39145,10 @@ var init_client = __esm({ } return body; } catch (error) { - if (error instanceof APIConnectionTimeoutError) { + if (error instanceof APIConnectionTimeoutError2) { timedOut = !callerSignal.aborted; controller.abort(); - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } if (callerSignal.aborted && !timedOut) { throw this._makeUserAbortError(callerSignal); @@ -21759,7 +39165,7 @@ var init_client = __esm({ if (retriesRemaining == null) { retriesRemaining = maxRetries; } - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); x509Authentication?.beginRequestPreparation(); await this.prepareOptions(options); x509Authentication?.beginRequestPlanning(); @@ -21770,7 +39176,7 @@ var init_client = __esm({ }); built = { req: candidate.req, url: candidate.url, timeout: candidate.timeout }; if (x509Authentication) { - validatePositiveInteger("timeout", built.timeout); + validatePositiveInteger2("timeout", built.timeout); x509Authentication.authorizePlannedRequest(built.url, built.req, built.timeout); if (X509WorkloadIdentityAuth.isStreamingRequestBody(built.req.body)) { options.__metadata = { ...options.__metadata, hasStreamingBody: true }; @@ -21791,13 +39197,13 @@ var init_client = __esm({ const security2 = options.__security ?? { bearerAuth: true }; const authenticationHeaders = await this.authHeaders(options, security2); const suppliedHeaders = x509Authentication.headerSnapshots(); - const supplied = buildHeaders([suppliedHeaders.defaultHeaders, suppliedHeaders.requestHeaders]); - for (const [name, value] of authenticationHeaders?.values ?? []) { - if (!supplied.nulls.has(name) && !built.req.headers.has(name)) { - built.req.headers.set(name, value); + const supplied2 = buildHeaders2([suppliedHeaders.defaultHeaders, suppliedHeaders.requestHeaders]); + for (const [name, value2] of authenticationHeaders?.values ?? []) { + if (!supplied2.nulls.has(name) && !built.req.headers.has(name)) { + built.req.headers.set(name, value2); } } - this.validateHeaders(buildHeaders([supplied, built.req.headers]), security2); + this.validateHeaders(buildHeaders2([supplied2, built.req.headers]), security2); } } catch (error) { x509Authentication?.retireRequestBody(); @@ -21823,7 +39229,7 @@ var init_client = __esm({ const startTime = x509Authentication?.requestStartedAt(options) ?? Date.now(); if (this.logLevel === "debug") { const body = typeof req.body === "string" ? { type: "string", length: req.body.length } : req.body; - loggerFor(this).debug(`[${requestLogID}] sending request`, formatRequestDetails({ + loggerFor2(this).debug(`[${requestLogID}] sending request`, formatRequestDetails2({ retryOfRequestLogID, method: options.method, url, @@ -21836,21 +39242,21 @@ var init_client = __esm({ throw this._makeUserAbortError(callerSignal?.aborted ? callerSignal : req.signal); } const security = options.__security ?? { bearerAuth: true }; - const controller = x509Authentication || this.fetchWithTimeout === _a3.prototype.fetchWithTimeout ? createRequestController(req.signal ?? (x509Authentication ? callerSignal : void 0), x509Authentication ? callerSignal : void 0) : new AbortController(); + const controller = x509Authentication || this.fetchWithTimeout === _a4.prototype.fetchWithTimeout ? createRequestController(req.signal ?? (x509Authentication ? callerSignal : void 0), x509Authentication ? callerSignal : void 0) : new AbortController(); const remainingTimeout = x509Authentication?.remainingTimeout(options, timeout) ?? timeout; - const fetchWithAuth = x509Authentication ? _a3.prototype.fetchWithAuth : this.fetchWithAuth; + const fetchWithAuth = x509Authentication ? _a4.prototype.fetchWithAuth : this.fetchWithAuth; x509Authentication?.releaseRequestBody(req.body); - const response = await fetchWithAuth.call(this, url, req, remainingTimeout, controller, security).catch(castToError); + const response = await fetchWithAuth.call(this, url, req, remainingTimeout, controller, security).catch(castToError2); const headersTime = Date.now(); if (response instanceof globalThis.Error) { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; if (callerSignal?.aborted || req.signal?.aborted) { throw this._makeUserAbortError(callerSignal?.aborted ? callerSignal : req.signal); } - const isTimeout = isAbortError(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); + const isTimeout = isAbortError2(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); if (retriesRemaining && !hasStreamingBody && (!x509Authentication || isTransientX509ConnectionError2(response))) { - loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); - loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, formatRequestDetails({ + loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); + loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, formatRequestDetails2({ retryOfRequestLogID, url, durationMs: headersTime - startTime, @@ -21859,8 +39265,8 @@ var init_client = __esm({ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, void 0, req.signal); } const terminalMessage = hasStreamingBody ? "error; streaming body cannot be retried" : "error; no more retries left"; - loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${terminalMessage}`); - loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${terminalMessage})`, formatRequestDetails({ + loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${terminalMessage}`); + loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${terminalMessage})`, formatRequestDetails2({ retryOfRequestLogID, url, durationMs: headersTime - startTime, @@ -21872,23 +39278,23 @@ var init_client = __esm({ if (isTimeout) { const transportCause = "cause" in response ? response.cause : void 0; const isHeadersTimeout = typeof transportCause === "object" && transportCause !== null && "code" in transportCause && transportCause.code === "UND_ERR_HEADERS_TIMEOUT"; - const timeoutError2 = isHeadersTimeout ? new APIConnectionTimeoutError({ + const timeoutError = isHeadersTimeout ? new APIConnectionTimeoutError2({ message: "Request timed out. Node.js fetch timed out waiting for response headers; configure a matching undici fetch and fetchOptions.dispatcher with an Agent whose headersTimeout is at least the SDK timeout." - }) : new APIConnectionTimeoutError(); + }) : new APIConnectionTimeoutError2(); if (x509Authentication) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } - throw Object.assign(timeoutError2, { cause: response }); + throw Object.assign(timeoutError, { cause: response }); } if (x509Authentication) { - throw new APIConnectionError({ message: "X.509 workload identity API connection failed." }); + throw new APIConnectionError2({ message: "X.509 workload identity API connection failed." }); } - throw new APIConnectionError({ + throw new APIConnectionError2({ message: getConnectionErrorMessage(response), cause: response }); } - const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "x-request-id").map(([name, value]) => ", " + name + ": " + JSON.stringify(value)).join(""); + const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "x-request-id").map(([name, value2]) => ", " + name + ": " + JSON.stringify(value2)).join(""); const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${redactURL(url)} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; if (!response.ok) { const rejectedX509Credential = response.status === 401 && x509Authentication && security.bearerAuth && x509Authentication.usedWorkloadToken(options); @@ -21897,9 +39303,9 @@ var init_client = __esm({ } if (response.status === 401 && (x509Authentication || this._workloadIdentityAuth) && security.bearerAuth && (!x509Authentication || x509Authentication.usedWorkloadToken(options)) && (!x509Authentication || retriesRemaining > 0) && !hasStreamingBody && !options.__metadata?.["workloadIdentityTokenRefreshed"]) { if (x509Authentication) { - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } else { - await CancelReadableStream(response.body); + await CancelReadableStream2(response.body); this._workloadIdentityAuth?.invalidateToken(); } const replayOptions = { @@ -21915,12 +39321,12 @@ var init_client = __esm({ if (retriesRemaining && shouldRetry && !hasStreamingBody) { const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; if (x509Authentication) { - void CancelReadableStream(response.body).catch(() => void 0); + void CancelReadableStream2(response.body).catch(() => void 0); } else { - await CancelReadableStream(response.body); + await CancelReadableStream2(response.body); } - loggerFor(this).info(`${responseInfo} - ${retryMessage2}`); - loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage2})`, formatRequestDetails({ + loggerFor2(this).info(`${responseInfo} - ${retryMessage2}`); + loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage2})`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -21930,11 +39336,11 @@ var init_client = __esm({ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers, req.signal); } const retryMessage = shouldRetry ? hasStreamingBody ? `error; streaming body cannot be retried` : `error; no more retries left` : `error; not retryable`; - loggerFor(this).info(`${responseInfo} - ${retryMessage}`); - const errText = x509Authentication ? await this.readX509ResponseError(response, options, timeout, controller, x509Authentication) : await response.text().catch((err2) => castToError(err2).message); - const errJSON = safeJSON(errText); + loggerFor2(this).info(`${responseInfo} - ${retryMessage}`); + const errText = x509Authentication ? await this.readX509ResponseError(response, options, timeout, controller, x509Authentication) : await response.text().catch((err2) => castToError2(err2).message); + const errJSON = safeJSON2(errText); const errMessage = errJSON ? void 0 : errText; - loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({ + loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -21945,8 +39351,8 @@ var init_client = __esm({ const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); throw err; } - loggerFor(this).info(responseInfo); - loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({ + loggerFor2(this).info(responseInfo); + loggerFor2(this).debug(`[${requestLogID}] response start`, formatRequestDetails2({ retryOfRequestLogID, url: response.url, status: response.status, @@ -21955,7 +39361,7 @@ var init_client = __esm({ })); const continueRequest = x509Authentication?.continuation(); x509Authentication?.releaseRequestCredentials(); - __classPrivateFieldGet(this, _OpenAI_responseAttempts, "f").set(controller, { + __classPrivateFieldGet2(this, _OpenAI_responseAttempts, "f").set(controller, { timeout, retriesRemaining, hasStreamingBody, @@ -21973,29 +39379,29 @@ var init_client = __esm({ startTime }; } - getAPIList(path4, Page3, opts) { - return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path4, ...opts2 })) : { method: "get", path: path4, ...opts }); + getAPIList(path5, Page3, opts) { + return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path5, ...opts2 })) : { method: "get", path: path5, ...opts }); } requestAPIList(Page3, options) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") ?? this._workloadIdentityAuth; const request2 = authentication instanceof X509WorkloadIdentityAuth ? Promise.resolve(options).then((resolved) => authentication.runRequest(() => this.makeRequest(resolved, null, void 0), this)) : this.makeRequest(options, null, void 0); - const page = new PagePromise(this, request2, Page3); + const page2 = new PagePromise2(this, request2, Page3); const guarded = this.responsePromise(request2, async (client, props) => { const body = await this.parseResponseWithTimeout(client, props); return new Page3(client, props.response, body, props.options); }); - page.then = guarded.then.bind(guarded); - page.catch = guarded.catch.bind(guarded); - page.finally = guarded.finally.bind(guarded); - page.withResponse = guarded.withResponse.bind(guarded); - page._thenUnwrap = guarded._thenUnwrap.bind(guarded); - return page; + page2.then = guarded.then.bind(guarded); + page2.catch = guarded.catch.bind(guarded); + page2.finally = guarded.finally.bind(guarded); + page2.withResponse = guarded.withResponse.bind(guarded); + page2._thenUnwrap = guarded._thenUnwrap.bind(guarded); + return page2; } async fetchWithAuth(url, init, timeout, controller, schemes = { bearerAuth: true, adminAPIKeyAuth: true }) { - if (this._workloadIdentityAuth && !__classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") && schemes.bearerAuth) { + if (this._workloadIdentityAuth && !__classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") && schemes.bearerAuth) { const headers = init.headers; const authHeader = headers.get("Authorization"); if (authHeader === `Bearer ${WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER}`) { @@ -22003,7 +39409,7 @@ var init_client = __esm({ headers.set("Authorization", `Bearer ${token}`); } } - const fetchWithTimeout = __classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") ? _a3.prototype.fetchWithTimeout : this.fetchWithTimeout; + const fetchWithTimeout = __classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") ? _a4.prototype.fetchWithTimeout : this.fetchWithTimeout; const response = await fetchWithTimeout.call(this, url, init, timeout, controller); return response; } @@ -22024,7 +39430,7 @@ var init_client = __esm({ fetchOptions.method = method.toUpperCase(); } try { - const response = await (__classPrivateFieldGet(this, _OpenAI_x509Fetch, "f") ?? this.fetch).call(void 0, url, fetchOptions); + const response = await (__classPrivateFieldGet2(this, _OpenAI_x509Fetch, "f") ?? this.fetch).call(void 0, url, fetchOptions); if (cleanup) { retainRequestAbortCallback(response.body ?? response, abort, controller.signal); } @@ -22074,11 +39480,11 @@ var init_client = __esm({ const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); if (x509Authentication) { const remaining = x509Authentication.remainingTimeout(options, x509Authentication.requestSnapshot().timeout); if (timeoutMillis >= remaining) { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError2(); } } if (x509Authentication) { @@ -22086,7 +39492,7 @@ var init_client = __esm({ } else { const retrySignals = requestSignal === options.signal ? [requestSignal] : [requestSignal, options.signal]; try { - await sleep(timeoutMillis, ...retrySignals); + await sleep2(timeoutMillis, ...retrySignals); } catch (error) { const abortedSignal = retrySignals.find((signal) => signal?.aborted); if (abortedSignal) { @@ -22112,16 +39518,16 @@ var init_client = __esm({ * can call `this.authHeaders()` to resolve headers with request-local credentials. */ async buildRequest(inputOptions, { retryCount = 0 } = {}) { - if (__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").inRequest(this)) { - const authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + if (__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").inRequest(this)) { + const authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); return await authentication.runRequest(async () => { - const built = await _a3.prototype.buildRequest.call(this, inputOptions, { retryCount }); + const built = await _a4.prototype.buildRequest.call(this, inputOptions, { retryCount }); authentication.releaseRequestBody(built.req.body); return built; }, this); } const options = { ...inputOptions }; - const x509Authentication = __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f"); + const x509Authentication = __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f"); const x509Tenant = x509Authentication?.snapshotTenant(this.organization, this.project); const x509Headers = x509Authentication?.snapshotHeaders(this._options.defaultHeaders, options.headers); if (x509Headers) { @@ -22129,12 +39535,12 @@ var init_client = __esm({ } const x509ClientFetchOptions = x509Authentication ? snapshotX509RequestOptions(this.fetchOptions) : void 0; const x509RequestFetchOptions = x509Authentication ? snapshotX509RequestOptions(options.fetchOptions) : void 0; - const { method, path: path4, query, defaultBaseURL } = options; - const url = this.buildURL(path4, query, defaultBaseURL); + const { method, path: path5, query, defaultBaseURL } = options; + const url = this.buildURL(path5, query, defaultBaseURL); x509Authentication?.snapshotAPIURL(url); const explicitTimeout = "timeout" in options; if (explicitTimeout) - validatePositiveInteger("timeout", options.timeout); + validatePositiveInteger2("timeout", options.timeout); options.timeout = options.timeout ?? this.timeout; if (x509Authentication && x509RequestFetchOptions) { x509Authentication.snapshotRequest(options.signal, options.timeout, x509RequestFetchOptions); @@ -22187,25 +39593,25 @@ var init_client = __esm({ } const helperMethod = options.__metadata?.["helperMethod"]; const timeout = x509Headers ? x509Timeout : options.timeout; - const headers = buildHeaders([ + const headers = buildHeaders2([ idempotencyHeaders, { Accept: "application/json", ...!isRunningInBrowserOrBrowserWorker() ? { "User-Agent": this.getUserAgent() } : void 0, "X-Stainless-Retry-Count": String(retryCount), ...timeout ? { "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)) } : {}, - ...getPlatformHeaders(), + ...getPlatformHeaders2(), ...typeof helperMethod === "string" ? { "X-Stainless-Helper-Method": helperMethod } : {}, "OpenAI-Organization": x509Tenant ? x509Tenant.organization : this.organization, "OpenAI-Project": x509Tenant ? x509Tenant.project : this.project }, // X.509 owns streaming uploads before authentication so it can retire them on failure. - __classPrivateFieldGet(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f").isPlanningRequest() ? await this.authHeaders(options, options.__security ?? { bearerAuth: true }) : authenticationHeaders, + __classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f") && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f").isPlanningRequest() ? await this.authHeaders(options, options.__security ?? { bearerAuth: true }) : authenticationHeaders, x509Headers?.defaultHeaders ?? this._options.defaultHeaders, bodyHeaders, x509Headers?.requestHeaders ?? options.headers ]); - if (!this._provider && !__classPrivateFieldGet(this, _OpenAI_x509Authentication, "f")?.isPlanningRequest()) { + if (!this._provider && !__classPrivateFieldGet2(this, _OpenAI_x509Authentication, "f")?.isPlanningRequest()) { this.validateHeaders(headers, options.__security ?? { bearerAuth: true }); } return headers.values; @@ -22214,7 +39620,7 @@ var init_client = __esm({ return () => controller.abort(); } _makeUserAbortError(signal) { - const error = new APIUserAbortError(); + const error = new APIUserAbortError2(); Object.defineProperty(error, "cause", { value: signal.reason, writable: true, configurable: true }); return error; } @@ -22222,11 +39628,11 @@ var init_client = __esm({ const { body, headers: rawHeaders } = options; if (!body) { if (body === void 0 && "body" in options) { - return { ...__classPrivateFieldGet(this, _OpenAI_encoder, "f").call(this, { body, headers: buildHeaders([rawHeaders]) }), isStreamingBody: false }; + return { ...__classPrivateFieldGet2(this, _OpenAI_encoder, "f").call(this, { body, headers: buildHeaders2([rawHeaders]) }), isStreamingBody: false }; } return { bodyHeaders: void 0, body: void 0, isStreamingBody: false }; } - const headers = buildHeaders([rawHeaders]); + const headers = buildHeaders2([rawHeaders]); const isReadableStream2 = typeof globalThis.ReadableStream !== "undefined" && body instanceof globalThis.ReadableStream; const isRetryableBody = !isReadableStream2 && (typeof body === "string" || body instanceof ArrayBuffer || ArrayBuffer.isView(body) || typeof globalThis.Blob !== "undefined" && body instanceof globalThis.Blob || body instanceof URLSearchParams || body instanceof FormData); if ( @@ -22242,7 +39648,7 @@ var init_client = __esm({ } else if (typeof body === "object" && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function")) { return { bodyHeaders: void 0, - body: ReadableStreamFrom(body), + body: ReadableStreamFrom2(body), isStreamingBody: true }; } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { @@ -22252,47 +39658,47 @@ var init_client = __esm({ isStreamingBody: false }; } else { - return { ...__classPrivateFieldGet(this, _OpenAI_encoder, "f").call(this, { body, headers }), isStreamingBody: false }; + return { ...__classPrivateFieldGet2(this, _OpenAI_encoder, "f").call(this, { body, headers }), isStreamingBody: false }; } } }; - _a3 = OpenAI, _OpenAI_encoder = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Authentication = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Credential = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Fetch = /* @__PURE__ */ new WeakMap(), _OpenAI_explicitDataResidency = /* @__PURE__ */ new WeakMap(), _OpenAI_responseAttempts = /* @__PURE__ */ new WeakMap(), _OpenAI_instances = /* @__PURE__ */ new WeakSet(), _OpenAI_baseURLOverridden = function _OpenAI_baseURLOverridden2() { - return __classPrivateFieldGet(this, _OpenAI_explicitDataResidency, "f") || this._provider !== void 0 || this.baseURL !== "https://api.openai.com/v1"; + _a4 = OpenAI, _OpenAI_encoder = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Authentication = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Credential = /* @__PURE__ */ new WeakMap(), _OpenAI_x509Fetch = /* @__PURE__ */ new WeakMap(), _OpenAI_explicitDataResidency = /* @__PURE__ */ new WeakMap(), _OpenAI_responseAttempts = /* @__PURE__ */ new WeakMap(), _OpenAI_instances = /* @__PURE__ */ new WeakSet(), _OpenAI_baseURLOverridden = function _OpenAI_baseURLOverridden2() { + return __classPrivateFieldGet2(this, _OpenAI_explicitDataResidency, "f") || this._provider !== void 0 || this.baseURL !== "https://api.openai.com/v1"; }; - OpenAI.OpenAI = _a3; + OpenAI.OpenAI = _a4; OpenAI.DEFAULT_TIMEOUT = 6e5; OpenAI.OpenAIError = OpenAIError; - OpenAI.APIError = APIError; - OpenAI.APIConnectionError = APIConnectionError; - OpenAI.APIConnectionTimeoutError = APIConnectionTimeoutError; - OpenAI.APIUserAbortError = APIUserAbortError; - OpenAI.NotFoundError = NotFoundError; - OpenAI.ConflictError = ConflictError; - OpenAI.RateLimitError = RateLimitError; - OpenAI.BadRequestError = BadRequestError; - OpenAI.AuthenticationError = AuthenticationError; - OpenAI.InternalServerError = InternalServerError; - OpenAI.PermissionDeniedError = PermissionDeniedError; - OpenAI.UnprocessableEntityError = UnprocessableEntityError; + OpenAI.APIError = APIError2; + OpenAI.APIConnectionError = APIConnectionError2; + OpenAI.APIConnectionTimeoutError = APIConnectionTimeoutError2; + OpenAI.APIUserAbortError = APIUserAbortError2; + OpenAI.NotFoundError = NotFoundError2; + OpenAI.ConflictError = ConflictError2; + OpenAI.RateLimitError = RateLimitError2; + OpenAI.BadRequestError = BadRequestError2; + OpenAI.AuthenticationError = AuthenticationError2; + OpenAI.InternalServerError = InternalServerError2; + OpenAI.PermissionDeniedError = PermissionDeniedError2; + OpenAI.UnprocessableEntityError = UnprocessableEntityError2; OpenAI.InvalidWebhookSignatureError = InvalidWebhookSignatureError; - OpenAI.toFile = toFile; + OpenAI.toFile = toFile2; OpenAI.toStreamingFile = toStreamingFile; - OpenAI.Completions = Completions2; + OpenAI.Completions = Completions3; OpenAI.Chat = Chat; OpenAI.Embeddings = Embeddings; - OpenAI.Files = Files3; + OpenAI.Files = Files5; OpenAI.Images = Images; OpenAI.ContentProvenanceChecks = ContentProvenanceChecks; OpenAI.Audio = Audio; OpenAI.Moderations = Moderations; - OpenAI.Models = Models; + OpenAI.Models = Models3; OpenAI.FineTuning = FineTuning; OpenAI.Graders = Graders2; OpenAI.VectorStores = VectorStores; OpenAI.Safety = Safety; - OpenAI.Webhooks = Webhooks; - OpenAI.Beta = Beta; - OpenAI.Batches = Batches; + OpenAI.Webhooks = Webhooks2; + OpenAI.Beta = Beta2; + OpenAI.Batches = Batches3; OpenAI.Uploads = Uploads; OpenAI.Admin = Admin; OpenAI.Responses = Responses2; @@ -22301,12 +39707,12 @@ var init_client = __esm({ OpenAI.Conversations = Conversations; OpenAI.Evals = Evals; OpenAI.Containers = Containers; - OpenAI.Skills = Skills; + OpenAI.Skills = Skills3; OpenAI.Videos = Videos; OpenAI.ConversationCursorPage = ConversationCursorPage; OpenAI.CursorPage = CursorPage; OpenAI.NextCursorPage = NextCursorPage; - OpenAI.Page = Page; + OpenAI.Page = Page2; OpenAI.TokenPage = TokenPage; composedCallerSignals = /* @__PURE__ */ new WeakMap(); } @@ -22315,11 +39721,11 @@ var init_client = __esm({ // node_modules/openai/azure.mjs var init_azure = __esm({ "node_modules/openai/azure.mjs"() { - init_headers2(); - init_error2(); - init_utils2(); - init_path(); - init_client(); + init_headers3(); + init_error4(); + init_utils4(); + init_path2(); + init_client2(); init_data_residency(); } }); @@ -22328,347 +39734,128 @@ var init_azure = __esm({ var brand_privateBedrockClient; var init_bedrock = __esm({ "node_modules/openai/internal/bedrock.mjs"() { - init_error2(); - init_utils2(); + init_error4(); + init_utils4(); brand_privateBedrockClient = /* @__PURE__ */ Symbol.for("openai.privateBedrockClient"); } }); // node_modules/openai/bedrock.mjs -var _a4; +var _a5; var init_bedrock2 = __esm({ "node_modules/openai/bedrock.mjs"() { - init_error2(); - init_client(); + init_error4(); + init_client2(); init_realtime_credentials(); init_data_residency(); init_bedrock(); - init_headers2(); - init_utils2(); + init_headers3(); + init_utils4(); init_ResponsesParser(); - init_resources(); - _a4 = brand_privateBedrockClient; + init_resources3(); + _a5 = brand_privateBedrockClient; } }); // node_modules/openai/index.mjs var init_openai = __esm({ "node_modules/openai/index.mjs"() { - init_client(); - init_uploads2(); - init_api_promise(); - init_client(); - init_pagination(); - init_error(); + init_client2(); + init_uploads4(); + init_api_promise2(); + init_client2(); + init_pagination2(); + init_error3(); init_azure(); init_bedrock2(); } }); -// node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js -function getBunSandboxEnvValue(name) { - if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) { - return void 0; +// node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +function normalizeProviderError(error) { + if (!(error instanceof Error)) { + return { message: safeJsonStringify2(error), messageCarriesBody: false }; } - if (procEnvCache === null) { - procEnvCache = /* @__PURE__ */ new Map(); - try { - const { readFileSync } = __require("node:fs"); - const data = readFileSync("/proc/self/environ", "utf-8"); - for (const entry of data.split("\0")) { - const idx = entry.indexOf("="); - if (idx > 0) { - procEnvCache.set(entry.slice(0, idx), entry.slice(idx + 1)); - } - } - } catch { - } - } - return procEnvCache.get(name); + const sdkError = error; + const status = extractStatus(sdkError); + const body = extractBody(sdkError); + const messageCarriesBody = body === void 0 || error.message.includes(body); + return { + status, + body, + message: error.message, + messageCarriesBody + }; } -function getProviderEnvValue(name, env) { - return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0; -} -var procEnvCache; -var init_provider_env = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js"() { - procEnvCache = null; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js -function isJsonSchemaObject(value) { - return typeof value === "object" && value !== null && !Array.isArray(value); -} -function isStructuredSchema(schema4) { - if (!isJsonSchemaObject(schema4)) - return false; - const types = typeof schema4.type === "string" ? [schema4.type] : Array.isArray(schema4.type) ? schema4.type : []; - return types.includes("object") || types.includes("array") || schema4.properties !== void 0 || schema4.items !== void 0; -} -function schemaAllowsNull(schema4) { - if (!isJsonSchemaObject(schema4)) - return false; - if (schema4.type === "null" || Array.isArray(schema4.type) && schema4.type.includes("null")) - return true; - if (schema4.const === null || Array.isArray(schema4.enum) && schema4.enum.includes(null)) - return true; - return Array.isArray(schema4.anyOf) && schema4.anyOf.some((variant) => schemaAllowsNull(variant)); -} -function makeJsonSchemaNodeStrict(schema4, isUnsupportedKeyword) { - if (!isJsonSchemaObject(schema4)) { - throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported"); - } - for (const key of UNSUPPORTED_STRICT_SCHEMA_KEYS) { - if (schema4[key] !== void 0) { - throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`); - } - } - if (isUnsupportedKeyword) { - for (const [key, value] of Object.entries(schema4)) { - if (isUnsupportedKeyword(key, value)) { - throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value)} is unsupported`); - } - } - } - if (schema4.anyOf !== void 0) { - if (!Array.isArray(schema4.anyOf) || schema4.anyOf.length === 0) { - throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema"); - } - for (const variant of schema4.anyOf) { - if (isStructuredSchema(variant)) { - throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported"); - } - makeJsonSchemaNodeStrict(variant, isUnsupportedKeyword); - } - } - if (schema4.items !== void 0) { - if (Array.isArray(schema4.items)) { - throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported"); - } - makeJsonSchemaNodeStrict(schema4.items, isUnsupportedKeyword); - } - const isObjectSchema = schema4.type === "object"; - if (schema4.properties !== void 0 && !isObjectSchema) { - throw new UnsupportedStrictJsonSchemaError("properties require type object"); - } - if (!isObjectSchema) - return; - if (schema4.additionalProperties !== void 0 && schema4.additionalProperties !== false) { - throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported"); - } - if (schema4.properties !== void 0 && !isJsonSchemaObject(schema4.properties)) { - throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map"); - } - if (schema4.required !== void 0 && (!Array.isArray(schema4.required) || schema4.required.some((key) => typeof key !== "string"))) { - throw new UnsupportedStrictJsonSchemaError("object required must be a string array"); - } - const properties = schema4.properties ?? {}; - const propertyNames = Object.keys(properties); - const required = new Set(Array.isArray(schema4.required) ? schema4.required : []); - if ([...required].some((key) => !propertyNames.includes(key))) { - throw new UnsupportedStrictJsonSchemaError("required contains an unknown property"); - } - for (const [key, property] of Object.entries(properties)) { - makeJsonSchemaNodeStrict(property, isUnsupportedKeyword); - if (!required.has(key) && !schemaAllowsNull(property)) { - properties[key] = { anyOf: [property, { type: "null" }] }; - } - } - schema4.required = propertyNames; - schema4.additionalProperties = false; -} -function makeStrictJsonSchema(schema4, isUnsupportedKeyword) { - const cloned = structuredClone(schema4); - if (!isJsonSchemaObject(cloned)) { - throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); - } - makeJsonSchemaNodeStrict(cloned, isUnsupportedKeyword); - if (cloned.type !== "object") { - throw new UnsupportedStrictJsonSchemaError("root schema must have type object"); - } - return cloned; -} -function prefersJsonSchemaStrictSampling(tool) { - const config = tool.constrainedSampling; - return !!config && config.type === "json_schema" && config.strict === "prefer"; -} -function isStrictToolLimitErrorMessage(message) { - return STRICT_TOOL_LIMIT_ERROR_MESSAGES.some((limitMessage) => message.includes(limitMessage)); -} -function getJsonSchemaToolParameters(tool, strict) { - return strict === true ? makeStrictJsonSchema(tool.parameters) : tool.parameters; -} -function getGrammarToolInput(toolName2, arguments_, inputProperty) { - const input = arguments_[inputProperty]; - if (typeof input !== "string") { - throw new Error(`Grammar tool call "${toolName2}" requires argument "${inputProperty}" to be a string.`); - } - return input; -} -function appendGrammarToolInputJsonDelta(buffer, inputProperty, inputDelta) { - if (buffer.closed) { - throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); - } - if (inputDelta.length === 0) - return void 0; - buffer.input += inputDelta; - return grammarToolInputJsonStart(buffer, inputProperty) + JSON.stringify(inputDelta).slice(1, -1); -} -function closeGrammarToolInputJson(buffer, inputProperty, finalInput) { - if (buffer.closed) { - if (finalInput === void 0 || finalInput === buffer.input) - return void 0; - throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`); - } - if (finalInput !== void 0 && !finalInput.startsWith(buffer.input)) { - throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`); - } - const rest = finalInput === void 0 ? "" : finalInput.slice(buffer.input.length); - if (finalInput !== void 0) - buffer.input = finalInput; - buffer.closed = true; - return `${grammarToolInputJsonStart(buffer, inputProperty)}${JSON.stringify(rest).slice(1, -1)}"}`; -} -function grammarToolInputJsonStart(buffer, inputProperty) { - if (buffer.started) - return ""; - buffer.started = true; - return `{${JSON.stringify(inputProperty)}:"`; -} -function inferGrammarInputProperty(tool) { - const schema4 = tool.parameters; - if (schema4.type !== "object") { - throw new Error("grammar constrained sampling requires an object parameter schema"); - } - if (!Array.isArray(schema4.required) || schema4.required.length !== 1 || typeof schema4.required[0] !== "string") { - throw new Error("grammar constrained sampling requires exactly one required string property"); - } - const inputProperty = schema4.required[0]; - if (!schema4.properties?.[inputProperty]) { - throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`); - } - if (schema4.properties[inputProperty]?.type !== "string") { - throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`); - } - return inputProperty; -} -function resolveJsonSchemaStrictSampling(tool, supportsStrictMode, isUnsupportedKeyword) { - const config = tool.constrainedSampling; - if (!config || config.type !== "json_schema") - return void 0; - if (supportsStrictMode) { - try { - makeStrictJsonSchema(tool.parameters, isUnsupportedKeyword); - return true; - } catch (error) { - if (!(error instanceof UnsupportedStrictJsonSchemaError)) - throw error; - if (config.strict !== "require") - return void 0; - throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`); - } - } - if (config.strict === "require") { - throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`); - } +function extractStatus(error) { + if (typeof error.statusCode === "number") + return error.statusCode; + if (typeof error.status === "number") + return error.status; + if (typeof error.$metadata?.httpStatusCode === "number") + return error.$metadata.httpStatusCode; + if (typeof error.$response?.statusCode === "number") + return error.$response.statusCode; return void 0; } -function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) { - const config = tool.constrainedSampling; - if (!config || config.type !== "grammar") { +function extractBody(error) { + const bodyText = pickBodyText(error); + if (bodyText === void 0) return void 0; - } - if (!supportsOpenAIGrammarTools) { + const trimmed = bodyText.trim(); + if (trimmed.length === 0) return void 0; - } - const larkDefinition = config.variants.openai_lark; - const regexDefinition = config.variants.openai_regex; - const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0; - const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0; - if (!hasLarkDefinition && !hasRegexDefinition) { - throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`); - } - try { - return { - format: hasLarkDefinition ? "lark" : "regex", - definition: hasLarkDefinition ? larkDefinition : regexDefinition, - inputProperty: inferGrammarInputProperty(tool) - }; - } catch (error) { - const message = error instanceof Error ? error.message : String(error); - throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`); - } + return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS); } -function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) { - const properties = /* @__PURE__ */ new Map(); - for (const tool of tools ?? []) { - const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools); - if (grammar) { - properties.set(tool.name, grammar.inputProperty); - } - } - return properties; +function pickBodyText(error) { + if (typeof error.body === "string") + return error.body; + if (isPlainNonEmptyObject(error.error)) + return safeJsonStringify2(error.error); + const responseBody = error.$response?.body; + if (typeof responseBody === "string") + return responseBody; + if (isReadableStreamLike(responseBody)) + return void 0; + if (isPlainNonEmptyObject(responseBody)) + return safeJsonStringify2(responseBody); + return void 0; } -var UnsupportedStrictJsonSchemaError, UNSUPPORTED_STRICT_SCHEMA_KEYS, STRICT_TOOL_LIMIT_ERROR_MESSAGES; -var init_constrained_sampling = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js"() { - UnsupportedStrictJsonSchemaError = class extends Error { - }; - UNSUPPORTED_STRICT_SCHEMA_KEYS = [ - "$ref", - "$defs", - "definitions", - "allOf", - "oneOf", - "patternProperties", - "dependentSchemas", - "dependencies", - "unevaluatedProperties", - "propertyNames", - "contains", - "prefixItems", - "not", - "if", - "then", - "else" - ]; - STRICT_TOOL_LIMIT_ERROR_MESSAGES = [ - "The compiled grammar is too large", - "Too many strict tools (", - "Schemas contains too many parameters with union types (" - ]; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js -function inferCopilotInitiator(messages) { - const last = messages[messages.length - 1]; - return last && last.role !== "user" ? "agent" : "user"; +function isReadableStreamLike(value2) { + return typeof value2 === "object" && value2 !== null && "pipe" in value2 && typeof value2.pipe === "function"; } -function hasCopilotVisionInput(messages) { - return messages.some((msg) => { - if (msg.role === "user" && Array.isArray(msg.content)) { - return msg.content.some((c) => c.type === "image"); - } - if (msg.role === "toolResult" && Array.isArray(msg.content)) { - return msg.content.some((c) => c.type === "image"); - } +function isPlainNonEmptyObject(value2) { + if (typeof value2 !== "object" || value2 === null) return false; - }); + const proto = Object.getPrototypeOf(value2); + if (proto !== Object.prototype && proto !== null) + return false; + return Object.keys(value2).length > 0; } -function buildCopilotDynamicHeaders(params) { - const headers = { - "X-Initiator": inferCopilotInitiator(params.messages), - "Openai-Intent": "conversation-edits" - }; - if (params.hasImages) { - headers["Copilot-Vision-Request"] = "true"; +function formatProviderError(norm, prefix) { + if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) { + return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message; } - return headers; + return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`; } -var init_github_copilot_headers = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js"() { +function truncateErrorText(text, maxChars) { + if (text.length <= maxChars) + return text; + return `${ownedSlice(text, 0, maxChars)}... [truncated ${text.length - maxChars} chars]`; +} +function safeJsonStringify2(value2) { + try { + const serialized = JSON.stringify(value2); + return serialized === void 0 ? String(value2) : serialized; + } catch { + return String(value2); + } +} +var MAX_PROVIDER_ERROR_BODY_CHARS; +var init_error_body = __esm({ + "node_modules/@earendil-works/pi-ai/dist/utils/error-body.js"() { + init_text(); + MAX_PROVIDER_ERROR_BODY_CHARS = 4e3; } }); @@ -22706,974 +39893,6 @@ var init_hash = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js -function sanitizeSurrogates(text) { - return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(? { - const length = jsonString.length; - let index = 0; - const markPartialJSON = (msg) => { - throw new PartialJSON2(`${msg} at position ${index}`); - }; - const throwMalformedError = (msg) => { - throw new MalformedJSON2(`${msg} at position ${index}`); - }; - const parseAny = () => { - skipBlank(); - if (index >= length) - markPartialJSON("Unexpected end of input"); - if (jsonString[index] === '"') - return parseStr(); - if (jsonString[index] === "{") - return parseObj(); - if (jsonString[index] === "[") - return parseArr(); - if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) { - index += 4; - return null; - } - if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) { - index += 4; - return true; - } - if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) { - index += 5; - return false; - } - if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) { - index += 8; - return Infinity; - } - if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) { - index += 9; - return -Infinity; - } - if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) { - index += 3; - return NaN; - } - return parseNum(); - }; - const parseStr = () => { - const start = index; - let escape2 = false; - index++; - while (index < length && (jsonString[index] !== '"' || escape2 && jsonString[index - 1] === "\\")) { - escape2 = jsonString[index] === "\\" ? !escape2 : false; - index++; - } - if (jsonString.charAt(index) == '"') { - try { - return JSON.parse(jsonString.substring(start, ++index - Number(escape2))); - } catch (e) { - throwMalformedError(String(e)); - } - } else if (options_1.Allow.STR & allow) { - try { - return JSON.parse(jsonString.substring(start, index - Number(escape2)) + '"'); - } catch (e) { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); - } - } - markPartialJSON("Unterminated string literal"); - }; - const parseObj = () => { - index++; - skipBlank(); - const obj2 = {}; - try { - while (jsonString[index] !== "}") { - skipBlank(); - if (index >= length && options_1.Allow.OBJ & allow) - return obj2; - const key = parseStr(); - skipBlank(); - index++; - try { - const value = parseAny(); - obj2[key] = value; - } catch (e) { - if (options_1.Allow.OBJ & allow) - return obj2; - else - throw e; - } - skipBlank(); - if (jsonString[index] === ",") - index++; - } - } catch (e) { - if (options_1.Allow.OBJ & allow) - return obj2; - else - markPartialJSON("Expected '}' at end of object"); - } - index++; - return obj2; - }; - const parseArr = () => { - index++; - const arr2 = []; - try { - while (jsonString[index] !== "]") { - arr2.push(parseAny()); - skipBlank(); - if (jsonString[index] === ",") { - index++; - } - } - } catch (e) { - if (options_1.Allow.ARR & allow) { - return arr2; - } - markPartialJSON("Expected ']' at end of array"); - } - index++; - return arr2; - }; - const parseNum = () => { - if (index === 0) { - if (jsonString === "-") - throwMalformedError("Not sure what '-' is"); - try { - return JSON.parse(jsonString); - } catch (e) { - if (options_1.Allow.NUM & allow) - try { - return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); - } catch (e2) { - } - throwMalformedError(String(e)); - } - } - const start = index; - if (jsonString[index] === "-") - index++; - while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1) - index++; - if (index == length && !(options_1.Allow.NUM & allow)) - markPartialJSON("Unterminated number literal"); - try { - return JSON.parse(jsonString.substring(start, index)); - } catch (e) { - if (jsonString.substring(start, index) === "-") - markPartialJSON("Not sure what '-' is"); - try { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); - } catch (e2) { - throwMalformedError(String(e2)); - } - } - }; - const skipBlank = () => { - while (index < length && " \n\r ".includes(jsonString[index])) { - index++; - } - }; - return parseAny(); - }; - var parse2 = parseJSON2; - exports.parse = parse2; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js -function isControlCharacter(char) { - const codePoint = char.codePointAt(0); - return codePoint !== void 0 && codePoint >= 0 && codePoint <= 31; -} -function escapeControlCharacter(char) { - switch (char) { - case "\b": - return "\\b"; - case "\f": - return "\\f"; - case "\n": - return "\\n"; - case "\r": - return "\\r"; - case " ": - return "\\t"; - default: - return `\\u${char.codePointAt(0)?.toString(16).padStart(4, "0") ?? "0000"}`; - } -} -function repairJson(json) { - let repaired = ""; - let inString = false; - for (let index = 0; index < json.length; index++) { - const char = json[index]; - if (!inString) { - repaired += char; - if (char === '"') { - inString = true; - } - continue; - } - if (char === '"') { - repaired += char; - inString = false; - continue; - } - if (char === "\\") { - const nextChar = json[index + 1]; - if (nextChar === void 0) { - repaired += "\\\\"; - continue; - } - if (nextChar === "u") { - const unicodeDigits = json.slice(index + 2, index + 6); - if (/^[0-9a-fA-F]{4}$/.test(unicodeDigits)) { - repaired += `\\u${unicodeDigits}`; - index += 5; - continue; - } - } - if (VALID_JSON_ESCAPES.has(nextChar)) { - repaired += `\\${nextChar}`; - index += 1; - continue; - } - repaired += "\\\\"; - continue; - } - repaired += isControlCharacter(char) ? escapeControlCharacter(char) : char; - } - return repaired; -} -function parseJsonWithRepair(json) { - try { - return JSON.parse(json); - } catch (error) { - const repairedJson = repairJson(json); - if (repairedJson !== json) { - return JSON.parse(repairedJson); - } - throw error; - } -} -function parseToolCallArguments(json) { - if (!json?.trim()) - return { arguments: {} }; - try { - const parsed = parseJsonWithRepair(json); - if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { - throw new Error("Tool arguments must be a JSON object"); - } - return { arguments: parsed }; - } catch (error) { - return { - arguments: {}, - argumentsError: `${error instanceof Error ? error.message : String(error)} - -Received arguments: -${json}` - }; - } -} -var import_partial_json, VALID_JSON_ESCAPES; -var init_json_parse = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js"() { - import_partial_json = __toESM(require_dist(), 1); - VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]); - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js -function isDelimiter(char) { - return char === " " || char === " " || char === "\n" || char === "\r" || char === "," || char === ":" || char === "{" || char === "}" || char === "[" || char === "]" || char === '"'; -} -function isHexDigit(char) { - return char >= "0" && char <= "9" || char >= "a" && char <= "f" || char >= "A" && char <= "F"; -} -function scalarValue(token) { - for (const [literal, value] of LITERALS) - if (token === literal) - return value; - return NUMBER.test(token) ? Number(token) : void 0; -} -function pendingScalarValue(token) { - for (const [literal, value] of LITERALS) - if (literal.startsWith(token)) - return value; - if (NUMBER.test(token)) - return Number(token); - const mantissa = NUMBER_WITHOUT_EXPONENT_DIGITS.exec(token); - return mantissa === null ? void 0 : Number(mantissa[1]); -} -function setSlot(container, slot, value) { - if (slot.kind === "element") - container[slot.index] = value; - else if (slot.kind === "member") - setMember(container, slot.key, value); -} -function setMember(members, key, value) { - if (key === "__proto__") { - Object.defineProperty(members, key, { value, writable: true, enumerable: true, configurable: true }); - } else { - members[key] = value; - } -} -var MAX_REPORTED_DEPTH, ROOT_SLOT, CREDIT_PER_APPEND, CREDIT_PER_CHARACTER, MAX_PENDING_SCALAR_LENGTH, NUMBER, NUMBER_WITHOUT_EXPONENT_DIGITS, LITERALS, QUOTE, BACKSLASH, StreamingJsonParser, ToolCallArgumentsStream, SIMPLE_ESCAPES; -var init_streaming_json = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js"() { - init_json_parse(); - MAX_REPORTED_DEPTH = 32; - ROOT_SLOT = { kind: "root" }; - CREDIT_PER_APPEND = 256; - CREDIT_PER_CHARACTER = 8; - MAX_PENDING_SCALAR_LENGTH = 64; - NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; - NUMBER_WITHOUT_EXPONENT_DIGITS = /^(-?(?:0|[1-9]\d*)(?:\.\d+)?)[eE][+-]?$/; - LITERALS = [ - ["true", true], - ["false", false], - ["null", null] - ]; - QUOTE = 34; - BACKSLASH = 92; - StreamingJsonParser = class { - #root = void 0; - #done = false; - #stack = []; - #string = void 0; - #scalar = ""; - #scalarSlot = void 0; - /** Sum of `size + 1` over the open path: what a fresh snapshot copies. */ - #pathCost = 0; - #credit = 0; - #dirty = false; - #snapshot = void 0; - /** Changes of the piece being read. */ - #changes = []; - /** - * Read the next piece of text; returns the changes it made, in order. Costs time linear in `text.length`. - */ - append(text) { - this.#credit += CREDIT_PER_APPEND + CREDIT_PER_CHARACTER * text.length; - this.#changes = []; - if (this.#string !== void 0) - this.#string.change = void 0; - let index = 0; - while (index < text.length && !this.#done) { - const open = this.#string; - if (open !== void 0) - index = this.#readString(open, text, index); - else if (this.#scalar !== "") - index = this.#readScalar(text, index); - else - this.#structural(text[index++]); - } - return this.#changes; - } - /** - * The value of the text read so far: `undefined` before a value starts, otherwise a plain JSON value that never - * changes afterwards. Returns the previous snapshot while the text read since did not change the value, or while a - * fresh copy of the open path is not yet paid for (see the module comment). - */ - snapshot() { - if (!this.#dirty) - return this.#snapshot; - const pending = this.#pendingScalar(); - const cost = this.#pathCost + (pending === void 0 ? 0 : 1); - if (cost > this.#credit) - return this.#snapshot; - this.#credit -= cost; - this.#dirty = false; - this.#snapshot = this.#copyOpenPath(pending); - return this.#snapshot; - } - /** Read string characters from `start` until the string ends or the text does; returns the next index. */ - #readString(open, text, start) { - let runStart = start; - for (let index = start; index < text.length; index++) { - const code = text.charCodeAt(index); - if (open.escape !== "") { - if (this.#continueEscape(open, text[index])) { - runStart = index + 1; - continue; - } - runStart = index; - } - if (code === QUOTE) { - if (index > runStart) - this.#appendString(open, text.slice(runStart, index)); - this.#endString(open); - return index + 1; - } - if (code === BACKSLASH) { - if (index > runStart) - this.#appendString(open, text.slice(runStart, index)); - open.escape = "\\"; - runStart = index + 1; - } - } - if (text.length > runStart) - this.#appendString(open, text.slice(runStart)); - return text.length; - } - /** Read number or literal characters from `start` up to the next delimiter; returns the delimiter's index. */ - #readScalar(text, start) { - let end = start; - while (end < text.length && !isDelimiter(text[end])) - end++; - if (end > start) { - this.#scalar += text.slice(start, end); - if (this.#scalarSlot !== void 0) - this.#dirty = true; - } - if (end < text.length) - this.#endScalar(); - return end; - } - /** Handle one character outside strings. */ - #structural(char) { - switch (char) { - case " ": - case " ": - case "\n": - case "\r": - return; - case '"': - this.#startString(); - return; - case "{": - case "[": - this.#openContainer(char === "{" ? {} : []); - return; - case "}": - case "]": - this.#closeContainer(); - return; - case ":": { - const frame = this.#stack.at(-1); - if (frame !== void 0 && !Array.isArray(frame.container) && frame.phase === "colon") - frame.phase = "value"; - return; - } - case ",": { - const frame = this.#stack.at(-1); - if (frame !== void 0) - frame.phase = Array.isArray(frame.container) ? "value" : "key"; - return; - } - default: - this.#scalar = char; - this.#scalarSlot = this.#valueSlot(); - if (this.#scalarSlot !== void 0) - this.#dirty = true; - } - } - /** Where a value starting now goes, or `undefined` when this position takes no value. */ - #valueSlot() { - const frame = this.#stack.at(-1); - if (frame === void 0) - return this.#root === void 0 ? ROOT_SLOT : void 0; - if (Array.isArray(frame.container)) - return { kind: "element", index: frame.container.length }; - if ((frame.phase === "value" || frame.phase === "colon") && frame.key !== void 0) { - return { kind: "member", key: frame.key }; - } - return void 0; - } - #startString() { - const frame = this.#stack.at(-1); - if (frame !== void 0 && !Array.isArray(frame.container) && (frame.phase === "key" || frame.phase === "comma")) { - this.#string = { target: "key", slot: void 0, text: "", escape: "", path: void 0, change: void 0 }; - return; - } - const slot = this.#valueSlot(); - const path4 = this.#reportedPath(slot); - this.#string = { target: "value", slot, text: "", escape: "", path: path4, change: void 0 }; - this.#place(slot, ""); - if (path4 !== void 0) - this.#string.change = this.#report({ kind: "set", path: path4, value: "" }); - } - /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ - #reportedPath(slot) { - if (slot === void 0) - return void 0; - if (slot.kind === "root") - return []; - const frame = this.#stack.at(-1); - if (!frame.reportsInside) - return void 0; - return [...frame.path, slot.kind === "member" ? slot.key : slot.index]; - } - #report(change) { - this.#changes.push(change); - return change; - } - /** Continue an escape with `char`; returns false when `char` is not part of it and must be read normally. */ - #continueEscape(open, char) { - if (open.escape === "\\") { - const decoded = SIMPLE_ESCAPES[char]; - if (decoded !== void 0) { - open.escape = ""; - this.#appendString(open, decoded); - return true; - } - if (char === "u") { - open.escape = "\\u"; - return true; - } - open.escape = ""; - this.#appendString(open, "\\"); - return false; - } - if (isHexDigit(char)) { - open.escape += char; - if (open.escape.length < 6) - return true; - const decoded = String.fromCharCode(Number.parseInt(open.escape.slice(2), 16)); - open.escape = ""; - this.#appendString(open, decoded); - return true; - } - const literal = open.escape; - open.escape = ""; - this.#appendString(open, literal); - return false; - } - #appendString(open, text) { - open.text += text; - if (open.target !== "value") - return; - this.#place(open.slot, open.text); - if (open.path === void 0) - return; - const change = open.change; - if (change !== void 0 && this.#changes.at(-1) === change) { - if (change.kind === "set") - change.value = change.value + text; - else - change.text += text; - return; - } - open.change = this.#report({ kind: "append", path: open.path, text }); - } - #endString(open) { - this.#string = void 0; - const frame = this.#stack.at(-1); - if (open.target === "key") { - if (frame === void 0) - return; - frame.key = open.text; - frame.phase = "colon"; - return; - } - this.#valueEnded(frame); - } - #endScalar() { - const token = this.#scalar; - const slot = this.#scalarSlot; - this.#scalar = ""; - this.#scalarSlot = void 0; - const value = scalarValue(token); - if (value !== void 0) { - this.#place(slot, value); - const path4 = this.#reportedPath(slot); - if (path4 !== void 0) - this.#report({ kind: "set", path: path4, value }); - } - this.#valueEnded(this.#stack.at(-1)); - } - /** The value of the unterminated scalar at the end of the text, if it shows. */ - #pendingScalar() { - const slot = this.#scalarSlot; - const token = this.#scalar; - if (slot === void 0 || token === "" || token.length > MAX_PENDING_SCALAR_LENGTH) - return void 0; - const value = pendingScalarValue(token); - return value === void 0 ? void 0 : { slot, value }; - } - #openContainer(container) { - const slot = this.#valueSlot(); - const path4 = this.#reportedPath(slot); - this.#place(slot, container); - this.#stack.push({ - container, - slot, - path: path4, - reportsInside: path4 !== void 0 && path4.length < MAX_REPORTED_DEPTH, - size: 0, - key: void 0, - phase: Array.isArray(container) ? "value" : "key" - }); - this.#pathCost += 1; - this.#dirty = true; - if (path4 !== void 0) - this.#report({ kind: "set", path: path4, value: Array.isArray(container) ? [] : {} }); - } - #closeContainer() { - const frame = this.#stack.pop(); - if (frame === void 0) - return; - this.#pathCost -= frame.size + 1; - this.#dirty = true; - if (frame.path !== void 0 && !frame.reportsInside) { - this.#report({ kind: "set", path: frame.path, value: frame.container }); - } - this.#valueEnded(this.#stack.at(-1)); - } - /** A value in `frame`, or the root value when there is no frame, has ended. */ - #valueEnded(frame) { - if (frame === void 0) { - if (this.#root !== void 0) - this.#done = true; - return; - } - frame.phase = "comma"; - } - /** Set the value at `slot` in the open path; nothing for a value in an invalid position. */ - #place(slot, value) { - if (slot === void 0) - return; - this.#dirty = true; - if (slot.kind === "root") { - this.#root = value; - return; - } - const frame = this.#stack.at(-1); - if (slot.kind === "element") { - const elements = frame.container; - if (slot.index === elements.length) { - frame.size++; - this.#pathCost++; - } - elements[slot.index] = value; - return; - } - const members = frame.container; - if (!Object.hasOwn(members, slot.key)) { - frame.size++; - this.#pathCost++; - } - setMember(members, slot.key, value); - } - /** A fresh snapshot: copies of the open containers, innermost first, each holding the copy of its open child. */ - #copyOpenPath(pending) { - if (this.#stack.length === 0) - return pending?.slot.kind === "root" ? pending.value : this.#root; - let child; - let childSlot; - for (let depth = this.#stack.length - 1; depth >= 0; depth--) { - const frame = this.#stack[depth]; - const copy = Array.isArray(frame.container) ? frame.container.slice() : { ...frame.container }; - if (depth === this.#stack.length - 1 && pending !== void 0) - setSlot(copy, pending.slot, pending.value); - if (child !== void 0 && childSlot !== void 0) - setSlot(copy, childSlot, child); - child = copy; - childSlot = frame.slot; - } - return childSlot?.kind === "root" ? child : this.#root; - } - }; - ToolCallArgumentsStream = class { - #text = ""; - #parser = new StreamingJsonParser(); - #snapshot = void 0; - #arguments = {}; - /** The raw argument text received so far. */ - get text() { - return this.#text; - } - /** Append a piece of argument text; returns the partial arguments, a new object whenever they changed. */ - append(delta) { - this.#text += delta; - this.#parser.append(delta); - return this.#partial(); - } - /** - * Take the provider's complete argument text. When it continues the text so far, returns the missing piece as - * `delta`; otherwise starts over with `text`. Either way returns the partial arguments of `text`. - */ - replace(text) { - if (text.startsWith(this.#text)) { - const delta = text.slice(this.#text.length); - return { delta, arguments: delta === "" ? this.#partial() : this.append(delta) }; - } - this.#text = ""; - this.#parser = new StreamingJsonParser(); - return { delta: void 0, arguments: this.append(text) }; - } - /** The final arguments: one full parse of the complete text, which reports malformed arguments. */ - finish() { - return parseToolCallArguments(this.#text); - } - #partial() { - const snapshot = this.#parser.snapshot(); - if (snapshot === this.#snapshot) - return this.#arguments; - this.#snapshot = snapshot; - this.#arguments = typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : {}; - return this.#arguments; - } - }; - SIMPLE_ESCAPES = { - '"': '"', - "\\": "\\", - "/": "/", - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: " " - }; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js -function splitErrorToolResultImages(msg) { - if (!msg.isError) - return void 0; - const images = msg.content.filter((block) => block.type === "image"); - if (images.length === 0) - return void 0; - return { - content: replaceImagesWithPlaceholder(msg.content, ERROR_TOOL_IMAGE_PLACEHOLDER), - caption: `Images from the error result of tool call ${msg.toolCallId} (${msg.toolName}):`, - images - }; -} -function replaceImagesWithPlaceholder(content, placeholder) { - const result = []; - let previousWasPlaceholder = false; - for (const block of content) { - if (block.type === "image") { - if (!previousWasPlaceholder) { - result.push({ type: "text", text: placeholder }); - } - previousWasPlaceholder = true; - continue; - } - result.push(block); - previousWasPlaceholder = block.text === placeholder; - } - return result; -} -function downgradeUnsupportedImages(messages, model2) { - if (model2.input.includes("image")) { - return messages; - } - return messages.map((msg) => { - if (msg.role === "user" && Array.isArray(msg.content)) { - return { - ...msg, - content: replaceImagesWithPlaceholder(msg.content, NON_VISION_USER_IMAGE_PLACEHOLDER) - }; - } - if (msg.role === "toolResult") { - return { - ...msg, - content: replaceImagesWithPlaceholder(msg.content, NON_VISION_TOOL_IMAGE_PLACEHOLDER) - }; - } - return msg; - }); -} -function transformMessages(messages, model2, normalizeToolCallId2) { - const toolCallIdMap = /* @__PURE__ */ new Map(); - const normalizedMessages = messages.map((msg) => msg.content == null ? { ...msg, content: [] } : msg); - const imageAwareMessages = downgradeUnsupportedImages(normalizedMessages, model2); - const transformed = imageAwareMessages.map((msg) => { - if (msg.role === "system" || msg.role === "user") { - return msg; - } - if (msg.role === "toolResult") { - const normalizedId = toolCallIdMap.get(msg.toolCallId); - if (normalizedId && normalizedId !== msg.toolCallId) { - return { ...msg, toolCallId: normalizedId }; - } - return msg; - } - if (msg.role === "assistant") { - const assistantMsg = msg; - const isSameModel = assistantMsg.provider === model2.provider && assistantMsg.api === model2.api && assistantMsg.model === model2.id; - const transformedContent = assistantMsg.content.flatMap((block) => { - if (block.type === "thinking") { - if (!isSameModel) - return []; - if (block.redacted || block.thinkingSignature) - return block; - if (!block.thinking || block.thinking.trim() === "") - return []; - return block; - } - if (block.type === "text") { - if (isSameModel) - return block; - return { - type: "text", - text: block.text - }; - } - if (block.type === "toolCall") { - const toolCall = block; - let normalizedToolCall = toolCall; - if (!isSameModel && toolCall.thoughtSignature) { - normalizedToolCall = { ...toolCall }; - delete normalizedToolCall.thoughtSignature; - } - if (!isSameModel && normalizeToolCallId2) { - const normalizedId = normalizeToolCallId2(toolCall.id, model2, assistantMsg); - if (normalizedId !== toolCall.id) { - toolCallIdMap.set(toolCall.id, normalizedId); - normalizedToolCall = { ...normalizedToolCall, id: normalizedId }; - } - } - return normalizedToolCall; - } - return block; - }); - return { - ...assistantMsg, - content: transformedContent - }; - } - return msg; - }); - const result = []; - let pendingToolCalls = []; - let existingToolResultIds = /* @__PURE__ */ new Set(); - const heldSystemMessages = []; - const closePendingToolCalls = () => { - if (pendingToolCalls.length > 0) { - for (const tc of pendingToolCalls) { - if (!existingToolResultIds.has(tc.id)) { - result.push({ - role: "toolResult", - toolCallId: tc.id, - toolName: tc.name, - content: [{ type: "text", text: "No result provided" }], - isError: true, - timestamp: Date.now() - }); - } - } - pendingToolCalls = []; - existingToolResultIds = /* @__PURE__ */ new Set(); - } - result.push(...heldSystemMessages); - heldSystemMessages.length = 0; - }; - for (let i = 0; i < transformed.length; i++) { - const msg = transformed[i]; - if (msg.role === "assistant") { - closePendingToolCalls(); - const assistantMsg = msg; - if (assistantMsg.stopReason === "error" || assistantMsg.stopReason === "aborted") { - continue; - } - const toolCalls = assistantMsg.content.filter((b) => b.type === "toolCall"); - if (toolCalls.length > 0) { - pendingToolCalls = toolCalls; - existingToolResultIds = /* @__PURE__ */ new Set(); - } - result.push(msg); - } else if (msg.role === "toolResult") { - existingToolResultIds.add(msg.toolCallId); - result.push(msg); - } else if (msg.role === "system") { - if (pendingToolCalls.length > 0) { - heldSystemMessages.push(msg); - } else { - result.push(msg); - } - } else if (msg.role === "user") { - closePendingToolCalls(); - result.push(msg); - } else { - result.push(msg); - } - } - closePendingToolCalls(); - return result; -} -var NON_VISION_USER_IMAGE_PLACEHOLDER, NON_VISION_TOOL_IMAGE_PLACEHOLDER, ERROR_TOOL_IMAGE_PLACEHOLDER; -var init_transform_messages = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js"() { - NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)"; - NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)"; - ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)"; - } -}); - // node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js function encodeTextSignatureV1(id, phase) { const payload = { v: 1, id }; @@ -23728,9 +39947,9 @@ function renderIncrementalToolsNotice(unavailable2) { return unavailable2.size > 0 ? `${notice} Still unavailable: ${[...unavailable2].join(", ")}.` : notice; } -function renderToolRemovalNotice(names) { +function renderToolRemovalNotice(names2) { return `The following tools are no longer available. Do not call them: -${names.map((name) => `- ${name}`).join("\n")}`; +${names2.map((name) => `- ${name}`).join("\n")}`; } function convertResponsesMessages(model2, context, allowedToolCallProviders, options) { const normalizedContext = resolveTranscript(context, options?.supportsMidConvoSystemMessages); @@ -23783,14 +40002,14 @@ function convertResponsesMessages(model2, context, allowedToolCallProviders, opt } if (toolSupport !== "additions") return; - const names = tools.map((tool) => tool.name); - const callId = `pi_tool_load_${shortHash(`${seed}:${names.join(",")}`)}`; + const names2 = tools.map((tool) => tool.name); + const callId = `pi_tool_load_${shortHash(`${seed}:${names2.join(",")}`)}`; messages.push({ type: "tool_search_call", call_id: callId, execution: "client", status: "completed", - arguments: { query: names.join(" "), limit: names.length } + arguments: { query: names2.join(" "), limit: names2.length } }); messages.push({ type: "tool_search_output", @@ -23986,7 +40205,7 @@ function convertResponsesTools(tools, options) { return functionTool; }); } -async function processResponsesStream(openaiStream, output, stream4, model2, options) { +async function processResponsesStream(openaiStream, output, stream5, model2, options) { let sawTerminalResponseEvent = false; const outputSlots = /* @__PURE__ */ new Map(); const unfinishedToolCalls = /* @__PURE__ */ new Set(); @@ -24003,7 +40222,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt const pushToolCallDelta = (slot, delta) => { if (delta === void 0) return; - stream4.push({ + stream5.push({ type: "toolcall_delta", contentIndex: slot.contentIndex, delta, @@ -24020,7 +40239,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt contentIndex: output.content.length - 1 }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "thinking_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "thinking_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "message") { @@ -24029,7 +40248,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt output.content.push(block); const slot = { type: "text", block, contentIndex: output.content.length - 1 }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "text_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "text_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "function_call") { @@ -24050,7 +40269,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt input: { kind: "json", arguments: args } }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); return slot; } if (item.type === "custom_tool_call") { @@ -24072,7 +40291,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt input: customInput(inputProperty, input) }; outputSlots.set(outputIndex, slot); - stream4.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); + stream5.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output }); return slot; } return void 0; @@ -24126,7 +40345,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt const incompleteDetails = response?.incomplete_details; const incompleteReason = typeof incompleteDetails?.reason === "string" ? incompleteDetails.reason : void 0; output.rawStopReason = incompleteReason ? `${status}.${incompleteReason}` : status; - const mappedStop = mapStopReason(status, incompleteReason); + const mappedStop = mapStopReason2(status, incompleteReason); output.stopReason = mappedStop.stopReason; if (mappedStop.errorMessage === void 0) delete output.errorMessage; @@ -24147,7 +40366,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += event.delta; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24158,7 +40377,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += "\n\n"; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: "\n\n", @@ -24169,7 +40388,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.thinking += event.delta; - stream4.push({ + stream5.push({ type: "thinking_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24180,7 +40399,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.text += event.delta; - stream4.push({ + stream5.push({ type: "text_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24191,7 +40410,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (!slot) continue; slot.block.text += event.delta; - stream4.push({ + stream5.push({ type: "text_delta", contentIndex: slot.contentIndex, delta: event.delta, @@ -24226,12 +40445,12 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt applyMessagePhaseStopReason(item); const slot = getOrCreateSlot(event.output_index, item); if (item.type === "reasoning" && slot?.type === "thinking") { - const summaryText = item.summary?.map((s) => s.text).join("\n\n") || ""; - const contentText2 = item.content?.map((c) => c.text).join("\n\n") || ""; - slot.block.thinking = summaryText || contentText2 || slot.block.thinking; + const summaryText2 = item.summary?.map((s) => s.text).join("\n\n") || ""; + const contentText3 = item.content?.map((c) => c.text).join("\n\n") || ""; + slot.block.thinking = summaryText2 || contentText3 || slot.block.thinking; slot.block.thinkingSignature = JSON.stringify(item); reasoningBlocksById.set(item.id, slot.block); - stream4.push({ + stream5.push({ type: "thinking_end", contentIndex: slot.contentIndex, content: slot.block.thinking, @@ -24241,7 +40460,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt } else if (item.type === "message" && slot?.type === "text") { slot.block.text = item.content?.map((c) => c.type === "output_text" ? c.text : c.refusal).join("") || ""; slot.block.textSignature = encodeTextSignatureV1(item.id, item.phase ?? void 0); - stream4.push({ + stream5.push({ type: "text_end", contentIndex: slot.contentIndex, content: slot.block.text, @@ -24255,7 +40474,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (item.namespace !== void 0) slot.block.namespace = item.namespace; unfinishedToolCalls.delete(slot.block); - stream4.push({ + stream5.push({ type: "toolcall_end", contentIndex: slot.contentIndex, toolCall: slot.block, @@ -24267,7 +40486,7 @@ async function processResponsesStream(openaiStream, output, stream4, model2, opt if (item.namespace !== void 0) slot.block.namespace = item.namespace; unfinishedToolCalls.delete(slot.block); - stream4.push({ + stream5.push({ type: "toolcall_end", contentIndex: slot.contentIndex, toolCall: slot.block, @@ -24320,7 +40539,7 @@ function sendCustomInput(block, input, jsonDelta) { input.unsent = ""; return sent; } -function mapStopReason(status, incompleteReason) { +function mapStopReason2(status, incompleteReason) { if (!status) return { stopReason: "stop" }; switch (status) { @@ -24360,186 +40579,21 @@ var init_openai_responses_shared = __esm({ } }); -// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js -function calculateContextTokens(usage) { - return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite; -} -function safeJsonStringify2(value) { - try { - return JSON.stringify(value) ?? "undefined"; - } catch { - return "[unserializable]"; - } -} -function estimateTextAndImageContentChars(content) { - if (typeof content === "string") - return content.length; - let chars = 0; - for (const block of content) - chars += block.type === "text" ? block.text.length : ESTIMATED_IMAGE_CHARS; - return chars; -} -function estimateTextTokens(text) { - return Math.ceil(text.length / CHARS_PER_TOKEN); -} -function estimateTextAndImageContentTokens(content) { - return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN); -} -function estimateMessageTokens(message) { - let chars = 0; - if (message.role === "system") { - return estimateTextTokens(getSystemMessageText(message)) + estimateToolsTokens(message.toolsAdded) + estimateToolsTokens(message.toolsRemoved); - } - if (message.role === "user") - return estimateTextAndImageContentTokens(message.content); - if (message.role === "toolResult") - return estimateTextAndImageContentTokens(message.content); - for (const block of message.content) { - if (block.type === "text") { - chars += block.text.length; - } else if (block.type === "thinking") { - chars += block.thinking.length; - } else { - chars += block.name.length + safeJsonStringify2(block.arguments).length; - } - } - return Math.ceil(chars / CHARS_PER_TOKEN); -} -function getLastAssistantUsageInfo(messages) { - let latestPrefixTimestamp = Number.NEGATIVE_INFINITY; - let usageInfo; - for (let i = 0; i < messages.length; i++) { - const message = messages[i]; - if (message.role === "assistant") { - const assistant = message; - const usageAppliesToPrefix = assistant.timestamp >= latestPrefixTimestamp; - if (usageAppliesToPrefix && assistant.stopReason !== "aborted" && assistant.stopReason !== "error" && calculateContextTokens(assistant.usage) > 0) { - usageInfo = { usage: assistant.usage, index: i }; - } - } - latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp); - } - return usageInfo; -} -function estimateContextTokens(context) { - const messages = "messages" in context ? context.messages : context; - const usageInfo = getLastAssistantUsageInfo(messages); - if (usageInfo) { - const usageTokens = calculateContextTokens(usageInfo.usage); - let trailingTokens = 0; - for (let i = usageInfo.index + 1; i < messages.length; i++) { - trailingTokens += estimateMessageTokens(messages[i]); - } - return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index }; - } - let tokens = 0; - for (const message of messages) - tokens += estimateMessageTokens(message); - return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null }; -} -function estimateToolsTokens(tools) { - if (!tools || tools.length === 0) - return 0; - return estimateTextTokens(safeJsonStringify2(tools)); -} -var CHARS_PER_TOKEN, ESTIMATED_IMAGE_CHARS; -var init_estimate = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/estimate.js"() { - init_text(); - CHARS_PER_TOKEN = 3.5; - ESTIMATED_IMAGE_CHARS = 4800; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/simple-options.js -function clampMaxTokensToContext(model2, context, maxTokens) { - if (model2.contextWindow <= 0) - return Math.max(MIN_MAX_TOKENS, maxTokens); - const available = model2.contextWindow - estimateContextTokens(context).tokens - CONTEXT_SAFETY_TOKENS; - return Math.min(maxTokens, Math.max(MIN_MAX_TOKENS, available)); -} -function resolveSamplingParams(model2, thinkingLevel, requestParams) { - const effectiveThinkingLevel = clampThinkingLevel(model2, thinkingLevel); - const thinkingLevelParams = model2.samplingParamsByThinkingLevel?.[effectiveThinkingLevel]; - return model2.samplingParams || thinkingLevelParams || requestParams ? { ...model2.samplingParams, ...thinkingLevelParams, ...requestParams } : void 0; -} -function buildBaseOptions(model2, context, options, apiKey) { - const samplingParams = resolveSamplingParams(model2, options?.reasoning ?? "off", options?.samplingParams); - return { - temperature: options?.temperature, - samplingParams, - maxTokens: clampMaxTokensToContext(model2, context, options?.maxTokens ?? model2.maxTokens), - signal: options?.signal, - telemetry: options?.telemetry, - apiKey: apiKey || options?.apiKey, - fetch: options?.fetch, - transport: options?.transport, - cacheRetention: options?.cacheRetention, - sessionId: options?.sessionId, - headers: options?.headers, - identity: options?.identity, - onPayload: options?.onPayload, - onResponse: options?.onResponse, - onProviderStreamEvent: options?.onProviderStreamEvent, - timeoutMs: options?.timeoutMs, - websocketConnectTimeoutMs: options?.websocketConnectTimeoutMs, - maxRetries: options?.maxRetries, - maxRetryDelayMs: options?.maxRetryDelayMs, - metadata: options?.metadata, - env: options?.env - }; -} -function clampReasoning(effort) { - return effort === "xhigh" || effort === "max" ? "high" : effort; -} -function thinkingBudgetForLevel(reasoningLevel, customBudgets) { - const budgets = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets }; - const level = clampReasoning(reasoningLevel); - return budgets[level]; -} -function clampThinkingBudgetToAnswerRoom(thinkingBudget, ceiling) { - return Math.min(thinkingBudget, Math.max(0, ceiling - MIN_ANSWER_TOKENS)); -} -function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) { - let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets); - const maxTokens = baseMaxTokens === void 0 ? modelMaxTokens : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens); - if (maxTokens <= thinkingBudget) { - thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens); - } - return { maxTokens, thinkingBudget }; -} -var CONTEXT_SAFETY_TOKENS, MIN_MAX_TOKENS, MIN_ANSWER_TOKENS, DEFAULT_THINKING_BUDGETS; -var init_simple_options = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/simple-options.js"() { - init_models(); - init_estimate(); - CONTEXT_SAFETY_TOKENS = 4096; - MIN_MAX_TOKENS = 1; - MIN_ANSWER_TOKENS = 1024; - DEFAULT_THINKING_BUDGETS = { - minimal: 1024, - low: 2048, - medium: 8192, - high: 16384 - }; - } -}); - // node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js var openai_responses_exports = {}; __export(openai_responses_exports, { - stream: () => stream, - streamSimple: () => streamSimple + stream: () => stream3, + streamSimple: () => streamSimple2 }); function isChatGPTSignIn(model2, apiKey) { return model2.provider === "openai" && model2.baseUrl === "https://api.openai.com/v1" && apiKey !== void 0 && !apiKey.startsWith("sk-"); } -function hasHeader(headers, name) { +function hasHeader2(headers, name) { if (!headers) return false; const expected = name.toLowerCase(); - for (const [key, value] of Object.entries(headers)) { - if (key.toLowerCase() === expected && value !== null && value.trim().length > 0) + for (const [key, value2] of Object.entries(headers)) { + if (key.toLowerCase() === expected && value2 !== null && value2.trim().length > 0) return true; } return false; @@ -24547,14 +40601,14 @@ function hasHeader(headers, name) { function getClientApiKey(provider2, apiKey, headers) { if (apiKey) return apiKey; - if (hasHeader(headers, "authorization") || hasHeader(headers, "cf-aig-authorization")) + if (hasHeader2(headers, "authorization") || hasHeader2(headers, "cf-aig-authorization")) return "unused"; throw new Error(`No API key for provider: ${provider2}`); } function detectSessionAffinityFormat(model2) { return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai") ? "openrouter" : "openai"; } -function resolveCacheRetention(cacheRetention, env) { +function resolveCacheRetention2(cacheRetention, env) { if (cacheRetention) { return cacheRetention; } @@ -24597,7 +40651,7 @@ function getPromptCacheOptions(compat, cacheRetention) { return { ttl: "30m" }; return void 0; } -function createClient(model2, context, apiKey, optionsHeaders, identity, fetch2, sessionId) { +function createClient2(model2, context, apiKey, optionsHeaders, identity, fetch3, sessionId) { const compat = getCompat(model2); const headers = { ...getIdentityHeaders(model2, identity), ...model2.headers }; if (model2.provider === "github-copilot") { @@ -24625,11 +40679,11 @@ function createClient(model2, context, apiKey, optionsHeaders, identity, fetch2, apiKey, baseURL: model2.baseUrl, dangerouslyAllowBrowser: true, - fetch: fetch2, + fetch: fetch3, defaultHeaders: headers }); } -function buildParams(model2, context, options, compat, grammarToolInputProperties, configurationUpdateEffort) { +function buildParams2(model2, context, options, compat, grammarToolInputProperties, configurationUpdateEffort) { const transcriptTools = resolveTranscriptTools(context.messages, getResponsesToolSupport(compat)); const messages = convertResponsesMessages(model2, context, OPENAI_TOOL_CALL_PROVIDERS, { grammarToolInputProperties, @@ -24642,7 +40696,7 @@ function buildParams(model2, context, options, compat, grammarToolInputPropertie }, configurationUpdateEffort }); - const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); const omitUnsupportedFields = isChatGPTSignIn(model2, options?.apiKey); const params = { model: model2.id, @@ -24716,14 +40770,14 @@ function applyServiceTierPricing(usage, serviceTier, model2) { usage.cost.cacheWrite *= multiplier; usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite; } -var OPENAI_TOOL_CALL_PROVIDERS, OPENAI_RESPONSES_MIN_OUTPUT_TOKENS, CHATGPT_USAGE_URL, CHATGPT_WORKSPACE_LIMIT_HINT, CONFIGURATION_UPDATE_REQUEST_EFFORT, stream, streamSimple; +var OPENAI_TOOL_CALL_PROVIDERS, OPENAI_RESPONSES_MIN_OUTPUT_TOKENS, CHATGPT_USAGE_URL, CHATGPT_WORKSPACE_LIMIT_HINT, CONFIGURATION_UPDATE_REQUEST_EFFORT, stream3, streamSimple2; var init_openai_responses = __esm({ "node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js"() { init_openai(); init_models(); init_error_body(); init_event_stream(); - init_headers(); + init_headers2(); init_identity(); init_provider_env(); init_provider_retry(); @@ -24738,8 +40792,8 @@ var init_openai_responses = __esm({ CHATGPT_USAGE_URL = "https://chatgpt.com/settings/usage"; CHATGPT_WORKSPACE_LIMIT_HINT = "You've reached your ChatGPT workspace's usage limit. Ask your workspace admin to increase it at admin.openai.com \u2192 Workspace \u2192 Usage limits."; CONFIGURATION_UPDATE_REQUEST_EFFORT = "medium"; - stream = (model2, context, options) => { - const stream4 = new AssistantMessageEventStream(); + stream3 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); const normalizedContext = resolveTranscript(context, getCompat(model2).supportsMidConvoSystemMessages); (async () => { const compat = getCompat(model2); @@ -24764,11 +40818,11 @@ var init_openai_responses = __esm({ }; try { const apiKey = getClientApiKey(model2.provider, options?.apiKey, options?.headers); - const cacheRetention = resolveCacheRetention(options?.cacheRetention, options?.env); + const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; const grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(normalizedContext.messages), compat.supportsOpenAIGrammarTools); - const client = createClient(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId); - let params = buildParams(model2, normalizedContext, options, compat, grammarToolInputProperties, configurationUpdateEffort); + const client = createClient2(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId); + let params = buildParams2(model2, normalizedContext, options, compat, grammarToolInputProperties, configurationUpdateEffort); const nextParams = await options?.onPayload?.(params, model2); if (nextParams !== void 0) { params = nextParams; @@ -24784,8 +40838,8 @@ var init_openai_responses = __esm({ signal: options?.signal }); await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - stream4.push({ type: "start", partial: output }); - await processResponsesStream(openaiStream, output, stream4, model2, { + stream5.push({ type: "start", partial: output }); + await processResponsesStream(openaiStream, output, stream5, model2, { onProviderStreamEvent: options?.onProviderStreamEvent, serviceTier: options?.serviceTier, grammarToolInputProperties, @@ -24800,8 +40854,8 @@ var init_openai_responses = __esm({ if (output.stopReason === "aborted" || output.stopReason === "error") { throw new Error(output.errorMessage || "An unknown error occurred"); } - stream4.push({ type: "done", reason: output.stopReason, message: output }); - stream4.end(); + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); } catch (error) { output.stopReason = options?.signal?.aborted ? "aborted" : "error"; const errorMessage2 = formatProviderError(normalizeProviderError(error), `${model2.provider === "openai" ? "OpenAI" : model2.provider} API error`); @@ -24814,13 +40868,13 @@ ${CHATGPT_WORKSPACE_LIMIT_HINT}`; } else { output.errorMessage = errorMessage2; } - stream4.push({ type: "error", reason: output.stopReason, error: output }); - stream4.end(); + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); } })(); - return stream4; + return stream5; }; - streamSimple = (model2, context, options) => { + streamSimple2 = (model2, context, options) => { getClientApiKey(model2.provider, options?.apiKey, options?.headers); const base = { ...buildBaseOptions(model2, context, options, options?.apiKey), @@ -24828,7 +40882,7 @@ ${CHATGPT_WORKSPACE_LIMIT_HINT}`; }; const clampedReasoning = options?.reasoning ? clampThinkingLevel(model2, options.reasoning) : void 0; const reasoningEffort = clampedReasoning === "off" ? void 0 : clampedReasoning; - return stream(model2, context, { + return stream3(model2, context, { ...base, reasoningEffort }); @@ -24836,15107 +40890,120 @@ ${CHATGPT_WORKSPACE_LIMIT_HINT}`; } }); -// node_modules/@anthropic-ai/sdk/internal/tslib.mjs -function __classPrivateFieldSet2(receiver, state2, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state2.set(receiver, value), value; -} -function __classPrivateFieldGet2(receiver, state2, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state2 === "function" ? receiver !== state2 || !f : !state2.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver); -} -var init_tslib2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/tslib.mjs"() { - } +// node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +var openai_completions_exports = {}; +__export(openai_completions_exports, { + convertMessages: () => convertMessages2, + stream: () => stream4, + streamSimple: () => streamSimple3 }); - -// node_modules/@anthropic-ai/sdk/internal/errors.mjs -function isAbortError2(err) { - return typeof err === "object" && err !== null && // Spec-compliant fetch implementations - ("name" in err && err.name === "AbortError" || // Expo fetch - "message" in err && String(err.message).includes("FetchRequestCanceledException")); -} -var castToError2; -var init_errors2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/errors.mjs"() { - castToError2 = (err) => { - if (err instanceof Error) - return err; - if (typeof err === "object" && err !== null) { - try { - const tag = Object.prototype.toString.call(err); - if (tag === "[object Error]" || tag === "[object DOMException]") { - const error = new Error(err.message, err.cause ? { cause: err.cause } : {}); - if (err.stack) - error.stack = err.stack; - if (err.cause && !error.cause) - error.cause = err.cause; - if (err.name) - error.name = err.name; - return error; - } - } catch { - } - try { - return new Error(JSON.stringify(err)); - } catch { - } - } - return new Error(err); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/core/error.mjs -var AnthropicError, APIError2, APIUserAbortError2, APIConnectionError2, APIConnectionTimeoutError2, RetryableError, BadRequestError2, AuthenticationError2, PermissionDeniedError2, NotFoundError2, ConflictError2, UnprocessableEntityError2, RateLimitError2, InternalServerError2; -var init_error3 = __esm({ - "node_modules/@anthropic-ai/sdk/core/error.mjs"() { - init_errors2(); - AnthropicError = /* @__PURE__ */ (() => { - class AnthropicError2 extends Error { - } - return AnthropicError2; - })(); - APIError2 = class _APIError extends AnthropicError { - constructor(status, error, message, headers, type) { - super(`${_APIError.makeMessage(status, error, message)}`); - this.status = status; - this.headers = headers; - this.requestID = headers?.get("request-id"); - this.workspaceID = headers?.get("anthropic-workspace-id"); - this.error = error; - this.type = type ?? null; - } - static makeMessage(status, error, message) { - const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message; - if (status && msg) { - return `${status} ${msg}`; - } - if (status) { - return `${status} status code (no body)`; - } - if (msg) { - return msg; - } - return "(no status code or body)"; - } - static generate(status, errorResponse, message, headers) { - if (!status || !headers) { - return new APIConnectionError2({ message, cause: castToError2(errorResponse) }); - } - const error = errorResponse; - const type = error?.["error"]?.["type"]; - if (status === 400) { - return new BadRequestError2(status, error, message, headers, type); - } - if (status === 401) { - return new AuthenticationError2(status, error, message, headers, type); - } - if (status === 403) { - return new PermissionDeniedError2(status, error, message, headers, type); - } - if (status === 404) { - return new NotFoundError2(status, error, message, headers, type); - } - if (status === 409) { - return new ConflictError2(status, error, message, headers, type); - } - if (status === 422) { - return new UnprocessableEntityError2(status, error, message, headers, type); - } - if (status === 429) { - return new RateLimitError2(status, error, message, headers, type); - } - if (status >= 500) { - return new InternalServerError2(status, error, message, headers, type); - } - return new _APIError(status, error, message, headers, type); - } - }; - APIUserAbortError2 = class extends APIError2 { - constructor({ message } = {}) { - super(void 0, void 0, message || "Request was aborted.", void 0); - } - }; - APIConnectionError2 = class extends APIError2 { - constructor({ message, cause }) { - super(void 0, void 0, message || "Connection error.", void 0); - if (cause) - this.cause = cause; - } - }; - APIConnectionTimeoutError2 = class extends APIConnectionError2 { - constructor({ message } = {}) { - super({ message: message ?? "Request timed out." }); - } - }; - RetryableError = class extends AnthropicError { - constructor(message, { cause } = {}) { - super(message ?? "Retryable error."); - if (cause !== void 0) - this.cause = cause; - } - }; - BadRequestError2 = class extends APIError2 { - }; - AuthenticationError2 = class extends APIError2 { - }; - PermissionDeniedError2 = class extends APIError2 { - }; - NotFoundError2 = class extends APIError2 { - }; - ConflictError2 = class extends APIError2 { - }; - UnprocessableEntityError2 = class extends APIError2 { - }; - RateLimitError2 = class extends APIError2 { - }; - InternalServerError2 = class extends APIError2 { - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/values.mjs -function maybeObj2(x) { - if (typeof x !== "object") { - return {}; - } - return x ?? {}; -} -function isEmptyObj2(obj2) { - if (!obj2) - return true; - for (const _k in obj2) +function hasHeader3(headers, name) { + if (!headers) return false; - return true; -} -function hasOwn2(obj2, key) { - return Object.prototype.hasOwnProperty.call(obj2, key); -} -function isObj2(obj2) { - return obj2 != null && typeof obj2 === "object" && !Array.isArray(obj2); -} -function checkNever(_value) { -} -var startsWithSchemeRegexp2, isAbsoluteURL2, isArray2, isReadonlyArray2, validatePositiveInteger2, safeJSON2; -var init_values2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/values.mjs"() { - init_error3(); - startsWithSchemeRegexp2 = /^[a-z][a-z0-9+.-]*:/i; - isAbsoluteURL2 = (url) => { - return startsWithSchemeRegexp2.test(url); - }; - isArray2 = (val) => (isArray2 = Array.isArray, isArray2(val)); - isReadonlyArray2 = isArray2; - validatePositiveInteger2 = (name, n) => { - if (typeof n !== "number" || !Number.isInteger(n)) { - throw new AnthropicError(`${name} must be an integer`); - } - if (n < 0) { - throw new AnthropicError(`${name} must be a positive integer`); - } - return n; - }; - safeJSON2 = (text) => { - try { - return JSON.parse(text); - } catch (err) { - return void 0; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs -var sleep2; -var init_sleep2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs"() { - sleep2 = (ms, signal) => new Promise((resolve) => { - if (signal?.aborted) - return resolve(); - const onAbort = () => { - clearTimeout(timer); - resolve(); - }; - const timer = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve(); - }, ms); - signal?.addEventListener("abort", onAbort, { once: true }); - }); - } -}); - -// node_modules/@anthropic-ai/sdk/version.mjs -var VERSION2; -var init_version3 = __esm({ - "node_modules/@anthropic-ai/sdk/version.mjs"() { - VERSION2 = "0.129.0"; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs -function getDetectedPlatform2() { - if (typeof Deno !== "undefined" && Deno.build != null) { - return "deno"; - } - if (typeof EdgeRuntime !== "undefined") { - return "edge"; - } - if (Object.prototype.toString.call(typeof globalThis.process !== "undefined" ? globalThis.process : 0) === "[object process]") { - return "node"; - } - return "unknown"; -} -function getBrowserInfo2() { - if (typeof navigator === "undefined" || !navigator) { - return null; - } - const browserPatterns = [ - { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } - ]; - for (const { key, pattern } of browserPatterns) { - const match = pattern.exec(navigator.userAgent); - if (match) { - const major = match[1] || 0; - const minor = match[2] || 0; - const patch = match[3] || 0; - return { browser: key, version: `${major}.${minor}.${patch}` }; - } - } - return null; -} -var isRunningInBrowser2, getPlatformProperties2, normalizeArch2, normalizePlatform2, _platformHeaders2, getPlatformHeaders2; -var init_detect_platform2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs"() { - init_version3(); - isRunningInBrowser2 = () => { - return ( - // @ts-ignore - typeof window !== "undefined" && // @ts-ignore - typeof window.document !== "undefined" && // @ts-ignore - typeof navigator !== "undefined" - ); - }; - getPlatformProperties2 = () => { - const detectedPlatform = getDetectedPlatform2(); - if (detectedPlatform === "deno") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": normalizePlatform2(Deno.build.os), - "X-Stainless-Arch": normalizeArch2(Deno.build.arch), - "X-Stainless-Runtime": "deno", - "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" - }; - } - if (typeof EdgeRuntime !== "undefined") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": `other:${EdgeRuntime}`, - "X-Stainless-Runtime": "edge", - "X-Stainless-Runtime-Version": globalThis.process?.version ?? "unknown" - }; - } - if (detectedPlatform === "node") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": normalizePlatform2(globalThis.process.platform ?? "unknown"), - "X-Stainless-Arch": normalizeArch2(globalThis.process.arch ?? "unknown"), - "X-Stainless-Runtime": "node", - "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" - }; - } - const browserInfo = getBrowserInfo2(); - if (browserInfo) { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": `browser:${browserInfo.browser}`, - "X-Stainless-Runtime-Version": browserInfo.version - }; - } - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION2, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": "unknown", - "X-Stainless-Runtime-Version": "unknown" - }; - }; - normalizeArch2 = (arch) => { - if (arch === "x32") - return "x32"; - if (arch === "x86_64" || arch === "x64") - return "x64"; - if (arch === "arm") - return "arm"; - if (arch === "aarch64" || arch === "arm64") - return "arm64"; - if (arch) - return `other:${arch}`; - return "unknown"; - }; - normalizePlatform2 = (platform) => { - platform = platform.toLowerCase(); - if (platform.includes("ios")) - return "iOS"; - if (platform === "android") - return "Android"; - if (platform === "darwin") - return "MacOS"; - if (platform === "win32") - return "Windows"; - if (platform === "freebsd") - return "FreeBSD"; - if (platform === "openbsd") - return "OpenBSD"; - if (platform === "linux") - return "Linux"; - if (platform) - return `Other:${platform}`; - return "Unknown"; - }; - getPlatformHeaders2 = () => { - return _platformHeaders2 ?? (_platformHeaders2 = getPlatformProperties2()); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/request-signal.mjs -function makeCleanup(signal, listener) { - return () => signal.removeEventListener("abort", listener); -} -function registerRequestSignalCleanup(controller, signal, listener) { - cleanups.set(controller, makeCleanup(signal, listener)); -} -function armAbandonmentBackstop(body, controller) { - if (cleanups.has(controller)) - registry?.register(body, controller, controller); -} -function releaseRequestSignal(controller) { - const cleanup = cleanups.get(controller); - if (cleanup) { - cleanups.delete(controller); - registry?.unregister(controller); - cleanup(); - } -} -var cleanups, registry; -var init_request_signal = __esm({ - "node_modules/@anthropic-ai/sdk/internal/request-signal.mjs"() { - cleanups = /* @__PURE__ */ new WeakMap(); - registry = typeof globalThis.FinalizationRegistry === "function" ? new globalThis.FinalizationRegistry((controller) => releaseRequestSignal(controller)) : null; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/shims.mjs -function getDefaultFetch2() { - if (typeof fetch !== "undefined") { - return fetch; - } - throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); -} -function makeReadableStream2(...args) { - const ReadableStream2 = globalThis.ReadableStream; - if (typeof ReadableStream2 === "undefined") { - throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); - } - return new ReadableStream2(...args); -} -function ReadableStreamFrom2(iterable) { - let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); - return makeReadableStream2({ - start() { - }, - async pull(controller) { - const { done, value } = await iter.next(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - }, - async cancel() { - await iter.return?.(); - } - }); -} -function ReadableStreamToAsyncIterable2(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) - reader.releaseLock(); - return result; - } catch (e) { - reader.releaseLock(); - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: void 0 }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -async function CancelReadableStream2(stream4) { - if (stream4 === null || typeof stream4 !== "object") - return; - if (stream4[Symbol.asyncIterator]) { - await stream4[Symbol.asyncIterator]().return?.(); - return; - } - const reader = stream4.getReader(); - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; -} -var init_shims2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/shims.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/request-options.mjs -var FallbackEncoder2; -var init_request_options2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/request-options.mjs"() { - FallbackEncoder2 = ({ headers, body }) => { - return { - bodyHeaders: { - "content-type": "application/json" - }, - body: JSON.stringify(body) - }; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs -var default_format2, default_formatter2, formatters2, RFC17382; -var init_formats2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs"() { - default_format2 = "RFC3986"; - default_formatter2 = (v) => String(v); - formatters2 = { - RFC1738: (v) => String(v).replace(/%20/g, "+"), - RFC3986: default_formatter2 - }; - RFC17382 = "RFC1738"; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs -function is_buffer2(obj2) { - if (!obj2 || typeof obj2 !== "object") { - return false; - } - return !!(obj2.constructor && obj2.constructor.isBuffer && obj2.constructor.isBuffer(obj2)); -} -function maybe_map2(val, fn) { - if (isArray2(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -} -var has2, hex_table2, limit2, encode2; -var init_utils3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs"() { - init_formats2(); - init_values2(); - has2 = (obj2, key) => (has2 = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has2(obj2, key)); - hex_table2 = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); - } - return array; - })(); - limit2 = 1024; - encode2 = (str2, _defaultEncoder, charset, _kind, format) => { - if (str2.length === 0) { - return str2; - } - let string2 = str2; - if (typeof str2 === "symbol") { - string2 = Symbol.prototype.toString.call(str2); - } else if (typeof str2 !== "string") { - string2 = String(str2); - } - if (charset === "iso-8859-1") { - return escape(string2).replace(/%u[0-9a-f]{4}/gi, function($0) { - return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; - }); - } - let out = ""; - for (let j = 0; j < string2.length; j += limit2) { - const segment = string2.length >= limit2 ? string2.slice(j, j + limit2) : string2; - const arr2 = []; - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if (c === 45 || // - - c === 46 || // . - c === 95 || // _ - c === 126 || // ~ - c >= 48 && c <= 57 || // 0-9 - c >= 65 && c <= 90 || // a-z - c >= 97 && c <= 122 || // A-Z - format === RFC17382 && (c === 40 || c === 41)) { - arr2[arr2.length] = segment.charAt(i); - continue; - } - if (c < 128) { - arr2[arr2.length] = hex_table2[c]; - continue; - } - if (c < 2048) { - arr2[arr2.length] = hex_table2[192 | c >> 6] + hex_table2[128 | c & 63]; - continue; - } - if (c < 55296 || c >= 57344) { - arr2[arr2.length] = hex_table2[224 | c >> 12] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; - continue; - } - i += 1; - c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); - arr2[arr2.length] = hex_table2[240 | c >> 18] + hex_table2[128 | c >> 12 & 63] + hex_table2[128 | c >> 6 & 63] + hex_table2[128 | c & 63]; - } - out += arr2.join(""); - } - return out; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs -function is_non_nullish_primitive2(v) { - return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; -} -function inner_stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder3, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { - let obj2 = object; - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel2)) !== void 0 && !find_flag) { - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== "undefined") { - if (pos === step) { - throw new RangeError("Cyclic object value"); - } else { - find_flag = true; - } - } - if (typeof tmp_sc.get(sentinel2) === "undefined") { - step = 0; - } - } - if (typeof filter === "function") { - obj2 = filter(prefix, obj2); - } else if (obj2 instanceof Date) { - obj2 = serializeDate?.(obj2); - } else if (generateArrayPrefix === "comma" && isArray2(obj2)) { - obj2 = maybe_map2(obj2, function(value) { - if (value instanceof Date) { - return serializeDate?.(value); - } - return value; - }); - } - if (obj2 === null) { - if (strictNullHandling) { - return encoder3 && !encodeValuesOnly ? ( - // @ts-expect-error - encoder3(prefix, defaults2.encoder, charset, "key", format) - ) : prefix; - } - obj2 = ""; - } - if (is_non_nullish_primitive2(obj2) || is_buffer2(obj2)) { - if (encoder3) { - const key_value = encodeValuesOnly ? prefix : encoder3(prefix, defaults2.encoder, charset, "key", format); - return [ - formatter?.(key_value) + "=" + // @ts-expect-error - formatter?.(encoder3(obj2, defaults2.encoder, charset, "value", format)) - ]; - } - return [formatter?.(prefix) + "=" + formatter?.(String(obj2))]; - } - const values = []; - if (typeof obj2 === "undefined") { - return values; - } - let obj_keys; - if (generateArrayPrefix === "comma" && isArray2(obj2)) { - if (encodeValuesOnly && encoder3) { - obj2 = maybe_map2(obj2, encoder3); - } - obj_keys = [{ value: obj2.length > 0 ? obj2.join(",") || null : void 0 }]; - } else if (isArray2(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj2); - obj_keys = sort ? keys.sort(sort) : keys; - } - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix); - const adjusted_prefix = commaRoundTrip && isArray2(obj2) && obj2.length === 1 ? encoded_prefix + "[]" : encoded_prefix; - if (allowEmptyArrays && isArray2(obj2) && obj2.length === 0) { - return adjusted_prefix + "[]"; - } - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value = ( - // @ts-ignore - typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj2[key] - ); - if (skipNulls && value === null) { - continue; - } - const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; - const key_prefix = isArray2(obj2) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); - sideChannel.set(object, step); - const valueSideChannel = /* @__PURE__ */ new WeakMap(); - valueSideChannel.set(sentinel2, sideChannel); - push_to_array3(values, inner_stringify2( - value, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj2) ? null : encoder3, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - return values; -} -function normalize_stringify_options2(opts = defaults2) { - if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - } - if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { - throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); - } - if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { - throw new TypeError("Encoder has to be a function."); - } - const charset = opts.charset || defaults2.charset; - if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - } - let format = default_format2; - if (typeof opts.format !== "undefined") { - if (!has2(formatters2, opts.format)) { - throw new TypeError("Unknown format option provided."); - } - format = opts.format; - } - const formatter = formatters2[format]; - let filter = defaults2.filter; - if (typeof opts.filter === "function" || isArray2(opts.filter)) { - filter = opts.filter; - } - let arrayFormat; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators2) { - arrayFormat = opts.arrayFormat; - } else if ("indices" in opts) { - arrayFormat = opts.indices ? "indices" : "repeat"; - } else { - arrayFormat = defaults2.arrayFormat; - } - if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { - throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); - } - const allowDots = typeof opts.allowDots === "undefined" ? !!opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; - return { - addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, - // @ts-ignore - allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, - arrayFormat, - charset, - charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, - encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, - encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, - filter, - format, - formatter, - serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, - skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, - // @ts-ignore - sort: typeof opts.sort === "function" ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling - }; -} -function stringify2(object, opts = {}) { - let obj2 = object; - const options = normalize_stringify_options2(opts); - let obj_keys; - let filter; - if (typeof options.filter === "function") { - filter = options.filter; - obj2 = filter("", obj2); - } else if (isArray2(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - const keys = []; - if (typeof obj2 !== "object" || obj2 === null) { - return ""; - } - const generateArrayPrefix = array_prefix_generators2[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; - if (!obj_keys) { - obj_keys = Object.keys(obj2); - } - if (options.sort) { - obj_keys.sort(options.sort); - } - const sideChannel = /* @__PURE__ */ new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]; - if (options.skipNulls && obj2[key] === null) { - continue; - } - push_to_array3(keys, inner_stringify2( - obj2[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? "?" : ""; - if (options.charsetSentinel) { - if (options.charset === "iso-8859-1") { - prefix += "utf8=%26%2310003%3B&"; - } else { - prefix += "utf8=%E2%9C%93&"; - } - } - return joined.length > 0 ? prefix + joined : ""; -} -var array_prefix_generators2, push_to_array3, toISOString2, defaults2, sentinel2; -var init_stringify2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs"() { - init_utils3(); - init_formats2(); - init_values2(); - array_prefix_generators2 = { - brackets(prefix) { - return String(prefix) + "[]"; - }, - comma: "comma", - indices(prefix, key) { - return String(prefix) + "[" + key + "]"; - }, - repeat(prefix) { - return String(prefix); - } - }; - push_to_array3 = function(arr2, value_or_array) { - Array.prototype.push.apply(arr2, isArray2(value_or_array) ? value_or_array : [value_or_array]); - }; - defaults2 = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: "indices", - charset: "utf-8", - charsetSentinel: false, - delimiter: "&", - encode: true, - encodeDotInKeys: false, - encoder: encode2, - encodeValuesOnly: false, - format: default_format2, - formatter: default_formatter2, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString2 ?? (toISOString2 = Function.prototype.call.bind(Date.prototype.toISOString)))(date); - }, - skipNulls: false, - strictNullHandling: false - }; - sentinel2 = {}; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/query.mjs -function stringifyQuery2(query) { - return stringify2(query, { arrayFormat: "brackets" }); -} -var init_query2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/query.mjs"() { - init_stringify2(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/node.browser.mjs -var node_browser_exports = {}; -__export(node_browser_exports, { - child_process: () => child_process, - crypto: () => crypto2, - fs: () => fs, - os: () => os, - path: () => path2, - stream: () => stream2, - util: () => util -}); -function unavailable(module) { - return new Proxy({}, { - get(_target, property) { - if (typeof property === "symbol") - return void 0; - throw new AnthropicError(`\`${module}.${property}\` is not available in this environment; it needs a Node.js-compatible runtime`); - } - }); -} -var child_process, crypto2, fs, os, path2, stream2, util; -var init_node_browser = __esm({ - "node_modules/@anthropic-ai/sdk/internal/node.browser.mjs"() { - init_error3(); - child_process = /* @__PURE__ */ unavailable("child_process"); - crypto2 = /* @__PURE__ */ unavailable("crypto"); - fs = /* @__PURE__ */ unavailable("fs"); - os = /* @__PURE__ */ unavailable("os"); - path2 = /* @__PURE__ */ unavailable("path"); - stream2 = /* @__PURE__ */ unavailable("stream"); - util = /* @__PURE__ */ unavailable("util"); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs -function requireSecureTokenEndpoint(baseURL) { - if (!baseURL) - return; - let u; - try { - u = new URL(baseURL); - } catch (err) { - throw new WorkloadIdentityError(`Invalid token endpoint base URL "${baseURL}": ${err}`); - } - if (u.protocol === "https:") - return; - const host = u.hostname.toLowerCase().replace(/^\[|\]$/g, ""); - if (u.protocol === "http:" && (host === "localhost" || host === "127.0.0.1" || host === "::1")) { - return; - } - throw new WorkloadIdentityError(`Refusing to send credential over non-https token endpoint "${baseURL}"`); -} -async function parseTokenResponse(resp, requestId) { - const text = await readLimitedText(resp); - let data; - try { - data = JSON.parse(text); - } catch { - throw new WorkloadIdentityError(`Token endpoint returned non-JSON response (status ${resp.status})`, resp.status, redactSensitive(text), requestId); - } - if (!data.access_token) { - throw new WorkloadIdentityError(`Token endpoint response missing access_token: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - if (data.token_type && data.token_type.toLowerCase() !== "bearer") { - throw new WorkloadIdentityError(`Token endpoint response: unsupported token_type "${data.token_type}" (want Bearer)`, resp.status, redactSensitive(data), requestId); - } - return data; -} -function redactSensitive(body) { - if (body == null) - return body; - if (typeof body === "string") { - let parsed; - try { - parsed = JSON.parse(body); - } catch { - if (body.length <= MAX_ERROR_BODY_CHARS) - return body; - return body.slice(0, MAX_ERROR_BODY_CHARS) + `... <${body.length - MAX_ERROR_BODY_CHARS} more chars>`; - } - return JSON.stringify(redactSensitive(parsed)); - } - if (typeof body === "object" && !Array.isArray(body)) { - const out = {}; - for (const [k, v] of Object.entries(body)) { - if (SAFE_ERROR_KEYS.has(k)) - out[k] = v; - } - return out; - } - return null; -} -async function checkCredentialsFileSafety(path4, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) { - if (typeof process === "undefined" || process.platform === "win32") - return; - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - let resolved = path4; - let st; - try { - resolved = await fs3.promises.realpath(path4); - st = await fs3.promises.stat(resolved); - } catch { - return; - } - const mode = st.mode & 511; - if (mode & 18) { - throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-writable (mode 0o${mode.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${resolved}\`.`); - } - if (mode & 36) { - throw new WorkloadIdentityError(`Credentials file at ${resolved} is group/world-readable (mode 0o${mode.toString(8)}); run \`chmod 600 ${resolved}\` before retrying.`); - } - if (typeof process.getuid === "function" && st.uid !== process.getuid()) { - onWarn(`credentials file at ${resolved} is owned by uid ${st.uid} (current process uid ${process.getuid()}); verify this is intentional.`); - } -} -async function writeCredentialsFileAtomic(targetPath, data) { - const { fs: fs3, path: path4 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const dir = path4.dirname(targetPath); - await fs3.promises.mkdir(dir, { recursive: true, mode: 448 }); - const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`; - try { - const fh = await fs3.promises.open(tmpPath, "w", 384); - try { - await fh.writeFile(JSON.stringify(data, null, 2)); - await fh.sync(); - } finally { - await fh.close(); - } - await fs3.promises.rename(tmpPath, targetPath); - } catch (err) { - await fs3.promises.unlink(tmpPath).catch(() => { - }); - throw err; - } - try { - const dirFh = await fs3.promises.open(dir, "r"); - try { - await dirFh.sync(); - } finally { - await dirFh.close(); - } - } catch { - } -} -async function readLimitedText(resp) { - if (!resp.body) { - return ""; - } - const reader = resp.body.getReader(); - const chunks = []; - let received = 0; - for (; ; ) { - const { done, value } = await reader.read(); - if (done) - break; - if (received + value.length > MAX_TOKEN_RESPONSE_BYTES) { - const remaining = MAX_TOKEN_RESPONSE_BYTES - received; - if (remaining > 0) - chunks.push(value.subarray(0, remaining)); - await reader.cancel(); - break; - } - chunks.push(value); - received += value.length; - } - let merged; - if (chunks.length === 1) { - merged = chunks[0]; - } else { - merged = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0)); - let offset = 0; - for (const c of chunks) { - merged.set(c, offset); - offset += c.length; - } - } - return new TextDecoder("utf-8").decode(merged); -} -var GRANT_TYPE_JWT_BEARER, GRANT_TYPE_REFRESH_TOKEN, TOKEN_ENDPOINT, OAUTH_API_BETA_HEADER, FEDERATION_BETA_HEADER, ADVISORY_REFRESH_THRESHOLD_IN_SECONDS, MANDATORY_REFRESH_THRESHOLD_IN_SECONDS, ADVISORY_REFRESH_BACKOFF_IN_SECONDS, MAX_TOKEN_RESPONSE_BYTES, MAX_ERROR_BODY_CHARS, SAFE_ERROR_KEYS, WorkloadIdentityError; -var init_types = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs"() { - init_error3(); - GRANT_TYPE_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer"; - GRANT_TYPE_REFRESH_TOKEN = "refresh_token"; - TOKEN_ENDPOINT = "/v1/oauth/token"; - OAUTH_API_BETA_HEADER = "oauth-2025-04-20"; - FEDERATION_BETA_HEADER = "oidc-federation-2026-04-01"; - ADVISORY_REFRESH_THRESHOLD_IN_SECONDS = 120; - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS = 30; - ADVISORY_REFRESH_BACKOFF_IN_SECONDS = 5; - MAX_TOKEN_RESPONSE_BYTES = 1 << 20; - MAX_ERROR_BODY_CHARS = 2e3; - SAFE_ERROR_KEYS = /* @__PURE__ */ new Set(["error", "error_description", "error_uri"]); - WorkloadIdentityError = class extends AnthropicError { - constructor(message, statusCode = null, body = null, requestId = null) { - super(message); - this.statusCode = statusCode; - this.body = body; - this.requestId = requestId; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/time.mjs -function nowAsSeconds() { - return Math.floor(Date.now() / 1e3); -} -var init_time = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/time.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs -var TokenCache; -var init_token_cache = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs"() { - init_types(); - init_time(); - TokenCache = class { - constructor(provider2, onAdvisoryRefreshError) { - this.cached = null; - this.pendingRefresh = null; - this.nextForce = false; - this.lastAdvisoryError = 0; - this.provider = provider2; - this.onAdvisoryRefreshError = onAdvisoryRefreshError; - } - async getToken() { - const force = this.nextForce; - this.nextForce = false; - const cached = this.cached; - if (force || cached == null) { - const token2 = await this.refresh(force); - return token2.token; - } - if (cached.expiresAt == null) { - return cached.token; - } - const remaining = cached.expiresAt - nowAsSeconds(); - if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) { - return cached.token; - } - if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { - this.backgroundRefresh(); - return cached.token; - } - const token = await this.refresh(); - return token.token; - } - /** - * Clears the cached token and marks the next {@link getToken} as a forced - * refresh, so the underlying provider bypasses any on-disk freshness check. - * Called after a 401 — the server has just told us the token is bad even - * if its `expires_at` still looks fresh. - */ - invalidate() { - this.cached = null; - this.nextForce = true; - } - /** - * Mandatory refresh. Joins any in-flight refresh unless forced — a forced - * refresh must not coalesce into a non-forced one that may re-serve the - * same stale disk token. - */ - refresh(force = false) { - if (this.pendingRefresh && !force) { - return this.pendingRefresh; - } - return this.doRefresh(force); - } - /** - * Advisory background refresh. Shares the same in-flight promise as - * mandatory refreshes for deduplication, but swallows errors so the - * stale cached token keeps being served. Backs off for - * {@link ADVISORY_REFRESH_BACKOFF_IN_SECONDS} after a failure so an - * outage during the advisory window doesn't hammer the token endpoint. - */ - backgroundRefresh() { - if (this.pendingRefresh) { - return; - } - if (nowAsSeconds() - this.lastAdvisoryError < ADVISORY_REFRESH_BACKOFF_IN_SECONDS) { - return; - } - this.doRefresh().catch((err) => { - this.lastAdvisoryError = nowAsSeconds(); - this.onAdvisoryRefreshError?.(err); - }); - } - /** - * Core refresh. Sets {@link pendingRefresh} so concurrent callers - * (both advisory and mandatory) coalesce into a single provider call. - */ - doRefresh(force = false) { - this.pendingRefresh = this.provider(force ? { forceRefresh: true } : void 0).then((token) => { - this.cached = token; - this.pendingRefresh = null; - return token; - }, (err) => { - this.pendingRefresh = null; - throw err; - }); - return this.pendingRefresh; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/env.mjs -var readEnv2; -var init_env2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/env.mjs"() { - readEnv2 = (env) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env]?.trim() || void 0; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env)?.trim() || void 0; - } - return void 0; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs -function concatBytes(buffers) { - let length = 0; - for (const buffer of buffers) { - length += buffer.length; - } - const output = new Uint8Array(length); - let index = 0; - for (const buffer of buffers) { - output.set(buffer, index); - index += buffer.length; - } - return output; -} -function encodeUTF82(str2) { - let encoder3; - return (encodeUTF8_2 ?? (encoder3 = new globalThis.TextEncoder(), encodeUTF8_2 = encoder3.encode.bind(encoder3)))(str2); -} -function decodeUTF82(bytes2) { - let decoder3; - return (decodeUTF8_2 ?? (decoder3 = new globalThis.TextDecoder(), decodeUTF8_2 = decoder3.decode.bind(decoder3)))(bytes2); -} -var encodeUTF8_2, decodeUTF8_2; -var init_bytes2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs -var fromBase642; -var init_base642 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs"() { - init_error3(); - fromBase642 = (str2) => { - if (typeof globalThis.Buffer !== "undefined") { - const buf = globalThis.Buffer.from(str2, "base64"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - if (typeof atob !== "undefined") { - const bstr = atob(str2); - const buf = new Uint8Array(bstr.length); - for (let i = 0; i < bstr.length; i++) { - buf[i] = bstr.charCodeAt(i); - } - return buf; - } - throw new AnthropicError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined"); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/log.mjs -function noop2() { -} -function makeLogFn2(fnLevel, logger, logLevel) { - if (!logger || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) { - return noop2; - } else { - return logger[fnLevel].bind(logger); - } -} -function filterLogger(logger, logLevel) { - const cachedLogger = cachedLoggers2.get(logger); - if (cachedLogger && cachedLogger[0] === logLevel) { - return cachedLogger[1]; - } - const levelLogger = { - error: makeLogFn2("error", logger, logLevel), - warn: makeLogFn2("warn", logger, logLevel), - info: makeLogFn2("info", logger, logLevel), - debug: makeLogFn2("debug", logger, logLevel) - }; - cachedLoggers2.set(logger, [logLevel, levelLogger]); - return levelLogger; -} -function loggerFor2(client) { - const logger = client.logger; - const logLevel = client.logLevel ?? "off"; - if (!logger) { - return noopLogger2; - } - return filterLogger(logger, logLevel); -} -function defaultLogger() { - const envLevel = readEnv2("ANTHROPIC_LOG"); - if (!cachedDefaultLogger || envLevel !== lastEnvLevel) { - lastEnvLevel = envLevel; - cachedDefaultLogger = filterLogger(console, parseLogLevel2(envLevel, "process.env['ANTHROPIC_LOG']", filterLogger(console, defaultLogLevel)) ?? defaultLogLevel); - } - return cachedDefaultLogger; -} -function debugLogRequestDetails(logger, message, details) { - if (logger.debug === noop2) { - return; - } - logger.debug(message, formatRequestDetails2(details)); -} -var defaultLogLevel, levelNumbers2, parseLogLevel2, noopLogger2, cachedLoggers2, lastEnvLevel, cachedDefaultLogger, formatRequestDetails2; -var init_log2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/log.mjs"() { - init_values2(); - init_env2(); - defaultLogLevel = "warn"; - levelNumbers2 = { - off: 0, - error: 200, - warn: 300, - info: 400, - debug: 500 - }; - parseLogLevel2 = (maybeLevel, sourceName, logger) => { - if (!maybeLevel) { - return void 0; - } - if (hasOwn2(levelNumbers2, maybeLevel)) { - return maybeLevel; - } - logger.warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers2))}`); - return void 0; - }; - noopLogger2 = { - error: noop2, - warn: noop2, - info: noop2, - debug: noop2 - }; - cachedLoggers2 = /* @__PURE__ */ new WeakMap(); - formatRequestDetails2 = (details) => { - if (details.options) { - details.options = { ...details.options }; - delete details.options["headers"]; - } - if (details.headers) { - details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [ - name, - name.toLowerCase() === "authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value - ])); - } - if ("retryOfRequestLogID" in details) { - if (details.retryOfRequestLogID) { - details.retryOf = details.retryOfRequestLogID; - } - delete details.retryOfRequestLogID; - } - return details; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs -var uuid42; -var init_uuid2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs"() { - uuid42 = function() { - const { crypto: crypto3 } = globalThis; - if (crypto3?.randomUUID) { - uuid42 = crypto3.randomUUID.bind(crypto3); - return crypto3.randomUUID(); - } - const u8 = new Uint8Array(1); - const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; - return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16)); - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils.mjs -var init_utils4 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils.mjs"() { - init_values2(); - init_base642(); - init_env2(); - init_log2(); - init_uuid2(); - init_sleep2(); - init_query2(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/credentials.mjs -function validateProfileName(name) { - if (!name) { - throw new Error("profile name is empty"); - } - if (name === "." || name === "..") { - throw new Error(`profile name "${name}" is not allowed`); - } - if (name.includes("/") || name.includes("\\")) { - throw new Error(`profile name "${name}" must not contain path separators`); - } - if (!PROFILE_NAME_PATTERN.test(name)) { - throw new Error(`profile name "${name}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`); - } -} -var CREDENTIALS_FILE_VERSION, PROFILE_NAME_PATTERN, loadConfigWithSource, getCredentialsPath, getRootConfigPath, supportsLocalConfigFiles, getActiveProfileName; -var init_credentials2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/credentials.mjs"() { - init_detect_platform2(); - init_utils4(); - CREDENTIALS_FILE_VERSION = "1.0"; - PROFILE_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/; - loadConfigWithSource = async (profile) => { - var _a6, _b; - const rootConfigPath = await getRootConfigPath(); - if (rootConfigPath === null) { - return null; - } - const profileName = profile ?? await getActiveProfileName(); - if (profileName === null) { - return null; - } - validateProfileName(profileName); - const { fs: fs3, path: path4 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const configPath = path4.join(rootConfigPath, "configs", `${profileName}.json`); - let configRaw; - try { - configRaw = await fs3.promises.readFile(configPath, "utf-8"); - } catch (err) { - if (err?.code !== "ENOENT") { - throw new Error(`failed to read config file ${configPath}: ${err}`); - } - configRaw = null; - } - if (configRaw === null) { - const organizationId = readEnv2("ANTHROPIC_ORGANIZATION_ID"); - const identityTokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - const federationRuleId = readEnv2("ANTHROPIC_FEDERATION_RULE_ID"); - if (federationRuleId && organizationId) { - return { - fromFile: false, - config: { - organization_id: organizationId, - // A defaulted-but-empty CI variable (`ANTHROPIC_WORKSPACE_ID=""`) is - // treated as unset — readEnv coerces empty to undefined, and the body - // builder's truthy check skips it — so `"workspace_id": ""` never goes - // on the wire. - workspace_id: readEnv2("ANTHROPIC_WORKSPACE_ID"), - base_url: readEnv2("ANTHROPIC_BASE_URL"), - authentication: { - type: "oidc_federation", - federation_rule_id: federationRuleId, - service_account_id: readEnv2("ANTHROPIC_SERVICE_ACCOUNT_ID"), - identity_token: identityTokenFile ? { source: "file", path: identityTokenFile } : void 0, - scope: readEnv2("ANTHROPIC_SCOPE") - } - } - }; - } - return null; - } - let config; - try { - config = JSON.parse(configRaw); - } catch (err) { - throw new Error(`failed to parse config file ${configPath}: ${err}`); - } - if (!config.authentication) { - throw new Error(`config file ${configPath} is missing "authentication"`); - } - const authType = config.authentication.type; - if (authType !== "oidc_federation" && authType !== "user_oauth") { - throw new Error(`authentication.type "${authType}" is not a known authentication type`); - } - config.organization_id ?? (config.organization_id = readEnv2("ANTHROPIC_ORGANIZATION_ID")); - config.workspace_id ?? (config.workspace_id = readEnv2("ANTHROPIC_WORKSPACE_ID")); - config.base_url ?? (config.base_url = readEnv2("ANTHROPIC_BASE_URL")); - (_a6 = config.authentication).scope ?? (_a6.scope = readEnv2("ANTHROPIC_SCOPE")); - if (config.authentication.type === "oidc_federation") { - if (!config.authentication.identity_token) { - const identityTokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - if (identityTokenFile) { - config.authentication.identity_token = { - source: "file", - path: identityTokenFile - }; - } - } - if (!config.authentication.federation_rule_id) { - config.authentication.federation_rule_id = readEnv2("ANTHROPIC_FEDERATION_RULE_ID") ?? ""; - } - (_b = config.authentication).service_account_id ?? (_b.service_account_id = readEnv2("ANTHROPIC_SERVICE_ACCOUNT_ID")); - } - return { config, fromFile: true }; - }; - getCredentialsPath = async (config, profile) => { - if (config?.authentication.credentials_path) { - return config.authentication.credentials_path; - } - const rootConfigPath = await getRootConfigPath(); - if (!rootConfigPath) { - return null; - } - const profileName = profile ?? await getActiveProfileName(); - if (!profileName) { - return null; - } - validateProfileName(profileName); - const { path: path4 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - return path4.join(rootConfigPath, "credentials", `${profileName}.json`); - }; - getRootConfigPath = async () => { - if (!supportsLocalConfigFiles()) { - return null; - } - const { path: path4 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const configDir = readEnv2("ANTHROPIC_CONFIG_DIR"); - if (configDir) { - return configDir; - } - const os2 = getPlatformHeaders2()["X-Stainless-OS"]; - if (os2 === "Windows") { - const appData = readEnv2("APPDATA"); - if (appData) { - return path4.join(appData, "Anthropic"); - } - const userProfile = readEnv2("USERPROFILE"); - if (userProfile) { - return path4.join(userProfile, "AppData", "Roaming", "Anthropic"); - } - return null; - } - const xdgConfigHome = readEnv2("XDG_CONFIG_HOME"); - if (xdgConfigHome) { - return path4.join(xdgConfigHome, "anthropic"); - } - const home = readEnv2("HOME"); - if (home) { - return path4.join(home, ".config", "anthropic"); - } - return null; - }; - supportsLocalConfigFiles = () => { - const runtime = getPlatformHeaders2()["X-Stainless-Runtime"]; - return runtime === "node" || runtime === "deno"; - }; - getActiveProfileName = async () => { - const rootConfigPath = await getRootConfigPath(); - if (!rootConfigPath) { - return null; - } - const profileName = readEnv2("ANTHROPIC_PROFILE"); - if (profileName) { - return profileName; - } - const { fs: fs3, path: path4 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - const filePath = path4.join(rootConfigPath, "active_config"); - try { - return (await fs3.promises.readFile(filePath, "utf-8")).trim() || "default"; - } catch (err) { - if (err?.code !== "ENOENT") { - throw new Error(`failed to read ${filePath}: ${err}`); - } - return "default"; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs -function identityTokenFromFile(path4) { - if (!path4) { - throw new AnthropicError("Identity token file path is empty"); - } - return async () => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - let content; - try { - content = await fs3.promises.readFile(path4, "utf-8"); - } catch (err) { - throw new AnthropicError(`Failed to read identity token file at ${path4}: ${err}`); - } - const token = content.trim(); - if (!token) { - throw new AnthropicError(`Identity token file at ${path4} is empty`); - } - return token; - }; -} -function identityTokenFromValue(token) { - if (!token) { - throw new AnthropicError("Identity token value is empty"); - } - return () => token; -} -var init_identity_token = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs -function oidcFederationProvider(config) { - return async () => { - requireSecureTokenEndpoint(config.baseURL); - const jwt = await config.identityTokenProvider(); - if (jwt.length > 16 * 1024) { - throw new WorkloadIdentityError(`Identity token is ${Math.ceil(jwt.length / 1024)} KiB, exceeds the 16 KiB assertion limit`); - } - const body = { - grant_type: GRANT_TYPE_JWT_BEARER, - assertion: jwt, - federation_rule_id: config.federationRuleId, - organization_id: config.organizationId - }; - if (config.serviceAccountId) { - body["service_account_id"] = config.serviceAccountId; - } - if (config.workspaceId) { - body["workspace_id"] = config.workspaceId; - } - const url = `${config.baseURL}${TOKEN_ENDPOINT}`; - let resp; - try { - resp = await config.fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "anthropic-beta": `${OAUTH_API_BETA_HEADER},${FEDERATION_BETA_HEADER}`, - "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION2} oidcFederationProvider` - }, - body: JSON.stringify(body) - }); - } catch (err) { - throw new WorkloadIdentityError(`Failed to reach token endpoint ${url}: ${err}`); - } - const requestId = resp.headers.get("Request-Id"); - if (!resp.ok) { - const text = await resp.text().catch(() => ""); - const redacted = redactSensitive(text); - let hint = ""; - if (resp.status === 401) { - const hintMiddle = config.workspaceId ? "" : "If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "; - hint = ` Ensure your federation rule matches your identity token. ${hintMiddle}View your authentication events in the Workload identity page of Claude Console for more details.`; - } - throw new WorkloadIdentityError(`Token exchange failed with status ${resp.status}${requestId ? ` (request-id ${requestId})` : ""}: ${redacted}${hint}`, resp.status, redacted, requestId); - } - const data = await parseTokenResponse(resp, requestId); - const expiresIn = Number(data.expires_in); - if (!Number.isFinite(expiresIn)) { - throw new WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - return { - token: data.access_token, - expiresAt: nowAsSeconds() + expiresIn - }; - }; -} -var init_oidc_federation = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs"() { - init_types(); - init_time(); - init_version3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs -function userOAuthProvider(config) { - return async (opts) => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning); - let raw; - try { - raw = await fs3.promises.readFile(config.credentialsPath, "utf-8"); - } catch (err) { - throw new WorkloadIdentityError(`Credentials file not found at ${config.credentialsPath}: ${err}`); - } - let creds; - try { - creds = JSON.parse(raw); - } catch (err) { - throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} is not valid JSON: ${err}`); - } - const accessToken = creds.access_token; - if (!accessToken) { - throw new WorkloadIdentityError(`Credentials file at ${config.credentialsPath} must include 'access_token'`); - } - const expiresAt = creds.expires_at; - if (!opts?.forceRefresh && (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS)) { - return { token: accessToken, expiresAt: expiresAt ?? null }; - } - const refreshToken = creds.refresh_token; - if (!config.clientId || !refreshToken) { - throw new WorkloadIdentityError(`Access token at ${config.credentialsPath} has expired and no refresh is available (client_id ${config.clientId ? "set" : "empty"}, refresh_token ${refreshToken ? "set" : "empty"})`); - } - requireSecureTokenEndpoint(config.baseURL); - const body = { - grant_type: GRANT_TYPE_REFRESH_TOKEN, - refresh_token: refreshToken, - client_id: config.clientId - }; - const url = `${config.baseURL}${TOKEN_ENDPOINT}`; - let resp; - try { - resp = await config.fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "anthropic-beta": OAUTH_API_BETA_HEADER, - "User-Agent": config.userAgent || `anthropic-sdk-typescript/${VERSION2} userOAuthProvider` - }, - body: JSON.stringify(body) - }); - } catch (err) { - throw new WorkloadIdentityError(`User OAuth refresh failed to reach token endpoint: ${err}`); - } - const requestId = resp.headers.get("Request-Id"); - if (!resp.ok) { - const text = await resp.text().catch(() => ""); - throw new WorkloadIdentityError(`User OAuth refresh failed (HTTP ${resp.status}): ${redactSensitive(text)}`, resp.status, redactSensitive(text), requestId); - } - const data = await parseTokenResponse(resp, requestId); - const expiresIn = Number(data.expires_in); - if (!Number.isFinite(expiresIn)) { - throw new WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(redactSensitive(data))}`, resp.status, redactSensitive(data), requestId); - } - const newExpiresAt = nowAsSeconds() + expiresIn; - const newRefreshToken = data.refresh_token || refreshToken; - await writeCredentialsFileAtomic(config.credentialsPath, { - ...creds, - version: CREDENTIALS_FILE_VERSION, - type: "oauth_token", - access_token: data.access_token, - expires_at: newExpiresAt, - refresh_token: newRefreshToken - }); - return { token: data.access_token, expiresAt: newExpiresAt }; - }; -} -var init_user_oauth = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs"() { - init_credentials2(); - init_types(); - init_time(); - init_version3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs -function resolveCredentialsFromConfig(config, options) { - const credentialsPath = config.authentication.credentials_path ?? null; - const effectiveBaseURL = (config.base_url || options.baseURL).replace(/\/+$/, ""); - const provider2 = buildProvider(config, credentialsPath, effectiveBaseURL, options); - const extraHeaders = {}; - if (config.workspace_id && config.authentication.type === "user_oauth") { - extraHeaders["anthropic-workspace-id"] = config.workspace_id; - } - return { provider: provider2, extraHeaders, baseURL: config.base_url || void 0 }; -} -async function defaultCredentials(options, profile) { - const loaded = await loadConfigWithSource(profile); - if (!loaded) { - return null; - } - const { config, fromFile } = loaded; - const withPath = config.authentication.credentials_path || !fromFile ? config : { - ...config, - authentication: { - ...config.authentication, - credentials_path: await getCredentialsPath(config, profile) ?? void 0 - } - }; - return resolveCredentialsFromConfig(withPath, options); -} -function buildProvider(config, credentialsPath, baseURL, options) { - switch (config.authentication.type) { - case "oidc_federation": { - const auth2 = config.authentication; - const identityProvider = resolveIdentityTokenProvider(auth2); - if (!identityProvider) { - throw new WorkloadIdentityError("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)"); - } - if (!auth2.federation_rule_id) { - throw new WorkloadIdentityError("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence)."); - } - if (!config.organization_id) { - throw new WorkloadIdentityError("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)"); - } - const exchange = oidcFederationProvider({ - identityTokenProvider: identityProvider, - federationRuleId: auth2.federation_rule_id, - organizationId: config.organization_id, - serviceAccountId: auth2.service_account_id, - workspaceId: config.workspace_id, - baseURL, - fetch: options.fetch, - userAgent: options.userAgent - }); - if (credentialsPath) { - return cachedExchangeProvider(exchange, credentialsPath, options.onCacheWriteError, options.onSafetyWarning); - } - return exchange; - } - case "user_oauth": { - if (!credentialsPath) { - throw new WorkloadIdentityError("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)"); - } - return userOAuthProvider({ - credentialsPath, - clientId: config.authentication.client_id, - baseURL, - fetch: options.fetch, - userAgent: options.userAgent, - onSafetyWarning: options.onSafetyWarning - }); - } - default: { - const t = config.authentication.type; - throw new WorkloadIdentityError(`authentication.type "${t}" is not a known authentication type`); - } - } -} -function resolveIdentityTokenProvider(auth2) { - if (auth2.identity_token) { - const source = auth2.identity_token.source; - if (source !== "file") { - throw new WorkloadIdentityError(`identity_token.source "${source}" is not supported by this SDK version (only "file")`); - } - if (!auth2.identity_token.path) { - throw new WorkloadIdentityError(`identity_token.source "file" requires a non-empty path`); - } - return identityTokenFromFile(auth2.identity_token.path); - } - const tokenFile = readEnv2("ANTHROPIC_IDENTITY_TOKEN_FILE"); - if (tokenFile) { - return identityTokenFromFile(tokenFile); - } - const tokenValue = readEnv2("ANTHROPIC_IDENTITY_TOKEN"); - if (tokenValue) { - return identityTokenFromValue(tokenValue); - } - return null; -} -function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) { - return async (opts) => { - const { fs: fs3 } = await Promise.resolve().then(() => (init_node_browser(), node_browser_exports)); - await checkCredentialsFileSafety(credentialsPath, onSafetyWarning); - let existing; - try { - const raw = await fs3.promises.readFile(credentialsPath, "utf-8"); - existing = JSON.parse(raw); - const token = existing?.["access_token"]; - if (token && !opts?.forceRefresh) { - const expiresAt = existing?.["expires_at"]; - if (expiresAt == null || nowAsSeconds() < expiresAt - MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) { - return { token, expiresAt: expiresAt ?? null }; - } - } - } catch (err) { - const code = err?.code; - if (code !== "ENOENT" && !(err instanceof SyntaxError)) { - onCacheWriteError?.(err); - } - } - const result = await exchange(opts); - try { - await writeCredentialsFileAtomic(credentialsPath, { - ...existing ?? {}, - version: CREDENTIALS_FILE_VERSION, - type: "oauth_token", - access_token: result.token, - expires_at: result.expiresAt - }); - } catch (err) { - onCacheWriteError?.(err); - } - return result; - }; -} -var init_credential_chain = __esm({ - "node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs"() { - init_env2(); - init_credentials2(); - init_types(); - init_time(); - init_identity_token(); - init_oidc_federation(); - init_user_oauth(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs -function findNewlineIndex2(buffer, startIndex) { - const newline = 10; - const carriage = 13; - for (let i = startIndex ?? 0; i < buffer.length; i++) { - if (buffer[i] === newline) { - return { preceding: i, index: i + 1, carriage: false }; - } - if (buffer[i] === carriage) { - return { preceding: i, index: i + 1, carriage: true }; - } - } - return null; -} -var _LineDecoder_buffer2, _LineDecoder_carriageReturnIndex, LineDecoder2; -var init_line2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs"() { - init_tslib2(); - init_bytes2(); - LineDecoder2 = /* @__PURE__ */ (() => { - class LineDecoder3 { - constructor() { - _LineDecoder_buffer2.set(this, void 0); - _LineDecoder_carriageReturnIndex.set(this, void 0); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array(), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - } - decode(chunk) { - if (chunk == null) { - return []; - } - const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? encodeUTF82(chunk) : chunk; - __classPrivateFieldSet2(this, _LineDecoder_buffer2, concatBytes([__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), binaryChunk]), "f"); - const lines = []; - let patternIndex; - while ((patternIndex = findNewlineIndex2(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { - if (patternIndex.carriage && __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") == null) { - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); - continue; - } - if (__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { - lines.push(decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") - 1))); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f")), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - continue; - } - const endIndex = __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; - const line = decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, endIndex)); - lines.push(line); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(patternIndex.index), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex, null, "f"); - } - return lines; - } - flush() { - if (!__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { - return []; - } - return this.decode("\n"); - } - } - _LineDecoder_buffer2 = /* @__PURE__ */ new WeakMap(), _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); - LineDecoder3.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); - LineDecoder3.NEWLINE_REGEXP = /\r\n|[\n\r]/g; - return LineDecoder3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/streaming.mjs -async function* _iterSSEMessages2(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); - } - throw new AnthropicError(`Attempted to iterate over a response with no body`); - } - const sseDecoder = new SSEDecoder2(); - const lineDecoder = new LineDecoder2(); - const iter = ReadableStreamToAsyncIterable2(response.body); - for await (const chunk of iter) { - for (const line of lineDecoder.decode(chunk)) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } - } - for (const line of lineDecoder.flush()) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } -} -function partition2(str2, delimiter) { - const index = str2.indexOf(delimiter); - if (index !== -1) { - return [str2.substring(0, index), delimiter, str2.substring(index + delimiter.length)]; - } - return [str2, "", ""]; -} -var _Stream_client2, Stream2, SSEDecoder2; -var init_streaming3 = __esm({ - "node_modules/@anthropic-ai/sdk/core/streaming.mjs"() { - init_tslib2(); - init_error3(); - init_shims2(); - init_line2(); - init_shims2(); - init_errors2(); - init_values2(); - init_bytes2(); - init_log2(); - init_error3(); - init_request_signal(); - Stream2 = /* @__PURE__ */ (() => { - class Stream3 { - constructor(iterator, controller, client) { - this.iterator = iterator; - _Stream_client2.set(this, void 0); - this.controller = controller; - __classPrivateFieldSet2(this, _Stream_client2, client, "f"); - } - /** - * Iterate the raw Server-Sent Events from `response` — `{event, data, raw}` - * objects, before any JSON parsing or event-name filtering. - * - * This reads `response.body` directly (not a clone), so the response is - * consumed. Use this in middleware that fully replaces the stream body; for - * read-only observation of parsed events, use `ctx.parse()` instead. - */ - static rawEvents(response, controller = new AbortController()) { - return _iterSSEMessages2(response, controller); - } - static fromSSEResponse(response, controller, client) { - let consumed = false; - const logger = client ? loggerFor2(client) : console; - async function* iterator() { - if (consumed) { - throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const sse of _iterSSEMessages2(response, controller)) { - if (sse.event === "completion") { - try { - yield JSON.parse(sse.data); - } catch (e) { - logger.error(`Could not parse message into JSON:`, sse.data); - logger.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop" || sse.event === "message" || sse.event === "user.message" || sse.event === "user.interrupt" || sse.event === "user.tool_confirmation" || sse.event === "user.custom_tool_result" || sse.event === "user.tool_result" || sse.event === "agent.message" || sse.event === "agent.thinking" || sse.event === "agent.tool_use" || sse.event === "agent.tool_result" || sse.event === "agent.mcp_tool_use" || sse.event === "agent.mcp_tool_result" || sse.event === "agent.custom_tool_use" || sse.event === "agent.thread_context_compacted" || sse.event === "session.status_running" || sse.event === "session.status_idle" || sse.event === "session.status_rescheduled" || sse.event === "session.status_terminated" || sse.event === "session.error" || sse.event === "session.deleted" || sse.event === "session.updated" || sse.event === "span.model_request_start" || sse.event === "span.model_request_end" || sse.event === "span.outcome_evaluation_start" || sse.event === "span.outcome_evaluation_ongoing" || sse.event === "span.outcome_evaluation_end" || sse.event === "user.define_outcome" || sse.event === "agent.thread_message_received" || sse.event === "agent.thread_message_sent" || sse.event === "agent.session_thread_message_received" || sse.event === "agent.session_thread_message_sent" || sse.event === "session.thread_created" || sse.event === "session.thread_status_created" || sse.event === "session.thread_status_running" || sse.event === "session.thread_status_idle" || sse.event === "session.thread_status_rescheduled" || sse.event === "session.thread_status_terminated" || sse.event === "event_start" || sse.event === "event_delta" || sse.event === "system.message") { - try { - yield JSON.parse(sse.data); - } catch (e) { - logger.error(`Could not parse message into JSON:`, sse.data); - logger.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "ping") { - continue; - } - if (sse.event === "error") { - const body = safeJSON2(sse.data) ?? sse.data; - const type = body?.error?.type; - throw new APIError2(void 0, body, void 0, response.headers, type); - } - } - done = true; - } catch (e) { - if (isAbortError2(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - releaseRequestSignal(controller); - } - } - return new Stream3(iterator, controller, client); - } - /** - * Generates a Stream from a newline-separated ReadableStream - * where each item is a JSON value. - */ - static fromReadableStream(readableStream, controller, client) { - let consumed = false; - async function* iterLines() { - const lineDecoder = new LineDecoder2(); - const iter = ReadableStreamToAsyncIterable2(readableStream); - for await (const chunk of iter) { - for (const line of lineDecoder.decode(chunk)) { - yield line; - } - } - for (const line of lineDecoder.flush()) { - yield line; - } - } - async function* iterator() { - if (consumed) { - throw new AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const line of iterLines()) { - if (done) - continue; - if (line) - yield JSON.parse(line); - } - done = true; - } catch (e) { - if (isAbortError2(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - releaseRequestSignal(controller); - } - } - return new Stream3(iterator, controller, client); - } - [(_Stream_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - return this.iterator(); - } - /** - * Splits the stream into two streams which can be - * independently read from at different speeds. - */ - tee() { - const left = []; - const right = []; - const iterator = this.iterator(); - const teeIterator = (queue) => { - return { - next: () => { - if (queue.length === 0) { - const result = iterator.next(); - left.push(result); - right.push(result); - } - return queue.shift(); - } - }; - }; - return [ - new Stream3(() => teeIterator(left), this.controller, __classPrivateFieldGet2(this, _Stream_client2, "f")), - new Stream3(() => teeIterator(right), this.controller, __classPrivateFieldGet2(this, _Stream_client2, "f")) - ]; - } - /** - * Converts this stream to a newline-separated ReadableStream of - * JSON stringified values in the stream - * which can be turned back into a Stream with `Stream.fromReadableStream()`. - */ - toReadableStream() { - const self = this; - let iter; - return makeReadableStream2({ - async start() { - iter = self[Symbol.asyncIterator](); - }, - async pull(ctrl) { - try { - const { value, done } = await iter.next(); - if (done) - return ctrl.close(); - const bytes2 = encodeUTF82(JSON.stringify(value) + "\n"); - ctrl.enqueue(bytes2); - } catch (err) { - ctrl.error(err); - } - }, - async cancel() { - await iter.return?.(); - } - }); - } - } - return Stream3; - })(); - SSEDecoder2 = class { - constructor() { - this.event = null; - this.data = []; - this.chunks = []; - } - decode(line) { - if (line.endsWith("\r")) { - line = line.substring(0, line.length - 1); - } - if (!line) { - if (!this.event && !this.data.length) - return null; - const sse = { - event: this.event, - data: this.data.join("\n"), - raw: this.chunks - }; - this.event = null; - this.data = []; - this.chunks = []; - return sse; - } - this.chunks.push(line); - if (line.startsWith(":")) { - return null; - } - let [fieldname, _, value] = partition2(line, ":"); - if (value.startsWith(" ")) { - value = value.substring(1); - } - if (fieldname === "event") { - this.event = value; - } else if (fieldname === "data") { - this.data.push(value); - } - return null; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/parse.mjs -async function defaultParseResponse2(client, props) { - const { response, requestLogID, retryOfRequestLogID, startTime } = props; - const body = await (async () => { - if (props.options.stream) { - loggerFor2(client).debug("response", response.status, response.url, response.headers, response.body); - return Stream2.fromSSEResponse(response, props.controller, client); - } - if (response.status === 204) { - return null; - } - if (props.options.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - const contentLength = response.headers.get("content-length"); - if (contentLength === "0") { - return void 0; - } - const json = await response.json(); - return addResponseIDs(json, response); - } - const text = await response.text(); - return text; - })().finally(() => { - if (!props.options.stream && !props.options.__binaryResponse) { - releaseRequestSignal(props.controller); - } - }); - debugLogRequestDetails(loggerFor2(client), `[${requestLogID}] response parsed`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - body, - durationMs: Date.now() - startTime - }); - return body; -} -function addResponseIDs(value, response) { - if (!value || typeof value !== "object" || Array.isArray(value)) { - return value; - } - return Object.defineProperties(value, { - _request_id: { value: response.headers.get("request-id"), enumerable: false }, - _workspace_id: { value: response.headers.get("anthropic-workspace-id"), enumerable: false } - }); -} -var init_parse2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/parse.mjs"() { - init_streaming3(); - init_log2(); - init_request_signal(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/middleware.mjs -function isFetchOriginError(err) { - return typeof err === "object" && err !== null && fetchOriginErrors.has(err); -} -function isRetryableError(err) { - const seen = /* @__PURE__ */ new Set(); - while (typeof err === "object" && err !== null && !seen.has(err)) { - seen.add(err); - if (isFetchOriginError(err) || isAbortError2(err) || err instanceof APIConnectionError2 || err instanceof RetryableError) { + const expected = name.toLowerCase(); + for (const [key, value2] of Object.entries(headers)) { + if (key.toLowerCase() === expected && value2 !== null && value2.trim().length > 0) return true; - } - err = err.cause; } return false; } -function wrapFetchWithMiddleware(fetchFn, middleware, options, client) { - return async (url, init = {}) => { - if (middleware.length === 0) { - return fetchFn.call(void 0, url, init); - } - const headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - const response = await applyMiddleware(fetchFn, middleware, options, client)({ - ...init, - headers, - url: typeof url === "string" ? url : url instanceof URL ? url.href : url.url - }); - if (response.bodyUsed || response.body?.locked) { - throw new AnthropicError("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it"); - } - return response; - }; +function getClientApiKey2(provider2, apiKey, headers) { + if (apiKey) + return apiKey; + if (hasHeader3(headers, "authorization") || hasHeader3(headers, "cf-aig-authorization")) + return "unused"; + throw new Error(`No API key for provider: ${provider2}`); } -function createMiddlewareContext(options, client) { - const cache = /* @__PURE__ */ new WeakMap(); - return { - options, - // Resolved per chain, so changes to the client's `logLevel`/`logger` - // apply to subsequent requests. - logger: client ? loggerFor2(client) : defaultLogger(), - parse(response) { - if (options?.stream && response.ok) { - return parseMiddlewareResponse(response, options, client); - } - let parsed = cache.get(response); - if (!parsed) { - parsed = parseMiddlewareResponse(response, options, client); - cache.set(response, parsed); - } - return parsed; - } - }; -} -async function parseMiddlewareResponse(response, options, client) { - if (response.bodyUsed || response.body?.locked) { - throw new AnthropicError("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()"); - } - if (options?.stream && response.ok) { - return Stream2.fromSSEResponse(response.clone(), new AbortController(), client); - } - if (response.status === 204) { - return null; - } - if (options?.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - if (response.headers.get("content-length") === "0") { - return void 0; - } - return addResponseIDs(await response.clone().json(), response); - } - return await response.clone().text(); -} -function applyMiddleware(fetchFn, middleware, options, client) { - let next = async ({ url, ...init }) => { - try { - return await fetchFn.call(void 0, url, init); - } catch (err) { - const error = castToError2(err); - fetchOriginErrors.add(error); - throw error; - } - }; - const ctx = createMiddlewareContext(options, client); - for (let i = middleware.length - 1; i >= 0; i--) { - const mw = middleware[i]; - const nextInner = next; - next = async (request2) => mw(request2, nextInner, ctx); - } - return next; -} -var fetchOriginErrors; -var init_middleware = __esm({ - "node_modules/@anthropic-ai/sdk/core/middleware.mjs"() { - init_errors2(); - init_parse2(); - init_log2(); - init_error3(); - init_streaming3(); - fetchOriginErrors = /* @__PURE__ */ new WeakSet(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/api-promise.mjs -var _APIPromise_client2, APIPromise2; -var init_api_promise2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/api-promise.mjs"() { - init_tslib2(); - init_parse2(); - APIPromise2 = /* @__PURE__ */ (() => { - class APIPromise3 extends Promise { - constructor(client, responsePromise, parseResponse2 = defaultParseResponse2) { - super((resolve) => { - resolve(null); - }); - this.responsePromise = responsePromise; - this.parseResponse = parseResponse2; - _APIPromise_client2.set(this, void 0); - __classPrivateFieldSet2(this, _APIPromise_client2, client, "f"); - } - _thenUnwrap(transform) { - return new APIPromise3(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), this.responsePromise, async (client, props) => addResponseIDs(transform(await this.parseResponse(client, props), props), props.response)); - } - /** - * Gets the raw `Response` instance instead of parsing the response - * data. - * - * If you want to parse the response body but still get the `Response` - * instance, you can use {@link withResponse()}. - * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` - * to your `tsconfig.json`. - */ - asResponse() { - return this.responsePromise.then((p) => p.response); - } - /** - * Gets the parsed response data, the raw `Response` instance and the ID of the request, - * returned via the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * If you just want to get the raw `Response` instance without parsing it, - * you can use {@link asResponse()}. - * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` - * to your `tsconfig.json`. - */ - async withResponse() { - const [data, response] = await Promise.all([this.parse(), this.asResponse()]); - return { - data, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - parse() { - if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), data)); - } - return this.parsedPromise; - } - then(onfulfilled, onrejected) { - return this.parse().then(onfulfilled, onrejected); - } - catch(onrejected) { - return this.parse().catch(onrejected); - } - finally(onfinally) { - return this.parse().finally(onfinally); - } - } - _APIPromise_client2 = /* @__PURE__ */ new WeakMap(); - return APIPromise3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/core/pagination.mjs -var _AbstractPage_client2, AbstractPage2, PagePromise2, Page2, PageCursor, BidirectionalPageCursor; -var init_pagination2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/pagination.mjs"() { - init_tslib2(); - init_error3(); - init_parse2(); - init_api_promise2(); - init_values2(); - AbstractPage2 = /* @__PURE__ */ (() => { - class AbstractPage3 { - constructor(client, response, body, options) { - _AbstractPage_client2.set(this, void 0); - __classPrivateFieldSet2(this, _AbstractPage_client2, client, "f"); - this.options = options; - this.response = response; - this.body = body; - } - hasNextPage() { - const items = this.getPaginatedItems(); - if (!items.length) - return false; - return this.nextPageRequestOptions() != null; - } - async getNextPage() { - const nextOptions = this.nextPageRequestOptions(); - if (!nextOptions) { - throw new AnthropicError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); - } - return await __classPrivateFieldGet2(this, _AbstractPage_client2, "f").requestAPIList(this.constructor, nextOptions); - } - async *iterPages() { - let page = this; - yield page; - while (page.hasNextPage()) { - page = await page.getNextPage(); - yield page; - } - } - async *[(_AbstractPage_client2 = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - for await (const page of this.iterPages()) { - for (const item of page.getPaginatedItems()) { - yield item; - } - } - } - } - return AbstractPage3; - })(); - PagePromise2 = /* @__PURE__ */ (() => { - class PagePromise3 extends APIPromise2 { - constructor(client, request2, Page3) { - super(client, request2, async (client2, props) => new Page3(client2, props.response, await defaultParseResponse2(client2, props), props.options)); - } - /** - * Allow auto-paginating iteration on an unawaited list call, eg: - * - * for await (const item of client.items.list()) { - * console.log(item) - * } - */ - async *[Symbol.asyncIterator]() { - const page = await this; - for await (const item of page) { - yield item; - } - } - } - return PagePromise3; - })(); - Page2 = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.has_more = body.has_more || false; - this.first_id = body.first_id || null; - this.last_id = body.last_id || null; - } - getPaginatedItems() { - return this.data ?? []; - } - hasNextPage() { - if (this.has_more === false) { - return false; - } - return super.hasNextPage(); - } - nextPageRequestOptions() { - if (this.options.query?.["before_id"]) { - const first_id = this.first_id; - if (!first_id) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - before_id: first_id - } - }; - } - const cursor = this.last_id; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - after_id: cursor - } - }; - } - }; - PageCursor = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.next_page = body.next_page || null; - } - getPaginatedItems() { - return this.data ?? []; - } - nextPageRequestOptions() { - const cursor = this.next_page; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - page: cursor - } - }; - } - }; - BidirectionalPageCursor = class extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.next_page = body.next_page || null; - this.prev_page = body.prev_page || null; - } - getPaginatedItems() { - return this.data ?? []; - } - nextPageRequestOptions() { - const cursor = this.next_page; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - page: cursor - } - }; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/uploads.mjs -function makeFile2(fileBits, fileName, options) { - checkFileSupport2(); - return new File(fileBits, fileName ?? "", options); -} -function getName2(value, stripPath) { - const val = typeof value === "object" && value !== null && ("name" in value && value.name && String(value.name) || "url" in value && value.url && String(value.url) || "filename" in value && value.filename && String(value.filename) || "path" in value && value.path && String(value.path)) || ""; - return stripPath ? val.split(/[\\/]/).pop() || void 0 : val; -} -function supportsFormData2(fetchObject) { - const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; - const cached = supportsFormDataMap2.get(fetch2); - if (cached) - return cached; - const promise = (async () => { - try { - const FetchResponse = "Response" in fetch2 ? fetch2.Response : (await fetch2("data:,")).constructor; - const data = new FormData(); - if (data.toString() === await new FetchResponse(data).text()) { - return false; - } - return true; - } catch { +function hasToolHistory(messages) { + for (const msg of messages) { + if (msg.role === "toolResult") { return true; } - })(); - supportsFormDataMap2.set(fetch2, promise); - return promise; -} -var checkFileSupport2, isAsyncIterable2, multipartFormRequestOptions2, supportsFormDataMap2, createForm2, addFormValue2; -var init_uploads4 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/uploads.mjs"() { - init_shims2(); - checkFileSupport2 = () => { - if (typeof File === "undefined") { - const { process: process2 } = globalThis; - const isOldNode = typeof process2?.versions?.node === "string" && parseInt(process2.versions.node.split(".")) < 20; - throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : "")); - } - }; - isAsyncIterable2 = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function"; - multipartFormRequestOptions2 = async (opts, fetch2, stripFilenames = true) => { - return { ...opts, body: await createForm2(opts.body, fetch2, stripFilenames) }; - }; - supportsFormDataMap2 = /* @__PURE__ */ new WeakMap(); - createForm2 = async (body, fetch2, stripFilenames = true) => { - if (!await supportsFormData2(fetch2)) { - throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); - } - const form = new FormData(); - await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue2(form, key, value, stripFilenames))); - return form; - }; - addFormValue2 = async (form, key, value, stripFilenames) => { - if (value === void 0) - return; - if (value == null) { - throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); - } - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - form.append(key, String(value)); - } else if (value instanceof Response) { - let options = {}; - const contentType = value.headers.get("Content-Type"); - if (contentType) { - options = { type: contentType }; - } - form.append(key, makeFile2([await value.blob()], getName2(value, stripFilenames), options)); - } else if (isAsyncIterable2(value)) { - form.append(key, makeFile2([await new Response(ReadableStreamFrom2(value)).blob()], getName2(value, stripFilenames))); - } else if (value instanceof Blob) { - const isFile = typeof File !== "undefined" && value instanceof File; - const name = isFile ? value.name : getName2(value, stripFilenames); - form.append(key, makeFile2([value], name, { type: value.type })); - } else if (Array.isArray(value)) { - await Promise.all(value.map((entry) => addFormValue2(form, key + "[]", entry, stripFilenames))); - } else if (typeof value.then === "function") { - throw new TypeError(`Received a Promise for "${key}"; await it first, e.g. \`await toFile(...)\``); - } else if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) { - throw new TypeError(`Received ${value.constructor.name} for "${key}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``); - } else if (typeof value === "object") { - await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue2(form, `${key}[${name}]`, prop, stripFilenames))); - } else { - throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/to-file.mjs -async function toFile2(value, name, options) { - checkFileSupport2(); - value = await value; - name || (name = value instanceof File ? value.name : getName2(value, true)); - if (isFileLike2(value)) { - if (value instanceof File && name == null && options == null) { - return value; - } - return makeFile2([await value.arrayBuffer()], name ?? value.name, { - type: value.type, - lastModified: value.lastModified, - ...options - }); - } - if (isResponseLike2(value)) { - const blob = await value.blob(); - name || (name = new URL(value.url).pathname.split(/[\\/]/).pop()); - return makeFile2(await getBytes2(blob), name, options); - } - const parts = await getBytes2(value); - if (!options?.type) { - const type = parts.find((part) => typeof part === "object" && "type" in part && part.type); - if (typeof type === "string") { - options = { ...options, type }; - } - } - return makeFile2(parts, name, options); -} -async function getBytes2(value) { - let parts = []; - if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc. - value instanceof ArrayBuffer) { - parts.push(value); - } else if (isBlobLike2(value)) { - parts.push(value instanceof Blob ? value : await value.arrayBuffer()); - } else if (isAsyncIterable2(value)) { - for await (const chunk of value) { - parts.push(...await getBytes2(chunk)); - } - } else { - const constructor = value?.constructor?.name; - throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ""}${propsForError2(value)}`); - } - return parts; -} -function propsForError2(value) { - if (typeof value !== "object" || value === null) - return ""; - const props = Object.getOwnPropertyNames(value); - return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; -} -var isBlobLike2, isFileLike2, isResponseLike2; -var init_to_file2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/to-file.mjs"() { - init_uploads4(); - init_uploads4(); - isBlobLike2 = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function"; - isFileLike2 = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike2(value); - isResponseLike2 = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function"; - } -}); - -// node_modules/@anthropic-ai/sdk/core/uploads.mjs -var init_uploads5 = __esm({ - "node_modules/@anthropic-ai/sdk/core/uploads.mjs"() { - init_to_file2(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/shared.mjs -var init_shared2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/shared.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/core/resource.mjs -var APIResource2; -var init_resource2 = __esm({ - "node_modules/@anthropic-ai/sdk/core/resource.mjs"() { - APIResource2 = class { - constructor(client) { - this._client = client; - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/headers.mjs -function* iterateHeaders2(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders2 in headers) { - const { values, nulls } = headers; - yield* values.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (isReadonlyArray2(headers)) { - iter = headers; - } else { - shouldClear = true; - iter = Object.entries(headers ?? {}); - } - for (let row of iter) { - const name = row[0]; - if (typeof name !== "string") - throw new TypeError("expected header name to be a string"); - const values = isReadonlyArray2(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value of values) { - if (value === void 0) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, clearSentinel]; - } - yield [name, value]; - } - } -} -var brand_privateNullableHeaders2, clearSentinel, APPEND_HEADERS, appendHeaderValue, buildHeaders2; -var init_headers3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/headers.mjs"() { - init_values2(); - brand_privateNullableHeaders2 = /* @__PURE__ */ Symbol.for("brand.privateNullableHeaders"); - clearSentinel = /* @__PURE__ */ Symbol("clear"); - APPEND_HEADERS = /* @__PURE__ */ new Set(["x-stainless-helper"]); - appendHeaderValue = (existing, addition) => { - const tokens = existing ? existing.split(",").map((t) => t.trim()).filter(Boolean) : []; - for (const tok of addition.split(",").map((t) => t.trim())) { - if (tok && !tokens.includes(tok)) - tokens.push(tok); - } - return tokens.join(", "); - }; - buildHeaders2 = (newHeaders) => { - const targetHeaders = new Headers(); - const nullHeaders = /* @__PURE__ */ new Set(); - for (const headers of newHeaders) { - const seenHeaders = /* @__PURE__ */ new Set(); - for (const [name, value] of iterateHeaders2(headers)) { - const lowerName = name.toLowerCase(); - if (APPEND_HEADERS.has(lowerName)) { - if (value === clearSentinel) - continue; - if (value === null) { - targetHeaders.delete(name); - nullHeaders.add(lowerName); - } else { - targetHeaders.set(name, appendHeaderValue(targetHeaders.get(name), value)); - nullHeaders.delete(lowerName); - } - continue; - } - if (value === clearSentinel || !seenHeaders.has(lowerName)) { - targetHeaders.delete(name); - seenHeaders.add(lowerName); - if (value === clearSentinel) - continue; - } - if (value === null) { - targetHeaders.delete(name); - nullHeaders.add(lowerName); - } else { - targetHeaders.append(name, value); - nullHeaders.delete(lowerName); - } - } - } - return { [brand_privateNullableHeaders2]: true, values: targetHeaders, nulls: nullHeaders }; - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/path.mjs -function encodeURIPath2(str2) { - return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); -} -var EMPTY2, createPathTagFunction2, path3; -var init_path2 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() { - init_error3(); - EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); - createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path4(statics, ...params) { - if (statics.length === 1) - return statics[0]; - let postPath = false; - const invalidSegments = []; - const path5 = statics.reduce((previousValue, currentValue, index) => { - if (/[?#]/.test(currentValue)) { - postPath = true; - } - const value = params[index]; - let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value); - if (index !== params.length && (value == null || typeof value === "object" && // handle values from other realms - value.toString === Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY2) ?? EMPTY2)?.toString)) { - encoded = value + ""; - invalidSegments.push({ - start: previousValue.length + currentValue.length, - length: encoded.length, - error: `Value of type ${Object.prototype.toString.call(value).slice(8, -1)} is not a valid path parameter` - }); - } - return previousValue + currentValue + (index === params.length ? "" : encoded); - }, ""); - const pathOnly = path5.split(/[?#]/, 1)[0]; - const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; - let match; - while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { - invalidSegments.push({ - start: match.index, - length: match[0].length, - error: `Value "${match[0]}" can't be safely passed as a path parameter` - }); - } - invalidSegments.sort((a, b) => a.start - b.start); - if (invalidSegments.length > 0) { - let lastEnd = 0; - const underline = invalidSegments.reduce((acc, segment) => { - const spaces = " ".repeat(segment.start - lastEnd); - const arrows = "^".repeat(segment.length); - lastEnd = segment.start + segment.length; - return acc + spaces + arrows; - }, ""); - throw new AnthropicError(`Path parameters result in path with invalid segments: -${invalidSegments.map((e) => e.error).join("\n")} -${path5} -${underline}`); - } - return path5; - }; - path3 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs -var DeploymentRuns; -var init_deployment_runs = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - DeploymentRuns = class extends APIResource2 { - /** - * Get Deployment Run - * - * @example - * ```ts - * const betaManagedAgentsDeploymentRun = - * await client.beta.deploymentRuns.retrieve( - * 'deployment_run_id', - * ); - * ``` - */ - retrieve(deploymentRunID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/deployment_runs/${deploymentRunID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Deployment Runs - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsDeploymentRun of client.beta.deploymentRuns.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/deployment_runs?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs -var Deployments; -var init_deployments = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Deployments = class extends APIResource2 { - /** - * Create Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.create({ - * agent: 'string', - * environment_id: 'x', - * initial_events: [ - * { - * content: [ - * { - * text: 'Where is my order #1234?', - * type: 'text', - * }, - * ], - * type: 'user.message', - * }, - * ], - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/deployments?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.retrieve( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - retrieve(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/deployments/${deploymentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.update( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - update(deploymentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/deployments/${deploymentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Deployments - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsDeployment of client.beta.deployments.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/deployments?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.archive( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - archive(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Pause Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.pause( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - pause(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/pause?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Run Deployment Now - * - * @example - * ```ts - * const betaManagedAgentsDeploymentRun = - * await client.beta.deployments.run( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - run(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/run?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Unpause Deployment - * - * @example - * ```ts - * const betaManagedAgentsDeployment = - * await client.beta.deployments.unpause( - * 'depl_011CZkZcDH3vPqd7xnEfwTai', - * ); - * ``` - */ - unpause(deploymentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/deployments/${deploymentID}/unpause?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs -var Dreams; -var init_dreams = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Dreams = class extends APIResource2 { - /** - * Start an asynchronous job that uses past sessions to produce a reorganized - * version of a memory store and get back the dream to poll for the result. - * - * By default the dream writes its result to a new memory store and doesn't change - * the input memory store. The response has `status` set to `pending` and an empty - * `outputs` array. Poll the dream until `status` is `completed`, `failed`, or - * `canceled`. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#create-a-dream) - * to learn more about creating dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.create({ - * inputs: [{ memory_store_id: 'x', type: 'memory_store' }], - * model: 'string', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/dreams?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get a dream by ID to check its status, output memory store, and token usage. - * - * Archived dreams are returned too. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#track-progress) - * for how to poll a dream and what each status means. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.retrieve( - * 'dream_id', - * ); - * ``` - */ - retrieve(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/dreams/${dreamID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List the dreams in the workspace, newest first. - * - * Archived dreams are left out unless `include_archived` is `true`. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#list-dreams) - * for how to page through dreams. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaDream of client.beta.dreams.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/dreams?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Hide a `completed`, `failed`, or `canceled` dream from the default list of - * dreams. - * - * Archiving a `pending` or `running` dream returns a 400 error, so cancel it - * first. Archiving an archived dream returns it unchanged. An archived dream can - * still be fetched by ID. Archiving can't be undone. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#archive-a-dream) - * to learn more about archiving dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.archive( - * 'dream_id', - * ); - * ``` - */ - archive(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/dreams/${dreamID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stop a `pending` or `running` dream. - * - * The response shows `status` as `canceled`, unless the dream reached `completed` - * or `failed` first. `usage` can keep changing after the response. Canceling a - * `canceled` dream returns it unchanged. Canceling a `completed` or `failed` dream - * returns a 400 error. - * - * See the - * [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#cancel-a-dream) - * to learn more about canceling dreams. - * - * @example - * ```ts - * const betaDream = await client.beta.dreams.cancel( - * 'dream_id', - * ); - * ``` - */ - cancel(dreamID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/dreams/${dreamID}/cancel?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "dreaming-2026-04-21"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs -function helperHeader(value) { - return { [STAINLESS_HELPER_HEADER]: value }; -} -function wasCreatedByStainlessHelper(value) { - return typeof value === "object" && value !== null && SDK_HELPER_SYMBOL in value; -} -function collectStainlessHelpers(tools, messages) { - const helpers = /* @__PURE__ */ new Set(); - if (tools) { - for (const tool of tools) { - if (wasCreatedByStainlessHelper(tool)) { - helpers.add(tool[SDK_HELPER_SYMBOL]); + if (msg.role === "assistant") { + if (msg.content.some((block) => block.type === "toolCall")) { + return true; } } } - if (messages) { - for (const message of messages) { - if (wasCreatedByStainlessHelper(message)) { - helpers.add(message[SDK_HELPER_SYMBOL]); - } - const content = message.content; - if (Array.isArray(content)) { - for (const block of content) { - if (wasCreatedByStainlessHelper(block)) { - helpers.add(block[SDK_HELPER_SYMBOL]); - } - const definition = block?.tool?.definition; - if (wasCreatedByStainlessHelper(definition)) { - helpers.add(definition[SDK_HELPER_SYMBOL]); - } - } - } - } - } - return Array.from(helpers); + return false; } -function stainlessHelperHeader(tools, messages) { - const helpers = collectStainlessHelpers(tools, messages); - if (helpers.length === 0) - return {}; - return { [STAINLESS_HELPER_HEADER]: helpers.join(", ") }; +function isTextContentBlock(block) { + return block.type === "text"; } -function stainlessHelperHeaderFromFile(file2) { - if (wasCreatedByStainlessHelper(file2)) { - return { [STAINLESS_HELPER_HEADER]: file2[SDK_HELPER_SYMBOL] }; - } - return {}; +function isThinkingContentBlock(block) { + return block.type === "thinking"; } -var STAINLESS_HELPER_HEADER, STAINLESS_HELPER_METHOD_HEADER, SDK_HELPER_SYMBOL; -var init_stainless_helper_header = __esm({ - "node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs"() { - STAINLESS_HELPER_HEADER = "x-stainless-helper"; - STAINLESS_HELPER_METHOD_HEADER = "x-stainless-helper-method"; - SDK_HELPER_SYMBOL = /* @__PURE__ */ Symbol("anthropic.sdk.stainlessHelper"); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/files.mjs -var Files5; -var init_files5 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/files.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_stainless_helper_header(); - init_uploads4(); - init_path2(); - Files5 = class extends APIResource2 { - /** - * List Files - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFileMetadata of client.beta.files.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/files?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete File - * - * @example - * ```ts - * const betaDeletedFile = await client.beta.files.delete( - * 'file_id', - * ); - * ``` - */ - delete(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/files/${fileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Download File - * - * @example - * ```ts - * const response = await client.beta.files.download( - * 'file_id', - * ); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}/content?beta=true`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - /** - * Get File Metadata - * - * @example - * ```ts - * const betaFileMetadata = - * await client.beta.files.retrieveMetadata('file_id'); - * ``` - */ - retrieveMetadata(fileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Upload File - * - * @example - * ```ts - * const betaFileMetadata = await client.beta.files.upload({ - * file: fs.createReadStream('path/to/file'), - * }); - * ``` - */ - upload(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/files?beta=true", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - stainlessHelperHeaderFromFile(body.file), - options?.headers - ]) - }, this._client)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/models.mjs -var Models2; -var init_models3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/models.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Models2 = class extends APIResource2 { - /** - * Get a specific model. - * - * The Models API response can be used to determine information about a specific - * model or resolve a model alias to a model ID. - * - * @example - * ```ts - * const betaModelInfo = await client.beta.models.retrieve( - * 'model_id', - * ); - * ``` - */ - retrieve(modelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/models/${modelID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List available models. - * - * The Models API response can be used to determine which models are available for - * use in the API. More recently released models are listed first. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaModelInfo of client.beta.models.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs -var UserProfiles; -var init_user_profiles = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - UserProfiles = class extends APIResource2 { - /** - * Create User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.create(); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/user_profiles?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.retrieve( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - retrieve(userProfileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/user_profiles/${userProfileID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update User Profile - * - * @example - * ```ts - * const betaUserProfile = - * await client.beta.userProfiles.update( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - update(userProfileID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/user_profiles/${userProfileID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List User Profiles - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaUserProfile of client.beta.userProfiles.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/user_profiles?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Create Enrollment URL - * - * @example - * ```ts - * const betaUserProfileEnrollmentURL = - * await client.beta.userProfiles.createEnrollmentURL( - * 'uprof_011CZkZCu8hGbp5mYRQgUmz9', - * ); - * ``` - */ - createEnrollmentURL(userProfileID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "user-profiles-2026-08-18"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@stablelib/base64/lib/base64.js -var require_base64 = __commonJS({ - "node_modules/@stablelib/base64/lib/base64.js"(exports) { - "use strict"; - var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { - d2.__proto__ = b2; - } || function(d2, b2) { - for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p]; - }; - return extendStatics(d, b); - }; - return function(d, b) { - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var INVALID_BYTE = 256; - var Coder = ( - /** @class */ - (function() { - function Coder2(_paddingCharacter) { - if (_paddingCharacter === void 0) { - _paddingCharacter = "="; - } - this._paddingCharacter = _paddingCharacter; - } - Coder2.prototype.encodedLength = function(length) { - if (!this._paddingCharacter) { - return (length * 8 + 5) / 6 | 0; - } - return (length + 2) / 3 * 4 | 0; - }; - Coder2.prototype.encode = function(data) { - var out = ""; - var i = 0; - for (; i < data.length - 2; i += 3) { - var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2]; - out += this._encodeByte(c >>> 3 * 6 & 63); - out += this._encodeByte(c >>> 2 * 6 & 63); - out += this._encodeByte(c >>> 1 * 6 & 63); - out += this._encodeByte(c >>> 0 * 6 & 63); - } - var left = data.length - i; - if (left > 0) { - var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0); - out += this._encodeByte(c >>> 3 * 6 & 63); - out += this._encodeByte(c >>> 2 * 6 & 63); - if (left === 2) { - out += this._encodeByte(c >>> 1 * 6 & 63); - } else { - out += this._paddingCharacter || ""; - } - out += this._paddingCharacter || ""; - } - return out; - }; - Coder2.prototype.maxDecodedLength = function(length) { - if (!this._paddingCharacter) { - return (length * 6 + 7) / 8 | 0; - } - return length / 4 * 3 | 0; - }; - Coder2.prototype.decodedLength = function(s) { - return this.maxDecodedLength(s.length - this._getPaddingLength(s)); - }; - Coder2.prototype.decode = function(s) { - if (s.length === 0) { - return new Uint8Array(0); - } - var paddingLength = this._getPaddingLength(s); - var length = s.length - paddingLength; - var out = new Uint8Array(this.maxDecodedLength(length)); - var op = 0; - var i = 0; - var haveBad = 0; - var v0 = 0, v1 = 0, v2 = 0, v3 = 0; - for (; i < length - 4; i += 4) { - v0 = this._decodeChar(s.charCodeAt(i + 0)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - v2 = this._decodeChar(s.charCodeAt(i + 2)); - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op++] = v0 << 2 | v1 >>> 4; - out[op++] = v1 << 4 | v2 >>> 2; - out[op++] = v2 << 6 | v3; - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - haveBad |= v2 & INVALID_BYTE; - haveBad |= v3 & INVALID_BYTE; - } - if (i < length - 1) { - v0 = this._decodeChar(s.charCodeAt(i)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - out[op++] = v0 << 2 | v1 >>> 4; - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - } - if (i < length - 2) { - v2 = this._decodeChar(s.charCodeAt(i + 2)); - out[op++] = v1 << 4 | v2 >>> 2; - haveBad |= v2 & INVALID_BYTE; - } - if (i < length - 3) { - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op++] = v2 << 6 | v3; - haveBad |= v3 & INVALID_BYTE; - } - if (haveBad !== 0) { - throw new Error("Base64Coder: incorrect characters for decoding"); - } - return out; - }; - Coder2.prototype._encodeByte = function(b) { - var result = b; - result += 65; - result += 25 - b >>> 8 & 0 - 65 - 26 + 97; - result += 51 - b >>> 8 & 26 - 97 - 52 + 48; - result += 61 - b >>> 8 & 52 - 48 - 62 + 43; - result += 62 - b >>> 8 & 62 - 43 - 63 + 47; - return String.fromCharCode(result); - }; - Coder2.prototype._decodeChar = function(c) { - var result = INVALID_BYTE; - result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62; - result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63; - result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; - result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; - result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; - return result; - }; - Coder2.prototype._getPaddingLength = function(s) { - var paddingLength = 0; - if (this._paddingCharacter) { - for (var i = s.length - 1; i >= 0; i--) { - if (s[i] !== this._paddingCharacter) { - break; - } - paddingLength++; - } - if (s.length < 4 || paddingLength > 2) { - throw new Error("Base64Coder: incorrect padding"); - } - } - return paddingLength; - }; - return Coder2; - })() - ); - exports.Coder = Coder; - var stdCoder = new Coder(); - function encode3(data) { - return stdCoder.encode(data); - } - exports.encode = encode3; - function decode(s) { - return stdCoder.decode(s); - } - exports.decode = decode; - var URLSafeCoder = ( - /** @class */ - (function(_super) { - __extends(URLSafeCoder2, _super); - function URLSafeCoder2() { - return _super !== null && _super.apply(this, arguments) || this; - } - URLSafeCoder2.prototype._encodeByte = function(b) { - var result = b; - result += 65; - result += 25 - b >>> 8 & 0 - 65 - 26 + 97; - result += 51 - b >>> 8 & 26 - 97 - 52 + 48; - result += 61 - b >>> 8 & 52 - 48 - 62 + 45; - result += 62 - b >>> 8 & 62 - 45 - 63 + 95; - return String.fromCharCode(result); - }; - URLSafeCoder2.prototype._decodeChar = function(c) { - var result = INVALID_BYTE; - result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62; - result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63; - result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52; - result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0; - result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26; - return result; - }; - return URLSafeCoder2; - })(Coder) - ); - exports.URLSafeCoder = URLSafeCoder; - var urlSafeCoder = new URLSafeCoder(); - function encodeURLSafe(data) { - return urlSafeCoder.encode(data); - } - exports.encodeURLSafe = encodeURLSafe; - function decodeURLSafe(s) { - return urlSafeCoder.decode(s); - } - exports.decodeURLSafe = decodeURLSafe; - exports.encodedLength = function(length) { - return stdCoder.encodedLength(length); - }; - exports.maxDecodedLength = function(length) { - return stdCoder.maxDecodedLength(length); - }; - exports.decodedLength = function(s) { - return stdCoder.decodedLength(s); - }; - } -}); - -// node_modules/fast-sha256/sha256.js -var require_sha256 = __commonJS({ - "node_modules/fast-sha256/sha256.js"(exports, module) { - (function(root, factory) { - var exports2 = {}; - factory(exports2); - var sha256 = exports2["default"]; - for (var k in exports2) { - sha256[k] = exports2[k]; - } - if (typeof module === "object" && typeof module.exports === "object") { - module.exports = sha256; - } else if (typeof define === "function" && define.amd) { - define(function() { - return sha256; - }); - } else { - root.sha256 = sha256; - } - })(exports, function(exports2) { - "use strict"; - exports2.__esModule = true; - exports2.digestLength = 32; - exports2.blockSize = 64; - var K = new Uint32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 - ]); - function hashBlocks(w, v, p, pos, len) { - var a, b, c, d, e, f, g, h, u, i, j, t1, t2; - while (len >= 64) { - a = v[0]; - b = v[1]; - c = v[2]; - d = v[3]; - e = v[4]; - f = v[5]; - g = v[6]; - h = v[7]; - for (i = 0; i < 16; i++) { - j = pos + i * 4; - w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255; - } - for (i = 16; i < 64; i++) { - u = w[i - 2]; - t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; - u = w[i - 15]; - t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; - w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0); - } - for (i = 0; i < 64; i++) { - t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0; - t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; - h = g; - g = f; - f = e; - e = d + t1 | 0; - d = c; - c = b; - b = a; - a = t1 + t2 | 0; - } - v[0] += a; - v[1] += b; - v[2] += c; - v[3] += d; - v[4] += e; - v[5] += f; - v[6] += g; - v[7] += h; - pos += 64; - len -= 64; - } - return pos; - } - var Hash = ( - /** @class */ - (function() { - function Hash2() { - this.digestLength = exports2.digestLength; - this.blockSize = exports2.blockSize; - this.state = new Int32Array(8); - this.temp = new Int32Array(64); - this.buffer = new Uint8Array(128); - this.bufferLength = 0; - this.bytesHashed = 0; - this.finished = false; - this.reset(); - } - Hash2.prototype.reset = function() { - this.state[0] = 1779033703; - this.state[1] = 3144134277; - this.state[2] = 1013904242; - this.state[3] = 2773480762; - this.state[4] = 1359893119; - this.state[5] = 2600822924; - this.state[6] = 528734635; - this.state[7] = 1541459225; - this.bufferLength = 0; - this.bytesHashed = 0; - this.finished = false; - return this; - }; - Hash2.prototype.clean = function() { - for (var i = 0; i < this.buffer.length; i++) { - this.buffer[i] = 0; - } - for (var i = 0; i < this.temp.length; i++) { - this.temp[i] = 0; - } - this.reset(); - }; - Hash2.prototype.update = function(data, dataLength) { - if (dataLength === void 0) { - dataLength = data.length; - } - if (this.finished) { - throw new Error("SHA256: can't update because hash was finished."); - } - var dataPos = 0; - this.bytesHashed += dataLength; - if (this.bufferLength > 0) { - while (this.bufferLength < 64 && dataLength > 0) { - this.buffer[this.bufferLength++] = data[dataPos++]; - dataLength--; - } - if (this.bufferLength === 64) { - hashBlocks(this.temp, this.state, this.buffer, 0, 64); - this.bufferLength = 0; - } - } - if (dataLength >= 64) { - dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength); - dataLength %= 64; - } - while (dataLength > 0) { - this.buffer[this.bufferLength++] = data[dataPos++]; - dataLength--; - } - return this; - }; - Hash2.prototype.finish = function(out) { - if (!this.finished) { - var bytesHashed = this.bytesHashed; - var left = this.bufferLength; - var bitLenHi = bytesHashed / 536870912 | 0; - var bitLenLo = bytesHashed << 3; - var padLength = bytesHashed % 64 < 56 ? 64 : 128; - this.buffer[left] = 128; - for (var i = left + 1; i < padLength - 8; i++) { - this.buffer[i] = 0; - } - this.buffer[padLength - 8] = bitLenHi >>> 24 & 255; - this.buffer[padLength - 7] = bitLenHi >>> 16 & 255; - this.buffer[padLength - 6] = bitLenHi >>> 8 & 255; - this.buffer[padLength - 5] = bitLenHi >>> 0 & 255; - this.buffer[padLength - 4] = bitLenLo >>> 24 & 255; - this.buffer[padLength - 3] = bitLenLo >>> 16 & 255; - this.buffer[padLength - 2] = bitLenLo >>> 8 & 255; - this.buffer[padLength - 1] = bitLenLo >>> 0 & 255; - hashBlocks(this.temp, this.state, this.buffer, 0, padLength); - this.finished = true; - } - for (var i = 0; i < 8; i++) { - out[i * 4 + 0] = this.state[i] >>> 24 & 255; - out[i * 4 + 1] = this.state[i] >>> 16 & 255; - out[i * 4 + 2] = this.state[i] >>> 8 & 255; - out[i * 4 + 3] = this.state[i] >>> 0 & 255; - } - return this; - }; - Hash2.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - Hash2.prototype._saveState = function(out) { - for (var i = 0; i < this.state.length; i++) { - out[i] = this.state[i]; - } - }; - Hash2.prototype._restoreState = function(from, bytesHashed) { - for (var i = 0; i < this.state.length; i++) { - this.state[i] = from[i]; - } - this.bytesHashed = bytesHashed; - this.finished = false; - this.bufferLength = 0; - }; - return Hash2; - })() - ); - exports2.Hash = Hash; - var HMAC = ( - /** @class */ - (function() { - function HMAC2(key) { - this.inner = new Hash(); - this.outer = new Hash(); - this.blockSize = this.inner.blockSize; - this.digestLength = this.inner.digestLength; - var pad = new Uint8Array(this.blockSize); - if (key.length > this.blockSize) { - new Hash().update(key).finish(pad).clean(); - } else { - for (var i = 0; i < key.length; i++) { - pad[i] = key[i]; - } - } - for (var i = 0; i < pad.length; i++) { - pad[i] ^= 54; - } - this.inner.update(pad); - for (var i = 0; i < pad.length; i++) { - pad[i] ^= 54 ^ 92; - } - this.outer.update(pad); - this.istate = new Uint32Array(8); - this.ostate = new Uint32Array(8); - this.inner._saveState(this.istate); - this.outer._saveState(this.ostate); - for (var i = 0; i < pad.length; i++) { - pad[i] = 0; - } - } - HMAC2.prototype.reset = function() { - this.inner._restoreState(this.istate, this.inner.blockSize); - this.outer._restoreState(this.ostate, this.outer.blockSize); - return this; - }; - HMAC2.prototype.clean = function() { - for (var i = 0; i < this.istate.length; i++) { - this.ostate[i] = this.istate[i] = 0; - } - this.inner.clean(); - this.outer.clean(); - }; - HMAC2.prototype.update = function(data) { - this.inner.update(data); - return this; - }; - HMAC2.prototype.finish = function(out) { - if (this.outer.finished) { - this.outer.finish(out); - } else { - this.inner.finish(out); - this.outer.update(out, this.digestLength).finish(out); - } - return this; - }; - HMAC2.prototype.digest = function() { - var out = new Uint8Array(this.digestLength); - this.finish(out); - return out; - }; - return HMAC2; - })() - ); - exports2.HMAC = HMAC; - function hash(data) { - var h = new Hash().update(data); - var digest = h.digest(); - h.clean(); - return digest; - } - exports2.hash = hash; - exports2["default"] = hash; - function hmac(key, data) { - var h = new HMAC(key).update(data); - var digest = h.digest(); - h.clean(); - return digest; - } - exports2.hmac = hmac; - function fillBuffer(buffer, hmac2, info, counter) { - var num2 = counter[0]; - if (num2 === 0) { - throw new Error("hkdf: cannot expand more"); - } - hmac2.reset(); - if (num2 > 1) { - hmac2.update(buffer); - } - if (info) { - hmac2.update(info); - } - hmac2.update(counter); - hmac2.finish(buffer); - counter[0]++; - } - var hkdfSalt = new Uint8Array(exports2.digestLength); - function hkdf(key, salt, info, length) { - if (salt === void 0) { - salt = hkdfSalt; - } - if (length === void 0) { - length = 32; - } - var counter = new Uint8Array([1]); - var okm = hmac(salt, key); - var hmac_ = new HMAC(okm); - var buffer = new Uint8Array(hmac_.digestLength); - var bufpos = buffer.length; - var out = new Uint8Array(length); - for (var i = 0; i < length; i++) { - if (bufpos === buffer.length) { - fillBuffer(buffer, hmac_, info, counter); - bufpos = 0; - } - out[i] = buffer[bufpos++]; - } - hmac_.clean(); - buffer.fill(0); - counter.fill(0); - return out; - } - exports2.hkdf = hkdf; - function pbkdf2(password, salt, iterations, dkLen) { - var prf = new HMAC(password); - var len = prf.digestLength; - var ctr = new Uint8Array(4); - var t = new Uint8Array(len); - var u = new Uint8Array(len); - var dk = new Uint8Array(dkLen); - for (var i = 0; i * len < dkLen; i++) { - var c = i + 1; - ctr[0] = c >>> 24 & 255; - ctr[1] = c >>> 16 & 255; - ctr[2] = c >>> 8 & 255; - ctr[3] = c >>> 0 & 255; - prf.reset(); - prf.update(salt); - prf.update(ctr); - prf.finish(u); - for (var j = 0; j < len; j++) { - t[j] = u[j]; - } - for (var j = 2; j <= iterations; j++) { - prf.reset(); - prf.update(u).finish(u); - for (var k = 0; k < len; k++) { - t[k] ^= u[k]; - } - } - for (var j = 0; j < len && i * len + j < dkLen; j++) { - dk[i * len + j] = t[j]; - } - } - for (var i = 0; i < len; i++) { - t[i] = u[i] = 0; - } - for (var i = 0; i < 4; i++) { - ctr[i] = 0; - } - prf.clean(); - return dk; - } - exports2.pbkdf2 = pbkdf2; - }); - } -}); - -// node_modules/standardwebhooks/dist/timing_safe_equal.js -var require_timing_safe_equal = __commonJS({ - "node_modules/standardwebhooks/dist/timing_safe_equal.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.timingSafeEqual = timingSafeEqual; - function assert(expr, msg = "") { - if (!expr) { - throw new Error(msg); - } - } - function timingSafeEqual(a, b) { - if (a.byteLength !== b.byteLength) { - return false; - } - if (!(a instanceof DataView)) { - a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a); - } - if (!(b instanceof DataView)) { - b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b); - } - assert(a instanceof DataView); - assert(b instanceof DataView); - const length = a.byteLength; - let out = 0; - let i = -1; - while (++i < length) { - out |= a.getUint8(i) ^ b.getUint8(i); - } - return out === 0; - } - } -}); - -// node_modules/standardwebhooks/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/standardwebhooks/dist/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Webhook = exports.WebhookVerificationError = void 0; - var base64 = require_base64(); - var sha256 = require_sha256(); - var timing_safe_equal_1 = require_timing_safe_equal(); - var WEBHOOK_TOLERANCE_IN_SECONDS = 5 * 60; - var ExtendableError = class _ExtendableError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _ExtendableError.prototype); - this.name = "ExtendableError"; - this.stack = new Error(message).stack; - } - }; - var WebhookVerificationError = class _WebhookVerificationError extends ExtendableError { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _WebhookVerificationError.prototype); - this.name = "WebhookVerificationError"; - } - }; - exports.WebhookVerificationError = WebhookVerificationError; - var Webhook2 = class _Webhook { - constructor(secret, options) { - if ((options === null || options === void 0 ? void 0 : options.format) === "raw") { - if (secret instanceof Uint8Array) { - this.key = secret; - } else { - this.key = Uint8Array.from(secret, (c) => c.charCodeAt(0)); - } - } else { - if (typeof secret !== "string") { - throw new Error("Expected secret to be of type string"); - } - if (secret.startsWith(_Webhook.prefix)) { - secret = secret.substring(_Webhook.prefix.length); - } - this.key = base64.decode(secret); - } - if (this.key.length === 0) { - throw new Error("Secret can't be empty."); - } - } - verify(payload, headers, options) { - var _a6; - const jsonParse = (_a6 = options === null || options === void 0 ? void 0 : options.jsonParse) !== null && _a6 !== void 0 ? _a6 : true; - const normalizedHeaders = {}; - for (const key of Object.keys(headers)) { - normalizedHeaders[key.toLowerCase()] = headers[key]; - } - const msgId = normalizedHeaders["webhook-id"]; - const msgSignature = normalizedHeaders["webhook-signature"]; - const msgTimestamp = normalizedHeaders["webhook-timestamp"]; - if (!msgSignature || !msgId || !msgTimestamp) { - throw new WebhookVerificationError("Missing required headers"); - } - const timestamp2 = this.verifyTimestamp(msgTimestamp); - const computedSignature = this.sign(msgId, timestamp2, payload); - const expectedSignature = computedSignature.split(",")[1]; - const passedSignatures = msgSignature.split(" "); - const encoder3 = new globalThis.TextEncoder(); - for (const versionedSignature of passedSignatures) { - const [version, signature] = versionedSignature.split(","); - if (version !== "v1") { - continue; - } - if ((0, timing_safe_equal_1.timingSafeEqual)(encoder3.encode(signature), encoder3.encode(expectedSignature))) { - const payloadString = payload.toString(); - if (payloadString === "") { - return void 0; - } - if (jsonParse) { - return JSON.parse(payloadString); - } else { - return void 0; - } - } - } - throw new WebhookVerificationError("No matching signature found"); - } - sign(msgId, timestamp2, payload) { - if (typeof payload === "string") { - } else if (payload.constructor.name === "Buffer") { - payload = payload.toString(); - } else { - throw new Error("Expected payload to be of type string or Buffer."); - } - const encoder3 = new TextEncoder(); - const timestampNumber = Math.floor(timestamp2.getTime() / 1e3); - const toSign = encoder3.encode(`${msgId}.${timestampNumber}.${payload}`); - const expectedSignature = base64.encode(sha256.hmac(this.key, toSign)); - return `v1,${expectedSignature}`; - } - verifyTimestamp(timestampHeader) { - const now = Math.floor(Date.now() / 1e3); - const timestamp2 = parseInt(timestampHeader, 10); - if (Number.isNaN(timestamp2)) { - throw new WebhookVerificationError("Invalid Signature Headers"); - } - if (now - timestamp2 > WEBHOOK_TOLERANCE_IN_SECONDS) { - throw new WebhookVerificationError("Message timestamp too old"); - } - if (timestamp2 > now + WEBHOOK_TOLERANCE_IN_SECONDS) { - throw new WebhookVerificationError("Message timestamp too new"); - } - return new Date(timestamp2 * 1e3); - } - }; - exports.Webhook = Webhook2; - Webhook2.prefix = "whsec_"; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs -var import_standardwebhooks, Webhooks2; -var init_webhooks2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs"() { - init_resource2(); - import_standardwebhooks = __toESM(require_dist2(), 1); - Webhooks2 = class extends APIResource2 { - /** - * Parses a webhook payload into an event without verifying its signature. Prefer - * `unwrap()` unless you have already verified the signature yourself. - */ - parseUnverified(body) { - return JSON.parse(body); - } - /** - * Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and - * `webhook-signature` headers using your webhook signing key, then parses the - * payload into an event. Fails if the signature is missing or invalid. - */ - unwrap(body, options) { - const headers = options?.headers; - if (headers == null) - throw new Error("Webhook headers are required in order to verify the signature"); - const keyStr = options.key === void 0 ? this._client.webhookKey : options.key; - if (!keyStr) - throw new Error("Webhook key must not be null or empty in order to unwrap"); - const wh = new import_standardwebhooks.Webhook(keyStr); - wh.verify(body, headers); - return JSON.parse(body); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs -var Versions2; -var init_versions2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Versions2 = class extends APIResource2 { - /** - * List Agent Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsAgent of client.beta.agents.versions.list( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * )) { - * // ... - * } - * ``` - */ - list(agentID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/agents/${agentID}/versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs -var Agents2; -var init_agents2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs"() { - init_resource2(); - init_versions2(); - init_versions2(); - init_pagination2(); - init_headers3(); - init_path2(); - Agents2 = /* @__PURE__ */ (() => { - class Agents3 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions2(this._client); - } - /** - * Create Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.create({ - * model: 'claude-opus-5', - * name: 'My First Agent', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/agents?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.retrieve( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * ); - * ``` - */ - retrieve(agentID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.get(path3`/v1/agents/${agentID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.update( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * { description: 'updated' }, - * ); - * ``` - */ - update(agentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/agents/${agentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Agents - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsAgent of client.beta.agents.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/agents?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Agent - * - * @example - * ```ts - * const betaManagedAgentsAgent = - * await client.beta.agents.archive( - * 'agent_011CZkYpogX7uDKUyvBTophP', - * ); - * ``` - */ - archive(agentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/agents/${agentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Agents3.Versions = Versions2; - return Agents3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs -function linkAbort(external, controller) { - if (!external) - return () => { - }; - if (external.aborted) { - controller.abort(); - return () => { - }; - } - const onAbort = () => controller.abort(); - external.addEventListener("abort", onAbort); - return () => external.removeEventListener("abort", onAbort); +function isToolCallBlock(block) { + return block.type === "toolCall"; } -var init_abort3 = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs"() { +function isImageContentBlock(block) { + return block.type === "image"; +} +function isReasoningDetailObject(detail) { + return typeof detail === "object" && detail !== null && !Array.isArray(detail); +} +function hasValidCommonReasoningDetailFields(candidate) { + return (candidate.id === void 0 || candidate.id === null || typeof candidate.id === "string") && (candidate.format === void 0 || typeof candidate.format === "string") && (candidate.index === void 0 || typeof candidate.index === "number"); +} +function isOpenAIReasoningDetail(detail) { + if (!isReasoningDetailObject(detail) || !hasValidCommonReasoningDetailFields(detail)) { + return false; } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs -function isStatus(e, code) { - return e instanceof APIError2 && e.status === code; -} -function is4xx(e) { - return e instanceof APIError2 && typeof e.status === "number" && e.status >= 400 && e.status < 500; -} -function isFatal4xx(e) { - return is4xx(e) && !isStatus(e, 408) && !isStatus(e, 409) && !isStatus(e, 429); -} -function backoff(attempt, baseMs, capMs) { - return Math.min(baseMs * 2 ** attempt, capMs); -} -function jitter(lowMs, highMs) { - return lowMs + Math.random() * (highMs - lowMs); -} -function applyJitter(ms) { - return ms * (1 - Math.random() * 0.25); -} -var init_backoff = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs"() { - init_error3(); + switch (detail.type) { + case "reasoning.summary": + return typeof detail.summary === "string"; + case "reasoning.encrypted": + return typeof detail.data === "string"; + case "reasoning.text": + return typeof detail.text === "string" && (detail.signature === void 0 || detail.signature === null || typeof detail.signature === "string"); + default: + return false; } -}); - -// node_modules/@anthropic-ai/sdk/lib/helper-client.mjs -function copyClientForHelper(client, { authToken, helper }) { - if (!authToken) { - throw new AnthropicError(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(authToken)}`); - } - const internal = client; - const parentDefaults = internal._options.defaultHeaders; - const parentAuthExtraHeaders = internal._authState?.extraHeaders; - const inheritedAuthExtraHeaders = parentAuthExtraHeaders ? Object.fromEntries(Object.entries(parentAuthExtraHeaders).filter(([name]) => { - const lower = name.toLowerCase(); - return lower !== "authorization" && lower !== "x-api-key"; - })) : void 0; - const defaultHeaders = buildHeaders2([ - inheritedAuthExtraHeaders, - parentDefaults, - { [STAINLESS_HELPER_HEADER]: helper } - ]); - return client.withOptions({ - apiKey: null, - authToken, - baseURL: client.baseURL, - credentials: void 0, - defaultHeaders - }); } -var init_helper_client = __esm({ - "node_modules/@anthropic-ai/sdk/lib/helper-client.mjs"() { - init_error3(); - init_headers3(); - init_stainless_helper_header(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs -function backoff2(attempt) { - return backoff(attempt, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS); -} -function defaultWorkerId() { - const env = globalThis.process?.env; - const host = env?.["HOSTNAME"]; - return host ? `${host}-${uuid42()}` : uuid42(); -} -var _WorkPoller_runnerClient, _WorkPoller_consumed, _WorkPoller_controller, _WorkPoller_detachExternal, _WorkPoller_autoStop, _WorkPoller_drain, _WorkPoller_blockMs, _WorkPoller_reclaimOlderThanMs, _WorkPoller_requestOpts, _IdleLog_log, _IdleLog_environmentId, _IdleLog_idleSince, _IdleLog_lastReport, POLL_BLOCK_MS, POLL_BACKOFF_BASE_MS, POLL_BACKOFF_CAP_MS, IDLE_REPORT_INTERVAL_MS, WorkPoller, IdleLog; -var init_poller = __esm({ - "node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_sleep2(); - init_uuid2(); - init_abort3(); - init_headers3(); - init_backoff(); - init_helper_client(); - POLL_BLOCK_MS = 999; - POLL_BACKOFF_BASE_MS = 1e3; - POLL_BACKOFF_CAP_MS = 6e4; - IDLE_REPORT_INTERVAL_MS = 3e5; - WorkPoller = /* @__PURE__ */ (() => { - class WorkPoller2 { - constructor(opts) { - _WorkPoller_runnerClient.set(this, void 0); - _WorkPoller_consumed.set(this, false); - _WorkPoller_controller.set(this, void 0); - _WorkPoller_detachExternal.set(this, void 0); - _WorkPoller_autoStop.set(this, void 0); - _WorkPoller_drain.set(this, void 0); - _WorkPoller_blockMs.set(this, void 0); - _WorkPoller_reclaimOlderThanMs.set(this, void 0); - _WorkPoller_requestOpts.set(this, void 0); - this.client = opts.client; - this.environmentId = opts.environmentId; - this.environmentKey = opts.environmentKey; - this.workerId = opts.workerId ?? defaultWorkerId(); - __classPrivateFieldSet2(this, _WorkPoller_runnerClient, copyClientForHelper(opts.client, { - authToken: opts.environmentKey, - helper: "environments-work-poller" - }), "f"); - __classPrivateFieldSet2(this, _WorkPoller_autoStop, opts.autoStop ?? true, "f"); - __classPrivateFieldSet2(this, _WorkPoller_drain, opts.drain ?? false, "f"); - __classPrivateFieldSet2(this, _WorkPoller_blockMs, opts.blockMs === void 0 ? POLL_BLOCK_MS : opts.blockMs, "f"); - __classPrivateFieldSet2(this, _WorkPoller_reclaimOlderThanMs, opts.reclaimOlderThanMs ?? null, "f"); - __classPrivateFieldSet2(this, _WorkPoller_requestOpts, opts.requestOptions, "f"); - __classPrivateFieldSet2(this, _WorkPoller_controller, new AbortController(), "f"); - __classPrivateFieldSet2(this, _WorkPoller_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet2(this, _WorkPoller_controller, "f")), "f"); - } - /** Read-only view of this iterator's abort signal. */ - get signal() { - return __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal; - } - /** Abort the iterator. The current `for await` will exit cleanly. */ - abort() { - __classPrivateFieldGet2(this, _WorkPoller_controller, "f").abort(); - } - async *[(_WorkPoller_runnerClient = /* @__PURE__ */ new WeakMap(), _WorkPoller_consumed = /* @__PURE__ */ new WeakMap(), _WorkPoller_controller = /* @__PURE__ */ new WeakMap(), _WorkPoller_detachExternal = /* @__PURE__ */ new WeakMap(), _WorkPoller_autoStop = /* @__PURE__ */ new WeakMap(), _WorkPoller_drain = /* @__PURE__ */ new WeakMap(), _WorkPoller_blockMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_reclaimOlderThanMs = /* @__PURE__ */ new WeakMap(), _WorkPoller_requestOpts = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet2(this, _WorkPoller_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed WorkPoller"); - } - __classPrivateFieldSet2(this, _WorkPoller_consumed, true, "f"); - const log = loggerFor2(this.client); - log.info("poller starting", { - component: "work-poller", - environment_id: this.environmentId - }); - const idle = new IdleLog(log, this.environmentId); - try { - let attempt = 0; - while (!__classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal.aborted) { - let work; - try { - work = await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.poll(this.environmentId, { - "Anthropic-Worker-ID": this.workerId, - ...__classPrivateFieldGet2(this, _WorkPoller_blockMs, "f") !== null ? { block_ms: __classPrivateFieldGet2(this, _WorkPoller_blockMs, "f") } : {}, - ...__classPrivateFieldGet2(this, _WorkPoller_reclaimOlderThanMs, "f") !== null ? { reclaim_older_than_ms: __classPrivateFieldGet2(this, _WorkPoller_reclaimOlderThanMs, "f") } : {} - }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal }); - } catch (e) { - if (__classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal.aborted) - return; - if (isFatal4xx(e)) { - log.error("poll failed permanently, stopping poller", { error: String(e) }); - throw e; - } - const wait = applyJitter(backoff2(attempt)); - log.warn("poll failed, backing off", { error: String(e), backoff_ms: wait }); - attempt++; - await sleep2(wait, __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal); - continue; - } - attempt = 0; - if (work == null) { - if (__classPrivateFieldGet2(this, _WorkPoller_drain, "f")) - return; - idle.onEmptyPoll(); - await sleep2(jitter(1e3, 3e3), __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal); - continue; - } - idle.onClaim(); - log.info("claimed work", { - component: "work-poller", - environment_id: this.environmentId, - work_id: work.id, - work_type: work.data.type - }); - try { - await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.ack(work.id, { environment_id: work.environment_id }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]), signal: __classPrivateFieldGet2(this, _WorkPoller_controller, "f").signal }); - } catch (e) { - log.error("ack failed", { work_id: work.id, error: String(e) }); - continue; - } - try { - yield work; - } finally { - if (__classPrivateFieldGet2(this, _WorkPoller_autoStop, "f")) { - try { - await __classPrivateFieldGet2(this, _WorkPoller_runnerClient, "f").beta.environments.work.stop(work.id, { environment_id: work.environment_id }, { headers: buildHeaders2([__classPrivateFieldGet2(this, _WorkPoller_requestOpts, "f")?.headers]) }); - } catch (e) { - if (!isStatus(e, 409)) - log.warn("stop failed", { work_id: work.id, error: String(e) }); - } - } - } - } - } finally { - __classPrivateFieldGet2(this, _WorkPoller_detachExternal, "f").call(this); - } - } - } - return WorkPoller2; - })(); - IdleLog = /* @__PURE__ */ (() => { - class IdleLog2 { - constructor(log, environmentId) { - _IdleLog_log.set(this, void 0); - _IdleLog_environmentId.set(this, void 0); - _IdleLog_idleSince.set(this, void 0); - _IdleLog_lastReport.set(this, 0); - __classPrivateFieldSet2(this, _IdleLog_log, log, "f"); - __classPrivateFieldSet2(this, _IdleLog_environmentId, environmentId, "f"); - } - onEmptyPoll() { - const now = Date.now(); - const fields = { component: "work-poller", environment_id: __classPrivateFieldGet2(this, _IdleLog_environmentId, "f") }; - if (__classPrivateFieldGet2(this, _IdleLog_idleSince, "f") === void 0) { - __classPrivateFieldSet2(this, _IdleLog_idleSince, __classPrivateFieldSet2(this, _IdleLog_lastReport, now, "f"), "f"); - __classPrivateFieldGet2(this, _IdleLog_log, "f").info("idle; polling for work", fields); - } else if (now - __classPrivateFieldGet2(this, _IdleLog_lastReport, "f") >= IDLE_REPORT_INTERVAL_MS) { - __classPrivateFieldSet2(this, _IdleLog_lastReport, now, "f"); - __classPrivateFieldGet2(this, _IdleLog_log, "f").info(`still polling; idle for ${Math.round((now - __classPrivateFieldGet2(this, _IdleLog_idleSince, "f")) / 1e3)}s`, fields); - } else { - __classPrivateFieldGet2(this, _IdleLog_log, "f").debug("poll returned no work", fields); - } - } - onClaim() { - __classPrivateFieldSet2(this, _IdleLog_idleSince, void 0, "f"); - } - } - _IdleLog_log = /* @__PURE__ */ new WeakMap(), _IdleLog_environmentId = /* @__PURE__ */ new WeakMap(), _IdleLog_idleSince = /* @__PURE__ */ new WeakMap(), _IdleLog_lastReport = /* @__PURE__ */ new WeakMap(); - return IdleLog2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs -var _AsyncQueue_items, _AsyncQueue_waiters, _AsyncQueue_closed, AsyncQueue; -var init_async_queue = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs"() { - init_tslib2(); - AsyncQueue = /* @__PURE__ */ (() => { - class AsyncQueue2 { - constructor() { - _AsyncQueue_items.set(this, []); - _AsyncQueue_waiters.set(this, []); - _AsyncQueue_closed.set(this, false); - } - /** Enqueue an item, or hand it directly to a waiting reader. Returns `false` once closed. */ - push(item) { - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f")) - return false; - const w = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").shift(); - if (w) - w({ done: false, value: item }); - else - __classPrivateFieldGet2(this, _AsyncQueue_items, "f").push(item); - return true; - } - /** Mark the queue done. Idempotent; wakes every pending reader with `done: true`. */ - close() { - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f")) - return; - __classPrivateFieldSet2(this, _AsyncQueue_closed, true, "f"); - while (__classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").length > 0) { - const w = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").shift(); - w({ done: true, value: void 0 }); - } - } - /** - * Resolve with the next item, or `done: true` once the queue is closed and - * drained. When `signal` is supplied, aborting it resolves a pending read - * with `done: true` (cancellation is pushed down here rather than handled by - * an outer `Promise.race`). - */ - next(signal) { - if (__classPrivateFieldGet2(this, _AsyncQueue_items, "f").length > 0) { - return Promise.resolve({ done: false, value: __classPrivateFieldGet2(this, _AsyncQueue_items, "f").shift() }); - } - if (__classPrivateFieldGet2(this, _AsyncQueue_closed, "f") || signal?.aborted) { - return Promise.resolve({ done: true, value: void 0 }); - } - return new Promise((resolve) => { - const waiter = (r) => { - signal?.removeEventListener("abort", onAbort); - resolve(r); - }; - const onAbort = () => { - const idx = __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").indexOf(waiter); - if (idx >= 0) - __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").splice(idx, 1); - resolve({ done: true, value: void 0 }); - }; - __classPrivateFieldGet2(this, _AsyncQueue_waiters, "f").push(waiter); - signal?.addEventListener("abort", onAbort, { once: true }); - }); - } - /** Synchronously remove and return the next buffered item, or `undefined` if empty. */ - tryShift() { - return __classPrivateFieldGet2(this, _AsyncQueue_items, "f").shift(); - } - } - _AsyncQueue_items = /* @__PURE__ */ new WeakMap(), _AsyncQueue_waiters = /* @__PURE__ */ new WeakMap(), _AsyncQueue_closed = /* @__PURE__ */ new WeakMap(); - return AsyncQueue2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs -var ToolError; -var init_ToolError = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs"() { - ToolError = /* @__PURE__ */ (() => { - class ToolError2 extends Error { - constructor(content) { - const message = typeof content === "string" ? content : content.map((block) => { - if (block.type === "text") - return block.text; - return `[${block.type}]`; - }).join(" "); - super(message); - this.name = "ToolError"; - this.content = content; - } - } - return ToolError2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs -function toolName(tool) { - return "name" in tool ? tool.name : "mcp_server_name" in tool ? tool.mcp_server_name : tool.type; -} -function toolErrorContent(e) { - return e instanceof ToolError ? e.content : `Error: ${e instanceof Error ? e.message : String(e)}`; -} -async function runRunnableTool(tool, rawInput, context) { +function parseOpenAIReasoningDetails(signature) { + if (!signature) + return void 0; try { - const input = tool.parse ? tool.parse(rawInput) : rawInput; - const content = await tool.run(input, context); - return { content, isError: false }; - } catch (e) { - return { content: toolErrorContent(e), isError: true }; - } -} -var init_BetaRunnableTool = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs"() { - init_ToolError(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs -function isEndTurnIdle(ev) { - return ev.type === "session.status_idle" && ev.stop_reason?.type === "end_turn"; -} -function buildResultEvent(ev, isError, content) { - if (ev.type === "agent.custom_tool_use") { - return { type: "user.custom_tool_result", custom_tool_use_id: ev.id, is_error: isError, content }; - } - return { type: "user.tool_result", tool_use_id: ev.id, is_error: isError, content }; -} -function toSessionContent(content) { - if (typeof content === "string") - return [{ type: "text", text: content || "(no output)" }]; - const out = content.map((b) => { - if (b.type === "text") - return { type: "text", text: b.text || "(no output)" }; - if (b.type === "image" || b.type === "document") - return b; - if (b.type === "search_result") { - return { - type: "search_result", - source: b.source, - title: b.title, - content: b.content.map((c) => ({ type: "text", text: c.text })), - citations: { enabled: b.citations?.enabled ?? false } - }; - } - return { type: "text", text: JSON.stringify(b) }; - }); - return out.length > 0 ? out : [{ type: "text", text: "(no output)" }]; -} -var _IdleClock_maxIdleMs, _IdleClock_onExpire, _IdleClock_blockers, _IdleClock_armPending, _IdleClock_timer, _SessionToolRunner_instances, _SessionToolRunner_consumed, _SessionToolRunner_controller, _SessionToolRunner_detachExternal, _SessionToolRunner_requestOpts, _SessionToolRunner_toolByName, _SessionToolRunner_logger, _SessionToolRunner_seen, _SessionToolRunner_answered, _SessionToolRunner_confirmationVerdicts, _SessionToolRunner_awaitingConfirmation, _SessionToolRunner_results, _SessionToolRunner_inFlightCount, _SessionToolRunner_sendRetryWindowMs, _SessionToolRunner_onIdle, _SessionToolRunner_idleClock, _SessionToolRunner_requestOptions, _SessionToolRunner_streamLoop, _SessionToolRunner_reconcile, _SessionToolRunner_ingestHistory, _SessionToolRunner_handleStreamEvent, _SessionToolRunner_routeToolEvent, _SessionToolRunner_noteConfirmation, _SessionToolRunner_applyVerdict, _SessionToolRunner_surfaceCall, _SessionToolRunner_execute, _SessionToolRunner_sendResult, _SessionToolRunner_drain, STREAM_BACKOFF_START_MS, STREAM_BACKOFF_CAP_MS, TOOL_TIMEOUT_MS, DRAIN_TIMEOUT_MS, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS, SEND_RETRY_WINDOW_MS, DEFAULT_MAX_IDLE_MS, IdleClock, SessionToolRunner; -var init_SessionToolRunner = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_sleep2(); - init_backoff(); - init_abort3(); - init_async_queue(); - init_headers3(); - init_stainless_helper_header(); - init_BetaRunnableTool(); - STREAM_BACKOFF_START_MS = 500; - STREAM_BACKOFF_CAP_MS = 1e4; - TOOL_TIMEOUT_MS = 12e4; - DRAIN_TIMEOUT_MS = 3e4; - SEND_BACKOFF_START_MS = 1e3; - SEND_BACKOFF_CAP_MS = 3e4; - SEND_RETRY_WINDOW_MS = 5 * 6e4; - DEFAULT_MAX_IDLE_MS = 6e4; - IdleClock = /* @__PURE__ */ (() => { - class IdleClock2 { - constructor(maxIdleMs, onExpire) { - _IdleClock_maxIdleMs.set(this, void 0); - _IdleClock_onExpire.set(this, void 0); - _IdleClock_blockers.set(this, /* @__PURE__ */ new Set()); - _IdleClock_armPending.set(this, false); - _IdleClock_timer.set(this, void 0); - __classPrivateFieldSet2(this, _IdleClock_maxIdleMs, maxIdleMs, "f"); - __classPrivateFieldSet2(this, _IdleClock_onExpire, onExpire, "f"); - } - /** - * Arm on `status_idle{end_turn}`; disarm otherwise. `user.tool_confirmation` - * is neutral: it signals neither agent activity nor an idle, and its effect - * on the clock flows through {@link block} / {@link unblock} instead — - * disarming here would discard the pending arm the verdict is about to - * settle. - */ - noteEvent(ev) { - if (ev.type === "user.tool_confirmation") - return; - if (isEndTurnIdle(ev)) - this.arm(); - else - this.disarm(); - } - /** Register gated work that must resolve before an idle countdown starts. */ - block(toolUseId) { - __classPrivateFieldGet2(this, _IdleClock_blockers, "f").add(toolUseId); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) { - __classPrivateFieldSet2(this, _IdleClock_armPending, true, "f"); - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, void 0, "f"); - } - } - /** - * Retire gated work (a no-op for ids never blocked); applies a pending arm — - * with a fresh full `maxIdleMs` window — once the last blocker retires. - */ - unblock(toolUseId) { - __classPrivateFieldGet2(this, _IdleClock_blockers, "f").delete(toolUseId); - if (__classPrivateFieldGet2(this, _IdleClock_blockers, "f").size === 0 && __classPrivateFieldGet2(this, _IdleClock_armPending, "f")) - this.arm(); - } - /** - * (Re)start the idle countdown — or, while blockers are outstanding, hold - * the arm pending instead. Stopping then would drop a held call when its - * verdict later arrives, or cut the runner off before a released call's - * result can drive the next turn. - */ - arm() { - if (__classPrivateFieldGet2(this, _IdleClock_maxIdleMs, "f") <= 0) - return; - if (__classPrivateFieldGet2(this, _IdleClock_blockers, "f").size > 0) { - __classPrivateFieldSet2(this, _IdleClock_armPending, true, "f"); - return; - } - __classPrivateFieldSet2(this, _IdleClock_armPending, false, "f"); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, setTimeout(__classPrivateFieldGet2(this, _IdleClock_onExpire, "f"), __classPrivateFieldGet2(this, _IdleClock_maxIdleMs, "f")), "f"); - } - /** - * Cancel the idle countdown and any pending arm. Blockers persist — they - * track real outstanding work, retired only by {@link unblock}. - */ - disarm() { - __classPrivateFieldSet2(this, _IdleClock_armPending, false, "f"); - if (__classPrivateFieldGet2(this, _IdleClock_timer, "f") !== void 0) { - clearTimeout(__classPrivateFieldGet2(this, _IdleClock_timer, "f")); - __classPrivateFieldSet2(this, _IdleClock_timer, void 0, "f"); - } - } - } - _IdleClock_maxIdleMs = /* @__PURE__ */ new WeakMap(), _IdleClock_onExpire = /* @__PURE__ */ new WeakMap(), _IdleClock_blockers = /* @__PURE__ */ new WeakMap(), _IdleClock_armPending = /* @__PURE__ */ new WeakMap(), _IdleClock_timer = /* @__PURE__ */ new WeakMap(); - return IdleClock2; - })(); - SessionToolRunner = /* @__PURE__ */ (() => { - class SessionToolRunner2 { - constructor(sessionId, opts) { - _SessionToolRunner_instances.add(this); - _SessionToolRunner_consumed.set(this, false); - _SessionToolRunner_controller.set(this, void 0); - _SessionToolRunner_detachExternal.set(this, void 0); - _SessionToolRunner_requestOpts.set(this, void 0); - _SessionToolRunner_toolByName.set(this, void 0); - _SessionToolRunner_logger.set(this, void 0); - _SessionToolRunner_seen.set(this, /* @__PURE__ */ new Set()); - _SessionToolRunner_answered.set(this, /* @__PURE__ */ new Set()); - _SessionToolRunner_confirmationVerdicts.set(this, /* @__PURE__ */ new Map()); - _SessionToolRunner_awaitingConfirmation.set(this, /* @__PURE__ */ new Map()); - _SessionToolRunner_results.set(this, new AsyncQueue()); - _SessionToolRunner_inFlightCount.set(this, 0); - _SessionToolRunner_sendRetryWindowMs.set(this, SEND_RETRY_WINDOW_MS); - _SessionToolRunner_onIdle.set(this, null); - _SessionToolRunner_idleClock.set(this, void 0); - this.client = opts.client; - this.sessionId = sessionId; - this.tools = opts.tools; - this.maxIdleMs = opts.maxIdleMs ?? DEFAULT_MAX_IDLE_MS; - __classPrivateFieldSet2(this, _SessionToolRunner_logger, loggerFor2(opts.client), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_toolByName, new Map(opts.tools.map((t) => [toolName(t), t])), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_controller, new AbortController(), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_detachExternal, linkAbort(opts.signal, __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f")), "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_requestOpts, opts.requestOptions, "f"); - __classPrivateFieldSet2(this, _SessionToolRunner_idleClock, new IdleClock(this.maxIdleMs, () => { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session idle after end_turn; stopping", { - component: "session-tool-runner", - session_id: this.sessionId, - max_idle_ms: this.maxIdleMs - }); - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - }), "f"); - } - /** Read-only view of this runner's abort signal. */ - get signal() { - return __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal; - } - /** Abort the runner. Background tasks will wind down and `for await` will exit cleanly. */ - abort() { - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - } - /** - * @internal - * `EnvironmentWorker` keeps this equal to the lease TTL each heartbeat - * reports; applies to a send already retrying. - */ - _setSendRetryWindow(ms) { - __classPrivateFieldSet2(this, _SessionToolRunner_sendRetryWindowMs, ms, "f"); - } - async *[(_SessionToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_controller = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_detachExternal = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_requestOpts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_toolByName = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_logger = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_seen = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_answered = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_confirmationVerdicts = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_awaitingConfirmation = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_results = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_inFlightCount = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_sendRetryWindowMs = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_onIdle = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_idleClock = /* @__PURE__ */ new WeakMap(), _SessionToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - if (__classPrivateFieldGet2(this, _SessionToolRunner_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed SessionToolRunner"); - } - __classPrivateFieldSet2(this, _SessionToolRunner_consumed, true, "f"); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session tool runner starting", { - component: "session-tool-runner", - session_id: this.sessionId - }); - const streamPromise = __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_streamLoop).call(this).catch((e) => { - if (!__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal.aborted) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("stream loop failed", { error: String(e) }); - } - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - }); - try { - while (true) { - const next = await __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").next(__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal); - if (next.done) - break; - yield next.value; - } - await streamPromise; - let pending; - while ((pending = __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").tryShift()) !== void 0) { - yield pending; - } - } finally { - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - await streamPromise; - try { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_drain).call(this); - } catch (e) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("drain failed", { error: String(e) }); - } - __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").close(); - for (const t of this.tools) { - try { - await t.close?.(); - } catch (e) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("tool.close failed", { tool: toolName(t), error: String(e) }); - } - } - __classPrivateFieldGet2(this, _SessionToolRunner_detachExternal, "f").call(this); - } - } - } - _SessionToolRunner_requestOptions = function _SessionToolRunner_requestOptions2() { - return { - ...__classPrivateFieldGet2(this, _SessionToolRunner_requestOpts, "f"), - headers: buildHeaders2([helperHeader("session-tool-runner"), __classPrivateFieldGet2(this, _SessionToolRunner_requestOpts, "f")?.headers]), - signal: __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal - }; - }, _SessionToolRunner_streamLoop = // ===== event stream ===== - async function _SessionToolRunner_streamLoop2() { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - let backoff3 = STREAM_BACKOFF_START_MS; - while (!ctrl.signal.aborted) { - try { - const stream4 = await this.client.beta.sessions.events.stream(this.sessionId, {}, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_reconcile).call(this); - for await (const ev of stream4) { - backoff3 = STREAM_BACKOFF_START_MS; - if (await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_handleStreamEvent).call(this, ev)) - return; - } - } catch (e) { - ctrl.signal.throwIfAborted(); - if (isFatal4xx(e)) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("permanent stream failure, shutting down", { error: String(e) }); - ctrl.abort(); - throw e; - } - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("stream disconnected, reconnecting", { - error: String(e), - backoff_ms: backoff3 - }); - } - ctrl.signal.throwIfAborted(); - await sleep2(backoff3, ctrl.signal); - backoff3 = Math.min(backoff3 * 2, STREAM_BACKOFF_CAP_MS); - } - }, _SessionToolRunner_reconcile = /** - * Read full history before dispatching so a `tool_use` whose result appears - * later in the same history is not re-executed. Runs after the live stream is - * already attached (see {@link SessionToolRunner.#streamLoop}). - */ - async function _SessionToolRunner_reconcile2() { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - const pending = []; - let lastWasEndTurn = false; - try { - for await (const ev of this.client.beta.sessions.events.list(this.sessionId, { limit: 1e3 }, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this))) { - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_ingestHistory).call(this, ev, pending); - lastWasEndTurn = isEndTurnIdle(ev); - } - } catch (e) { - ctrl.signal.throwIfAborted(); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("reconcile list failed", { error: String(e) }); - for (const ev of pending) - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").delete(ev.id); - return; - } - const unanswered = pending.filter((ev) => !__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - for (const ev of unanswered) - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); - for (const held of [...__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").values()]) { - const verdict = __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").get(held.id); - if (verdict !== void 0) - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held, verdict); - } - const outstanding = unanswered.filter((ev) => !__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id) && !__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)); - if (lastWasEndTurn && outstanding.length === 0) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").arm(); - else - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").disarm(); - }, _SessionToolRunner_ingestHistory = function _SessionToolRunner_ingestHistory2(ev, pending) { - if (ev.type === "agent.tool_use" || ev.type === "agent.custom_tool_use") { - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").add(ev.id); - if (!__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)) - pending.push(ev); - } else if (ev.type === "user.tool_result") { - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); - } else if (ev.type === "user.custom_tool_result") { - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); - } else if (ev.type === "user.tool_confirmation") { - if (!__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.tool_use_id)) - __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); - } - }, _SessionToolRunner_handleStreamEvent = /** Returns true when the runner should exit. */ - async function _SessionToolRunner_handleStreamEvent2(ev) { - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").noteEvent(ev); - switch (ev.type) { - case "agent.tool_use": - case "agent.custom_tool_use": - if (!__classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").has(ev.id)) { - __classPrivateFieldGet2(this, _SessionToolRunner_seen, "f").add(ev.id); - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_routeToolEvent).call(this, ev); - } - return false; - case "user.tool_confirmation": - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_noteConfirmation).call(this, ev); - return false; - case "user.tool_result": - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.tool_use_id); - return false; - case "user.custom_tool_result": - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.custom_tool_use_id); - return false; - case "session.status_terminated": - case "session.deleted": - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("session terminated", { - component: "session-tool-runner", - session_id: this.sessionId - }); - __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").abort(); - return true; - default: - return false; - } - }, _SessionToolRunner_routeToolEvent = // ===== confirmation gating (always_ask tools) ===== - /** - * Dispatch `ev`, honoring its evaluated permission. A call the server gated - * (`evaluated_permission == "ask"`) is held until its `user.tool_confirmation` - * arrives. Fails closed: only an explicit `allow` verdict releases a gated - * call; a server-side `deny` overrides any recorded verdict; an unrecognized - * permission is held like `ask` and an unrecognized verdict is denied. - */ - async function _SessionToolRunner_routeToolEvent2(ev) { - const permission = ev.evaluated_permission; - const verdict = permission === "deny" ? "deny" : __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").get(ev.id); - if (verdict === void 0) { - if (permission === void 0 || permission === "allow") { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, void 0); - } else if (!__classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").has(ev.id)) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call awaiting confirmation; holding", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").set(ev.id, ev); - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").block(ev.id); - } - return; - } - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, ev, verdict); - }, _SessionToolRunner_noteConfirmation = /** Record an allow/deny verdict and release the held call it gates, if any. */ - async function _SessionToolRunner_noteConfirmation2(ev) { - __classPrivateFieldGet2(this, _SessionToolRunner_confirmationVerdicts, "f").set(ev.tool_use_id, ev.result); - const held = __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").get(ev.tool_use_id); - if (held === void 0) - return; - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_applyVerdict).call(this, held, ev.result); - }, _SessionToolRunner_applyVerdict = /** - * Dispatch or resolve a gated call according to its verdict. - * - * The idle-clock blocker accounting lives here: a denial retires the held - * call's blocker, while an allow keeps one on the call — taking it now if the - * verdict was already known when the call was routed, so it was never held — - * until `#execute` has finished with it. The countdown must not run over - * gated work that is still in flight. - */ - async function _SessionToolRunner_applyVerdict2(ev, verdict) { - const wasHeld = __classPrivateFieldGet2(this, _SessionToolRunner_awaitingConfirmation, "f").delete(ev.id); - if (verdict === "allow") { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call confirmed", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - if (!wasHeld) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").block(ev.id); - try { - await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_execute).call(this, ev, "allow"); - } finally { - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); - } - return; - } - if (wasHeld) - __classPrivateFieldGet2(this, _SessionToolRunner_idleClock, "f").unblock(ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool call denied; not executing", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - toolUseId: ev.id, - name: ev.name, - isError: false, - posted: false, - confirmation: "deny" - }); - }, _SessionToolRunner_surfaceCall = function _SessionToolRunner_surfaceCall2(call) { - __classPrivateFieldGet2(this, _SessionToolRunner_results, "f").push(call); - }, _SessionToolRunner_execute = // ===== tool execution ===== - async function _SessionToolRunner_execute2(ev, confirmation) { - var _a6, _b; - if (__classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").has(ev.id)) - return; - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("executing tool", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldSet2(this, _SessionToolRunner_inFlightCount, (_a6 = __classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f"), _a6++, _a6), "f"); - try { - const tool = __classPrivateFieldGet2(this, _SessionToolRunner_toolByName, "f").get(ev.name); - if (!tool) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner", { - component: "session-tool-runner", - session_id: this.sessionId, - tool: ev.name, - tool_use_id: ev.id - }); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - toolUseId: ev.id, - name: ev.name, - isError: false, - posted: false, - confirmation - }); - return; - } - let content; - let isError; - const toolCtrl = new AbortController(); - const detachTool = linkAbort(__classPrivateFieldGet2(this, _SessionToolRunner_controller, "f").signal, toolCtrl); - const timer = setTimeout(() => toolCtrl.abort(), TOOL_TIMEOUT_MS); - try { - const outcome = await runRunnableTool(tool, ev.input, { - toolUse: ev, - toolUseBlock: ev, - signal: toolCtrl.signal - }); - content = outcome.content; - isError = outcome.isError; - } finally { - clearTimeout(timer); - detachTool(); - } - const result = buildResultEvent(ev, isError, toSessionContent(content)); - const posted = await __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_sendResult).call(this, result, ev.id); - __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_surfaceCall).call(this, { - event: ev, - result, - toolUseId: ev.id, - name: ev.name, - isError, - posted, - confirmation - }); - } finally { - __classPrivateFieldSet2(this, _SessionToolRunner_inFlightCount, (_b = __classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f"), _b--, _b), "f"); - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") === 0) - __classPrivateFieldGet2(this, _SessionToolRunner_onIdle, "f")?.call(this); - } - }, _SessionToolRunner_sendResult = async function _SessionToolRunner_sendResult2(result, toolUseId) { - const ctrl = __classPrivateFieldGet2(this, _SessionToolRunner_controller, "f"); - const start = Date.now(); - let lastErr; - let attempt = 0; - while (true) { - attempt++; - ctrl.signal.throwIfAborted(); - try { - await this.client.beta.sessions.events.send(this.sessionId, { events: [result] }, __classPrivateFieldGet2(this, _SessionToolRunner_instances, "m", _SessionToolRunner_requestOptions).call(this)); - __classPrivateFieldGet2(this, _SessionToolRunner_answered, "f").add(toolUseId); - return true; - } catch (e) { - lastErr = e; - if (isFatal4xx(e)) - break; - const remainingMs = __classPrivateFieldGet2(this, _SessionToolRunner_sendRetryWindowMs, "f") - (Date.now() - start); - if (remainingMs <= 0) - break; - const waitMs = Math.min(applyJitter(backoff(attempt - 1, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS)), remainingMs); - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("tool result send failed; retrying", { - tool_use_id: toolUseId, - attempt, - backoff_ms: waitMs, - error: String(e) - }); - await sleep2(waitMs, ctrl.signal); - } - } - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").error("failed to send tool result", { - tool_use_id: toolUseId, - attempts: attempt, - error: String(lastErr) - }); - return false; - }, _SessionToolRunner_drain = /** Wait (bounded) for in-flight tool executions to finish during teardown. */ - async function _SessionToolRunner_drain2() { - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") === 0) - return; - await Promise.race([new Promise((r) => __classPrivateFieldSet2(this, _SessionToolRunner_onIdle, r, "f")), sleep2(DRAIN_TIMEOUT_MS)]); - __classPrivateFieldSet2(this, _SessionToolRunner_onIdle, null, "f"); - if (__classPrivateFieldGet2(this, _SessionToolRunner_inFlightCount, "f") > 0) { - __classPrivateFieldGet2(this, _SessionToolRunner_logger, "f").warn("drain timeout exceeded"); - } - }; - return SessionToolRunner2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs -function checkMemorySyncInterval(ms, option) { - if (!(ms >= MIN_MEMORY_SYNC_INTERVAL_MS)) { - throw new AnthropicError(`${option} must be at least ${MIN_MEMORY_SYNC_INTERVAL_MS}ms (got ${ms}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`); - } -} -var DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS; -var init_sync_interval = __esm({ - "node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs"() { - init_error3(); - DEFAULT_MEMORY_SYNC_INTERVAL_MS = 15e3; - MIN_MEMORY_SYNC_INTERVAL_MS = 5e3; - } -}); - -// node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs -var node_browser_exports2 = {}; -__export(node_browser_exports2, { - BashSession: () => BashSession, - BashTimeoutError: () => BashTimeoutError, - DEFAULT_MEMORY_SYNC_INTERVAL_MS: () => DEFAULT_MEMORY_SYNC_INTERVAL_MS, - MARKER_PATH: () => MARKER_PATH, - MEMORY_FLUSH_TIMEOUT_MS: () => MEMORY_FLUSH_TIMEOUT_MS, - MIN_MEMORY_SYNC_INTERVAL_MS: () => MIN_MEMORY_SYNC_INTERVAL_MS, - SessionMemoryError: () => SessionMemoryError, - SessionMemoryStores: () => SessionMemoryStores, - betaAgentToolset20260401: () => betaAgentToolset20260401, - betaBashTool: () => betaBashTool, - betaEditTool: () => betaEditTool, - betaGlobTool: () => betaGlobTool, - betaGrepTool: () => betaGrepTool, - betaReadTool: () => betaReadTool, - betaWriteTool: () => betaWriteTool, - extractSkillArchive: () => extractSkillArchive, - resolvePath: () => resolvePath, - setupSkills: () => setupSkills -}); -function nodeOnly(name) { - throw new AnthropicError(`${name} requires Node.js or a Node-compatible runtime`); -} -function setupSkills(_ctx) { - return nodeOnly("setupSkills"); -} -function extractSkillArchive(_resp, _dest) { - return nodeOnly("extractSkillArchive"); -} -function betaAgentToolset20260401(_ctx) { - return nodeOnly("betaAgentToolset20260401"); -} -function resolvePath(_ctx, _p) { - return nodeOnly("resolvePath"); -} -function betaBashTool(_ctx) { - return nodeOnly("betaBashTool"); -} -function betaReadTool(_ctx) { - return nodeOnly("betaReadTool"); -} -function betaWriteTool(_ctx) { - return nodeOnly("betaWriteTool"); -} -function betaEditTool(_ctx) { - return nodeOnly("betaEditTool"); -} -function betaGlobTool(_ctx) { - return nodeOnly("betaGlobTool"); -} -function betaGrepTool(_ctx) { - return nodeOnly("betaGrepTool"); -} -var MEMORY_FLUSH_TIMEOUT_MS, MARKER_PATH, SessionMemoryError, SessionMemoryStores, BashTimeoutError, BashSession; -var init_node_browser2 = __esm({ - "node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs"() { - init_error3(); - init_sync_interval(); - MEMORY_FLUSH_TIMEOUT_MS = 3e4; - MARKER_PATH = ".anthropic-memory-store"; - SessionMemoryError = class extends AnthropicError { - constructor(message, cause) { - super(message); - this.name = "SessionMemoryError"; - if (cause !== void 0) - this.cause = cause; - } - }; - SessionMemoryStores = class { - constructor(_client, _opts) { - nodeOnly("SessionMemoryStores"); - } - get roots() { - return nodeOnly("SessionMemoryStores"); - } - get readOnlyRoots() { - return nodeOnly("SessionMemoryStores"); - } - download(_session) { - return nodeOnly("SessionMemoryStores"); - } - finish() { - return nodeOnly("SessionMemoryStores"); - } - /** @internal */ - syncAll(_final) { - return nodeOnly("SessionMemoryStores"); - } - syncIfDue() { - return nodeOnly("SessionMemoryStores"); - } - flushWrites(_signal) { - return nodeOnly("SessionMemoryStores"); - } - dispose() { - return nodeOnly("SessionMemoryStores"); - } - }; - BashTimeoutError = class extends AnthropicError { - constructor(timeoutMs) { - super(`bash command timed out after ${timeoutMs}ms`); - this.name = "BashTimeoutError"; - this.timeoutMs = timeoutMs; - } - }; - BashSession = class { - constructor(_dir, _env) { - nodeOnly("BashSession"); - } - get closed() { - return nodeOnly("BashSession"); - } - exec(_command, _opts = {}) { - return nodeOnly("BashSession"); - } - close() { - nodeOnly("BashSession"); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs -function hasMemoryStore(session) { - return session.resources.some((r) => r.type === "memory_store"); -} -function sessionsTokenFromSecret(secret) { - if (!secret) - return null; - let parsed; - try { - const normalized = secret.replace(/-/g, "+").replace(/_/g, "/"); - const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "="); - parsed = JSON.parse(decodeUTF82(fromBase642(padded))); + const parsed = JSON.parse(signature); + return Array.isArray(parsed) && parsed.length > 0 && parsed.every(isOpenAIReasoningDetail) ? parsed : void 0; } catch { - return null; + return void 0; } - if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) - return null; - const token = parsed.sessions_token; - return typeof token === "string" && token !== "" ? token : null; } -async function withTimeout(p, ms) { - let timer; +function parseLegacyEncryptedReasoningDetail(signature) { + if (!signature) + return void 0; try { - return await Promise.race([ - p.then(() => false, () => false), - new Promise((resolve) => { - timer = setTimeout(() => resolve(true), ms); - }) - ]); - } finally { - if (timer !== void 0) - clearTimeout(timer); + const parsed = JSON.parse(signature); + return isOpenAIReasoningDetail(parsed) && parsed.type === "reasoning.encrypted" && typeof parsed.id === "string" && parsed.id.length > 0 && parsed.data.length > 0 ? parsed : void 0; + } catch { + return void 0; } } -async function forceStop(client, work, log, requestOptions) { - try { - await client.beta.environments.work.stop( - work.id, - { environment_id: work.environment_id, force: true }, - // Caller's headers pass through; the helper-tag header is on the scoped - // sub-client's default_headers via copyClientForHelper, so no per-call - // re-stamping needed. - { ...requestOptions, headers: buildHeaders2([requestOptions?.headers]) } - ); - } catch (e) { - if (!isStatus(e, 409)) { - log.error("force-stop on exit failed", { work_id: work.id, error: String(e) }); - } - } +function fillMissingCommonReasoningDetailFields(target, source) { + target.id ??= source.id; + target.format ||= source.format; + target.index ??= source.index; } -function serverLeaseState(e) { - let node = e instanceof APIError2 ? e.error : void 0; - for (const key of ["error", "details", "current_state"]) { - if (!isObj2(node)) - return {}; - node = node[key]; - } - return isObj2(node) ? node : {}; -} -async function heartbeatLoop(client, work, lease, logger, requestOptions, onLeaseTtl) { - let intervalMs = HEARTBEAT_DEFAULT_MS; - let ttlMs = HEARTBEAT_TTL_DEFAULT_MS; - let lastSuccessMs = Date.now(); - let last = NO_HEARTBEAT_SENTINEL; - const beat = async () => { - const beatCtrl = new AbortController(); - const detach = linkAbort(lease.signal, beatCtrl); - const cutoff = setTimeout(() => beatCtrl.abort(), intervalMs); - try { - const resp = await client.beta.environments.work.heartbeat(work.id, { environment_id: work.environment_id, expected_last_heartbeat: last }, { ...requestOptions, headers: buildHeaders2([requestOptions?.headers]), signal: beatCtrl.signal }); - lastSuccessMs = Date.now(); - last = resp.last_heartbeat; - if (resp.ttl_seconds > 0) { - ttlMs = resp.ttl_seconds * 1e3; - intervalMs = Math.max(1e3, Math.min(ttlMs / 2, HEARTBEAT_DEFAULT_MS)); - onLeaseTtl?.(ttlMs); - } - if (resp.state === "stopping" || resp.state === "stopped") { - logger.info("heartbeat signals shutdown", { work_id: work.id, state: resp.state }); - lease.finish("control_plane_stop"); - } - if (!resp.lease_extended) { - logger.warn("lease not extended, shutting down", { work_id: work.id }); - lease.finish("control_plane_stop"); - } - } catch (e) { - lease.signal.throwIfAborted(); - if (isStatus(e, 412)) { - const server = serverLeaseState(e); - logger.error("lease lost: heartbeat precondition failed", { - work_id: work.id, - server_state: server["state"], - server_ttl_seconds: server["ttl_seconds"], - server_last_heartbeat: server["last_heartbeat"] - }); - lease.finish("lease_lost"); - return; - } - if (isFatal4xx(e)) { - logger.error("permanent heartbeat failure", { work_id: work.id, error: String(e) }); - lease.finish("heartbeat_rejected"); - throw e; - } - if (Date.now() - lastSuccessMs > ttlMs) { - logger.error("lease assumed lost: no successful heartbeat in ttl", { - work_id: work.id, - ttl_ms: ttlMs, - error: String(e) - }); - lease.finish("assumed_lost"); - return; - } - logger.warn("transient heartbeat failure", { work_id: work.id, error: String(e) }); - } finally { - clearTimeout(cutoff); - detach(); - } - }; - await beat(); - while (!lease.signal.aborted) { - await sleep2(intervalMs, lease.signal); - lease.signal.throwIfAborted(); - await beat(); - } -} -var _EnvironmentWorker_instances, _EnvironmentWorker_signal, _EnvironmentWorker_handleItem, _Lease_ctrl, _Lease_endReason, HEARTBEAT_DEFAULT_MS, HEARTBEAT_TTL_DEFAULT_MS, NO_HEARTBEAT_SENTINEL, EnvironmentWorker, Lease; -var init_worker = __esm({ - "node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs"() { - init_tslib2(); - init_error3(); - init_log2(); - init_base642(); - init_bytes2(); - init_env2(); - init_sleep2(); - init_backoff(); - init_abort3(); - init_values2(); - init_headers3(); - init_SessionToolRunner(); - init_poller(); - init_helper_client(); - init_sync_interval(); - HEARTBEAT_DEFAULT_MS = 3e4; - HEARTBEAT_TTL_DEFAULT_MS = 9e4; - NO_HEARTBEAT_SENTINEL = "NO_HEARTBEAT"; - EnvironmentWorker = /* @__PURE__ */ (() => { - class EnvironmentWorker2 { - constructor(opts) { - _EnvironmentWorker_instances.add(this); - _EnvironmentWorker_signal.set(this, void 0); - if (opts.unrestrictedPaths !== void 0) { - throw new AnthropicError("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory."); - } - this.client = opts.client; - this.environmentId = opts.environmentId; - this.environmentKey = opts.environmentKey; - this.tools = opts.tools; - this.workdir = opts.workdir ?? process.cwd(); - this.maxFileBytes = opts.maxFileBytes; - this.maxIdleMs = opts.maxIdleMs; - if (opts.memorySyncIntervalMs != null) { - checkMemorySyncInterval(opts.memorySyncIntervalMs, "memorySyncIntervalMs"); - } - this.memorySyncIntervalMs = opts.memorySyncIntervalMs; - this.memorySyncDeletions = opts.memorySyncDeletions ?? "enabled"; - this.workerId = opts.workerId; - this.requestOptions = opts.requestOptions; - __classPrivateFieldSet2(this, _EnvironmentWorker_signal, opts.signal, "f"); - } - /** - * Poll the environment and service each claimed session until the supplied - * signal (or the one passed to the constructor) aborts. Throws if - * `environmentId` / `environmentKey` were not provided to the constructor. - */ - async run(signal) { - const { environmentId, environmentKey } = this; - if (environmentId === void 0 || environmentKey === void 0) { - throw new AnthropicError("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work"); - } - const externalSignal = signal ?? __classPrivateFieldGet2(this, _EnvironmentWorker_signal, "f"); - const poller = new WorkPoller({ - client: this.client, - environmentId, - environmentKey, - ...this.workerId !== void 0 ? { workerId: this.workerId } : {}, - ...externalSignal ? { signal: externalSignal } : {}, - ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, - // The per-item handler stops or releases every work item on exit; let it - // be the single owner of `work.stop` rather than double-posting from the - // poller. - autoStop: false - }); - for await (const work of poller) { - try { - await __classPrivateFieldGet2(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, poller.signal); - } catch (e) { - if (poller.signal?.aborted) - throw e; - loggerFor2(this.client).error("work item failed", { work_id: work.id, error: String(e) }); - } - } - } - /** - * Service a single, already-claimed work item without the poll loop: build the - * per-session {@link AgentToolContext} (workdir from this worker's options), - * download the session agent's skills (`setupSkills`), run a - * {@link SessionToolRunner} for the session while heartbeating the work-item - * lease, and force-stop the work item on exit (whether the runner finishes - * normally, throws, or the control plane signals shutdown). The one - * exception is a lost lease: the item then belongs to the queue or another - * worker and is left alone. - * - * Use this when something else does the claiming — e.g. a `worker poll - * --on-work` script that hands an already-claimed item to a fresh process. The - * work id / environment id / session id each fall back to `ANTHROPIC_WORK_ID` / - * `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that - * command sets) when not passed; the environment key resolves from this - * option, then the worker's own `environmentKey`, then - * `ANTHROPIC_ENVIRONMENT_KEY`, and is needed only when the work item's - * `secret` yields no sessions token — a host that receives only the - * per-item secret runs without ever holding the key. With no arguments - * inside that command it just works. Throws a clear error naming the first - * required value still missing after resolution, and — rather than ever - * running unauthenticated — when neither a sessions token nor an - * environment key resolved. Throws `SessionMemoryError` when the - * session has memory stores attached but they cannot be mounted — the work - * item carried no sessions token (unless `memorySyncIntervalMs` turned - * memory off), or a store failed to download. - * - * `workSecret` is the work item's per-item `secret` payload from the poll - * response, falling back to `ANTHROPIC_WORK_SECRET`; unlike the others it is - * optional — when present, the sessions token extracted from it is preferred - * as the Bearer credential for this item's heartbeat / force-stop / session - * calls; when absent (or undecodable) those calls use the environment key. - */ - async handleItem(opts) { - const workId = opts?.workId ?? readEnv2("ANTHROPIC_WORK_ID"); - const environmentId = opts?.environmentId ?? readEnv2("ANTHROPIC_ENVIRONMENT_ID"); - const sessionId = opts?.sessionId ?? readEnv2("ANTHROPIC_SESSION_ID"); - const environmentKey = (opts?.environmentKey ?? this.environmentKey ?? readEnv2("ANTHROPIC_ENVIRONMENT_KEY")) || void 0; - const workSecret = opts?.workSecret || readEnv2("ANTHROPIC_WORK_SECRET") || null; - if (!workId) { - throw new AnthropicError("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID"); - } - if (!environmentId) { - throw new AnthropicError("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID"); - } - if (!sessionId) { - throw new AnthropicError("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID"); - } - if (!environmentKey && !workSecret) { - throw new AnthropicError("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY"); - } - const work = { - id: workId, - environment_id: environmentId, - secret: workSecret, - data: { type: "session", id: sessionId } - }; - await __classPrivateFieldGet2(this, _EnvironmentWorker_instances, "m", _EnvironmentWorker_handleItem).call(this, work, environmentKey, opts?.signal ?? __classPrivateFieldGet2(this, _EnvironmentWorker_signal, "f")); - } - } - _EnvironmentWorker_signal = /* @__PURE__ */ new WeakMap(), _EnvironmentWorker_instances = /* @__PURE__ */ new WeakSet(), _EnvironmentWorker_handleItem = /** - * The per-item body shared by {@link EnvironmentWorker.run}'s poll loop and - * {@link EnvironmentWorker.handleItem}: run a {@link SessionToolRunner} for the - * work item's session while heartbeating its lease, force-stopping on exit - * unless the lease was lost. Non-session work items are ignored. - * - * When the poll response carried a per-item `secret` (a short-lived payload - * scoped to this work item), the sessions token extracted from it is - * preferred over `environmentKey` as the Bearer credential for those - * per-item calls; a missing/undecodable secret falls back to - * `environmentKey` unchanged. - */ - async function _EnvironmentWorker_handleItem2(work, environmentKey, externalSignal) { - const log = loggerFor2(this.client); - const sessionsToken = sessionsTokenFromSecret(work.secret); - const itemCredential = sessionsToken ?? environmentKey; - if (itemCredential === void 0) { - throw new AnthropicError("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)"); - } - if (work.secret && sessionsToken === null) { - log.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key", { work_id: work.id }); - } - const sessionClient = copyClientForHelper(this.client, { - authToken: itemCredential, - helper: "environments-worker" - }); - const sessionId = work.data.id; - const ctrl = new AbortController(); - const detachExternal = linkAbort(externalSignal, ctrl); - const lease = new Lease(ctrl); - const agentToolset = await Promise.resolve().then(() => (init_node_browser2(), node_browser_exports2)); - let leaseTtlMs; - let runner; - const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => { - leaseTtlMs = ttlMs; - runner?._setSendRetryWindow(ttlMs); - }).catch((e) => { - if (!ctrl.signal.aborted) - log.error("heartbeat loop failed", { work_id: work.id, error: String(e) }); - ctrl.abort(); - }); - let cleanupSkills = async () => { - }; - let stores; - let cleanEnd = false; - try { - if (work.data.type !== "session") { - log.debug("skipping non-session work item", { work_id: work.id, type: work.data.type }); - return; - } - const session = await sessionClient.beta.sessions.retrieve(sessionId); - if (sessionsToken === null && this.memorySyncIntervalMs !== null && hasMemoryStore(session)) { - throw new agentToolset.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${work.id}, session_id=${sessionId}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`); - } - const ctx = { - workdir: this.workdir, - // The scoped sub-client, not the parent: the skill download - // `setupSkills` performs for this session rides the same per-item - // credential as every other per-item call. - client: sessionClient, - session, - ...this.maxFileBytes !== void 0 ? { maxFileBytes: this.maxFileBytes } : {} - }; - try { - cleanupSkills = await agentToolset.setupSkills(ctx); - } catch (e) { - log.warn("skill setup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); - } - if (sessionsToken !== null && this.memorySyncIntervalMs !== null) { - stores = new agentToolset.SessionMemoryStores(sessionClient, { - workdir: this.workdir, - ...this.memorySyncIntervalMs !== void 0 ? { syncIntervalMs: this.memorySyncIntervalMs } : {}, - syncDeletions: this.memorySyncDeletions - }); - await stores.download(session); - ctx.allowedRoots = stores.roots; - ctx.readOnlyRoots = stores.readOnlyRoots; - } else { - log.debug("memory stores disabled for this item", { work_id: work.id }); - } - const tools = typeof this.tools === "function" ? this.tools(ctx) : this.tools ?? agentToolset.betaAgentToolset20260401(ctx); - runner = new SessionToolRunner(sessionId, { - client: sessionClient, - tools, - ...this.maxIdleMs !== void 0 ? { maxIdleMs: this.maxIdleMs } : {}, - ...this.requestOptions !== void 0 ? { requestOptions: this.requestOptions } : {}, - signal: ctrl.signal - }); - if (leaseTtlMs !== void 0) - runner._setSendRetryWindow(leaseTtlMs); - for await (const _ of runner) { - if (stores) - await stores.syncIfDue(); - } - cleanEnd = !ctrl.signal.aborted; - } finally { - try { - await cleanupSkills().catch((e) => { - log.warn("skill cleanup failed", { session_id: sessionId, work_id: work.id, error: String(e) }); - }); - } finally { - if (stores) { - const boundMs = agentToolset.MEMORY_FLUSH_TIMEOUT_MS; - if (cleanEnd) { - const finishCutOff = await withTimeout(stores.finish(), boundMs); - if (finishCutOff) { - log.warn(`final memory sync cut off after ${boundMs}ms; the flush that follows still uploads changed files`, { session_id: sessionId, work_id: work.id }); - } - } - const flushBound = new AbortController(); - const flushCutOff = await withTimeout(stores.flushWrites(flushBound.signal), boundMs); - if (flushCutOff) { - flushBound.abort(); - log.warn(`memory flush cut off after ${boundMs}ms; changed files it had not uploaded yet are not saved`, { session_id: sessionId, work_id: work.id }); - } - await stores.dispose().catch((e) => { - log.warn("memory store cleanup failed", { - session_id: sessionId, - work_id: work.id, - error: String(e) - }); - }); - } - } - lease.finish("runner_done"); - detachExternal(); - await heartbeatPromise; - if (lease.lost) { - log.info("lease lost; released without stopping it", { session_id: sessionId, work_id: work.id }); - } else { - await forceStop(sessionClient, work, log, this.requestOptions); - } - } - }; - return EnvironmentWorker2; - })(); - Lease = /* @__PURE__ */ (() => { - class Lease2 { - constructor(ctrl) { - _Lease_ctrl.set(this, void 0); - _Lease_endReason.set(this, void 0); - __classPrivateFieldSet2(this, _Lease_ctrl, ctrl, "f"); - } - get signal() { - return __classPrivateFieldGet2(this, _Lease_ctrl, "f").signal; - } - finish(reason) { - __classPrivateFieldSet2(this, _Lease_endReason, __classPrivateFieldGet2(this, _Lease_endReason, "f") ?? reason, "f"); - __classPrivateFieldGet2(this, _Lease_ctrl, "f").abort(); - } - /** True once the item belongs to the queue or another worker. */ - get lost() { - return __classPrivateFieldGet2(this, _Lease_endReason, "f") === "lease_lost" || __classPrivateFieldGet2(this, _Lease_endReason, "f") === "assumed_lost"; - } - } - _Lease_ctrl = /* @__PURE__ */ new WeakMap(), _Lease_endReason = /* @__PURE__ */ new WeakMap(); - return Lease2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs -var Work; -var init_work = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - init_poller(); - init_worker(); - Work = /* @__PURE__ */ (() => { - class Work2 extends APIResource2 { - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Retrieve detailed information about a specific work item. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.retrieve('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - retrieve(workID, params, options) { - const { environment_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/environments/${environment_id}/work/${workID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Update work item metadata with merge semantics. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.update('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * metadata: { foo: 'string' }, - * }); - * ``` - */ - update(workID, params, options) { - const { environment_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * List work items in an environment. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSelfHostedWork of client.beta.environments.work.list( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * )) { - * // ... - * } - * ``` - */ - list(environmentID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/environments/${environmentID}/work?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' - * and removing it from the queue. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.ack('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - ack(workID, params, options) { - const { environment_id, betas } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/ack?beta=true`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Record a heartbeat for a work item to maintain the lease. - * - * @example - * ```ts - * const betaSelfHostedWorkHeartbeatResponse = - * await client.beta.environments.work.heartbeat('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - heartbeat(workID, params, options) { - const { environment_id, desired_ttl_seconds, expected_last_heartbeat, betas } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/heartbeat?beta=true`, { - query: { desired_ttl_seconds, expected_last_heartbeat }, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Long poll for work items in the queue. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.poll( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - poll(environmentID, params = {}, options) { - const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}/work/poll?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...anthropicWorkerID != null ? { "Anthropic-Worker-ID": anthropicWorkerID } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get statistics about the work queue for an environment. - * - * @example - * ```ts - * const betaSelfHostedWorkQueueStats = - * await client.beta.environments.work.stats( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - stats(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}/work/stats?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Note: these endpoints are called automatically by the pre-built environment - * worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted - * sandbox environments. They are included here as a reference; you do not need to - * invoke them directly. - * - * Stop a work item, initiating graceful or forced shutdown. - * - * @example - * ```ts - * const betaSelfHostedWork = - * await client.beta.environments.work.stop('work_id', { - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - stop(workID, params, options) { - const { environment_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environment_id}/work/${workID}/stop?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Continuously claim work from a self-hosted environment, ack each item, - * and yield it. Posts `stop` automatically when the consumer's loop body - * returns or when iteration ends. - * - * @example - * ```ts - * for await (const work of client.beta.environments.work.poller({ - * environmentId, - * environmentKey, - * })) { - * if (work.data.type !== 'session') continue; - * // ...service the work... - * } - * ``` - */ - poller(opts) { - return new WorkPoller({ ...opts, client: this._client }); - } - worker(opts) { - return new EnvironmentWorker({ ...opts, client: this._client }); - } - } - Work2.WorkPoller = WorkPoller; - Work2.EnvironmentWorker = EnvironmentWorker; - return Work2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs -var Environments2; -var init_environments2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs"() { - init_resource2(); - init_work(); - init_work(); - init_pagination2(); - init_headers3(); - init_path2(); - Environments2 = /* @__PURE__ */ (() => { - class Environments3 extends APIResource2 { - constructor() { - super(...arguments); - this.work = new Work(this._client); - } - /** - * Create a new environment with the specified configuration. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.create({ - * name: 'python-data-analysis', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/environments?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a specific environment by ID. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.retrieve( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - retrieve(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/environments/${environmentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update an existing environment's configuration. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.update( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - update(environmentID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/environments/${environmentID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List environments with pagination support. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaEnvironment of client.beta.environments.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/environments?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete an environment by ID. Returns a confirmation of the deletion. - * - * @example - * ```ts - * const betaEnvironmentDeleteResponse = - * await client.beta.environments.delete( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - delete(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/environments/${environmentID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive an environment by ID. Archived environments cannot be used to create new - * sessions. - * - * @example - * ```ts - * const betaEnvironment = - * await client.beta.environments.archive( - * 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * ); - * ``` - */ - archive(environmentID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/environments/${environmentID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Environments3.Work = Work; - return Environments3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs -var Memories; -var init_memories = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Memories = class extends APIResource2 { - /** - * Create a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.create( - * 'memory_store_id', - * { content: 'content', path: 'xx' }, - * ); - * ``` - */ - create(memoryStoreID, params, options) { - const { view, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, { - query: { view }, - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.retrieve( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - retrieve(memoryID, params, options) { - const { memory_store_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update a memory - * - * @example - * ```ts - * const betaManagedAgentsMemory = - * await client.beta.memoryStores.memories.update( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - update(memoryID, params, options) { - const { memory_store_id, view, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query: { view }, - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memories - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryListItem of client.beta.memoryStores.memories.list( - * 'memory_store_id', - * )) { - * // ... - * } - * ``` - */ - list(memoryStoreID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a memory - * - * @example - * ```ts - * const betaManagedAgentsDeletedMemory = - * await client.beta.memoryStores.memories.delete( - * 'memory_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - delete(memoryID, params, options) { - const { memory_store_id, expected_content_sha256, betas, workspace_id } = params; - return this._client.delete(path3`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, { - query: { expected_content_sha256 }, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs -var MemoryVersions; -var init_memory_versions = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - MemoryVersions = class extends APIResource2 { - /** - * Retrieve a memory version - * - * @example - * ```ts - * const betaManagedAgentsMemoryVersion = - * await client.beta.memoryStores.memoryVersions.retrieve( - * 'memory_version_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - retrieve(memoryVersionID, params, options) { - const { memory_store_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memory versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryVersion of client.beta.memoryStores.memoryVersions.list( - * 'memory_store_id', - * )) { - * // ... - * } - * ``` - */ - list(memoryStoreID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Redact a memory version - * - * @example - * ```ts - * const betaManagedAgentsMemoryVersion = - * await client.beta.memoryStores.memoryVersions.redact( - * 'memory_version_id', - * { memory_store_id: 'memory_store_id' }, - * ); - * ``` - */ - redact(memoryVersionID, params, options) { - const { memory_store_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs -var MemoryStores; -var init_memory_stores = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs"() { - init_resource2(); - init_memories(); - init_memories(); - init_memory_versions(); - init_memory_versions(); - init_pagination2(); - init_headers3(); - init_path2(); - MemoryStores = /* @__PURE__ */ (() => { - class MemoryStores2 extends APIResource2 { - constructor() { - super(...arguments); - this.memories = new Memories(this._client); - this.memoryVersions = new MemoryVersions(this._client); - } - /** - * Create a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.create({ name: 'x' }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/memory_stores?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Retrieve a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.retrieve( - * 'memory_store_id', - * ); - * ``` - */ - retrieve(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.update('memory_store_id'); - * ``` - */ - update(memoryStoreID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List memory stores - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsMemoryStore of client.beta.memoryStores.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/memory_stores?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a memory store - * - * @example - * ```ts - * const betaManagedAgentsDeletedMemoryStore = - * await client.beta.memoryStores.delete('memory_store_id'); - * ``` - */ - delete(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/memory_stores/${memoryStoreID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive a memory store - * - * @example - * ```ts - * const betaManagedAgentsMemoryStore = - * await client.beta.memoryStores.archive('memory_store_id'); - * ``` - */ - archive(memoryStoreID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "agent-memory-2026-07-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - MemoryStores2.Memories = Memories; - MemoryStores2.MemoryVersions = MemoryVersions; - return MemoryStores2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/error.mjs -var init_error4 = __esm({ - "node_modules/@anthropic-ai/sdk/error.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs -var JSONLDecoder; -var init_jsonl = __esm({ - "node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs"() { - init_error3(); - init_shims2(); - init_line2(); - JSONLDecoder = /* @__PURE__ */ (() => { - class JSONLDecoder2 { - constructor(iterator, controller) { - this.iterator = iterator; - this.controller = controller; - } - async *decoder() { - const lineDecoder = new LineDecoder2(); - for await (const chunk of this.iterator) { - for (const line of lineDecoder.decode(chunk)) { - yield JSON.parse(line); - } - } - for (const line of lineDecoder.flush()) { - yield JSON.parse(line); - } - } - [Symbol.asyncIterator]() { - return this.decoder(); - } - static fromResponse(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); - } - throw new AnthropicError(`Attempted to iterate over a response with no body`); - } - return new JSONLDecoder2(ReadableStreamToAsyncIterable2(response.body), controller); - } - } - return JSONLDecoder2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs -var Batches2; -var init_batches2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_jsonl(); - init_error4(); - init_path2(); - Batches2 = class extends APIResource2 { - /** - * Send a batch of Message creation requests. - * - * The Message Batches API can be used to process multiple Messages API requests at - * once. Once a Message Batch is created, it begins processing immediately. Batches - * can take up to 24 hours to complete. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.create({ - * requests: [ - * { - * custom_id: 'my-custom-id-1', - * params: { - * max_tokens: 1024, - * messages: [ - * { content: 'Hello, world', role: 'user' }, - * ], - * model: 'claude-opus-5', - * }, - * }, - * ], - * }); - * ``` - */ - create(params, options) { - const { betas, user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/batches?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * This endpoint is idempotent and can be used to poll for Message Batch - * completion. To access the results of a Message Batch, make a request to the - * `results_url` field in the response. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.retrieve( - * 'message_batch_id', - * ); - * ``` - */ - retrieve(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List all Message Batches within a Workspace. Most recently created batches are - * returned first. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaMessageBatch of client.beta.messages.batches.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/messages/batches?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete a Message Batch. - * - * Message Batches can only be deleted once they've finished processing. If you'd - * like to delete an in-progress batch, you must first cancel it. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaDeletedMessageBatch = - * await client.beta.messages.batches.delete( - * 'message_batch_id', - * ); - * ``` - */ - delete(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Batches may be canceled any time before processing ends. Once cancellation is - * initiated, the batch enters a `canceling` state, at which time the system may - * complete any in-progress, non-interruptible requests before finalizing - * cancellation. - * - * The number of canceled requests is specified in `request_counts`. To determine - * which requests were canceled, check the individual results within the batch. - * Note that cancellation may not result in any canceled requests if they were - * non-interruptible. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatch = - * await client.beta.messages.batches.cancel( - * 'message_batch_id', - * ); - * ``` - */ - cancel(messageBatchID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Streams the results of a Message Batch as a `.jsonl` file. - * - * Each line in the file is a JSON object containing the result of a single request - * in the Message Batch. Results are not guaranteed to be in the same order as - * requests. Use the `custom_id` field to match results to requests. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const betaMessageBatchIndividualResponse = - * await client.beta.messages.batches.results( - * 'message_batch_id', - * ); - * ``` - */ - async results(messageBatchID, params = {}, options) { - const batch = await this.retrieve(messageBatchID, params, options); - if (!batch.results_url) { - throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - const { betas, workspace_id } = params ?? {}; - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/internal/constants.mjs -var MODEL_NONSTREAMING_TOKENS; -var init_constants = __esm({ - "node_modules/@anthropic-ai/sdk/internal/constants.mjs"() { - MODEL_NONSTREAMING_TOKENS = { - "claude-opus-4@20250514": 8192, - "anthropic.claude-opus-4-1-20250805-v1:0": 8192, - "claude-opus-4-1@20250805": 8192 - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs -function getOutputFormat(params) { - return params?.output_format ?? params?.output_config?.format; -} -function maybeParseBetaMessage(message, params, opts) { - const outputFormat = getOutputFormat(params); - if (!params || !("parse" in (outputFormat ?? {}))) { - return { - ...message, - content: message.content.map((block) => { - if (block.type === "text") { - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: null, - enumerable: false - }); - return Object.defineProperty(parsedBlock, "parsed", { - get() { - opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); - return null; - }, - enumerable: false - }); - } - return block; - }), - parsed_output: null - }; - } - return parseBetaMessage(message, params, opts); -} -function parseBetaMessage(message, params, opts) { - let firstParsedOutput = null; - const content = message.content.map((block) => { - if (block.type === "text") { - const parsedOutput = parseBetaOutputFormat(params, block.text); - if (firstParsedOutput === null) { - firstParsedOutput = parsedOutput; - } - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: parsedOutput, - enumerable: false - }); - return Object.defineProperty(parsedBlock, "parsed", { - get() { - opts.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."); - return parsedOutput; - }, - enumerable: false - }); - } - return block; - }); - return { - ...message, - content, - parsed_output: firstParsedOutput - }; -} -function parseBetaOutputFormat(params, content) { - const outputFormat = getOutputFormat(params); - if (outputFormat?.type !== "json_schema") { - return null; - } - try { - if ("parse" in outputFormat) { - return outputFormat.parse(content); - } - return JSON.parse(content); - } catch (error) { - throw new AnthropicError(`Failed to parse structured output: ${error}`); - } -} -var init_beta_parser = __esm({ - "node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/streaming.mjs -var init_streaming4 = __esm({ - "node_modules/@anthropic-ai/sdk/streaming.mjs"() { - init_streaming3(); - } -}); - -// node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs -var tokenize, strip, unstrip, generate, partialParse3; -var init_parser3 = __esm({ - "node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs"() { - tokenize = (input) => { - let current = 0; - let tokens = []; - while (current < input.length) { - let char = input[current]; - if (char === "\\") { - current++; - continue; - } - if (char === "{") { - tokens.push({ - type: "brace", - value: "{" - }); - current++; - continue; - } - if (char === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - current++; - continue; - } - if (char === "[") { - tokens.push({ - type: "paren", - value: "[" - }); - current++; - continue; - } - if (char === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - current++; - continue; - } - if (char === ":") { - tokens.push({ - type: "separator", - value: ":" - }); - current++; - continue; - } - if (char === ",") { - tokens.push({ - type: "delimiter", - value: "," - }); - current++; - continue; - } - if (char === '"') { - const start = current + 1; - let end = start; - let danglingQuote = false; - while (true) { - end = input.indexOf('"', end); - if (end === -1) { - danglingQuote = true; - break; - } - let backslashes = 0; - let i = end - 1; - while (i >= start && input[i] === "\\") { - backslashes++; - i--; - } - if (backslashes % 2 === 0) - break; - end++; - } - if (danglingQuote) { - current = input.length; - } else { - tokens.push({ - type: "string", - value: input.slice(start, end) - }); - current = end + 1; - } - continue; - } - let WHITESPACE = /\s/; - if (char && WHITESPACE.test(char)) { - current++; - continue; - } - let NUMBERS = /[0-9]/; - if (char && NUMBERS.test(char) || char === "-" || char === ".") { - let value = ""; - if (char === "-") { - value += char; - char = input[++current]; - } - while (char && (NUMBERS.test(char) || char === "." || // exponent marker, e.g. `1e10` or `1.5E-9` - char === "e" || char === "E" || // exponent sign, only valid immediately after the exponent marker - (char === "-" || char === "+") && (value[value.length - 1] === "e" || value[value.length - 1] === "E"))) { - value += char; - char = input[++current]; - } - tokens.push({ - type: "number", - value, - unterminated: current === input.length - }); - continue; - } - let LETTERS = /[a-z]/i; - if (char && LETTERS.test(char)) { - let value = ""; - while (char && LETTERS.test(char)) { - if (current === input.length) { - break; - } - value += char; - char = input[++current]; - } - if (value == "true" || value == "false" || value === "null") { - tokens.push({ - type: "name", - value - }); - } else { - current++; - continue; - } - continue; - } - current++; - } - return tokens; - }; - strip = (tokens) => { - let open = []; - for (const token of tokens) { - if (token.type === "brace" || token.type === "paren") { - if (token.value === "{" || token.value === "[") { - open.push(token.value); - } else { - open.pop(); - } - } - } - let innermostOpenBracket = open[open.length - 1]; - let length = tokens.length; - let JSON_NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/; - while (length > 0) { - let lastToken = tokens[length - 1]; - switch (lastToken.type) { - case "separator": - length--; - continue; - case "number": - if (lastToken.unterminated || !JSON_NUMBER.test(lastToken.value)) { - length--; - continue; - } - break; - case "string": - let tokenBeforeTheLastToken = tokens[length - 2]; - if (innermostOpenBracket === "{" && (tokenBeforeTheLastToken?.type === "delimiter" || tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{")) { - length--; - continue; - } - break; - case "delimiter": - length--; - break; - } - break; - } - return tokens.slice(0, length); - }; - unstrip = (tokens) => { - let tail = []; - tokens.map((token) => { - if (token.type === "brace") { - if (token.value === "{") { - tail.push("}"); - } else { - tail.splice(tail.lastIndexOf("}"), 1); - } - } - if (token.type === "paren") { - if (token.value === "[") { - tail.push("]"); - } else { - tail.splice(tail.lastIndexOf("]"), 1); - } - } - }); - if (tail.length > 0) { - tail.reverse().map((item) => { - if (item === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - } else if (item === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - } - }); - } - return tokens; - }; - generate = (tokens) => { - let output = ""; - tokens.map((token) => { - switch (token.type) { - case "string": - output += '"' + token.value + '"'; - break; - default: - output += token.value; - break; - } - }); - return output; - }; - partialParse3 = (input) => JSON.parse(generate(unstrip(strip(tokenize(input))))); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs -function withLazyInput(prev, jsonBuf) { - const next = {}; - for (const key of Object.keys(prev)) { - if (key !== "input") - next[key] = prev[key]; - } - Object.defineProperty(next, JSON_BUF_PROPERTY, { value: jsonBuf, enumerable: false, writable: true }); - let input; - let parsed = false; - Object.defineProperty(next, "input", { - enumerable: true, - configurable: true, - get() { - if (!parsed) { - input = jsonBuf ? partialParse3(jsonBuf) : {}; - parsed = true; - } - return input; - } - }); - return next; -} -var JSON_BUF_PROPERTY; -var init_message_stream_utils = __esm({ - "node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs"() { - init_parser3(); - JSON_BUF_PROPERTY = "__json_buf"; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs -function tracksToolInput(content) { - return content.type === "tool_use" || content.type === "server_tool_use" || content.type === "mcp_tool_use"; -} -var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_params, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_workspace_id, _BetaMessageStream_logger, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage, _BetaMessageStream_toolInputParseError, BetaMessageStream; -var init_BetaMessageStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_error4(); - init_errors2(); - init_values2(); - init_streaming4(); - init_beta_parser(); - init_message_stream_utils(); - BetaMessageStream = /* @__PURE__ */ (() => { - class BetaMessageStream2 { - constructor(params, opts) { - _BetaMessageStream_instances.add(this); - this.messages = []; - this.receivedMessages = []; - _BetaMessageStream_currentMessageSnapshot.set(this, void 0); - _BetaMessageStream_params.set(this, null); - this.controller = new AbortController(); - _BetaMessageStream_connectedPromise.set(this, void 0); - _BetaMessageStream_resolveConnectedPromise.set(this, () => { - }); - _BetaMessageStream_rejectConnectedPromise.set(this, () => { - }); - _BetaMessageStream_endPromise.set(this, void 0); - _BetaMessageStream_resolveEndPromise.set(this, () => { - }); - _BetaMessageStream_rejectEndPromise.set(this, () => { - }); - _BetaMessageStream_listeners.set(this, {}); - _BetaMessageStream_ended.set(this, false); - _BetaMessageStream_errored.set(this, false); - _BetaMessageStream_aborted.set(this, false); - _BetaMessageStream_catchingPromiseCreated.set(this, false); - _BetaMessageStream_response.set(this, void 0); - _BetaMessageStream_request_id.set(this, void 0); - _BetaMessageStream_workspace_id.set(this, void 0); - _BetaMessageStream_logger.set(this, void 0); - _BetaMessageStream_handleError.set(this, (error) => { - __classPrivateFieldSet2(this, _BetaMessageStream_errored, true, "f"); - if (isAbortError2(error)) { - error = new APIUserAbortError2(); - } - if (error instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _BetaMessageStream_aborted, true, "f"); - return this._emit("abort", error); - } - if (error instanceof AnthropicError) { - return this._emit("error", error); - } - if (error instanceof Error) { - const anthropicError = new AnthropicError(error.message); - anthropicError.cause = error; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError(String(error))); - }); - __classPrivateFieldSet2(this, _BetaMessageStream_connectedPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveConnectedPromise, resolve, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectConnectedPromise, reject, "f"); - }), "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_endPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveEndPromise, resolve, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectEndPromise, reject, "f"); - }), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise, "f").catch(() => { - }); - __classPrivateFieldGet2(this, _BetaMessageStream_endPromise, "f").catch(() => { - }); - __classPrivateFieldSet2(this, _BetaMessageStream_params, params, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_logger, opts?.logger ?? console, "f"); - } - get response() { - return __classPrivateFieldGet2(this, _BetaMessageStream_response, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _BetaMessageStream_request_id, "f"); - } - get workspace_id() { - return __classPrivateFieldGet2(this, _BetaMessageStream_workspace_id, "f"); - } - /** - * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, - * returned vie the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * This is the same as the `APIPromise.withResponse()` method. - * - * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` - * as no `Response` is available. - */ - async withResponse() { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - const response = await __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - /** - * Intended for use on the frontend, consuming a stream produced with - * `.toReadableStream()` on the backend. - * - * Note that messages sent to the model do not appear in `.on('message')` - * in this context. - */ - static fromReadableStream(stream4) { - const runner = new BetaMessageStream2(null); - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options, { logger } = {}) { - const runner = new BetaMessageStream2(params, { logger }); - for (const message of params.messages) { - runner._addMessageParam(message); - } - __classPrivateFieldSet2(runner, _BetaMessageStream_params, { ...params, stream: true }, "f"); - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit = true) { - this.receivedMessages.push(message); - if (emit) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_response, response, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_request_id, response?.headers.get("request-id"), "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveConnectedPromise, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _BetaMessageStream_ended, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _BetaMessageStream_errored, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _BetaMessageStream_aborted, "f"); - } - abort() { - this.controller.abort(); - } - /** - * Adds the listener function to the end of the listeners array for the event. - * No checks are made to see if the listener has already been added. Multiple calls passing - * the same combination of event and listener will result in the listener being added, and - * called, multiple times. - * @returns this MessageStream, so that calls can be chained - */ - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = []); - listeners.push({ listener }); - return this; - } - /** - * Removes the specified listener from the listener array for the event. - * off() will remove, at most, one instance of a listener from the listener array. If any single - * listener has been added multiple times to the listener array for the specified event, then - * off() must be called multiple times to remove each instance. - * @returns this MessageStream, so that calls can be chained - */ - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - /** - * Adds a one-time listener function for the event. The next time the event is triggered, - * this listener is removed and then invoked. - * @returns this MessageStream, so that calls can be chained - */ - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - /** - * This is similar to `.once()`, but returns a Promise that resolves the next time - * the event is triggered, instead of calling a listener callback. - * @returns a Promise that resolves the next time given event is triggered, - * or rejects if an error is emitted. (If you request the 'error' event, - * returns a promise that resolves with the error). - * - * Example: - * - * const message = await stream.emitted('message') // rejects if the stream errors - */ - emitted(event) { - return new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - if (event !== "error") - this.once("error", reject); - this.once(event, resolve); - }); - } - async done() { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet2(this, _BetaMessageStream_endPromise, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - } - /** - * @returns a promise that resolves with the the final assistant Message response, - * or rejects if an error occurred or the stream ended prematurely without producing a Message. - * If structured outputs were used, this will be a ParsedMessage with a `parsed` field. - */ - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this); - } - /** - * @returns a promise that resolves with the the final assistant Message's text response, concatenated - * together if there are more than one text blocks. - * Rejects if an error occurred or the stream ended prematurely without producing a Message. - */ - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalText).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _BetaMessageStream_ended, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _BetaMessageStream_ended, true, "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveEndPromise, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - return; - } - if (event === "error") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_getFinalMessage).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_beginRequest).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - [(_BetaMessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_params = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_listeners = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_ended = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_errored = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_aborted = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_response = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_request_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_logger = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_handleError = /* @__PURE__ */ new WeakMap(), _BetaMessageStream_instances = /* @__PURE__ */ new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); - }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent2(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_accumulateMessage).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if (tracksToolInput(content) && __classPrivateFieldGet2(this, _BetaMessageStream_listeners, "f").inputJson?.length) { - let jsonSnapshot; - try { - jsonSnapshot = content.input; - } catch (err) { - __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, content, err)); - break; - } - this._emit("inputJson", event.delta.partial_json, jsonSnapshot); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - case "compaction_delta": { - if (content.type === "compaction" && content.content) { - this._emit("compaction", content.content); - } - break; - } - default: - checkNever(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(maybeParseBetaMessage(messageSnapshot, __classPrivateFieldGet2(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _BetaMessageStream_logger, "f") }), true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest2() { - if (this.ended) { - throw new AnthropicError(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - if (!snapshot) { - throw new AnthropicError(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot, void 0, "f"); - return maybeParseBetaMessage(snapshot, __classPrivateFieldGet2(this, _BetaMessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _BetaMessageStream_logger, "f") }); - }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage2(event) { - let snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.stop_details = event.delta.stop_details; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.delta.container != null) { - snapshot.container = event.delta.container; - } - if (event.context_management != null) { - snapshot.context_management = event.context_management; - } - if (event.input_transformations != null) { - snapshot.input_transformations = event.input_transformations; - } - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - if (event.usage.iterations != null) { - snapshot.usage.iterations = event.usage.iterations; - } - if (event.usage.fallback_credit != null) { - snapshot.usage.fallback_credit = event.usage.fallback_credit; - } - if (event.usage.output_tokens_details != null) { - snapshot.usage.output_tokens_details = event.usage.output_tokens_details; - } - return snapshot; - case "content_block_start": - snapshot.content.push(event.content_block); - if (event.content_block.type === "fallback") { - snapshot.model = event.content_block.to.model; - } - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - text: (snapshotContent.text || "") + event.delta.text - }; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - citations: [...snapshotContent.citations ?? [], event.delta.citation] - }; - } - break; - } - case "input_json_delta": { - if (snapshotContent && tracksToolInput(snapshotContent)) { - const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; - snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - thinking: snapshotContent.thinking + event.delta.thinking - }; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - signature: event.delta.signature - }; - } - break; - } - case "compaction_delta": { - if (snapshotContent?.type === "compaction") { - const block = { ...snapshotContent, content: event.delta.content }; - if ("encrypted_content" in event.delta) { - block.encrypted_content = event.delta.encrypted_content; - } - snapshot.content[event.index] = block; - } - break; - } - default: - checkNever(event.delta); - } - return snapshot; - } - case "content_block_stop": { - const snapshotContent = snapshot.content.at(event.index); - if (snapshotContent && tracksToolInput(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { - let input; - try { - input = snapshotContent.input; - } catch (err) { - input = {}; - __classPrivateFieldGet2(this, _BetaMessageStream_handleError, "f").call(this, __classPrivateFieldGet2(this, _BetaMessageStream_instances, "m", _BetaMessageStream_toolInputParseError).call(this, snapshotContent, err)); - } - Object.defineProperty(snapshotContent, "input", { - value: input, - enumerable: true, - configurable: true, - writable: true - }); - } - return snapshot; - } - } - }, _BetaMessageStream_toolInputParseError = function _BetaMessageStream_toolInputParseError2(block, err) { - const jsonBuf = block[JSON_BUF_PROPERTY]; - return new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`); - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); - } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - } - return BetaMessageStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs -var _BetaToolRunnerStream_instances, _BetaToolRunnerStream_onToolCall, _BetaToolRunnerStream_emitted, _BetaToolRunnerStream_readers, _BetaToolRunnerStream_toolCalls, _BetaToolRunnerStream_closed, _BetaToolRunnerStream_ready, _BetaToolRunnerStream_fallback, _BetaToolRunnerStream_track, _BetaToolRunnerStream_release, _BetaToolRunnerStream_removeReader, BetaToolRunnerStream; -var init_BetaToolRunnerStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/internal/BetaToolRunnerStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_BetaMessageStream(); - BetaToolRunnerStream = /* @__PURE__ */ (() => { - class BetaToolRunnerStream2 extends BetaMessageStream { - constructor(params, onToolCall) { - super(params); - _BetaToolRunnerStream_instances.add(this); - _BetaToolRunnerStream_onToolCall.set(this, void 0); - _BetaToolRunnerStream_emitted.set(this, 0); - _BetaToolRunnerStream_readers.set(this, []); - _BetaToolRunnerStream_toolCalls.set(this, []); - _BetaToolRunnerStream_closed.set(this, void 0); - _BetaToolRunnerStream_ready.set(this, []); - _BetaToolRunnerStream_fallback.set(this, false); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_onToolCall, onToolCall, "f"); - } - /** The `tool_use` blocks that have finished streaming, in the model's order */ - get toolCalls() { - return __classPrivateFieldGet2(this, _BetaToolRunnerStream_toolCalls, "f"); - } - /** Sends the request as `client.beta.messages.stream()` does. */ - static start(messages, params, options, onToolCall) { - const stream4 = new BetaToolRunnerStream2({ ...params, stream: true }, onToolCall); - for (const message of params.messages) { - stream4._addMessageParam(message); - } - stream4._run(() => stream4._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return stream4; - } - _emit(event, ...args) { - var _a6; - if (event !== "streamEvent" || this.ended) { - super._emit(event, ...args); - return; - } - __classPrivateFieldSet2(this, _BetaToolRunnerStream_emitted, (_a6 = __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f"), _a6++, _a6), "f"); - const [streamEvent, snapshot] = args; - const block = streamEvent.type === "content_block_stop" ? snapshot.content[streamEvent.index] : void 0; - const closed = block?.type === "tool_use" ? block : void 0; - if (closed) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_toolCalls, "f").push(closed); - } - super._emit(event, ...args); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_track).call(this, streamEvent, closed); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - [(_BetaToolRunnerStream_onToolCall = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_emitted = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_readers = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_toolCalls = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_closed = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_ready = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_fallback = /* @__PURE__ */ new WeakMap(), _BetaToolRunnerStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - const iterator = super[Symbol.asyncIterator](); - const reader = { handled: __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f") }; - __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").push(reader); - let holdsEvent = false; - return { - next: async () => { - if (holdsEvent) { - holdsEvent = false; - reader.handled++; - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - try { - const result = await iterator.next(); - holdsEvent = !result.done; - if (result.done) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - } - return result; - } catch (error) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - throw error; - } - }, - return: async () => { - const result = iterator.return?.(); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_removeReader).call(this, reader); - return await result ?? { value: void 0, done: true }; - } - }; - } - } - _BetaToolRunnerStream_track = function _BetaToolRunnerStream_track2(event, closed) { - if (__classPrivateFieldGet2(this, _BetaToolRunnerStream_fallback, "f")) { - return; - } - if (event.type === "content_block_start" && event.content_block.type === "fallback") { - __classPrivateFieldSet2(this, _BetaToolRunnerStream_fallback, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, void 0, "f"); - return; - } - const movedOn = event.type === "content_block_start" || event.type === "message_delta" && event.delta.stop_reason === "tool_use"; - if (__classPrivateFieldGet2(this, _BetaToolRunnerStream_closed, "f") && movedOn) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f").push({ toolUse: __classPrivateFieldGet2(this, _BetaToolRunnerStream_closed, "f"), event: __classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f") }); - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, void 0, "f"); - } - if (closed) { - __classPrivateFieldSet2(this, _BetaToolRunnerStream_closed, closed, "f"); - } - }, _BetaToolRunnerStream_release = function _BetaToolRunnerStream_release2() { - if (this.errored || this.controller.signal.aborted) { - return; - } - const handled = Math.min(__classPrivateFieldGet2(this, _BetaToolRunnerStream_emitted, "f"), ...__classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").map((reader) => reader.handled)); - while (__classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f")[0] && __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f")[0].event <= handled) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_onToolCall, "f").call(this, __classPrivateFieldGet2(this, _BetaToolRunnerStream_ready, "f").shift().toolUse); - } - }, _BetaToolRunnerStream_removeReader = function _BetaToolRunnerStream_removeReader2(reader) { - const index = __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").indexOf(reader); - if (index >= 0) { - __classPrivateFieldGet2(this, _BetaToolRunnerStream_readers, "f").splice(index, 1); - __classPrivateFieldGet2(this, _BetaToolRunnerStream_instances, "m", _BetaToolRunnerStream_release).call(this); - } - }; - return BetaToolRunnerStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs -function promiseWithResolvers() { - let resolve; - let reject; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - return { promise, resolve, reject }; -} -var init_promise = __esm({ - "node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs"() { - } -}); - -// node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs -function rejectCompactionParam(params) { - if ("compaction" in params && params.compaction != null) { - throw new AnthropicError("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead."); - } -} -function rejectCompactionControl(params) { - if ("compactionControl" in params && params.compactionControl != null) { - throw new AnthropicError("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted."); - } -} -function rejectRunToolsEagerlyWithoutStream(params) { - if (params.runToolsEagerly && !params.stream) { - throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole."); - } -} -function rejectCompactionEdit(params) { - if (params.context_management?.edits?.some((edit) => edit.type.startsWith("compact_"))) { - throw new AnthropicError("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first."); - } -} -function withoutCompactionIncompatibleParams(params) { - const { context_management, stop_sequences, output_format, ...kept } = params; - const withoutFormat = ({ format, ...outputConfig }) => outputConfig; - if (kept.tool_choice?.type === "any" || kept.tool_choice?.type === "tool") { - delete kept.tool_choice; - } - if (kept.output_config) { - kept.output_config = withoutFormat(kept.output_config); - } - if (Array.isArray(kept.fallbacks)) { - kept.fallbacks = kept.fallbacks.map((fallback2) => fallback2.output_config ? { ...fallback2, output_config: withoutFormat(fallback2.output_config) } : fallback2); - } - return kept; -} -async function generateToolResponse(runnable, available, lastMessage, requestOptions, calls) { - if (!lastMessage || lastMessage.role !== "assistant" || !lastMessage.content || typeof lastMessage.content === "string") { - return null; - } - const toolUseBlocks = lastMessage.content.filter((content) => content.type === "tool_use"); - if (toolUseBlocks.length === 0) { - return null; - } - const toolResults = await Promise.all(toolUseBlocks.map((toolUse) => { - const call = calls?.get(toolUse.id); - if (call?.status === "started") { - return call.result; - } - const result = runToolCall(runnable, available, toolUse, requestOptions); - calls?.set(toolUse.id, { status: "started", result }); - return result; - })); - return { - role: "user", - content: toolResults - }; -} -async function runToolCall(runnable, available, toolUse, requestOptions) { - const tool = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0; - if (!tool) { - return toolNotFoundResult(toolUse); - } - try { - let input = toolUse.input; - if ("parse" in tool && tool.parse) { - input = tool.parse(input); - } - const result = await tool.run(input, { - toolUse, - toolUseBlock: toolUse, - signal: requestOptions?.signal - }); - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: result - }; - } catch (error) { - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: error instanceof ToolError ? error.content : `Error: ${error instanceof Error ? error.message : String(error)}`, - is_error: true - }; - } -} -function asContentParam(content) { - return content; -} -function toolNotFoundResult(toolUse) { - return { - type: "tool_result", - tool_use_id: toolUse.id, - content: `Error: Tool '${toolUse.name}' not found`, - is_error: true - }; -} -function applyToolChange(block, available) { - switch (block.type) { - case "tool_removal": - case "tool_addition": - applyToolReference(block, available); - break; - } -} -function applyToolReference(block, available) { - const name = changedToolName(block.tool); - if (name === void 0) - return; - if (block.type === "tool_removal") { - available.delete(name); - } else { - available.add(name); - } -} -function changedToolName(tool) { - switch (tool.type) { - case "tool_reference": - return tool.name; - case "tool_definition": - return "name" in tool.definition ? tool.definition.name : void 0; - default: - return void 0; - } -} -function determineNextStepFromStopReason(stopReason) { - if (stopReason === null) - return "stop"; - switch (stopReason) { - case "tool_use": - return "run_tools"; - case "pause_turn": - // pause_after_compaction hands the turn back before the model answers; sending it back - // unchanged continues it. - case "compaction": - return "resume"; - case "end_turn": - case "stop_sequence": - case "max_tokens": - case "model_context_window_exceeded": - case "refusal": - return "stop"; - default: - checkNever(stopReason); - return "stop"; - } -} -var _BetaToolRunner_instances, _BetaToolRunner_consumed, _BetaToolRunner_mutated, _BetaToolRunner_state, _BetaToolRunner_options, _BetaToolRunner_message, _BetaToolRunner_stream, _BetaToolRunner_toolResponse, _BetaToolRunner_completion, _BetaToolRunner_iterationCount, _BetaToolRunner_compaction, _BetaToolRunner_calls, _BetaToolRunner_lastStopReason, _BetaToolRunner_toolOverrides, _BetaToolRunner_pendingToolChanges, _BetaToolRunner_send, _BetaToolRunner_streamThatStartsTools, _BetaToolRunner_startedCallsSettled, _BetaToolRunner_compact, _BetaToolRunner_runnableTools, _BetaToolRunner_availableToolNames, _BetaToolRunner_recordRemovalsFromHistory, _BetaToolRunner_compactAfterFinalTurn, _BetaToolRunner_generateToolResponse, _BetaToolRunner_flushPendingToolChanges, _BetaToolRunner_pendingToolChangesMessage, BetaToolRunner; -var init_BetaToolRunner = __esm({ - "node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs"() { - init_tslib2(); - init_ToolError(); - init_error3(); - init_BetaToolRunnerStream(); - init_headers3(); - init_promise(); - init_values2(); - init_log2(); - init_stainless_helper_header(); - BetaToolRunner = /* @__PURE__ */ (() => { - class BetaToolRunner2 { - constructor(client, params, options) { - _BetaToolRunner_instances.add(this); - this.client = client; - _BetaToolRunner_consumed.set(this, false); - _BetaToolRunner_mutated.set(this, false); - _BetaToolRunner_state.set(this, void 0); - _BetaToolRunner_options.set(this, void 0); - _BetaToolRunner_message.set(this, void 0); - _BetaToolRunner_stream.set(this, void 0); - _BetaToolRunner_toolResponse.set(this, void 0); - _BetaToolRunner_completion.set(this, void 0); - _BetaToolRunner_iterationCount.set(this, 0); - _BetaToolRunner_compaction.set(this, { status: "idle" }); - _BetaToolRunner_calls.set(this, void 0); - _BetaToolRunner_lastStopReason.set(this, null); - _BetaToolRunner_toolOverrides.set(this, /* @__PURE__ */ new Map()); - _BetaToolRunner_pendingToolChanges.set(this, []); - rejectCompactionParam(params); - rejectCompactionControl(params); - rejectRunToolsEagerlyWithoutStream(params); - __classPrivateFieldSet2(this, _BetaToolRunner_state, { - params: { - // You can't clone the entire params since there are functions as handlers. - // You also don't really need to clone params.messages, but it probably will prevent a foot gun - // somewhere. - ...params, - // Not structuredClone(): it throws on a function, and a runnable tool written by value into a - // `tool_addition` block has `run`. A JSON copy is the messages as they are sent, which drops it. - messages: JSON.parse(JSON.stringify(params.messages)) - } - }, "f"); - const collected = collectStainlessHelpers(params.tools, params.messages); - __classPrivateFieldSet2(this, _BetaToolRunner_options, { - ...options, - headers: buildHeaders2([ - helperHeader("BetaToolRunner"), - collected.length ? { [STAINLESS_HELPER_HEADER]: collected.join(", ") } : void 0, - options?.headers - ]) - }, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); - } - async *[(_BetaToolRunner_consumed = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_mutated = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_state = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_options = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_message = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_stream = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolResponse = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_completion = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_iterationCount = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_compaction = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_calls = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_lastStopReason = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_toolOverrides = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_pendingToolChanges = /* @__PURE__ */ new WeakMap(), _BetaToolRunner_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - var _a6; - if (__classPrivateFieldGet2(this, _BetaToolRunner_consumed, "f")) { - throw new AnthropicError("Cannot iterate over a consumed stream"); - } - __classPrivateFieldSet2(this, _BetaToolRunner_consumed, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - try { - while (true) { - try { - if (__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.max_iterations && __classPrivateFieldGet2(this, _BetaToolRunner_iterationCount, "f") >= __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.max_iterations) { - break; - } - __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_flushPendingToolChanges).call(this); - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "scheduled" && determineNextStepFromStopReason(__classPrivateFieldGet2(this, _BetaToolRunner_lastStopReason, "f")) !== "resume") { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").config); - continue; - } - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, false, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_iterationCount, (_a6 = __classPrivateFieldGet2(this, _BetaToolRunner_iterationCount, "f"), _a6++, _a6), "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_message, void 0, "f"); - const { max_iterations, runToolsEagerly, ...params } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, params); - if (!__classPrivateFieldGet2(this, _BetaToolRunner_mutated, "f")) { - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - const nextStep = determineNextStepFromStopReason(message.stop_reason); - __classPrivateFieldSet2(this, _BetaToolRunner_lastStopReason, message.stop_reason, "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push({ - role: message.role, - content: asContentParam(message.content) - }); - const { container } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - if (message.container) { - if (container == null) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.container = message.container.id; - } else if (typeof container === "object" && container.id == null) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.container = { ...container, id: message.container.id }; - } - } - if (nextStep === "stop") { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); - break; - } - if (nextStep === "resume") { - continue; - } - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_lastStopReason, null, "f"); - } - const toolMessage = await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.at(-1)); - if (toolMessage) { - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push(toolMessage); - } else if (!__classPrivateFieldGet2(this, _BetaToolRunner_mutated, "f")) { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compactAfterFinalTurn).call(this); - break; - } - } finally { - __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f")?.abort(); - __classPrivateFieldSet2(this, _BetaToolRunner_stream, void 0, "f"); - } - } - await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); - if (!__classPrivateFieldGet2(this, _BetaToolRunner_message, "f")) { - throw new AnthropicError("ToolRunner concluded without a message from the server"); - } - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").resolve(await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f")); - } catch (error) { - __classPrivateFieldSet2(this, _BetaToolRunner_consumed, false, "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").promise.catch(() => { - }); - __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").reject(error); - __classPrivateFieldSet2(this, _BetaToolRunner_completion, promiseWithResolvers(), "f"); - throw error; - } - } - setMessagesParams(paramsOrMutator) { - const params = typeof paramsOrMutator === "function" ? paramsOrMutator(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params) : paramsOrMutator; - rejectCompactionParam(params); - rejectRunToolsEagerlyWithoutStream(params); - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status !== "idle") { - rejectCompactionEdit(params); - } - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "in_flight" && params.messages !== __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages) { - throw new AnthropicError("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead."); - } - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params = params; - __classPrivateFieldSet2(this, _BetaToolRunner_mutated, true, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - } - setRequestOptions(optionsOrMutator) { - if (typeof optionsOrMutator === "function") { - __classPrivateFieldSet2(this, _BetaToolRunner_options, optionsOrMutator(__classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_options, { ...__classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), ...optionsOrMutator }, "f"); - } - } - /** - * Get the tool response for the last message from the assistant. - * Avoids redundant tool executions by caching results. With `runToolsEagerly`, it reuses the calls of - * the reply that have started and runs the rest, including the ones `deferToolCall()` is holding, so that no - * call runs twice. - * - * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed - * - * @example - * const toolResponse = await runner.generateToolResponse(); - * if (toolResponse) { - * console.log('Tool results:', toolResponse.content); - * } - */ - async generateToolResponse(signal = __classPrivateFieldGet2(this, _BetaToolRunner_options, "f").signal) { - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f") ?? this.params.messages.at(-1); - if (!message) { - return null; - } - return __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_generateToolResponse).call(this, message, signal); - } - /** - * Hold a tool call of the current reply until you are done with the reply, which is when it runs without - * streaming: at the end of the loop body, or when you call `generateToolResponse()`. - * - * With `runToolsEagerly` the runner otherwise starts each call while the reply streams, as soon as - * the model has moved on from it: when the next block starts, or the reply stops with `tool_use`. A call - * never starts before your stream listeners and any `for await` over the stream have handled that event, so - * you can call this from either once you have seen the call. The other calls of the reply still start early. - * It does nothing for a call that has started, outside the loop body, and without `runToolsEagerly`. - * - * @param toolUse - The `tool_use` block of the call, or its id - * - * @example - * for await (const stream of runner) { - * stream.on('contentBlock', (block) => { - * if (block.type === 'tool_use' && block.name === 'delete_file') { - * runner.deferToolCall(block); - * } - * }); - * await stream.finalMessage(); - * // No `delete_file` call has started yet. - * } - */ - deferToolCall(toolUse) { - const id = typeof toolUse === "string" ? toolUse : toolUse.id; - if (__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f") && !__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f").has(id)) { - __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f").set(id, { status: "held" }); - } - } - /** - * The tool calls of the current reply that `deferToolCall()` is holding, in the model's order, as their - * `tool_use` blocks. A call is in the list once its block has finished streaming, so read the list when you - * are done with the stream. A call that has started is not in it. It is empty without - * `runToolsEagerly`. - * - * Held calls are listed whatever the reply's `stop_reason`, because `generateToolResponse()` runs them - * whatever it is. After `max_tokens` the input of the last call can be cut off. - * - * @example - * for await (const stream of runner) { - * stream.on('contentBlock', (block) => { - * if (block.type === 'tool_use' && block.name === 'delete_file') { - * runner.deferToolCall(block); - * } - * }); - * await stream.finalMessage(); - * - * const held = runner.deferredToolCalls; - * if (held.length > 0 && !(await confirm(held))) break; - * } - */ - get deferredToolCalls() { - const stream4 = __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f"); - const calls = __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f"); - if (!(stream4 instanceof BetaToolRunnerStream) || !calls) { - return []; - } - return stream4.toolCalls.filter((toolUse) => calls.get(toolUse.id)?.status === "held"); - } - /** - * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and - * will wait for an instance to start and go to completion. - * - * @returns A promise that resolves to the final BetaMessage when the iterator completes - * - * @example - * // Start consuming the iterator - * for await (const message of runner) { - * console.log('Message:', message.content); - * } - * - * // Meanwhile, wait for completion from another part of the code - * const finalMessage = await runner.done(); - * console.log('Final response:', finalMessage.content); - */ - done() { - return __classPrivateFieldGet2(this, _BetaToolRunner_completion, "f").promise; - } - /** - * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream: - * * If the iterator has not been consumed, consume the entire iterator and return the final message from the - * assistant. - * * If the iterator has been consumed, waits for it to complete and returns the final message. - * - * @returns A promise that resolves to the final BetaMessage from the conversation - * @throws {AnthropicError} If no messages were processed during the conversation - * - * @example - * const finalMessage = await runner.runUntilDone(); - * console.log('Final response:', finalMessage.content); - */ - async runUntilDone() { - if (!__classPrivateFieldGet2(this, _BetaToolRunner_consumed, "f")) { - for await (const _ of this) { - } - } - return this.done(); - } - /** - * Get the current parameters being used by the ToolRunner. - * - * @returns A readonly view of the current ToolRunnerParams - * - * @example - * const currentParams = runner.params; - * console.log('Current model:', currentParams.model); - * console.log('Message count:', currentParams.messages.length); - */ - get params() { - return __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - } - /** - * Add one or more messages to the conversation history. - * - * @param messages - One or more BetaMessageParam objects to add to the conversation - * - * @example - * runner.pushMessages( - * { role: 'user', content: 'Also, what about the weather in NYC?' } - * ); - * - * @example - * // Adding multiple messages - * runner.pushMessages( - * { role: 'user', content: 'What about NYC?' }, - * { role: 'user', content: 'And Boston?' } - * ); - */ - pushMessages(...messages) { - this.setMessagesParams((params) => ({ - ...params, - messages: [...params.messages, ...messages] - })); - } - /** - * Schedule a compaction of the conversation. Once the current turn has finished, including any tool - * calls, the runner requests a summary and replaces the message history with the compaction response, - * which is yielded like any other message. Requires the `compact-2026-09-04` beta. - * - * @param compaction - The config to send, as `messages.create()` takes it. Defaults to `{ type: 'summarize' }` - * - * @example - * for await (const message of runner) { - * if (message.usage.input_tokens > 100_000) { - * runner.compactBeforeNextTurn(); - * } - * } - */ - compactBeforeNextTurn(compaction) { - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status === "in_flight") { - return; - } - rejectCompactionEdit(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "scheduled", config: compaction ?? { type: "summarize" } }, "f"); - } - /** - * Give the model more tools without changing `params.tools`, which would miss the prompt cache. - * - * Each tool's whole definition is sent in a `tool_addition` block with the next request, and a - * runnable tool replaces a runnable tool of the same name straight away, even for a call already in - * the message being handled. A call that started while the reply streamed keeps the old one. A raw - * definition is only sent: the runner never runs it, and stops running a tool of the same name. - * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. - * - * @param tools - Runnable tools (for example from `betaZodTool()`) or raw tool definitions - * - * @example - * runner.addTools(queryDatabaseTool); - */ - addTools(...tools) { - for (const tool of tools) { - if ("name" in tool) { - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(tool.name, "run" in tool ? tool : null); - } - __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool }); - } - } - /** - * Take tools away from the model without changing `params.tools`, which would miss the prompt cache. - * - * The tools stop being run straight away: a call to one of them, even one in the message being - * handled, gets the same "not found" error result as a call to an unknown tool. A call that started - * while the reply streamed finishes as usual. The model is told in a `tool_removal` block with the - * next request. Use {@link addTools} to bring a tool back. - * Requires the `inline-tools-2026-09-15` beta, which the runner does not add for you. - * - * @param tools - The tools to remove, or their names - * - * @example - * runner.removeTools('query_database'); - */ - removeTools(...tools) { - for (const tool of tools) { - const name = typeof tool === "string" ? tool : tool.name; - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(name, null); - __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "removal", name }); - } - } - /** - * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone() - * This allows using `await runner` instead of `await runner.runUntilDone()` - */ - then(onfulfilled, onrejected) { - return this.runUntilDone().then(onfulfilled, onrejected); - } - } - _BetaToolRunner_send = /** - * Sends one request and yields its message, or its stream when streaming. `#message` and `#stream` are set - * before the yield, so they are there while the caller handles the item; the loop aborts the stream at the - * end of the iteration. - */ - async function* _BetaToolRunner_send2(params) { - await __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_startedCallsSettled).call(this); - __classPrivateFieldSet2(this, _BetaToolRunner_calls, void 0, "f"); - if (params.stream) { - __classPrivateFieldSet2(this, _BetaToolRunner_stream, __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.runToolsEagerly ? __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_streamThatStartsTools).call(this, params) : this.client.beta.messages.stream({ ...params }, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_message, __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f").finalMessage(), "f"); - __classPrivateFieldGet2(this, _BetaToolRunner_message, "f").catch(() => { - }); - yield __classPrivateFieldGet2(this, _BetaToolRunner_stream, "f"); - } else { - __classPrivateFieldSet2(this, _BetaToolRunner_message, this.client.beta.messages.create({ ...params, stream: false }, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")), "f"); - yield __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - } - }, _BetaToolRunner_streamThatStartsTools = function _BetaToolRunner_streamThatStartsTools2(params) { - const calls = /* @__PURE__ */ new Map(); - __classPrivateFieldSet2(this, _BetaToolRunner_calls, calls, "f"); - return BetaToolRunnerStream.start(this.client.beta.messages, params, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), (toolUse) => { - if (calls.has(toolUse.id)) { - return; - } - const result = runToolCall(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), toolUse, __classPrivateFieldGet2(this, _BetaToolRunner_options, "f")); - result.catch(() => { - }); - calls.set(toolUse.id, { status: "started", result }); - }); - }, _BetaToolRunner_startedCallsSettled = /** Waits for the calls of the last streamed reply that have started, whether or not their results were sent. */ - async function _BetaToolRunner_startedCallsSettled2() { - const started = [...__classPrivateFieldGet2(this, _BetaToolRunner_calls, "f")?.values() ?? []].filter((call) => call.status === "started"); - await Promise.allSettled(started.map((call) => call.result)); - }, _BetaToolRunner_compact = async function* _BetaToolRunner_compact2(compaction) { - rejectCompactionEdit(__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params); - const { max_iterations, runToolsEagerly, ...requestParams } = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params; - const params = withoutCompactionIncompatibleParams(requestParams); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "in_flight" }, "f"); - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, void 0, "f"); - const lastMessage = __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - try { - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_send).call(this, { ...params, compaction }); - const message = await __classPrivateFieldGet2(this, _BetaToolRunner_message, "f"); - if (message.content.some((block) => block.type === "compaction" && block.content)) { - __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_recordRemovalsFromHistory).call(this); - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages = [{ role: message.role, content: message.content }]; - } else { - loggerFor2(this.client).warn("Compaction produced no summary; keeping the conversation as it is."); - __classPrivateFieldSet2(this, _BetaToolRunner_message, lastMessage, "f"); - } - } finally { - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); - } - }, _BetaToolRunner_runnableTools = function _BetaToolRunner_runnableTools2() { - const runnable = /* @__PURE__ */ new Map(); - for (const tool of __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.tools) { - if ("run" in tool) { - runnable.set(tool.name, tool); - } - } - for (const [name, tool] of __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f")) { - if (tool) { - runnable.set(name, tool); - } else { - runnable.delete(name); - } - } - return runnable; - }, _BetaToolRunner_availableToolNames = function _BetaToolRunner_availableToolNames2() { - const available = new Set(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()); - for (const message of [...__classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages, __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)]) { - if (typeof message.content === "string") { - continue; - } - for (const block of message.content) { - if (message.role === "system") { - applyToolChange(block, available); - } else if (message.role === "assistant" && block.type === "compaction") { - for (const change of block.tool_changes ?? []) { - applyToolChange(change, available); - } - } - } - } - return available; - }, _BetaToolRunner_recordRemovalsFromHistory = function _BetaToolRunner_recordRemovalsFromHistory2() { - const available = __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this); - for (const name of __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this).keys()) { - if (!available.has(name)) { - __classPrivateFieldGet2(this, _BetaToolRunner_toolOverrides, "f").set(name, null); - } - } - }, _BetaToolRunner_compactAfterFinalTurn = async function* _BetaToolRunner_compactAfterFinalTurn2() { - if (__classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").status !== "scheduled") { - return; - } - const lastContent = __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.at(-1)?.content; - if (Array.isArray(lastContent) && lastContent.some((block) => block.type === "tool_use")) { - loggerFor2(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."); - __classPrivateFieldSet2(this, _BetaToolRunner_compaction, { status: "idle" }, "f"); - return; - } - yield* __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_compact).call(this, __classPrivateFieldGet2(this, _BetaToolRunner_compaction, "f").config); - }, _BetaToolRunner_generateToolResponse = async function _BetaToolRunner_generateToolResponse2(lastMessage, signal = __classPrivateFieldGet2(this, _BetaToolRunner_options, "f").signal) { - if (__classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f") !== void 0) { - return __classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f"); - } - __classPrivateFieldSet2(this, _BetaToolRunner_toolResponse, generateToolResponse(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_runnableTools).call(this), __classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_availableToolNames).call(this), lastMessage, { ...__classPrivateFieldGet2(this, _BetaToolRunner_options, "f"), signal }, __classPrivateFieldGet2(this, _BetaToolRunner_calls, "f")), "f"); - return __classPrivateFieldGet2(this, _BetaToolRunner_toolResponse, "f"); - }, _BetaToolRunner_flushPendingToolChanges = function _BetaToolRunner_flushPendingToolChanges2() { - if (__classPrivateFieldGet2(this, _BetaToolRunner_lastStopReason, "f") === "pause_turn" || __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f").length === 0) { - return; - } - __classPrivateFieldGet2(this, _BetaToolRunner_state, "f").params.messages.push(__classPrivateFieldGet2(this, _BetaToolRunner_instances, "m", _BetaToolRunner_pendingToolChangesMessage).call(this)); - __classPrivateFieldSet2(this, _BetaToolRunner_pendingToolChanges, [], "f"); - }, _BetaToolRunner_pendingToolChangesMessage = function _BetaToolRunner_pendingToolChangesMessage2() { - const content = []; - for (const change of __classPrivateFieldGet2(this, _BetaToolRunner_pendingToolChanges, "f")) { - if (change.type === "removal") { - content.push({ type: "tool_removal", tool: { type: "tool_reference", name: change.name } }); - continue; - } - let definition = change.tool; - if ("run" in change.tool) { - const { run, parse: parse2, close, ...rest } = change.tool; - definition = rest; - } - content.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); - } - return { role: "system", content }; - }; - return BetaToolRunner2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs -function transformOutputFormat(params) { - if (!params.output_format) { - return params; - } - if (params.output_config?.format) { - throw new AnthropicError("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated)."); - } - const { output_format, ...rest } = params; - return { - ...rest, - output_config: { - ...params.output_config, - format: output_format - } - }; -} -var DEPRECATED_MODELS, MODELS_TO_WARN_WITH_THINKING_ENABLED, Messages3; -var init_messages3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs"() { - init_error4(); - init_batches2(); - init_resource2(); - init_constants(); - init_headers3(); - init_stainless_helper_header(); - init_beta_parser(); - init_BetaMessageStream(); - init_BetaToolRunner(); - init_ToolError(); - init_batches2(); - DEPRECATED_MODELS = {}; - MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-mythos-preview", "claude-opus-4-6"]; - Messages3 = /* @__PURE__ */ (() => { - class Messages5 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches2(this._client); - } - create(params, options) { - const modifiedParams = transformOutputFormat(params); - const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; - if (body.model in DEPRECATED_MODELS) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) && body.thinking && body.thinking.type === "enabled") { - console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); - } - let timeout = options?.timeout ?? this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); - return this._client.post("/v1/messages?beta=true", { - body, - timeout: timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - helperHeader2, - options?.headers - ]), - stream: modifiedParams.stream ?? false - }); - } - /** - * Send a structured list of input messages with text and/or image content, along with an expected `output_format` and - * the response will be automatically parsed and available in the `parsed_output` property of the message. - * - * @example - * ```ts - * const message = await client.beta.messages.parse({ - * model: 'claude-3-5-sonnet-20241022', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'), - * }); - * - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - parse(params, options) { - options = { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...params.betas ?? [], "structured-outputs-2025-12-15"].toString() }, - options?.headers - ]) - }; - return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console })); - } - /** - * Create a Message stream - */ - stream(body, options) { - return BetaMessageStream.createMessage(this, body, options); - } - /** - * Count the number of tokens in a Message. - * - * The Token Count API can be used to count the number of tokens in a Message, - * including tools, images, and documents, without creating it. - * - * Learn more about token counting in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) - * - * @example - * ```ts - * const betaMessageTokensCount = - * await client.beta.messages.countTokens({ - * messages: [{ content: 'Hello, world', role: 'user' }], - * model: 'claude-opus-5', - * }); - * ``` - */ - countTokens(params, options) { - const modifiedParams = transformOutputFormat(params); - const { betas, user_profile_id, workspace_id, ...body } = modifiedParams; - return this._client.post("/v1/messages/count_tokens?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "token-counting-2024-11-01"].toString(), - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - toolRunner(body, options) { - return new BetaToolRunner(this._client, body, options); - } - } - Messages5.Batches = Batches2; - Messages5.BetaToolRunner = BetaToolRunner; - Messages5.ToolError = ToolError; - return Messages5; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs -var APIKeys3; -var init_api_keys3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - APIKeys3 = class extends APIResource2 { - /** - * Get API Key - * - * @example - * ```ts - * const betaAPIKey = - * await client.beta.organization.apiKeys.retrieve( - * 'api_key_id', - * ); - * ``` - */ - retrieve(apiKeyID, options) { - return this._client.get(path3`/v1/organizations/api_keys/${apiKeyID}?beta=true`, options); - } - /** - * Update API Key - * - * @example - * ```ts - * const betaAPIKey = - * await client.beta.organization.apiKeys.update( - * 'api_key_id', - * ); - * ``` - */ - update(apiKeyID, body, options) { - return this._client.post(path3`/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options }); - } - /** - * List API Keys - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/api_keys?beta=true", Page2, { - query, - ...options - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs -var ComplianceSettings; -var init_compliance_settings = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs"() { - init_resource2(); - ComplianceSettings = class extends APIResource2 { - /** - * Retrieve your organization's Compliance Settings. - * - * Compliance Settings is a singleton resource: there is exactly one per - * organization, addressed without an identifier. The `state` field reflects - * whether the Compliance API is enabled. An organization with a parent - * organization reads the state inherited from the parent's configuration. - * - * @example - * ```ts - * const betaComplianceSettings = - * await client.beta.organization.complianceSettings.retrieve(); - * ``` - */ - retrieve(options) { - return this._client.get("/v1/organizations/compliance_settings?beta=true", options); - } - /** - * Update your organization's Compliance Settings. - * - * Setting `state` to `enabled` turns on the Compliance API and begins capturing - * organization activity events. Setting it to `disabled` turns both off. `state` - * reflects whether the Compliance API is enabled. - * - * A request that sets `state` to its current value succeeds and leaves the - * resource unchanged. A `disabled` request stays in effect until a later `enabled` - * request or the organization's next provisioning action that enables Access - * Transparency: enabling Access Transparency also enables the Compliance API, - * which serves its activity events, so such provisioning (including re-runs) - * re-enables the Compliance API even after a `disabled` request. Automated - * provisioning never disables compliance settings. - * - * @example - * ```ts - * const betaComplianceSettings = - * await client.beta.organization.complianceSettings.update({ - * state: { type: 'enabled' }, - * }); - * ``` - */ - update(body, options) { - return this._client.post("/v1/organizations/compliance_settings?beta=true", { body, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs -var ExternalKeys; -var init_external_keys = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - ExternalKeys = class extends APIResource2 { - /** - * Create an external key config owned by the caller's organization. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.create({ - * provider_config: { - * kms_arn: - * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222', - * type: 'aws', - * }, - * }); - * ``` - */ - create(body, options) { - return this._client.post("/v1/organizations/external_keys?beta=true", { body, ...options }); - } - /** - * Retrieve a single external key config in the caller's organization by ID. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.retrieve( - * 'external_key_id', - * ); - * ``` - */ - retrieve(externalKeyID, options) { - return this._client.get(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); - } - /** - * Partially update an external key config. Omitted fields are left unchanged. - * - * `display_name` is always editable. `geo` and `provider_config` cannot be changed - * once any workspace references this config, because previously encrypted data - * requires the original key identity to decrypt. - * - * @example - * ```ts - * const betaExternalKey = - * await client.beta.organization.externalKeys.update( - * 'external_key_id', - * ); - * ``` - */ - update(externalKeyID, body, options) { - return this._client.post(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, { - body, - ...options - }); - } - /** - * List external key configs in the caller's organization. - * - * Results are ordered by creation time (newest first). Use the `next_page` cursor - * from the response to fetch subsequent pages. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/external_keys?beta=true", PageCursor, { - query, - ...options - }); - } - /** - * Delete an external key config. - * - * The request is rejected if any workspace still references this config. - * - * @example - * ```ts - * const externalKey = - * await client.beta.organization.externalKeys.delete( - * 'external_key_id', - * ); - * ``` - */ - delete(externalKeyID, options) { - return this._client.delete(path3`/v1/organizations/external_keys/${externalKeyID}?beta=true`, options); - } - /** - * Validate an external key config against the customer's KMS. - * - * Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key - * and waits up to 30 seconds for the result. The response status is `success` if - * the roundtrip succeeded, or `failure` with an error message if it failed or - * timed out. - * - * @example - * ```ts - * const response = - * await client.beta.organization.externalKeys.validate( - * 'external_key_id', - * ); - * ``` - */ - validate(externalKeyID, options) { - return this._client.post(path3`/v1/organizations/external_keys/${externalKeyID}/validate?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs -var Invites2; -var init_invites2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Invites2 = class extends APIResource2 { - /** - * Invite a user to join the organization by email. - * - * On plans that draw members from a finite pool of purchased seats, the invite - * automatically consumes a seat from the lowest tier with availability; there is - * no seat-tier parameter. When no seat is free the request fails with a 400 error - * rather than purchasing a seat. - * - * @example - * ```ts - * const betaOrganizationInvite = - * await client.beta.organization.invites.create({ - * email: 'user@emaildomain.com', - * role: 'user', - * }); - * ``` - */ - create(body, options) { - return this._client.post("/v1/organizations/invites?beta=true", { body, ...options }); - } - /** - * Retrieve an invite by ID. - * - * @example - * ```ts - * const betaOrganizationInvite = - * await client.beta.organization.invites.retrieve( - * 'invite_id', - * ); - * ``` - */ - retrieve(inviteID, options) { - return this._client.get(path3`/v1/organizations/invites/${inviteID}?beta=true`, options); - } - /** - * List the organization's invites. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationInvite of client.beta.organization.invites.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/invites?beta=true", Page2, { - query, - ...options - }); - } - /** - * Delete a pending invite. - * - * @example - * ```ts - * const invite = - * await client.beta.organization.invites.delete( - * 'invite_id', - * ); - * ``` - */ - delete(inviteID, options) { - return this._client.delete(path3`/v1/organizations/invites/${inviteID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs -var RateLimits2; -var init_rate_limits2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs"() { - init_resource2(); - init_pagination2(); - RateLimits2 = class extends APIResource2 { - /** - * List Messages API rate limits for your organization. - * - * Each entry corresponds to one rate-limit group (either a model family or an - * API-surface category such as the Files API or Message Batches) and contains the - * set of limiter values that apply to it. - * - * When `limit` is omitted, every matching entry is returned in a single page; when - * `limit` truncates the result, follow `next_page` to fetch the remaining entries. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationRateLimit of client.beta.organization.rateLimits.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs -var Users4; -var init_users4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Users4 = class extends APIResource2 { - /** - * Retrieve a member of the organization by user ID. - * - * @example - * ```ts - * const betaOrganizationUser = - * await client.beta.organization.users.retrieve('user_id'); - * ``` - */ - retrieve(userID, options) { - return this._client.get(path3`/v1/organizations/users/${userID}?beta=true`, options); - } - /** - * Update a member's organization role. - * - * @example - * ```ts - * const betaOrganizationUser = - * await client.beta.organization.users.update('user_id', { - * role: 'user', - * }); - * ``` - */ - update(userID, body, options) { - return this._client.post(path3`/v1/organizations/users/${userID}?beta=true`, { body, ...options }); - } - /** - * List the organization's members. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaOrganizationUser of client.beta.organization.users.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/users?beta=true", Page2, { - query, - ...options - }); - } - /** - * Remove a member from the organization. - * - * @example - * ```ts - * const user = await client.beta.organization.users.remove( - * 'user_id', - * ); - * ``` - */ - remove(userID, options) { - return this._client.delete(path3`/v1/organizations/users/${userID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs -var Issuers; -var init_issuers = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Issuers = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Register an OIDC issuer that Anthropic will trust for workload identity - * federation in your organization. - * - * The `jwks` field controls how the issuer's signing keys are obtained and takes - * one of three shapes selected by `type`: `discovery` (resolve keys through OIDC - * discovery), `explicit_url` (fetch keys from a fixed JWKS URL), or `inline` - * (provide a static key set). When `jwks.type` is `discovery` and no - * `discovery_base` is set, the issuer URL must be publicly reachable over HTTPS so - * Anthropic can fetch the discovery document; for `explicit_url` and `inline` - * modes the issuer URL is only matched as the JWT's `iss` claim and is not - * fetched. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.create({ - * issuer_url: 'x', - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/federation_issuers?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a federation issuer by its ID (`fdis_...`). - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.retrieve( - * 'federation_issuer_id', - * ); - * ``` - */ - retrieve(federationIssuerID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Partially update a federation issuer. - * - * Setting `jwks` replaces the full JWKS shape at once. Archived issuers cannot be - * updated; this returns 400. Create a new issuer instead. - * - * Updating an issuer that backs a rule with a scope outside `workspace:developer` - * or `workspace:inference` requires a Console session. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.update( - * 'federation_issuer_id', - * ); - * ``` - */ - update(federationIssuerID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List federation issuers in your organization. - * - * Archived issuers are excluded unless `include_archived=true`. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationIssuer of client.beta.organization.federation.issuers.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a federation issuer. - * - * Idempotent; re-archiving returns the issuer with its original `archived_at`. - * Rejected with 400 if any live (non-archived) federation rule still references - * the issuer; archive those rules first (a rule's issuer cannot be changed), or - * recreate them against another issuer. - * - * @example - * ```ts - * const betaFederationIssuer = - * await client.beta.organization.federation.issuers.archive( - * 'federation_issuer_id', - * ); - * ``` - */ - archive(federationIssuerID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/federation_issuers/${federationIssuerID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs -var Workspaces; -var init_workspaces = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List workspaces where this federation rule is enabled. - * - * Returns all workspace enablements in a single response; the `limit` and `page` - * parameters are accepted but have no effect, and `next_page` is always `null`. - * Returns explicit per-workspace enablements only; for rules with - * `applies_to_all_workspaces` or a legacy single `workspace_id`, check those - * fields on the rule itself. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationRuleWorkspace of client.beta.organization.federation.rules.workspaces.list( - * 'federation_rule_id', - * )) { - * // ... - * } - * ``` - */ - list(federationRuleID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Enable a federation rule for a workspace. - * - * Idempotent; re-enabling returns the existing enablement. The rule and workspace - * must both belong to your organization. Membership of the rule's target service - * account in this workspace is not checked at enablement: token exchange into this - * workspace is rejected unless the target is a member (it is implicitly a member - * of the default workspace). Archived rules are rejected with 400. OAuth callers - * may only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRuleWorkspace = - * await client.beta.organization.federation.rules.workspaces.add( - * 'federation_rule_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - add(federationRuleID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Disable a federation rule for a workspace. - * - * Idempotent; succeeds even if the enablement was already removed. OAuth callers - * may only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const workspace = - * await client.beta.organization.federation.rules.workspaces.remove( - * 'workspace_id', - * { federation_rule_id: 'federation_rule_id' }, - * ); - * ``` - */ - remove(workspaceID, params, options) { - const { federation_rule_id, betas } = params; - return this._client.delete(path3`/v1/organizations/federation_rules/${federation_rule_id}/workspaces/${workspaceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs -var Rules; -var init_rules = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs"() { - init_resource2(); - init_workspaces(); - init_workspaces(); - init_pagination2(); - init_headers3(); - init_path2(); - Rules = /* @__PURE__ */ (() => { - class Rules2 extends APIResource2 { - constructor() { - super(...arguments); - this.workspaces = new Workspaces(this._client); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Create a federation rule owned by your organization. - * - * The referenced issuer and the target service account must already exist in the - * same organization; invalid references are rejected with a 400 error. The - * workspace reference is validated. Membership is not checked at rule creation: - * token exchange resolves a single enabled workspace per call and is rejected - * unless the target service account is a member of that workspace (it is - * implicitly a member of the default workspace). Rules on well-known shared - * issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, Google) must - * constrain tenant identity via an identity-bearing claim, a tenant-pinning - * subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition referencing one - * of those identity claims (e.g. `claims.repository_owner`). OAuth callers may - * only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.create({ - * issuer_id: 'issuer_id', - * match: {}, - * name: 'x', - * oauth_scope: 'x', - * target: { - * service_account_id: 'svac_01SDCCSbTxrXDpWc1phhtcfK', - * type: 'service_account', - * }, - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/federation_rules?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a federation rule by its ID (`fdrl_...`). - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.retrieve( - * 'federation_rule_id', - * ); - * ``` - */ - retrieve(federationRuleID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Partially update a federation rule. - * - * `issuer_id` is immutable. `match` and `target` are replaced as whole objects - * when set. Referenced service accounts and workspaces must exist in your - * organization; invalid references are rejected with a 400 error. Archived rules - * cannot be updated; this returns 400. Create a new rule instead. Rules on - * well-known shared issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, - * Google) must constrain tenant identity via an identity-bearing claim, a - * tenant-pinning subject prefix (such as `repo:YOUR_ORG/...`), or a CEL condition - * referencing one of those identity claims (e.g. `claims.repository_owner`). On - * these issuers the requirement is re-checked on every update; if an existing - * rule's stored match does not yet constrain tenant identity, any update (even a - * rename or description change) must also supply a conforming `match` in the same - * request. OAuth callers may only manage rules whose `oauth_scope` is - * `workspace:developer` or `workspace:inference`; other scopes require a Console - * session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.update( - * 'federation_rule_id', - * ); - * ``` - */ - update(federationRuleID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List federation rules in your organization. - * - * Optionally filter by issuer with `issuer_id`. Archived rules are excluded unless - * `include_archived=true`. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaFederationRule of client.beta.organization.federation.rules.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/federation_rules?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a federation rule. - * - * Token exchange through this rule stops immediately. Idempotent; re-archiving - * returns the rule with its original `archived_at`. Archiving clears the rule's - * workspace targeting (`workspace_id` and `workspace_ids` are emptied). Tokens - * already minted before archive remain valid until they expire. OAuth callers may - * only manage rules whose `oauth_scope` is `workspace:developer` or - * `workspace:inference`; other scopes require a Console session. - * - * @example - * ```ts - * const betaFederationRule = - * await client.beta.organization.federation.rules.archive( - * 'federation_rule_id', - * ); - * ``` - */ - archive(federationRuleID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/federation_rules/${federationRuleID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - } - Rules2.Workspaces = Workspaces; - return Rules2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs -var Federation; -var init_federation = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs"() { - init_resource2(); - init_issuers(); - init_issuers(); - init_rules(); - init_rules(); - Federation = /* @__PURE__ */ (() => { - class Federation2 extends APIResource2 { - constructor() { - super(...arguments); - this.issuers = new Issuers(this._client); - this.rules = new Rules(this._client); - } - } - Federation2.Issuers = Issuers; - Federation2.Rules = Rules; - return Federation2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs -var Workspaces2; -var init_workspaces2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces2 = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List the workspaces a service account is a member of. - * - * Each entry includes the service account's `workspace_role` in that workspace. - * Use `limit` and the `next_page` cursor to paginate. When the service account has - * no explicit default-workspace membership, the implicit (`implicit: true`) - * membership is returned as the first entry on the first page; with `limit=1` the - * first page may return up to 2 entries (the implicit entry plus one explicit - * membership) so a pagination cursor can be derived. Memberships are returned only - * while the service account is active. Without a `page` cursor, an archived - * service account returns an empty list. A `page` cursor that does not match an - * active membership returns a 400 invalid-request error. A cursor stops matching - * when the membership is removed, the workspace is deleted, or the service account - * is archived. Restart pagination from the first page to recover. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.serviceAccounts.workspaces.list( - * 'service_account_id', - * )) { - * // ... - * } - * ``` - */ - list(serviceAccountID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Add a service account to a workspace with the given `workspace_role`. - * - * Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed from the - * service-account side; both create the same membership. If the service account is - * already an explicit member of the workspace, its `workspace_role` is replaced - * with the value supplied here. Archived workspaces return 400. Archived service - * accounts cannot be added and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.serviceAccounts.workspaces.add( - * 'service_account_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(serviceAccountID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Remove a service account from a workspace. - * - * Mirror of - * `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`, - * addressed from the service-account side. Removal is idempotent (returns 200 even - * if the membership was already removed). A DELETE against the implicit - * default-workspace membership returns 200 but is a no-op and the membership - * persists; deleting an explicit default-workspace row reverts to the implicit - * `workspace_user` membership. Archived workspaces return 400. - * - * @example - * ```ts - * const workspace = - * await client.beta.organization.serviceAccounts.workspaces.remove( - * 'workspace_id', - * { service_account_id: 'service_account_id' }, - * ); - * ``` - */ - remove(workspaceID, params, options) { - const { service_account_id, betas } = params; - return this._client.delete(path3`/v1/organizations/service_accounts/${service_account_id}/workspaces/${workspaceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs -var ServiceAccounts2; -var init_service_accounts2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs"() { - init_resource2(); - init_workspaces2(); - init_workspaces2(); - init_pagination2(); - init_headers3(); - init_path2(); - ServiceAccounts2 = /* @__PURE__ */ (() => { - class ServiceAccounts4 extends APIResource2 { - constructor() { - super(...arguments); - this.workspaces = new Workspaces2(this._client); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Create a service account. - * - * A service account is a named workload identity that federation rules target. - * `organization_role` is `developer` (default) or `admin`; a rule may only be - * created or retargeted to grant `org:admin` scope when the target's - * `organization_role` is `admin`. Creating an `admin`-role service account - * requires an interactive credential (a user OAuth token or a Console session) — a - * workload may only create `developer`-role service accounts. - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.create({ - * name: 'ci-deploy-bot', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/service_accounts?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a service account by its ID (`svac_...`). - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.retrieve( - * 'service_account_id', - * ); - * ``` - */ - retrieve(serviceAccountID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path3`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Update a service account. - * - * Only `description` and `organization_role` are mutable; `name` cannot be - * changed. Archived service accounts cannot be updated; this returns 400. Setting - * `organization_role` to `admin` (even when unchanged) requires an interactive - * credential (a user OAuth token or a Console session). - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.update( - * 'service_account_id', - * ); - * ``` - */ - update(serviceAccountID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List service accounts in the caller's organization. - * - * Results are ordered by creation time, newest first. Use `limit` and the - * `next_page` cursor to paginate; set `include_archived=true` to include archived - * service accounts. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/organizations/service_accounts?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Archive a service account. - * - * Idempotent; re-archiving returns the service account with its original - * `archived_at`. Rejected with 400 if any live (non-archived) federation rule - * still targets this service account, same as issuer archival; archive those rules - * first or change their target to another service account. - * - * @example - * ```ts - * const betaServiceAccount = - * await client.beta.organization.serviceAccounts.archive( - * 'service_account_id', - * ); - * ``` - */ - archive(serviceAccountID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path3`/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - } - ServiceAccounts4.Workspaces = Workspaces2; - return ServiceAccounts4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs -var Members; -var init_members = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - Members = class extends APIResource2 { - /** - * Get Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.retrieve( - * 'user_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - retrieve(userID, params, options) { - const { workspace_id } = params; - return this._client.get(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); - } - /** - * Update Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.update( - * 'user_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - update(userID, params, options) { - const { workspace_id, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, { - body, - ...options - }); - } - /** - * List Workspace Members - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspaceMember of client.beta.organization.workspaces.members.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, query = {}, options) { - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page2, { query, ...options }); - } - /** - * Create Workspace Member - * - * @example - * ```ts - * const betaWorkspaceMember = - * await client.beta.organization.workspaces.members.add( - * 'workspace_id', - * { - * user_id: 'user_01WCz1FkmYMm4gnmykNKUu3Q', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(workspaceID, body, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, { - body, - ...options - }); - } - /** - * Delete Workspace Member - * - * @example - * ```ts - * const member = - * await client.beta.organization.workspaces.members.remove( - * 'user_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - remove(userID, params, options) { - const { workspace_id } = params; - return this._client.delete(path3`/v1/organizations/workspaces/${workspace_id}/members/${userID}?beta=true`, options); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs -var RateLimits3; -var init_rate_limits3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs"() { - init_resource2(); - init_pagination2(); - init_path2(); - RateLimits3 = class extends APIResource2 { - /** - * List a workspace's rate limits. - * - * By default, returns only the groups and limiter types that have a - * workspace-level override. With `include_inherited=true`, returns every group - * with organization-level limits the workspace can see, listing for each the - * values it inherits from the organization as well as its own overrides. Each - * value's `source` says which it is. - * - * When `limit` is omitted, every matching entry is returned in a single page; when - * `limit` truncates the result, follow `next_page` to fetch the remaining entries. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspaceRateLimit of client.beta.organization.workspaces.rateLimits.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, query = {}, options) { - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query, ...options }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs -var ServiceAccounts3; -var init_service_accounts3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - ServiceAccounts3 = class extends APIResource2 { - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Retrieve a service account's membership in a workspace. - * - * Returns the membership record, including the service account's `workspace_role` - * in this workspace. Archived workspaces return 400. For the default workspace, - * returns the implicit (`implicit: true`) membership when no explicit membership - * exists; an explicitly added membership is returned with its assigned role. An - * archived service account returns 404. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.retrieve( - * 'service_account_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - retrieve(serviceAccountID, params, options) { - const { workspace_id, betas } = params; - return this._client.get(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Change a service account's role in a workspace. - * - * The new `workspace_role` replaces the current one. Only explicit memberships can - * be updated; to set a role on the implicit default-workspace membership, add the - * service account explicitly with - * `POST /workspaces/{workspace_id}/service_accounts`. Archived workspaces - * return 400. Archived service accounts cannot be updated and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.update( - * 'service_account_id', - * { - * workspace_id: 'workspace_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - update(serviceAccountID, params, options) { - const { workspace_id, betas, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * List the service accounts that are members of a workspace. - * - * Each entry includes the service account's `workspace_role`. Use `limit` and the - * `next_page` cursor to paginate. Archived workspaces return 400; use - * `GET /service_accounts/{id}/workspaces` to audit memberships of an archived - * workspace. The implicit default-workspace membership is not included in this - * list. Memberships of archived service accounts are omitted from the results. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaServiceAccountWorkspaceMember of client.beta.organization.workspaces.serviceAccounts.list( - * 'workspace_id', - * )) { - * // ... - * } - * ``` - */ - list(workspaceID, params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Add a service account to a workspace with the given `workspace_role`. - * - * The role determines what the service account can do in the workspace and which - * workspace-scoped permissions it can be granted when authenticating through - * federation. Every service account is already an implicit `workspace_user` member - * of the default workspace; adding it explicitly assigns a chosen role. If the - * service account is already an explicit member of the workspace, its - * `workspace_role` is replaced with the value supplied here. Archived workspaces - * return 400. Archived service accounts cannot be added and are rejected. - * - * @example - * ```ts - * const betaServiceAccountWorkspaceMember = - * await client.beta.organization.workspaces.serviceAccounts.add( - * 'workspace_id', - * { - * service_account_id: 'service_account_id', - * workspace_role: 'workspace_admin', - * }, - * ); - * ``` - */ - add(workspaceID, params, options) { - const { betas, ...body } = params; - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * **Requires an OAuth access token with the `org:admin` scope**, from - * `ant auth login --scope org:admin` or a workload identity federation rule; Admin - * API keys are not accepted. See - * [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api). - * - * Remove a service account from a workspace. - * - * Removal is idempotent (returns 200 even if the membership was already removed). - * A DELETE against the implicit default-workspace membership returns 200 but is a - * no-op and the membership persists; deleting an explicit default-workspace row - * reverts to the implicit `workspace_user` membership. Archived workspaces - * return 400. - * - * @example - * ```ts - * const serviceAccount = - * await client.beta.organization.workspaces.serviceAccounts.remove( - * 'service_account_id', - * { workspace_id: 'workspace_id' }, - * ); - * ``` - */ - remove(serviceAccountID, params, options) { - const { workspace_id, betas } = params; - return this._client.delete(path3`/v1/organizations/workspaces/${workspace_id}/service_accounts/${serviceAccountID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs -var Workspaces3; -var init_workspaces3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs"() { - init_resource2(); - init_members(); - init_members(); - init_rate_limits3(); - init_rate_limits3(); - init_service_accounts3(); - init_service_accounts3(); - init_pagination2(); - init_headers3(); - init_path2(); - Workspaces3 = /* @__PURE__ */ (() => { - class Workspaces4 extends APIResource2 { - constructor() { - super(...arguments); - this.rateLimits = new RateLimits3(this._client); - this.members = new Members(this._client); - this.serviceAccounts = new ServiceAccounts3(this._client); - } - /** - * Create Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.create({ - * name: 'x', - * }); - * ``` - */ - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/organizations/workspaces?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, - options?.headers - ]) - }); - } - /** - * Get Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.retrieve( - * 'workspace_id', - * ); - * ``` - */ - retrieve(workspaceID, options) { - return this._client.get(path3`/v1/organizations/workspaces/${workspaceID}?beta=true`, options); - } - /** - * Update Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.update( - * 'workspace_id', - * ); - * ``` - */ - update(workspaceID, body, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}?beta=true`, { - body, - ...options - }); - } - /** - * List Workspaces - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaWorkspace of client.beta.organization.workspaces.list()) { - * // ... - * } - * ``` - */ - list(query = {}, options) { - return this._client.getAPIList("/v1/organizations/workspaces?beta=true", Page2, { - query, - ...options - }); - } - /** - * Archive Workspace - * - * @example - * ```ts - * const betaWorkspace = - * await client.beta.organization.workspaces.archive( - * 'workspace_id', - * ); - * ``` - */ - archive(workspaceID, options) { - return this._client.post(path3`/v1/organizations/workspaces/${workspaceID}/archive?beta=true`, options); - } - } - Workspaces4.RateLimits = RateLimits3; - Workspaces4.Members = Members; - Workspaces4.ServiceAccounts = ServiceAccounts3; - return Workspaces4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs -var Organization2; -var init_organization2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs"() { - init_resource2(); - init_api_keys3(); - init_api_keys3(); - init_compliance_settings(); - init_compliance_settings(); - init_external_keys(); - init_external_keys(); - init_invites2(); - init_invites2(); - init_rate_limits2(); - init_rate_limits2(); - init_users4(); - init_users4(); - init_federation(); - init_federation(); - init_service_accounts2(); - init_service_accounts2(); - init_workspaces3(); - init_workspaces3(); - Organization2 = /* @__PURE__ */ (() => { - class Organization3 extends APIResource2 { - constructor() { - super(...arguments); - this.apiKeys = new APIKeys3(this._client); - this.externalKeys = new ExternalKeys(this._client); - this.federation = new Federation(this._client); - this.invites = new Invites2(this._client); - this.serviceAccounts = new ServiceAccounts2(this._client); - this.users = new Users4(this._client); - this.workspaces = new Workspaces3(this._client); - this.rateLimits = new RateLimits2(this._client); - this.complianceSettings = new ComplianceSettings(this._client); - } - /** - * Retrieve information about the organization associated with the authenticated - * API key. - * - * @example - * ```ts - * const betaOrganization = - * await client.beta.organization.retrieve(); - * ``` - */ - retrieve(options) { - return this._client.get("/v1/organizations/me?beta=true", options); - } - } - Organization3.APIKeys = APIKeys3; - Organization3.ExternalKeys = ExternalKeys; - Organization3.Federation = Federation; - Organization3.Invites = Invites2; - Organization3.ServiceAccounts = ServiceAccounts2; - Organization3.Users = Users4; - Organization3.Workspaces = Workspaces3; - Organization3.RateLimits = RateLimits2; - Organization3.ComplianceSettings = ComplianceSettings; - return Organization3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs -var Events2; -var init_events2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - init_SessionToolRunner(); - Events2 = /* @__PURE__ */ (() => { - class Events4 extends APIResource2 { - /** - * List Events - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.events.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Send Events - * - * @example - * ```ts - * const betaManagedAgentsSendSessionEvents = - * await client.beta.sessions.events.send( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * { - * events: [ - * { - * content: [ - * { - * text: 'Where is my order #1234?', - * type: 'text', - * }, - * ], - * type: 'user.message', - * }, - * ], - * }, - * ); - * ``` - */ - send(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}/events?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stream Events - * - * @example - * ```ts - * const betaManagedAgentsStreamSessionEvents = - * await client.beta.sessions.events.stream( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - stream(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.get(path3`/v1/sessions/${sessionID}/events/stream?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true - }); - } - /** - * Attach to a session and dispatch every incoming `agent.tool_use` and - * `agent.custom_tool_use` event to a local tool registry, sending the matching - * result back (`user.tool_result` / `user.custom_tool_result`). The - * sessions-side counterpart to `client.beta.messages.toolRunner`: yields one - * entry per completed tool call so callers can observe each dispatch (and - * `break` to abort cleanly). - * - * @example - * ```ts - * import { betaAgentToolset20260401 } from '@anthropic-ai/sdk/tools/agent-toolset/node'; - * - * for await (const call of client.beta.sessions.events.toolRunner(work.data.id, { - * tools: [...betaAgentToolset20260401({ workdir }), myTool], - * })) { - * console.log(`${call.name} -> ${call.isError ? 'error' : 'ok'}`); - * } - * ``` - */ - toolRunner(sessionID, opts) { - return new SessionToolRunner(sessionID, { ...opts, client: this._client }); - } - } - Events4.SessionToolRunner = SessionToolRunner; - return Events4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs -var Resources; -var init_resources2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Resources = class extends APIResource2 { - /** - * Get Session Resource - * - * @example - * ```ts - * const resource = - * await client.beta.sessions.resources.retrieve( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - retrieve(resourceID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Session Resource - * - * @example - * ```ts - * const resource = - * await client.beta.sessions.resources.update( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { - * session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * authorization_token: 'ghp_exampletoken', - * }, - * ); - * ``` - */ - update(resourceID, params, options) { - const { session_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Session Resources - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionResource of client.beta.sessions.resources.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Session Resource - * - * @example - * ```ts - * const betaManagedAgentsDeleteSessionResource = - * await client.beta.sessions.resources.delete( - * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - delete(resourceID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Add Session Resource - * - * @example - * ```ts - * const betaManagedAgentsFileResource = - * await client.beta.sessions.resources.add( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * { - * file_id: 'file_011CNha8iCJcU1wXNR6q4V8w', - * type: 'file', - * }, - * ); - * ``` - */ - add(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}/resources?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs -var Events3; -var init_events3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Events3 = class extends APIResource2 { - /** - * List Session Thread Events - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.threads.events.list( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * )) { - * // ... - * } - * ``` - */ - list(threadID, params, options) { - const { session_id, betas, workspace_id, ...query } = params; - return this._client.getAPIList(path3`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Stream Session Thread Events - * - * @example - * ```ts - * const betaManagedAgentsStreamSessionThreadEvents = - * await client.beta.sessions.threads.events.stream( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - stream(threadID, params, options) { - const { session_id, betas, workspace_id, ...query } = params; - return this._client.get(path3`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs -var Threads3; -var init_threads3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs"() { - init_resource2(); - init_events3(); - init_events3(); - init_pagination2(); - init_headers3(); - init_path2(); - Threads3 = /* @__PURE__ */ (() => { - class Threads4 extends APIResource2 { - constructor() { - super(...arguments); - this.events = new Events3(this._client); - } - /** - * Get Session Thread - * - * @example - * ```ts - * const betaManagedAgentsSessionThread = - * await client.beta.sessions.threads.retrieve( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - retrieve(threadID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Session Threads - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSessionThread of client.beta.sessions.threads.list( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * )) { - * // ... - * } - * ``` - */ - list(sessionID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Session Thread - * - * @example - * ```ts - * const betaManagedAgentsSessionThread = - * await client.beta.sessions.threads.archive( - * 'sthr_011CZkZVWa6oIjw0rgXZpnBt', - * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' }, - * ); - * ``` - */ - archive(threadID, params, options) { - const { session_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Threads4.Events = Events3; - return Threads4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs -var Sessions5; -var init_sessions5 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs"() { - init_resource2(); - init_events2(); - init_events2(); - init_resources2(); - init_resources2(); - init_threads3(); - init_threads3(); - init_pagination2(); - init_headers3(); - init_path2(); - Sessions5 = /* @__PURE__ */ (() => { - class Sessions6 extends APIResource2 { - constructor() { - super(...arguments); - this.events = new Events2(this._client); - this.resources = new Resources(this._client); - this.threads = new Threads3(this._client); - } - /** - * Create Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.create({ - * agent: 'agent_011CZkYpogX7uDKUyvBTophP', - * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/sessions?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.retrieve( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - retrieve(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/sessions/${sessionID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.update( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - update(sessionID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/sessions/${sessionID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Sessions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsSession of client.beta.sessions.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/sessions?beta=true", BidirectionalPageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Session - * - * @example - * ```ts - * const betaManagedAgentsDeletedSession = - * await client.beta.sessions.delete( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - delete(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/sessions/${sessionID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Session - * - * @example - * ```ts - * const betaManagedAgentsSession = - * await client.beta.sessions.archive( - * 'sesn_011CZkZAtmR3yMPDzynEDxu7', - * ); - * ``` - */ - archive(sessionID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/sessions/${sessionID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Sessions6.Events = Events2; - Sessions6.Resources = Resources; - Sessions6.Threads = Threads3; - return Sessions6; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs -var Versions3; -var init_versions3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Versions3 = class extends APIResource2 { - /** - * Create Skill Version - * - * @example - * ```ts - * const betaSkillVersion = - * await client.beta.skills.versions.create('skill_id', { - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(skillID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill Version - * - * @example - * ```ts - * const betaSkillVersion = - * await client.beta.skills.versions.retrieve('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - retrieve(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Skill Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSkillVersion of client.beta.skills.versions.list( - * 'skill_id', - * )) { - * // ... - * } - * ``` - */ - list(skillID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/skills/${skillID}/versions?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Skill Version - * - * @example - * ```ts - * const betaDeletedSkillVersion = - * await client.beta.skills.versions.delete('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - delete(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/skills/${skill_id}/versions/${version}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Download a skill version's content as a zip archive. - * - * @example - * ```ts - * const response = await client.beta.skills.versions.download( - * 'version', - * { skill_id: 'skill_id' }, - * ); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(version, params, options) { - const { skill_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}/content?beta=true`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs -var Skills2; -var init_skills2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs"() { - init_resource2(); - init_versions3(); - init_versions3(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Skills2 = /* @__PURE__ */ (() => { - class Skills4 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions3(this._client); - } - /** - * Create Skill - * - * @example - * ```ts - * const betaSkill = await client.beta.skills.create({ - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/skills?beta=true", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill - * - * @example - * ```ts - * const betaSkill = await client.beta.skills.retrieve( - * 'skill_id', - * ); - * ``` - */ - retrieve(skillID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/skills/${skillID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Skills - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaSkill of client.beta.skills.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/skills?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Skill - * - * @example - * ```ts - * const betaDeletedSkill = await client.beta.skills.delete( - * 'skill_id', - * ); - * ``` - */ - delete(skillID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/skills/${skillID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Skills4.Versions = Versions3; - return Skills4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs -var Certificates3; -var init_certificates3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Certificates3 = class extends APIResource2 { - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's - * server certificate against this CA when it terminates the inner TLS session. A - * tunnel holds at most two non-archived certificates. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.create( - * 'tunnel_id', - * { ca_certificate_pem: 'ca_certificate_pem' }, - * ); - * ``` - */ - create(tunnelID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/tunnels/${tunnelID}/certificates?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Fetches a tunnel certificate by ID. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.retrieve( - * 'certificate_id', - * { tunnel_id: 'tunnel_id' }, - * ); - * ``` - */ - retrieve(certificateID, params, options) { - const { tunnel_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/tunnels/${tunnel_id}/certificates/${certificateID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Lists the certificates registered on a tunnel. Archived certificates are - * excluded unless include_archived is set. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaTunnelCertificate of client.beta.tunnels.certificates.list( - * 'tunnel_id', - * )) { - * // ... - * } - * ``` - */ - list(tunnelID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/tunnels/${tunnelID}/certificates?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Archives a tunnel certificate, removing it from the set Anthropic trusts for the - * tunnel. The certificate record is retained. Archiving the last non-archived - * certificate is permitted; the tunnel rejects MCP traffic until a new certificate - * is added. - * - * @example - * ```ts - * const betaTunnelCertificate = - * await client.beta.tunnels.certificates.archive( - * 'certificate_id', - * { tunnel_id: 'tunnel_id' }, - * ); - * ``` - */ - archive(certificateID, params, options) { - const { tunnel_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/tunnels/${tunnel_id}/certificates/${certificateID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs -var Tunnels; -var init_tunnels = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs"() { - init_resource2(); - init_certificates3(); - init_certificates3(); - init_pagination2(); - init_headers3(); - init_path2(); - Tunnels = /* @__PURE__ */ (() => { - class Tunnels2 extends APIResource2 { - constructor() { - super(...arguments); - this.certificates = new Certificates3(this._client); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; - * it is not idempotent. The new tunnel rejects MCP traffic until at least one CA - * certificate is added. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.create(); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/tunnels?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Fetches a tunnel by ID. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.retrieve( - * 'tunnel_id', - * ); - * ``` - */ - retrieve(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/tunnels/${tunnelID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Lists tunnels. Results are ordered by creation time, newest first; archived - * tunnels are excluded unless include_archived is set. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaTunnel of client.beta.tunnels.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/tunnels?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Archives a tunnel. Archival is irreversible: every non-archived certificate on - * the tunnel is archived in the same operation, the hostname is retired and never - * re-allocated, and the tunnel token is invalidated. Retrying against an - * already-archived tunnel returns the existing record unchanged. - * - * @example - * ```ts - * const betaTunnel = await client.beta.tunnels.archive( - * 'tunnel_id', - * ); - * ``` - */ - archive(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/tunnels/${tunnelID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Reveals a tunnel's connector token. The value is fetched live on each call; - * Anthropic does not store it. Repeated calls return the same value until the - * token is rotated. Exposed as POST so the token does not appear in intermediary - * access logs. - * - * @example - * ```ts - * const betaTunnelToken = - * await client.beta.tunnels.revealToken('tunnel_id'); - * ``` - */ - revealToken(tunnelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/tunnels/${tunnelID}/reveal_token?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * The Tunnels API is in research preview. It requires the - * `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a - * deprecation period. It supersedes the Admin API endpoints at - * `/v1/organizations/tunnels`, which remain available during a migration window. - * - * Rotates a tunnel's connector token. Rotation invalidates the current token for - * new connections and returns a fresh value; established connections are not - * severed. A connector restarted after rotation must use the new value. - * - * @example - * ```ts - * const betaTunnelToken = - * await client.beta.tunnels.rotateToken('tunnel_id'); - * ``` - */ - rotateToken(tunnelID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/tunnels/${tunnelID}/rotate_token?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "mcp-tunnels-2026-06-22"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Tunnels2.Certificates = Certificates3; - return Tunnels2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs -var Credentials2; -var init_credentials3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Credentials2 = class extends APIResource2 { - /** - * Create Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.create( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * { - * auth: { - * token: 'bearer_exampletoken', - * mcp_server_url: - * 'https://example-server.modelcontextprotocol.io/sse', - * type: 'static_bearer', - * }, - * }, - * ); - * ``` - */ - create(vaultID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vaultID}/credentials?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.retrieve( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - retrieve(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.get(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.update( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - update(credentialID, params, options) { - const { vault_id, betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Credentials - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * )) { - * // ... - * } - * ``` - */ - list(vaultID, params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Credential - * - * @example - * ```ts - * const betaManagedAgentsDeletedCredential = - * await client.beta.vaults.credentials.delete( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - delete(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.delete(path3`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Credential - * - * @example - * ```ts - * const betaManagedAgentsCredential = - * await client.beta.vaults.credentials.archive( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - archive(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Validate Credential - * - * @example - * ```ts - * const betaManagedAgentsCredentialValidation = - * await client.beta.vaults.credentials.mcpOAuthValidate( - * 'vcrd_011CZkZEMt8gZan2iYOQfSkw', - * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' }, - * ); - * ``` - */ - mcpOAuthValidate(credentialID, params, options) { - const { vault_id, betas, workspace_id } = params; - return this._client.post(path3`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs -var Vaults2; -var init_vaults2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs"() { - init_resource2(); - init_credentials3(); - init_credentials3(); - init_pagination2(); - init_headers3(); - init_path2(); - Vaults2 = /* @__PURE__ */ (() => { - class Vaults3 extends APIResource2 { - constructor() { - super(...arguments); - this.credentials = new Credentials2(this._client); - } - /** - * Create Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.create({ - * display_name: 'Example vault', - * }); - * ``` - */ - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/vaults?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Get Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.retrieve( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - retrieve(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/vaults/${vaultID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Update Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.update( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - update(vaultID, params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post(path3`/v1/vaults/${vaultID}?beta=true`, { - body, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List Vaults - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const betaManagedAgentsVault of client.beta.vaults.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/vaults?beta=true", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Delete Vault - * - * @example - * ```ts - * const betaManagedAgentsDeletedVault = - * await client.beta.vaults.delete( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - delete(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/vaults/${vaultID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * Archive Vault - * - * @example - * ```ts - * const betaManagedAgentsVault = - * await client.beta.vaults.archive( - * 'vlt_011CZkZDLs7fYzm1hXNPeRjv', - * ); - * ``` - */ - archive(vaultID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.post(path3`/v1/vaults/${vaultID}/archive?beta=true`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString(), - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Vaults3.Credentials = Credentials2; - return Vaults3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs -var Beta2; -var init_beta2 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs"() { - init_resource2(); - init_deployment_runs(); - init_deployment_runs(); - init_deployments(); - init_deployments(); - init_dreams(); - init_dreams(); - init_files5(); - init_files5(); - init_models3(); - init_models3(); - init_user_profiles(); - init_user_profiles(); - init_webhooks2(); - init_webhooks2(); - init_agents2(); - init_agents2(); - init_environments2(); - init_environments2(); - init_memory_stores(); - init_memory_stores(); - init_messages3(); - init_messages3(); - init_organization2(); - init_organization2(); - init_sessions5(); - init_sessions5(); - init_skills2(); - init_skills2(); - init_tunnels(); - init_tunnels(); - init_vaults2(); - init_vaults2(); - Beta2 = /* @__PURE__ */ (() => { - class Beta3 extends APIResource2 { - constructor() { - super(...arguments); - this.models = new Models2(this._client); - this.messages = new Messages3(this._client); - this.agents = new Agents2(this._client); - this.environments = new Environments2(this._client); - this.sessions = new Sessions5(this._client); - this.deployments = new Deployments(this._client); - this.deploymentRuns = new DeploymentRuns(this._client); - this.vaults = new Vaults2(this._client); - this.memoryStores = new MemoryStores(this._client); - this.files = new Files5(this._client); - this.skills = new Skills2(this._client); - this.webhooks = new Webhooks2(this._client); - this.userProfiles = new UserProfiles(this._client); - this.dreams = new Dreams(this._client); - this.tunnels = new Tunnels(this._client); - this.organization = new Organization2(this._client); - } - } - Beta3.Models = Models2; - Beta3.Messages = Messages3; - Beta3.Agents = Agents2; - Beta3.Environments = Environments2; - Beta3.Sessions = Sessions5; - Beta3.Deployments = Deployments; - Beta3.DeploymentRuns = DeploymentRuns; - Beta3.Vaults = Vaults2; - Beta3.MemoryStores = MemoryStores; - Beta3.Files = Files5; - Beta3.Skills = Skills2; - Beta3.Webhooks = Webhooks2; - Beta3.UserProfiles = UserProfiles; - Beta3.Dreams = Dreams; - Beta3.Tunnels = Tunnels; - Beta3.Organization = Organization2; - return Beta3; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/completions.mjs -var Completions3; -var init_completions4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/completions.mjs"() { - init_resource2(); - init_headers3(); - Completions3 = class extends APIResource2 { - create(params, options) { - const { betas, workspace_id, ...body } = params; - return this._client.post("/v1/complete", { - body, - timeout: this._client._options.timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: params.stream ?? false - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/files.mjs -var Files6; -var init_files6 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/files.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_stainless_helper_header(); - init_uploads4(); - init_path2(); - Files6 = class extends APIResource2 { - /** - * List Files - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const fileMetadata of client.files.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/files", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete File - * - * @example - * ```ts - * const deletedFile = await client.files.delete('file_id'); - * ``` - */ - delete(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Download File - * - * @example - * ```ts - * const response = await client.files.download('file_id'); - * - * const content = await response.blob(); - * console.log(content); - * ``` - */ - download(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}/content`, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - __binaryResponse: true - }); - } - /** - * Get File Metadata - * - * @example - * ```ts - * const fileMetadata = await client.files.retrieveMetadata( - * 'file_id', - * ); - * ``` - */ - retrieveMetadata(fileID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Upload File - * - * @example - * ```ts - * const fileMetadata = await client.files.upload({ - * file: fs.createReadStream('path/to/file'), - * }); - * ``` - */ - upload(params, options) { - const { workspace_id, ...body } = params; - return this._client.post("/v1/files", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - stainlessHelperHeaderFromFile(body.file), - options?.headers - ]) - }, this._client)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/lib/parser.mjs -function getOutputFormat2(params) { - return params?.output_config?.format; -} -function maybeParseMessage(message, params, opts) { - const outputFormat = getOutputFormat2(params); - if (!params || !("parse" in (outputFormat ?? {}))) { - return { - ...message, - content: message.content.map((block) => { - if (block.type === "text") { - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: null, - enumerable: false - }); - return parsedBlock; - } - return block; - }), - parsed_output: null - }; - } - return parseMessage(message, params, opts); -} -function parseMessage(message, params, opts) { - let firstParsedOutput = null; - const content = message.content.map((block) => { - if (block.type === "text") { - const parsedOutput = parseOutputFormat(params, block.text); - if (firstParsedOutput === null) { - firstParsedOutput = parsedOutput; - } - const parsedBlock = Object.defineProperty({ ...block }, "parsed_output", { - value: parsedOutput, - enumerable: false - }); - return parsedBlock; - } - return block; - }); - return { - ...message, - content, - parsed_output: firstParsedOutput - }; -} -function parseOutputFormat(params, content) { - const outputFormat = getOutputFormat2(params); - if (outputFormat?.type !== "json_schema") { - return null; - } - try { - if ("parse" in outputFormat) { - return outputFormat.parse(content); - } - return JSON.parse(content); - } catch (error) { - throw new AnthropicError(`Failed to parse structured output: ${error}`); - } -} -var init_parser4 = __esm({ - "node_modules/@anthropic-ai/sdk/lib/parser.mjs"() { - init_error3(); - } -}); - -// node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs -function tracksToolInput2(content) { - return content.type === "tool_use" || content.type === "server_tool_use"; -} -var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_params, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_workspace_id, _MessageStream_logger, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage, MessageStream; -var init_MessageStream = __esm({ - "node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs"() { - init_tslib2(); - init_stainless_helper_header(); - init_errors2(); - init_values2(); - init_error4(); - init_streaming4(); - init_parser4(); - init_message_stream_utils(); - MessageStream = /* @__PURE__ */ (() => { - class MessageStream2 { - constructor(params, opts) { - _MessageStream_instances.add(this); - this.messages = []; - this.receivedMessages = []; - _MessageStream_currentMessageSnapshot.set(this, void 0); - _MessageStream_params.set(this, null); - this.controller = new AbortController(); - _MessageStream_connectedPromise.set(this, void 0); - _MessageStream_resolveConnectedPromise.set(this, () => { - }); - _MessageStream_rejectConnectedPromise.set(this, () => { - }); - _MessageStream_endPromise.set(this, void 0); - _MessageStream_resolveEndPromise.set(this, () => { - }); - _MessageStream_rejectEndPromise.set(this, () => { - }); - _MessageStream_listeners.set(this, {}); - _MessageStream_ended.set(this, false); - _MessageStream_errored.set(this, false); - _MessageStream_aborted.set(this, false); - _MessageStream_catchingPromiseCreated.set(this, false); - _MessageStream_response.set(this, void 0); - _MessageStream_request_id.set(this, void 0); - _MessageStream_workspace_id.set(this, void 0); - _MessageStream_logger.set(this, void 0); - _MessageStream_handleError.set(this, (error) => { - __classPrivateFieldSet2(this, _MessageStream_errored, true, "f"); - if (isAbortError2(error)) { - error = new APIUserAbortError2(); - } - if (error instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _MessageStream_aborted, true, "f"); - return this._emit("abort", error); - } - if (error instanceof AnthropicError) { - return this._emit("error", error); - } - if (error instanceof Error) { - const anthropicError = new AnthropicError(error.message); - anthropicError.cause = error; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError(String(error))); - }); - __classPrivateFieldSet2(this, _MessageStream_connectedPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _MessageStream_resolveConnectedPromise, resolve, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectConnectedPromise, reject, "f"); - }), "f"); - __classPrivateFieldSet2(this, _MessageStream_endPromise, new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _MessageStream_resolveEndPromise, resolve, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectEndPromise, reject, "f"); - }), "f"); - __classPrivateFieldGet2(this, _MessageStream_connectedPromise, "f").catch(() => { - }); - __classPrivateFieldGet2(this, _MessageStream_endPromise, "f").catch(() => { - }); - __classPrivateFieldSet2(this, _MessageStream_params, params, "f"); - __classPrivateFieldSet2(this, _MessageStream_logger, opts?.logger ?? console, "f"); - } - get response() { - return __classPrivateFieldGet2(this, _MessageStream_response, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _MessageStream_request_id, "f"); - } - get workspace_id() { - return __classPrivateFieldGet2(this, _MessageStream_workspace_id, "f"); - } - /** - * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request, - * returned vie the `request-id` header which is useful for debugging requests and resporting - * issues to Anthropic. - * - * This is the same as the `APIPromise.withResponse()` method. - * - * This method will raise an error if you created the stream using `MessageStream.fromReadableStream` - * as no `Response` is available. - */ - async withResponse() { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - const response = await __classPrivateFieldGet2(this, _MessageStream_connectedPromise, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id"), - workspace_id: response.headers.get("anthropic-workspace-id") - }; - } - /** - * Intended for use on the frontend, consuming a stream produced with - * `.toReadableStream()` on the backend. - * - * Note that messages sent to the model do not appear in `.on('message')` - * in this context. - */ - static fromReadableStream(stream4) { - const runner = new MessageStream2(null); - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options, { logger } = {}) { - const runner = new MessageStream2(params, { logger }); - for (const message of params.messages) { - runner._addMessageParam(message); - } - __classPrivateFieldSet2(runner, _MessageStream_params, { ...params, stream: true }, "f"); - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, [STAINLESS_HELPER_METHOD_HEADER]: "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _MessageStream_handleError, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit = true) { - this.receivedMessages.push(message); - if (emit) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_response, response, "f"); - __classPrivateFieldSet2(this, _MessageStream_request_id, response?.headers.get("request-id"), "f"); - __classPrivateFieldSet2(this, _MessageStream_workspace_id, response?.headers.get("anthropic-workspace-id"), "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveConnectedPromise, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _MessageStream_ended, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _MessageStream_errored, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _MessageStream_aborted, "f"); - } - abort() { - this.controller.abort(); - } - /** - * Adds the listener function to the end of the listeners array for the event. - * No checks are made to see if the listener has already been added. Multiple calls passing - * the same combination of event and listener will result in the listener being added, and - * called, multiple times. - * @returns this MessageStream, so that calls can be chained - */ - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); - listeners.push({ listener }); - return this; - } - /** - * Removes the specified listener from the listener array for the event. - * off() will remove, at most, one instance of a listener from the listener array. If any single - * listener has been added multiple times to the listener array for the specified event, then - * off() must be called multiple times to remove each instance. - * @returns this MessageStream, so that calls can be chained - */ - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - /** - * Adds a one-time listener function for the event. The next time the event is triggered, - * this listener is removed and then invoked. - * @returns this MessageStream, so that calls can be chained - */ - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - /** - * This is similar to `.once()`, but returns a Promise that resolves the next time - * the event is triggered, instead of calling a listener callback. - * @returns a Promise that resolves the next time given event is triggered, - * or rejects if an error is emitted. (If you request the 'error' event, - * returns a promise that resolves with the error). - * - * Example: - * - * const message = await stream.emitted('message') // rejects if the stream errors - */ - emitted(event) { - return new Promise((resolve, reject) => { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - if (event !== "error") - this.once("error", reject); - this.once(event, resolve); - }); - } - async done() { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet2(this, _MessageStream_endPromise, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - } - /** - * @returns a promise that resolves with the the final assistant Message response, - * or rejects if an error occurred or the stream ended prematurely without producing a Message. - * If structured outputs were used, this will be a ParsedMessage with a `parsed_output` field. - */ - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); - } - /** - * @returns a promise that resolves with the the final assistant Message's text response, concatenated - * together if there are more than one text blocks. - * Rejects if an error occurred or the stream ended prematurely without producing a Message. - */ - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _MessageStream_ended, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _MessageStream_ended, true, "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveEndPromise, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - return; - } - if (event === "error") { - const error = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - let abortHandler; - if (signal) { - if (signal.aborted) - this.controller.abort(); - abortHandler = this.controller.abort.bind(this.controller); - signal.addEventListener("abort", abortHandler); - } - try { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2(); - } - __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); - } finally { - if (signal && abortHandler) { - signal.removeEventListener("abort", abortHandler); - } - } - } - [(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_params = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_response = /* @__PURE__ */ new WeakMap(), _MessageStream_request_id = /* @__PURE__ */ new WeakMap(), _MessageStream_workspace_id = /* @__PURE__ */ new WeakMap(), _MessageStream_logger = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _MessageStream_getFinalText = function _MessageStream_getFinalText2() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); - }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if (tracksToolInput2(content) && __classPrivateFieldGet2(this, _MessageStream_listeners, "f").inputJson?.length) { - this._emit("inputJson", event.delta.partial_json, content.input); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - default: - checkNever(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(maybeParseMessage(messageSnapshot, __classPrivateFieldGet2(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _MessageStream_logger, "f") }), true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _MessageStream_endRequest = function _MessageStream_endRequest2() { - if (this.ended) { - throw new AnthropicError(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - if (!snapshot) { - throw new AnthropicError(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); - return maybeParseMessage(snapshot, __classPrivateFieldGet2(this, _MessageStream_params, "f"), { logger: __classPrivateFieldGet2(this, _MessageStream_logger, "f") }); - }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { - let snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.stop_details = event.delta.stop_details; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.delta.container != null) { - snapshot.container = event.delta.container; - } - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - if (event.usage.output_tokens_details != null) { - snapshot.usage.output_tokens_details = event.usage.output_tokens_details; - } - return snapshot; - case "content_block_start": - snapshot.content.push({ ...event.content_block }); - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - text: (snapshotContent.text || "") + event.delta.text - }; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshot.content[event.index] = { - ...snapshotContent, - citations: [...snapshotContent.citations ?? [], event.delta.citation] - }; - } - break; - } - case "input_json_delta": { - if (snapshotContent && tracksToolInput2(snapshotContent)) { - const jsonBuf = (snapshotContent[JSON_BUF_PROPERTY] || "") + event.delta.partial_json; - snapshot.content[event.index] = withLazyInput(snapshotContent, jsonBuf); - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - thinking: snapshotContent.thinking + event.delta.thinking - }; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshot.content[event.index] = { - ...snapshotContent, - signature: event.delta.signature - }; - } - break; - } - default: - checkNever(event.delta); - } - return snapshot; - } - case "content_block_stop": { - const snapshotContent = snapshot.content.at(event.index); - if (snapshotContent && tracksToolInput2(snapshotContent) && JSON_BUF_PROPERTY in snapshotContent) { - Object.defineProperty(snapshotContent, "input", { - value: snapshotContent.input, - enumerable: true, - configurable: true, - writable: true - }); - } - return snapshot; - } - } - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); - } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - } - return MessageStream2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs -var Batches3; -var init_batches3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_jsonl(); - init_error4(); - init_path2(); - Batches3 = class extends APIResource2 { - /** - * Send a batch of Message creation requests. - * - * The Message Batches API can be used to process multiple Messages API requests at - * once. Once a Message Batch is created, it begins processing immediately. Batches - * can take up to 24 hours to complete. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.create({ - * requests: [ - * { - * custom_id: 'my-custom-id-1', - * params: { - * max_tokens: 1024, - * messages: [ - * { content: 'Hello, world', role: 'user' }, - * ], - * model: 'claude-opus-5', - * }, - * }, - * ], - * }); - * ``` - */ - create(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/batches", { - body, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * This endpoint is idempotent and can be used to poll for Message Batch - * completion. To access the results of a Message Batch, make a request to the - * `results_url` field in the response. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.retrieve( - * 'message_batch_id', - * ); - * ``` - */ - retrieve(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/messages/batches/${messageBatchID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List all Message Batches within a Workspace. Most recently created batches are - * returned first. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const messageBatch of client.messages.batches.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/messages/batches", Page2, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete a Message Batch. - * - * Message Batches can only be deleted once they've finished processing. If you'd - * like to delete an in-progress batch, you must first cancel it. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const deletedMessageBatch = - * await client.messages.batches.delete('message_batch_id'); - * ``` - */ - delete(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/messages/batches/${messageBatchID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Batches may be canceled any time before processing ends. Once cancellation is - * initiated, the batch enters a `canceling` state, at which time the system may - * complete any in-progress, non-interruptible requests before finalizing - * cancellation. - * - * The number of canceled requests is specified in `request_counts`. To determine - * which requests were canceled, check the individual results within the batch. - * Note that cancellation may not result in any canceled requests if they were - * non-interruptible. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatch = await client.messages.batches.cancel( - * 'message_batch_id', - * ); - * ``` - */ - cancel(messageBatchID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.post(path3`/v1/messages/batches/${messageBatchID}/cancel`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Streams the results of a Message Batch as a `.jsonl` file. - * - * Each line in the file is a JSON object containing the result of a single request - * in the Message Batch. Results are not guaranteed to be in the same order as - * requests. Use the `custom_id` field to match results to requests. - * - * Learn more about the Message Batches API in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) - * - * @example - * ```ts - * const messageBatchIndividualResponse = - * await client.messages.batches.results('message_batch_id'); - * ``` - */ - async results(messageBatchID, params = {}, options) { - const batch = await this.retrieve(messageBatchID, params, options); - if (!batch.results_url) { - throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - const { workspace_id } = params ?? {}; - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([ - { - Accept: "application/binary", - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller)); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs -var Messages4, DEPRECATED_MODELS2, MODELS_TO_WARN_WITH_THINKING_ENABLED2; -var init_messages4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs"() { - init_resource2(); - init_headers3(); - init_stainless_helper_header(); - init_MessageStream(); - init_parser4(); - init_batches3(); - init_batches3(); - init_constants(); - Messages4 = /* @__PURE__ */ (() => { - class Messages5 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches3(this._client); - } - create(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - if (body.model in DEPRECATED_MODELS2) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS2[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - if (MODELS_TO_WARN_WITH_THINKING_ENABLED2.includes(body.model) && body.thinking && body.thinking.type === "enabled") { - console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`); - } - let timeout = options?.timeout ?? this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? void 0; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - const helperHeader2 = stainlessHelperHeader(body.tools, body.messages); - return this._client.post("/v1/messages", { - body, - timeout: timeout ?? 6e5, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - helperHeader2, - options?.headers - ]), - stream: params.stream ?? false - }); - } - /** - * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and - * the response will be automatically parsed and available in the `parsed_output` property of the message. - * - * @example - * ```ts - * const message = await client.messages.parse({ - * model: 'claude-sonnet-4-5-20250929', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_config: { - * format: zodOutputFormat(z.object({ answer: z.number() })), - * }, - * }); - * - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - parse(params, options) { - return this.create(params, options).then((message) => parseMessage(message, params, { logger: this._client.logger ?? console })); - } - /** - * Create a Message stream. - * - * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`), - * the final message will include a `parsed_output` property with the parsed content. - * - * @example - * ```ts - * const stream = client.messages.stream({ - * model: 'claude-sonnet-4-5-20250929', - * max_tokens: 1024, - * messages: [{ role: 'user', content: 'What is 2+2?' }], - * output_config: { - * format: zodOutputFormat(z.object({ answer: z.number() })), - * }, - * }); - * - * const message = await stream.finalMessage(); - * console.log(message.parsed_output?.answer); // 4 - * ``` - */ - stream(body, options) { - return MessageStream.createMessage(this, body, options, { logger: this._client.logger ?? console }); - } - /** - * Count the number of tokens in a Message. - * - * The Token Count API can be used to count the number of tokens in a Message, - * including tools, images, and documents, without creating it. - * - * Learn more about token counting in our - * [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting) - * - * @example - * ```ts - * const messageTokensCount = - * await client.messages.countTokens({ - * messages: [{ content: 'Hello, world', role: 'user' }], - * model: 'claude-opus-5', - * }); - * ``` - */ - countTokens(params, options) { - const { user_profile_id, workspace_id, ...body } = params; - return this._client.post("/v1/messages/count_tokens", { - body, - ...options, - headers: buildHeaders2([ - { - ...user_profile_id != null ? { "anthropic-user-profile-id": user_profile_id } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - } - Messages5.Batches = Batches3; - return Messages5; - })(); - DEPRECATED_MODELS2 = {}; - MODELS_TO_WARN_WITH_THINKING_ENABLED2 = ["claude-mythos-preview", "claude-opus-4-6"]; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/models.mjs -var Models3; -var init_models4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/models.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_path2(); - Models3 = class extends APIResource2 { - /** - * Get a specific model. - * - * The Models API response can be used to determine information about a specific - * model or resolve a model alias to a model ID. - * - * @example - * ```ts - * const modelInfo = await client.models.retrieve('model_id'); - * ``` - */ - retrieve(modelID, params = {}, options) { - const { betas, workspace_id } = params ?? {}; - return this._client.get(path3`/v1/models/${modelID}`, { - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - /** - * List available models. - * - * The Models API response can be used to determine which models are available for - * use in the API. More recently released models are listed first. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const modelInfo of client.models.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { betas, workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models", Page2, { - query, - ...options, - headers: buildHeaders2([ - { - ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0, - ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 - }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs -var Versions4; -var init_versions4 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs"() { - init_resource2(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Versions4 = class extends APIResource2 { - /** - * Create Skill Version - * - * @example - * ```ts - * const skillVersion = await client.skills.versions.create( - * 'skill_id', - * { files: [fs.createReadStream('path/to/file')] }, - * ); - * ``` - */ - create(skillID, params, options) { - const { workspace_id, ...body } = params; - return this._client.post(path3`/v1/skills/${skillID}/versions`, multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill Version - * - * @example - * ```ts - * const skillVersion = await client.skills.versions.retrieve( - * 'version', - * { skill_id: 'skill_id' }, - * ); - * ``` - */ - retrieve(version, params, options) { - const { skill_id, workspace_id } = params; - return this._client.get(path3`/v1/skills/${skill_id}/versions/${version}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List Skill Versions - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const skillVersion of client.skills.versions.list( - * 'skill_id', - * )) { - * // ... - * } - * ``` - */ - list(skillID, params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList(path3`/v1/skills/${skillID}/versions`, PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete Skill Version - * - * @example - * ```ts - * const deletedSkillVersion = - * await client.skills.versions.delete('version', { - * skill_id: 'skill_id', - * }); - * ``` - */ - delete(version, params, options) { - const { skill_id, workspace_id } = params; - return this._client.delete(path3`/v1/skills/${skill_id}/versions/${version}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - }; - } -}); - -// node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs -var Skills3; -var init_skills3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs"() { - init_resource2(); - init_versions4(); - init_versions4(); - init_pagination2(); - init_headers3(); - init_uploads4(); - init_path2(); - Skills3 = /* @__PURE__ */ (() => { - class Skills4 extends APIResource2 { - constructor() { - super(...arguments); - this.versions = new Versions4(this._client); - } - /** - * Create Skill - * - * @example - * ```ts - * const skill = await client.skills.create({ - * files: [fs.createReadStream('path/to/file')], - * }); - * ``` - */ - create(params, options) { - const { workspace_id, ...body } = params; - return this._client.post("/v1/skills", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }, this._client, false)); - } - /** - * Get Skill - * - * @example - * ```ts - * const skill = await client.skills.retrieve('skill_id'); - * ``` - */ - retrieve(skillID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.get(path3`/v1/skills/${skillID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * List Skills - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const skill of client.skills.list()) { - * // ... - * } - * ``` - */ - list(params = {}, options) { - const { workspace_id, ...query } = params ?? {}; - return this._client.getAPIList("/v1/skills", PageCursor, { - query, - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - /** - * Delete Skill - * - * @example - * ```ts - * const deletedSkill = await client.skills.delete('skill_id'); - * ``` - */ - delete(skillID, params = {}, options) { - const { workspace_id } = params ?? {}; - return this._client.delete(path3`/v1/skills/${skillID}`, { - ...options, - headers: buildHeaders2([ - { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 }, - options?.headers - ]) - }); - } - } - Skills4.Versions = Versions4; - return Skills4; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/resources/index.mjs -var init_resources3 = __esm({ - "node_modules/@anthropic-ai/sdk/resources/index.mjs"() { - init_shared2(); - init_beta2(); - init_completions4(); - init_files6(); - init_messages4(); - init_models4(); - init_skills3(); - } -}); - -// node_modules/@anthropic-ai/sdk/client.mjs -var _BaseAnthropic_instances, _a5, _BaseAnthropic_encoder, _BaseAnthropic_baseURLOverridden, HUMAN_PROMPT, AI_PROMPT, BaseAnthropic, Anthropic; -var init_client2 = __esm({ - "node_modules/@anthropic-ai/sdk/client.mjs"() { - init_tslib2(); - init_values2(); - init_sleep2(); - init_errors2(); - init_detect_platform2(); - init_request_signal(); - init_shims2(); - init_request_options2(); - init_query2(); - init_version3(); - init_error3(); - init_types(); - init_token_cache(); - init_credential_chain(); - init_middleware(); - init_pagination2(); - init_uploads5(); - init_resources3(); - init_api_promise2(); - init_completions4(); - init_files6(); - init_models4(); - init_beta2(); - init_messages4(); - init_skills3(); - init_detect_platform2(); - init_headers3(); - init_env2(); - init_log2(); - init_values2(); - HUMAN_PROMPT = "\\n\\nHuman:"; - AI_PROMPT = "\\n\\nAssistant:"; - BaseAnthropic = /* @__PURE__ */ (() => { - class BaseAnthropic2 { - /** - * The active credential provider. Default credential resolution runs once - * at construction time. If it fails, the error is surfaced on every - * request and the client must be reconstructed — there is no retry path. - * - * Clones returned by {@link withOptions} share the parent's auth state - * (provider, token cache, pending resolution, and any resolution error) - * unless the caller passes an explicit `apiKey`, `authToken`, - * `credentials`, `config`, or `profile` override. - */ - get credentials() { - return this._authState.provider; - } - /** - * API Client for interfacing with the Anthropic API. - * - * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null] - * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null] - * @param {string | null | undefined} [opts.webhookKey=process.env['ANTHROPIC_WEBHOOK_SIGNING_KEY'] ?? null] - * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API. - * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. - * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. - * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. - * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. - * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. - * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. - * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. - */ - constructor({ baseURL = readEnv2("ANTHROPIC_BASE_URL"), apiKey, authToken, webhookKey = readEnv2("ANTHROPIC_WEBHOOK_SIGNING_KEY") ?? null, ...opts } = {}) { - _BaseAnthropic_instances.add(this); - this._requestAuthFlags = /* @__PURE__ */ new WeakMap(); - _BaseAnthropic_encoder.set(this, void 0); - if (apiKey === void 0) { - apiKey = opts.profile != null ? null : readEnv2("ANTHROPIC_API_KEY") ?? null; - } - if (authToken === void 0) { - authToken = opts.profile != null ? null : readEnv2("ANTHROPIC_AUTH_TOKEN") ?? null; - } - if (opts.profile != null && (opts.credentials != null || opts.config != null)) { - throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`."); - } - const options = { - apiKey, - authToken, - webhookKey, - ...opts, - baseURL: baseURL || `https://api.anthropic.com` - }; - if (!options.dangerouslyAllowBrowser && isRunningInBrowser2()) { - throw new AnthropicError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n"); - } - this.baseURL = options.baseURL; - this._baseURLIsExplicit = opts.__baseURLIsExplicit ?? !!baseURL; - this.timeout = options.timeout ?? _a5.DEFAULT_TIMEOUT; - this.logger = options.logger ?? console; - this.logLevel = defaultLogLevel; - this.logLevel = parseLogLevel2(options.logLevel, "ClientOptions.logLevel", loggerFor2(this)) ?? parseLogLevel2(readEnv2("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", loggerFor2(this)) ?? defaultLogLevel; - this.fetchOptions = options.fetchOptions; - this.maxRetries = validatePositiveInteger2("maxRetries", options.maxRetries ?? 2); - this.fetch = options.fetch ?? getDefaultFetch2(); - __classPrivateFieldSet2(this, _BaseAnthropic_encoder, FallbackEncoder2, "f"); - this.middleware = [...options.middleware ?? []]; - const customHeadersEnv = readEnv2("ANTHROPIC_CUSTOM_HEADERS"); - if (customHeadersEnv) { - const parsed = {}; - for (const line of customHeadersEnv.split("\n")) { - const colon = line.indexOf(":"); - if (colon >= 0) { - parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); - } - } - options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; - } - const inherited = opts.__auth; - delete options.__auth; - delete options.__baseURLIsExplicit; - this._options = options; - this.apiKey = typeof apiKey === "string" ? apiKey : null; - this.authToken = authToken; - this.webhookKey = webhookKey; - if (inherited) { - this._authState = inherited; - if (!this._baseURLIsExplicit && inherited.baseURL) { - this.baseURL = inherited.baseURL; - } - } else { - this._authState = { provider: null, tokenCache: null, resolution: null, error: null, extraHeaders: {} }; - if (this.apiKey == null && this.authToken == null) { - const credentials = options.credentials ?? null; - if (credentials) { - this._authState.provider = credentials; - this._authState.tokenCache = this._makeTokenCache(credentials); - } else if (options.config != null) { - const result = resolveCredentialsFromConfig(options.config, this._credentialResolverOptions()); - this._authState.provider = result.provider; - this._authState.tokenCache = this._makeTokenCache(result.provider); - this._authState.extraHeaders = result.extraHeaders; - this._applyCredentialBaseURL(result.baseURL); - } else if (options.profile != null) { - this._authState.resolution = this._resolveDefaultCredentials(options.profile); - } else if (this._shouldResolveDefaultCredentials()) { - this._authState.resolution = this._resolveDefaultCredentials(); - } - } - } - } - /** - * Whether to lazily resolve auth from the default credential chain when no - * explicit auth is configured. Called once from the constructor, so - * overrides must not depend on subclass instance state. Subclasses that - * bring their own auth scheme return false so unrelated local credentials - * are never resolved or allowed to supply a base URL. - */ - _shouldResolveDefaultCredentials() { - return true; - } - /** - * Stores a profile/config-supplied base URL on the shared auth state and, if - * the caller did not pin `baseURL` via constructor option or env, adopts it - * as this client's outbound API host. Precedence: ctor opt > env > profile > - * hardcoded default. - */ - _applyCredentialBaseURL(baseURL) { - if (!baseURL) - return; - const normalized = baseURL.replace(/\/+$/, ""); - this._authState.baseURL = normalized; - if (!this._baseURLIsExplicit) { - this.baseURL = normalized; - } - } - /** - * Options bag passed into the credential chain. `baseURL` here is only the - * fallback host for the token-exchange POST when the config itself omits - * `base_url`; the chain returns the config's own `base_url` (if any) on - * {@link CredentialResult.baseURL}, which {@link _applyCredentialBaseURL} - * then adopts for outbound API requests. The two are deliberately decoupled - * so this fallback never round-trips into precedence. - */ - _credentialResolverOptions() { - return { - baseURL: this.baseURL, - fetch: this._credentialsFetch(), - userAgent: this.getUserAgent(), - onCacheWriteError: (err) => { - loggerFor2(this).debug("credential cache write failed (best-effort)", err); - }, - onSafetyWarning: (msg) => { - loggerFor2(this).warn(msg); - } - }; - } - /** - * A `Fetch` for first-party credential token-exchange requests (OIDC - * federation jwt-bearer grants, user-OAuth refresh grants) that routes - * through this client's middleware chain, so middleware observes token - * traffic like any other request. Only client-level middleware applies: - * a minted token is shared across requests, so attributing the exchange - * to any one request's per-request middleware would be arbitrary. For the - * same reason, `ctx.options` is undefined for these requests. - */ - _credentialsFetch() { - return wrapFetchWithMiddleware(this.fetch, this.middleware, void 0, this); - } - _makeTokenCache(provider2) { - return new TokenCache(provider2, (err) => { - loggerFor2(this).debug("advisory token refresh failed; serving cached token", err); - }); - } - /** - * Create a new client instance re-using the same options given to the - * current client with optional overriding. - */ - withOptions(options) { - const overridesStructuredAuth = "credentials" in options || "config" in options || "profile" in options; - const overridesAuth = "apiKey" in options || "authToken" in options || overridesStructuredAuth; - const internal = { - ...this._options, - // Only forward baseURL when the caller (or env) explicitly chose it. - // For a non-explicit parent, this.baseURL may have been mutated to the - // profile-resolved host; pinning that as the clone's options.baseURL - // would make _options on the clone misreport caller intent and would - // leave the clone stuck on the parent's host across an auth override. - // The clone instead receives the construction-time value via - // ...this._options above and re-adopts the profile host through the - // shared _authState.baseURL + __baseURLIsExplicit=false path. - ...this._baseURLIsExplicit ? { baseURL: this.baseURL } : {}, - maxRetries: this.maxRetries, - timeout: this.timeout, - logger: this.logger, - logLevel: this.logLevel, - fetch: this.fetch, - fetchOptions: this.fetchOptions, - middleware: this.middleware, - apiKey: this.apiKey, - authToken: this.authToken, - webhookKey: this.webhookKey, - // credentials: this.credentials is a no-op when __auth is shared (the - // ctor takes the inherited path and ignores options.credentials); when - // overridesAuth is true via apiKey/authToken only, it lets the clone - // build a fresh TokenCache around the parent's provider. - credentials: this.credentials, - // When the caller passes a structured-credential override, drop inherited - // structured-credential options so only `...options` supplies them — - // otherwise an inherited `credentials`/`config`/`profile` would trip the - // mutual-exclusion check or precedence over the override. - ...overridesStructuredAuth ? { credentials: void 0, config: void 0, profile: void 0 } : {}, - ...options, - // Always set __auth so any stale value from ...this._options is - // overwritten. undefined means "build fresh auth from these options". - __auth: overridesAuth ? void 0 : this._authState, - __baseURLIsExplicit: "baseURL" in options ? true : this._baseURLIsExplicit - }; - return new this.constructor(internal); - } - /** - * Lazily resolves credentials from config files or environment variables. - * Called once from the constructor when no explicit auth is provided, or - * when an explicit `profile` was passed (in which case a missing/unresolved - * profile is surfaced as an error instead of falling through to "no auth"). - * The returned promise is stored and awaited on the first request. - */ - async _resolveDefaultCredentials(profile) { - try { - const result = await defaultCredentials(this._credentialResolverOptions(), profile); - if (result) { - this._authState.provider = result.provider; - this._authState.tokenCache = this._makeTokenCache(result.provider); - this._authState.extraHeaders = result.extraHeaders; - this._applyCredentialBaseURL(result.baseURL); - } else if (profile != null) { - throw new AnthropicError(`Profile "${profile}" could not be resolved (no /configs/${profile}.json found).`); - } - } catch (err) { - this._authState.error = err; - } finally { - this._authState.resolution = null; - } - } - defaultQuery() { - return this._options.defaultQuery; - } - validateHeaders({ values, nulls }) { - if (values.get("x-api-key") || values.get("authorization")) { - return; - } - if (this._authState.error) { - throw this._authState.error; - } - if (this._authState.tokenCache || this._authState.resolution) { - return; - } - if (this.apiKey && values.get("x-api-key")) { - return; - } - if (nulls.has("x-api-key")) { - return; - } - if (this.authToken && values.get("authorization")) { - return; - } - if (nulls.has("authorization")) { - return; - } - throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); - } - _authFlags(opts) { - let flags = this._requestAuthFlags.get(opts); - if (!flags) { - flags = { usedTokenCache: false, didRefreshFor401: false }; - this._requestAuthFlags.set(opts, flags); - } - return flags; - } - async authHeaders(opts) { - if (this._authState.resolution) { - await this._authState.resolution; - } - if (this._authState.error) { - return void 0; - } - if (this._authState.tokenCache && this.apiKey == null) { - const token = await this._authState.tokenCache.getToken(); - this._authFlags(opts).usedTokenCache = true; - return buildHeaders2([{ Authorization: `Bearer ${token}` }]); - } - return buildHeaders2([await this.apiKeyAuth(opts), await this.bearerAuth(opts)]); - } - async apiKeyAuth(opts) { - if (this.apiKey == null) { - return void 0; - } - return buildHeaders2([{ "X-Api-Key": this.apiKey }]); - } - async bearerAuth(opts) { - if (this.authToken == null) { - return void 0; - } - return buildHeaders2([{ Authorization: `Bearer ${this.authToken}` }]); - } - stringifyQuery(query) { - return stringifyQuery2(query); - } - getUserAgent() { - return `Anthropic/JS ${VERSION2}`; - } - makeStatusError(status, error, message, headers) { - return APIError2.generate(status, error, message, headers); - } - buildURL(path4, query, defaultBaseURL) { - const baseURL = !__classPrivateFieldGet2(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; - const url = isAbsoluteURL2(path4) ? new URL(path4) : new URL(baseURL + (baseURL.endsWith("/") && path4.startsWith("/") ? path4.slice(1) : path4)); - const defaultQuery = this.defaultQuery(); - const pathQuery = Object.fromEntries(url.searchParams); - if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) { - query = { ...pathQuery, ...defaultQuery, ...query }; - } - if (typeof query === "object" && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query); - } - return url.toString(); - } - _calculateNonstreamingTimeout(maxTokens) { - const defaultTimeout = 10 * 60; - const expectedTimeout = 60 * 60 * maxTokens / 128e3; - if (expectedTimeout > defaultTimeout) { - throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details"); - } - return defaultTimeout * 1e3; - } - /** - * Used as a callback for mutating the given `FinalRequestOptions` object. - */ - async prepareOptions(options) { - } - /** - * Used as a callback for mutating the given `RequestInit` object. - * - * This is useful for cases where you want to add certain headers based off of - * the request properties, e.g. `method` or `url`. - * - * Runs after all middleware (including {@link backendMiddleware}), - * immediately before each underlying fetch call, so it sees exactly what - * goes over the wire. Middleware may replay a request by calling `next()` - * more than once, so this hook can run multiple times per attempt: - * overrides must be idempotent and overwrite headers from a previous - * invocation rather than append to them. - */ - async prepareRequest(request2, { url, options }) { - if (this._authState.tokenCache && this.apiKey == null) { - const headers = request2.headers instanceof Headers ? request2.headers : new Headers(request2.headers); - for (const [k, v] of Object.entries(this._authState.extraHeaders)) { - if (!headers.has(k)) - headers.set(k, v); - } - const existing = headers.get("anthropic-beta")?.split(",").map((s) => s.trim()); - if (!existing?.includes(OAUTH_API_BETA_HEADER)) { - headers.set("anthropic-beta", [...existing ?? [], OAUTH_API_BETA_HEADER].join(",")); - } - request2.headers = headers; - } - } - /** - * Internal {@link Middleware} composed innermost in the chain — inside both - * client-level and per-request middleware, immediately around the underlying - * `fetch`. Subclasses for third-party backends override this to adapt the - * canonical Anthropic-shaped request to the backend's wire shape (URL/body - * rewriting, request signing) and to normalize the wire response back to the - * canonical shape (e.g. AWS EventStream to SSE). - * - * Running inside the user's middleware means user middleware always observes - * canonical Anthropic-shaped traffic, and the adaptation re-runs (e.g. - * re-signs) on every `next()` invocation, covering whatever the middleware - * mutated. - * - * Errors thrown here follow the middleware error policy: they propagate to - * the caller as-is — no retries, no `APIConnectionError` wrapping — unless - * retryable (see {@link Middleware}); throw a `RetryableError` to opt into - * the retry path. - */ - backendMiddleware() { - return []; - } - get(path4, opts) { - return this.methodRequest("get", path4, opts); - } - post(path4, opts) { - return this.methodRequest("post", path4, opts); - } - patch(path4, opts) { - return this.methodRequest("patch", path4, opts); - } - put(path4, opts) { - return this.methodRequest("put", path4, opts); - } - delete(path4, opts) { - return this.methodRequest("delete", path4, opts); - } - methodRequest(method, path4, opts) { - return this.request(Promise.resolve(opts).then((opts2) => { - return { method, path: path4, ...opts2 }; - })); - } - request(options, remainingRetries = null) { - return new APIPromise2(this, this.makeRequest(options, remainingRetries, void 0)); - } - async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) { - const options = await optionsInput; - let maxRetries = validatePositiveInteger2("maxRetries", options.maxRetries ?? this.maxRetries); - if (this.isStreamBody(options.body)) { - maxRetries = 0; - } - if (retriesRemaining == null) { - retriesRemaining = maxRetries; - this._requestAuthFlags.delete(options); - } - await this.prepareOptions(options); - const { req, url, timeout } = await this.buildRequest(options, { - retryCount: maxRetries - retriesRemaining - }); - const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); - const retryLogStr = retryOfRequestLogID === void 0 ? "" : `, retryOf: ${retryOfRequestLogID}`; - const startTime = Date.now(); - if (options.signal?.aborted) { - throw new APIUserAbortError2(); - } - const controller = new AbortController(); - const response = await this.fetchWithTimeout(url, req, timeout, controller, options, { - requestLogID, - retryOfRequestLogID - }).catch(castToError2); - const headersTime = Date.now(); - if (response instanceof globalThis.Error) { - releaseRequestSignal(controller); - const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; - if (options.signal?.aborted) { - throw new APIUserAbortError2(); - } - const isTimeout = isAbortError2(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); - const hasMiddleware = this.middleware.length > 0 || !!options.middleware?.length || this.backendMiddleware().length > 0; - if (hasMiddleware && !isTimeout && !isRetryableError(response)) { - loggerFor2(this).info(`[${requestLogID}] middleware error (not retryable)`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] middleware error (not retryable)`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - throw response; - } - if (retriesRemaining) { - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); - } - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, { - retryOfRequestLogID, - url, - durationMs: headersTime - startTime, - message: response.message - }); - if (isTimeout) { - throw new APIConnectionTimeoutError2(); - } - if (hasMiddleware && !isFetchOriginError(response)) { - throw response; - } - throw new APIConnectionError2({ cause: response }); - } - const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "request-id" || name === "anthropic-workspace-id").map(([name, value]) => ", " + name + ": " + JSON.stringify(value)).join(""); - const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; - if (!response.ok) { - const shouldRetry = await this.shouldRetry(response, options); - if (retriesRemaining && shouldRetry) { - const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; - await CancelReadableStream2(response.body); - releaseRequestSignal(controller); - loggerFor2(this).info(`${responseInfo} - ${retryMessage2}`); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response error (${retryMessage2})`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - durationMs: headersTime - startTime - }); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers); - } - const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; - loggerFor2(this).info(`${responseInfo} - ${retryMessage}`); - const errText = await response.text().catch((err2) => castToError2(err2).message); - const errJSON = safeJSON2(errText); - const errMessage = errJSON ? void 0 : errText; - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response error (${retryMessage})`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - message: errMessage, - durationMs: Date.now() - startTime - }); - releaseRequestSignal(controller); - const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); - throw err; - } - loggerFor2(this).info(responseInfo); - debugLogRequestDetails(loggerFor2(this), `[${requestLogID}] response start`, { - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - durationMs: headersTime - startTime - }); - armAbandonmentBackstop(response.body ?? response, controller); - return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; - } - getAPIList(path4, Page3, opts) { - return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path4, ...opts2 })) : { method: "get", path: path4, ...opts }); - } - requestAPIList(Page3, options) { - const request2 = this.makeRequest(options, null, void 0); - return new PagePromise2(this, request2, Page3); - } - async fetchWithTimeout(url, init, ms, controller, requestOptions, logCtx) { - const { signal, method, ...options } = init || {}; - const abort = this._makeAbort(controller); - if (signal) { - signal.addEventListener("abort", abort, { once: true }); - registerRequestSignalCleanup(controller, signal, abort); - } - const isReadableBody = globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream || typeof options.body === "object" && options.body !== null && Symbol.asyncIterator in options.body; - const fetchOptions = { - signal: controller.signal, - ...isReadableBody ? { duplex: "half" } : {}, - method: "GET", - ...options - }; - if (method) { - fetchOptions.method = method.toUpperCase(); - } - const baseFetch = this.fetch; - const timedFetch = async (innerUrl, innerInit) => { - const timeout = setTimeout(abort, ms); - try { - return await baseFetch.call(void 0, innerUrl, innerInit); - } finally { - clearTimeout(timeout); - } - }; - const innerFetch = requestOptions === void 0 ? timedFetch : (async (innerUrl, innerInit = {}) => { - const innerUrlStr = typeof innerUrl === "string" ? innerUrl : innerUrl instanceof URL ? innerUrl.href : innerUrl.url; - innerInit.headers = innerInit.headers instanceof Headers ? innerInit.headers : new Headers(innerInit.headers); - await this.prepareRequest(innerInit, { url: innerUrlStr, options: requestOptions }); - if (logCtx) { - debugLogRequestDetails(loggerFor2(this), `[${logCtx.requestLogID}] sending request`, { - retryOfRequestLogID: logCtx.retryOfRequestLogID, - method: innerInit.method, - url: innerUrlStr, - options: requestOptions, - headers: innerInit.headers - }); - } - return timedFetch(innerUrl, innerInit); - }); - const requestMiddleware = requestOptions?.middleware; - const backendMiddleware = this.backendMiddleware(); - const allMiddleware = requestMiddleware?.length || backendMiddleware.length ? [...this.middleware, ...requestMiddleware ?? [], ...backendMiddleware] : this.middleware; - return await wrapFetchWithMiddleware(innerFetch, allMiddleware, requestOptions, this)(url, fetchOptions); - } - async shouldRetry(response, options) { - const flags = this._authFlags(options); - if (response.status === 401 && this._authState.tokenCache && flags.usedTokenCache && !flags.didRefreshFor401) { - flags.didRefreshFor401 = true; - this._authState.tokenCache.invalidate(); - return true; - } - const shouldRetryHeader = response.headers.get("x-should-retry"); - if (shouldRetryHeader === "true") - return true; - if (shouldRetryHeader === "false") - return false; - if (response.status === 408) - return true; - if (response.status === 409) - return true; - if (response.status === 429) - return true; - if (response.status >= 500) - return true; - return false; - } - async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { - let timeoutMillis; - const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); - if (retryAfterMillisHeader) { - const timeoutMs = parseFloat(retryAfterMillisHeader); - if (!Number.isNaN(timeoutMs)) { - timeoutMillis = timeoutMs; - } - } - const retryAfterHeader = responseHeaders?.get("retry-after"); - if (retryAfterHeader && !timeoutMillis) { - const timeoutSeconds = parseFloat(retryAfterHeader); - if (!Number.isNaN(timeoutSeconds)) { - timeoutMillis = timeoutSeconds * 1e3; - } else { - timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); - } - } - if (timeoutMillis === void 0 || !(timeoutMillis > 0 && timeoutMillis <= 2 ** 31 - 1)) { - const maxRetries = options.maxRetries ?? this.maxRetries; - timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); - } - await sleep2(timeoutMillis, options.signal ?? void 0); - return this.makeRequest(options, retriesRemaining - 1, requestLogID); - } - calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { - const initialRetryDelay = 0.5; - const maxRetryDelay = 8; - const numRetries = maxRetries - retriesRemaining; - const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay); - const jitter2 = 1 - Math.random() * 0.25; - return sleepSeconds * jitter2 * 1e3; - } - calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) { - const maxTime = 60 * 60 * 1e3; - const defaultTime = 60 * 10 * 1e3; - const expectedTime = maxTime * maxTokens / 128e3; - if (expectedTime > defaultTime || maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens) { - throw new AnthropicError("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details"); - } - return defaultTime; - } - async buildRequest(inputOptions, { retryCount = 0 } = {}) { - const options = { ...inputOptions }; - const { method, path: path4, query, defaultBaseURL } = options; - if (this._authState.resolution) { - await this._authState.resolution; - } - if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) { - this.baseURL = this._authState.baseURL; - } - const url = this.buildURL(path4, query, defaultBaseURL); - if ("timeout" in options) - validatePositiveInteger2("timeout", options.timeout); - options.timeout = options.timeout ?? this.timeout; - const { bodyHeaders, body } = this.buildBody({ options }); - const reqHeaders = await this.buildHeaders({ - options: inputOptions, - method, - bodyHeaders, - retryCount, - timeout: options.timeout - }); - const req = { - method, - headers: reqHeaders, - ...options.signal && { signal: options.signal }, - ...globalThis.ReadableStream && body instanceof globalThis.ReadableStream && { duplex: "half" }, - ...body && { body }, - ...this.fetchOptions ?? {}, - ...options.fetchOptions ?? {} - }; - return { req, url, timeout: options.timeout }; - } - async buildHeaders({ options, method, bodyHeaders, retryCount, timeout }) { - const headers = buildHeaders2([ - { - Accept: "application/json", - "User-Agent": this.getUserAgent(), - "X-Stainless-Retry-Count": String(retryCount), - "X-Stainless-Timeout": String(Math.trunc(timeout / 1e3)), - ...getPlatformHeaders2(), - ...this._options.dangerouslyAllowBrowser ? { "anthropic-dangerous-direct-browser-access": "true" } : void 0, - "anthropic-version": "2023-06-01" - }, - await this.authHeaders(options), - this._options.defaultHeaders, - bodyHeaders, - options.headers - ]); - this.validateHeaders(headers); - return headers.values; - } - _makeAbort(controller) { - return () => controller.abort(); - } - buildBody({ options: { body, headers: rawHeaders } }) { - if (!body) { - return { bodyHeaders: void 0, body: void 0 }; - } - const headers = buildHeaders2([rawHeaders]); - if ( - // Pass raw type verbatim - ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && // Preserve legacy string encoding behavior for now - headers.values.has("content-type") || // `Blob` is superset of `File` - globalThis.Blob && body instanceof globalThis.Blob || // `FormData` -> `multipart/form-data` - body instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` - body instanceof URLSearchParams || // Send chunked stream (each chunk has own `length`) - globalThis.ReadableStream && body instanceof globalThis.ReadableStream - ) { - return { bodyHeaders: void 0, body }; - } else if (this.isStreamBody(body)) { - return { bodyHeaders: void 0, body: ReadableStreamFrom2(body) }; - } else if (typeof body === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { - return { - bodyHeaders: { "content-type": "application/x-www-form-urlencoded" }, - body: this.stringifyQuery(body) - }; - } else { - return __classPrivateFieldGet2(this, _BaseAnthropic_encoder, "f").call(this, { body, headers }); - } - } - /** - * Whether `body` is sent as a stream, which can be read only once: - * a `ReadableStream`, an async iterable or an iterator. - */ - isStreamBody(body) { - if (globalThis.ReadableStream && body instanceof globalThis.ReadableStream) { - return true; - } - return typeof body === "object" && body !== null && (Symbol.asyncIterator in body || Symbol.iterator in body && "next" in body && typeof body.next === "function"); - } - } - _a5 = BaseAnthropic2, _BaseAnthropic_encoder = /* @__PURE__ */ new WeakMap(), _BaseAnthropic_instances = /* @__PURE__ */ new WeakSet(), _BaseAnthropic_baseURLOverridden = function _BaseAnthropic_baseURLOverridden2() { - return this.baseURL !== "https://api.anthropic.com"; - }; - BaseAnthropic2.Anthropic = _a5; - BaseAnthropic2.DEFAULT_TIMEOUT = 6e5; - BaseAnthropic2.AnthropicError = AnthropicError; - BaseAnthropic2.APIError = APIError2; - BaseAnthropic2.APIConnectionError = APIConnectionError2; - BaseAnthropic2.APIConnectionTimeoutError = APIConnectionTimeoutError2; - BaseAnthropic2.APIUserAbortError = APIUserAbortError2; - BaseAnthropic2.NotFoundError = NotFoundError2; - BaseAnthropic2.ConflictError = ConflictError2; - BaseAnthropic2.RateLimitError = RateLimitError2; - BaseAnthropic2.BadRequestError = BadRequestError2; - BaseAnthropic2.AuthenticationError = AuthenticationError2; - BaseAnthropic2.InternalServerError = InternalServerError2; - BaseAnthropic2.PermissionDeniedError = PermissionDeniedError2; - BaseAnthropic2.UnprocessableEntityError = UnprocessableEntityError2; - BaseAnthropic2.toFile = toFile2; - BaseAnthropic2.HUMAN_PROMPT = HUMAN_PROMPT; - BaseAnthropic2.AI_PROMPT = AI_PROMPT; - return BaseAnthropic2; - })(); - Anthropic = /* @__PURE__ */ (() => { - class Anthropic2 extends BaseAnthropic { - constructor() { - super(...arguments); - this.completions = new Completions3(this); - this.messages = new Messages4(this); - this.models = new Models3(this); - this.files = new Files6(this); - this.skills = new Skills3(this); - this.beta = new Beta2(this); - } - } - Anthropic2.Completions = Completions3; - Anthropic2.Messages = Messages4; - Anthropic2.Models = Models3; - Anthropic2.Files = Files6; - Anthropic2.Skills = Skills3; - Anthropic2.Beta = Beta2; - return Anthropic2; - })(); - } -}); - -// node_modules/@anthropic-ai/sdk/index.mjs -var init_sdk = __esm({ - "node_modules/@anthropic-ai/sdk/index.mjs"() { - init_client2(); - } -}); - -// node_modules/@earendil-works/pi-ai/dist/env-api-keys.js -var __rewriteRelativeImportExtension3, _existsSync, _homedir, _join, dynamicImport, NODE_FS_SPECIFIER, NODE_OS_SPECIFIER, NODE_PATH_SPECIFIER, ANTHROPIC_AUTH_TOKEN_ENV, ANTHROPIC_OAUTH_TOKEN_ENV, ANTHROPIC_API_KEY_ENV, ANTHROPIC_FEDERATION_RULE_ID_ENV, ANTHROPIC_ORGANIZATION_ID_ENV, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, ANTHROPIC_WORKSPACE_ID_ENV; -var init_env_api_keys = __esm({ - "node_modules/@earendil-works/pi-ai/dist/env-api-keys.js"() { - __rewriteRelativeImportExtension3 = function(path4, preserveJsx) { - if (typeof path4 === "string" && /^\.\.?\//.test(path4)) { - return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return path4; - }; - _existsSync = null; - _homedir = null; - _join = null; - dynamicImport = (specifier) => import(__rewriteRelativeImportExtension3(specifier)); - NODE_FS_SPECIFIER = "node:fs"; - NODE_OS_SPECIFIER = "node:os"; - NODE_PATH_SPECIFIER = "node:path"; - if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) { - dynamicImport(NODE_FS_SPECIFIER).then((m) => { - _existsSync = m.existsSync; - }); - dynamicImport(NODE_OS_SPECIFIER).then((m) => { - _homedir = m.homedir; - }); - dynamicImport(NODE_PATH_SPECIFIER).then((m) => { - _join = m.join; - }); - } - ANTHROPIC_AUTH_TOKEN_ENV = "ANTHROPIC_AUTH_TOKEN"; - ANTHROPIC_OAUTH_TOKEN_ENV = "ANTHROPIC_OAUTH_TOKEN"; - ANTHROPIC_API_KEY_ENV = "ANTHROPIC_API_KEY"; - ANTHROPIC_FEDERATION_RULE_ID_ENV = "ANTHROPIC_FEDERATION_RULE_ID"; - ANTHROPIC_ORGANIZATION_ID_ENV = "ANTHROPIC_ORGANIZATION_ID"; - ANTHROPIC_SERVICE_ACCOUNT_ID_ENV = "ANTHROPIC_SERVICE_ACCOUNT_ID"; - ANTHROPIC_IDENTITY_TOKEN_FILE_ENV = "ANTHROPIC_IDENTITY_TOKEN_FILE"; - ANTHROPIC_WORKSPACE_ID_ENV = "ANTHROPIC_WORKSPACE_ID"; - } -}); - -// node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js -function isValidCost(value) { - return typeof value === "number" && Number.isFinite(value) && value >= 0; -} -function isOpenRouterModel(model2) { - return model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); -} -function applyOpenRouterReportedCost(usage, reported) { - if (!isValidCost(reported.cost)) - return; - if (reported.is_byok === false) { - usage.cost.total = reported.cost; - usage.cost.totalFromProvider = true; +function appendOpenAIReasoningDetail(details, detail) { + const lastDetail = details[details.length - 1]; + if (detail.type === "reasoning.text" && lastDetail?.type === "reasoning.text") { + lastDetail.text += detail.text; + lastDetail.signature ||= detail.signature; + fillMissingCommonReasoningDetailFields(lastDetail, detail); return; } - if (reported.is_byok === true) { - const details = reported.cost_details; - if (!details) - return; - let upstreamCost = details.upstream_inference_cost; - if (upstreamCost === null) { - if (!isValidCost(details.upstream_inference_prompt_cost) || !isValidCost(details.upstream_inference_completions_cost)) { - return; - } - upstreamCost = details.upstream_inference_prompt_cost + details.upstream_inference_completions_cost; - } - if (!isValidCost(upstreamCost)) - return; - usage.cost.total = reported.cost + upstreamCost; - usage.cost.totalFromProvider = true; + if (detail.type === "reasoning.summary" && lastDetail?.type === "reasoning.summary") { + lastDetail.summary += detail.summary; + fillMissingCommonReasoningDetailFields(lastDetail, detail); + return; } + details.push({ ...detail }); } -var init_openrouter_cost = __esm({ - "node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js"() { - } -}); - -// node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js -var anthropic_messages_exports = {}; -__export(anthropic_messages_exports, { - stream: () => stream3, - streamSimple: () => streamSimple2 -}); -function resolveCacheRetention2(cacheRetention, env) { +function isOpenAICompletionsReasoningField(field) { + return OPENAI_COMPLETIONS_REASONING_FIELDS.includes(field); +} +function resolveCacheRetention3(cacheRetention, env) { if (cacheRetention) { return cacheRetention; } @@ -39945,731 +41012,684 @@ function resolveCacheRetention2(cacheRetention, env) { } return "short"; } -function getCacheControl(model2, cacheRetention, env) { - const retention = resolveCacheRetention2(cacheRetention, env); - if (retention === "none") { - return { retention }; - } - const ttl = retention === "long" && getAnthropicCompat(model2).supportsLongCacheRetention ? "1h" : void 0; - return { - retention, - cacheControl: { type: "ephemeral", ...ttl && { ttl } } - }; -} -function convertImageBlock(image) { - return { - type: "image", - source: { - type: "base64", - media_type: image.mimeType, - data: image.data - } - }; -} -function convertContentBlocks(content) { - const hasImages = content.some((c) => c.type === "image"); - if (!hasImages) { - return sanitizeSurrogates(content.map((c) => c.text).join("\n")); - } - const blocks = content.map((block) => { - if (block.type === "text") { - return { - type: "text", - text: sanitizeSurrogates(block.text) - }; - } - return convertImageBlock(block); - }); - const hasText = blocks.some((b) => b.type === "text"); - if (!hasText) { - blocks.unshift({ - type: "text", - text: "(see attached image)" +function createClient3(model2, context, apiKey, optionsHeaders, identity, fetch3, sessionId, compat = getCompat2(model2)) { + const headers = { ...getIdentityHeaders(model2, identity), ...model2.headers }; + if (model2.provider === "github-copilot") { + const hasImages = hasCopilotVisionInput(context.messages); + const copilotHeaders = buildCopilotDynamicHeaders({ + messages: context.messages, + hasImages }); + Object.assign(headers, copilotHeaders); } - return blocks; -} -function shouldUseServerSideFallbackBeta(model2) { - return (model2.compat?.allowedFallbackModels?.length ?? 0) > 0; -} -function getAnthropicCompat(model2) { - const isOpenRouter2 = model2.provider === "openrouter" || model2.baseUrl.includes("openrouter.ai"); - return { - supportsEagerToolInputStreaming: model2.compat?.supportsEagerToolInputStreaming ?? true, - supportsLongCacheRetention: model2.compat?.supportsLongCacheRetention ?? true, - sendSessionAffinityHeaders: model2.compat?.sendSessionAffinityHeaders ?? isOpenRouter2, - sessionAffinityFormat: model2.compat?.sessionAffinityFormat ?? (isOpenRouter2 ? "openrouter" : void 0), - supportsCacheControlOnTools: model2.compat?.supportsCacheControlOnTools ?? true, - supportsTemperature: model2.compat?.supportsTemperature ?? true, - allowEmptySignature: model2.compat?.allowEmptySignature ?? false, - supportsStrictTools: model2.compat?.supportsStrictTools ?? false, - supportsMidConvoSystemMessages: model2.compat?.supportsMidConvoSystemMessages ?? false, - supportsMidConvoToolChanges: model2.compat?.supportsMidConvoToolChanges ?? false - }; -} -function mergeHeaders2(...headerSources) { - const merged = {}; - for (const headers of headerSources) { - if (headers) { - Object.assign(merged, headers); + if (sessionId && compat.sendSessionAffinityHeaders) { + if (compat.sessionAffinityFormat === "openrouter") { + headers["x-session-id"] = sessionId; + } else { + if (compat.sessionAffinityFormat === "openai") { + headers.session_id = sessionId; + } + headers["x-client-request-id"] = sessionId; + headers["x-session-affinity"] = sessionId; } } - return merged; + if (optionsHeaders) { + Object.assign(headers, optionsHeaders); + } + return new OpenAI({ + apiKey, + baseURL: model2.baseUrl, + dangerouslyAllowBrowser: true, + fetch: fetch3, + defaultHeaders: headers + }); } -function hasHeader2(headers, name) { - if (!headers) - return false; - const expected = name.toLowerCase(); - for (const [key, value] of Object.entries(headers)) { - if (key.toLowerCase() === expected && value !== null && value.trim().length > 0) - return true; +function buildParams3(model2, context, options, compat = getCompat2(model2), cacheRetention = resolveCacheRetention3(options?.cacheRetention, options?.env), grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(context.messages), compat.supportsOpenAIGrammarTools)) { + const transcriptTools = resolveTranscriptTools(context.messages, compat.supportsMidConvoSystemMessages === true && compat.supportsMidConvoToolAdditions === true ? "additions" : "none"); + const messages = convertMessages2(model2, context, compat, { + grammarToolInputProperties + }); + const cacheControl = getCompatCacheControl(compat, cacheRetention); + const params = { + model: model2.id, + messages, + stream: true, + prompt_cache_key: model2.baseUrl.includes("api.openai.com") && cacheRetention !== "none" || cacheRetention === "long" && compat.supportsLongCacheRetention ? clampOpenAIPromptCacheKey(options?.sessionId) : void 0, + prompt_cache_retention: cacheRetention === "long" && compat.supportsLongCacheRetention ? "24h" : void 0 + }; + if (compat.supportsUsageInStreaming !== false) { + params.stream_options = { include_usage: true }; + } + if (compat.supportsStore) { + params.store = false; + } + if (options?.maxTokens) { + if (compat.maxTokensField === "max_tokens") { + params.max_tokens = options.maxTokens; + } else { + params.max_completion_tokens = options.maxTokens; + } + } + if (options?.temperature !== void 0) { + params.temperature = options.temperature; + } + if (transcriptTools.requestTools.length > 0) { + params.tools = convertTools2(transcriptTools.requestTools, compat); + if (compat.zaiToolStream) { + params.tool_stream = true; + } + } else if (hasToolHistory(context.messages)) { + params.tools = []; + } + if (cacheControl) { + applyAnthropicCacheControl(messages, params.tools, cacheControl); + } + if (options?.toolChoice) { + params.tool_choice = options.toolChoice; + } + if (compat.vllmPriority !== void 0) { + params.priority = compat.vllmPriority; + } + const thinkingTokenBudgetField = resolveThinkingTokenBudgetField(compat); + const thinkingBudget = resolveClampedThinkingBudget(model2, options, params); + if (compat.thinkingFormat === "zai" && model2.reasoning) { + const zaiParams = params; + zaiParams.thinking = options?.reasoningEffort ? { type: "enabled", clear_thinking: false } : { type: "disabled" }; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + const mappedEffort = model2.thinkingLevelMap?.[options.reasoningEffort]; + const effort = mappedEffort === void 0 ? options.reasoningEffort : mappedEffort; + if (typeof effort === "string") { + zaiParams.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "qwen" && model2.reasoning) { + params.enable_thinking = !!options?.reasoningEffort; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + const effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + if (typeof effort === "string") { + params.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "qwen-chat-template" && model2.reasoning) { + params.chat_template_kwargs = { + enable_thinking: !!options?.reasoningEffort, + preserve_thinking: true + }; + } else if (compat.thinkingFormat === "chat-template" && model2.reasoning) { + const chatTemplateKwargs = buildChatTemplateValues(model2, options, compat.chatTemplateKwargs, thinkingBudget); + if (chatTemplateKwargs) { + params.chat_template_kwargs = chatTemplateKwargs; + } + } else if (compat.thinkingFormat === "baseten" && model2.reasoning) { + const basetenParams = params; + const chatTemplateArgs = buildChatTemplateValues(model2, options, compat.chatTemplateArgs, thinkingBudget); + if (chatTemplateArgs) { + basetenParams.chat_template_args = chatTemplateArgs; + } + if (compat.supportsReasoningEffort) { + const requestedEffort = options?.reasoningEffort; + const mappedEffort = requestedEffort ? model2.thinkingLevelMap?.[requestedEffort] : model2.thinkingLevelMap?.off; + const effort = mappedEffort === void 0 ? requestedEffort : mappedEffort; + if (typeof effort === "string") { + basetenParams.reasoning_effort = effort; + } + } + } else if (compat.thinkingFormat === "deepseek" && model2.reasoning) { + if (options?.reasoningEffort) { + params.thinking = { type: "enabled" }; + } else if (model2.thinkingLevelMap?.off !== null) { + params.thinking = { type: "disabled" }; + } + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + params.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } + } else if (compat.thinkingFormat === "openrouter" && model2.reasoning) { + const openRouterParams = params; + if (options?.reasoningEffort) { + openRouterParams.reasoning = { + effort: model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort + }; + } else if (model2.thinkingLevelMap?.off !== null) { + openRouterParams.reasoning = { effort: model2.thinkingLevelMap?.off ?? "none" }; + } + } else if (compat.thinkingFormat === "ant-ling" && model2.reasoning && options?.reasoningEffort) { + const effort = model2.thinkingLevelMap?.[options.reasoningEffort]; + if (typeof effort === "string") { + params.reasoning = { effort }; + } + } else if (compat.thinkingFormat === "together" && model2.reasoning) { + const togetherParams = params; + togetherParams.reasoning = { enabled: !!options?.reasoningEffort }; + if (options?.reasoningEffort && compat.supportsReasoningEffort) { + togetherParams.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } + } else if (compat.thinkingFormat === "string-thinking" && model2.reasoning) { + const stringThinkingParams = params; + if (options?.reasoningEffort) { + stringThinkingParams.thinking = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } else if (model2.thinkingLevelMap?.off !== null) { + stringThinkingParams.thinking = model2.thinkingLevelMap?.off ?? "none"; + } + } else if (options?.reasoningEffort && model2.reasoning && compat.supportsReasoningEffort) { + params.reasoning_effort = model2.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort; + } else if (!options?.reasoningEffort && model2.reasoning && compat.supportsReasoningEffort) { + const offValue = model2.thinkingLevelMap?.off; + if (typeof offValue === "string") { + params.reasoning_effort = offValue; + } + } + if (thinkingTokenBudgetField && thinkingBudget !== void 0) { + Object.assign(params, { [thinkingTokenBudgetField]: thinkingBudget }); + } + if (model2.compat?.openRouterRouting) { + params.provider = model2.compat.openRouterRouting; + } + if (model2.compat?.vercelGatewayRouting) { + const routing = model2.compat.vercelGatewayRouting; + if (routing.only || routing.order) { + const gatewayOptions = {}; + if (routing.only) + gatewayOptions.only = routing.only; + if (routing.order) + gatewayOptions.order = routing.order; + params.providerOptions = { gateway: gatewayOptions }; + } + } + const samplingParams = resolveSamplingParams(model2, options?.reasoningEffort ?? "off", options?.samplingParams); + if (samplingParams) { + Object.assign(params, samplingParams); + } + return params; +} +function resolveThinkingTokenBudgetField(compat) { + if (compat.thinkingTokenBudgetField) + return compat.thinkingTokenBudgetField; + if (compat.supportsThinkingTokenBudget) + return "thinking_token_budget"; + return void 0; +} +function resolveClampedThinkingBudget(model2, options, params) { + if (!options?.reasoningEffort || !model2.reasoning) + return void 0; + const ceiling = params.max_tokens ?? params.max_completion_tokens ?? model2.maxTokens; + const budget = clampThinkingBudgetToAnswerRoom(thinkingBudgetForLevel(options.reasoningEffort, options.thinkingBudgets), ceiling); + return budget > 0 ? budget : void 0; +} +function buildChatTemplateValues(model2, options, values, thinkingBudget) { + const resolvedValues = {}; + for (const [key, value2] of Object.entries(values)) { + const resolved = resolveChatTemplateKwargValue(model2, options, value2, thinkingBudget); + if (resolved !== void 0) { + resolvedValues[key] = resolved; + } + } + return Object.keys(resolvedValues).length > 0 ? resolvedValues : void 0; +} +function resolveChatTemplateKwargValue(model2, options, value2, thinkingBudget) { + if (typeof value2 !== "object" || value2 === null) { + return value2; + } + const reasoningEffort = options?.reasoningEffort; + if (!reasoningEffort && value2.omitWhenOff) { + return void 0; + } + if (value2.$var === "thinking.enabled") { + return !!reasoningEffort; + } + if (value2.$var === "thinking.budget") { + return thinkingBudget; + } + const mappedValue = reasoningEffort ? model2.thinkingLevelMap?.[reasoningEffort] : model2.thinkingLevelMap?.off; + return mappedValue === void 0 ? reasoningEffort : typeof mappedValue === "string" ? mappedValue : void 0; +} +function getCompatCacheControl(compat, cacheRetention) { + if (compat.cacheControlFormat !== "anthropic" || cacheRetention === "none") { + return void 0; + } + const ttl = cacheRetention === "long" && compat.supportsLongCacheRetention ? "1h" : void 0; + return { type: "ephemeral", ...ttl ? { ttl } : {} }; +} +function applyAnthropicCacheControl(messages, tools, cacheControl) { + addCacheControlToSystemPrompt(messages, cacheControl); + addCacheControlToLastTool(tools, cacheControl); + addCacheControlToLastConversationMessage(messages, cacheControl); +} +function addCacheControlToSystemPrompt(messages, cacheControl) { + for (const message of messages) { + if (message.role === "system" || message.role === "developer") { + addCacheControlToInstructionMessage(message, cacheControl); + return; + } + } +} +function addCacheControlToLastConversationMessage(messages, cacheControl) { + for (let i = messages.length - 1; i >= 0; i--) { + const message = messages[i]; + if (message.role === "user" || message.role === "assistant" || message.role === "tool") { + if (addCacheControlToMessage(message, cacheControl)) { + return; + } + } + } +} +function addCacheControlToLastTool(tools, cacheControl) { + if (!tools || tools.length === 0) { + return; + } + const lastTool = tools[tools.length - 1]; + lastTool.cache_control = cacheControl; +} +function addCacheControlToInstructionMessage(message, cacheControl) { + return addCacheControlToTextContent(message, cacheControl); +} +function addCacheControlToMessage(message, cacheControl) { + if (message.role === "user" || message.role === "assistant" || message.role === "tool") { + return addCacheControlToTextContent(message, cacheControl); } return false; } -function hasRequestAuth(apiKey, headers) { - return !!apiKey || hasHeader2(headers, "authorization") || hasHeader2(headers, "x-api-key") || hasHeader2(headers, "cf-aig-authorization"); -} -function assertRequestAuth(provider2, apiKey, headers) { - if (!hasRequestAuth(apiKey, headers)) - throw new Error(`No API key for provider: ${provider2}`); -} -function getAnthropicFederation(model2, apiKey, headers, env) { - if (model2.provider !== "anthropic" || hasRequestAuth(apiKey, headers)) - return void 0; - const federationRuleId = getProviderEnvValue(ANTHROPIC_FEDERATION_RULE_ID_ENV, env); - const organizationId = getProviderEnvValue(ANTHROPIC_ORGANIZATION_ID_ENV, env); - const identityTokenFile = getProviderEnvValue(ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, env); - if (!federationRuleId || !organizationId || !identityTokenFile) - return void 0; - return { - organization_id: organizationId, - workspace_id: getProviderEnvValue(ANTHROPIC_WORKSPACE_ID_ENV, env), - authentication: { - type: "oidc_federation", - federation_rule_id: federationRuleId, - service_account_id: getProviderEnvValue(ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, env), - identity_token: { source: "file", path: identityTokenFile } +function addCacheControlToTextContent(message, cacheControl) { + const content = message.content; + if (typeof content === "string") { + if (content.length === 0) { + return false; } - }; -} -function flushSseEvent(state2) { - if (!state2.event && state2.data.length === 0) { - return null; - } - const event = { - event: state2.event, - data: state2.data.join("\n"), - raw: [...state2.raw] - }; - state2.event = null; - state2.data = []; - state2.raw = []; - return event; -} -function decodeSseLine(line, state2) { - if (line === "") { - return flushSseEvent(state2); - } - state2.raw.push(line); - if (line.startsWith(":")) { - return null; - } - const delimiterIndex = line.indexOf(":"); - const fieldName = delimiterIndex === -1 ? line : line.slice(0, delimiterIndex); - let value = delimiterIndex === -1 ? "" : line.slice(delimiterIndex + 1); - if (value.startsWith(" ")) { - value = value.slice(1); - } - if (fieldName === "event") { - state2.event = value; - } else if (fieldName === "data") { - state2.data.push(value); - } - return null; -} -function nextLineBreakIndex(text) { - const carriageReturnIndex = text.indexOf("\r"); - const newlineIndex = text.indexOf("\n"); - if (carriageReturnIndex === -1) { - return newlineIndex; - } - if (newlineIndex === -1) { - return carriageReturnIndex; - } - return Math.min(carriageReturnIndex, newlineIndex); -} -function consumeLine(text) { - const lineBreakIndex = nextLineBreakIndex(text); - if (lineBreakIndex === -1) { - return null; - } - let nextIndex = lineBreakIndex + 1; - if (text[lineBreakIndex] === "\r" && text[nextIndex] === "\n") { - nextIndex += 1; - } - return { - line: text.slice(0, lineBreakIndex), - rest: text.slice(nextIndex) - }; -} -async function* iterateSseMessages(body, signal) { - const reader = body.getReader(); - const decoder3 = new TextDecoder(); - const state2 = { event: null, data: [], raw: [] }; - let buffer = ""; - try { - while (true) { - if (signal?.aborted) { - throw new Error("Request was aborted"); - } - const { value, done } = await reader.read(); - if (done) { - break; - } - buffer += decoder3.decode(value, { stream: true }); - let consumed2 = consumeLine(buffer); - while (consumed2) { - buffer = consumed2.rest; - const event = decodeSseLine(consumed2.line, state2); - if (event) { - yield event; - } - consumed2 = consumeLine(buffer); - } - } - buffer += decoder3.decode(); - let consumed = consumeLine(buffer); - while (consumed) { - buffer = consumed.rest; - const event = decodeSseLine(consumed.line, state2); - if (event) { - yield event; - } - consumed = consumeLine(buffer); - } - if (buffer.length > 0) { - const event = decodeSseLine(buffer, state2); - if (event) { - yield event; - } - } - const trailingEvent = flushSseEvent(state2); - if (trailingEvent) { - yield trailingEvent; - } - } finally { - reader.releaseLock(); - } -} -async function* iterateAnthropicEvents(response, signal) { - if (!response.body) { - throw new Error("Attempted to iterate over an Anthropic response with no body"); - } - let sawMessageStart = false; - let sawMessageEnd = false; - for await (const sse of iterateSseMessages(response.body, signal)) { - if (sse.event === "error") { - throw new Error(sse.data); - } - if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) { - continue; - } - try { - const event = parseJsonWithRepair(sse.data); - if (event.type === "message_start") { - sawMessageStart = true; - } else if (event.type === "message_stop") { - sawMessageEnd = true; - } - yield event; - } catch (error) { - const message = error instanceof Error ? error.message : String(error); - throw new Error(`Could not parse Anthropic SSE event ${sse.event}: ${message}; data=${sse.data}; raw=${sse.raw.join("\\n")}`); - } - } - if (sawMessageStart && !sawMessageEnd) { - throw new Error("Anthropic stream ended before message_stop"); - } -} -function mapThinkingLevelToEffort(model2, level) { - const mapped = level ? model2.thinkingLevelMap?.[level] : void 0; - if (typeof mapped === "string") - return mapped; - switch (level) { - case "minimal": - case "low": - return "low"; - case "medium": - return "medium"; - case "high": - return "high"; - default: - return "high"; - } -} -function isOAuthToken(apiKey) { - return apiKey.includes("sk-ant-oat"); -} -function createClient2(model2, apiKey, optionsHeaders, fetch2, dynamicHeaders, sessionId, federation, identity) { - if (model2.provider === "github-copilot") { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: apiKey ?? null, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2, - defaultHeaders: mergeHeaders2(getIdentityHeaders(model2, identity), { - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true" - }, model2.headers, dynamicHeaders, optionsHeaders) - }); - return { client: client2, isOAuthToken: false }; - } - if (apiKey && isOAuthToken(apiKey)) { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: apiKey, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2, - defaultHeaders: mergeHeaders2({ - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true", - "user-agent": `claude-cli/${claudeCodeVersion}`, - "x-app": "cli" - }, model2.headers, optionsHeaders) - }); - return { client: client2, isOAuthToken: true }; - } - const compat = getAnthropicCompat(model2); - const sessionAffinityHeaders = {}; - if (sessionId && compat.sendSessionAffinityHeaders) { - const header = compat.sessionAffinityFormat === "openrouter" ? "x-session-id" : "x-session-affinity"; - sessionAffinityHeaders[header] = sessionId; - } - const defaultHeaders = mergeHeaders2(getIdentityHeaders(model2, identity), { - accept: "application/json", - "anthropic-dangerous-direct-browser-access": "true" - }, sessionAffinityHeaders, model2.headers, optionsHeaders); - if (federation) { - const key = JSON.stringify([model2.baseUrl, federation]); - if (federationClient?.key !== key || federationClient.fetch !== fetch2) { - const client2 = new PiAnthropic({ - apiKey: null, - authToken: null, - config: federation, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2 - }); - federationClient = { key, fetch: fetch2, client: client2 }; - } - return { client: federationClient.client.withOptions({ defaultHeaders }), isOAuthToken: false }; - } - const client = new PiAnthropic({ - apiKey: apiKey ?? null, - authToken: null, - baseURL: model2.baseUrl, - dangerouslyAllowBrowser: true, - fetch: fetch2, - defaultHeaders - }); - return { client, isOAuthToken: false }; -} -function getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options) { - let configuredFeatures; - for (const headers of [model2.headers, options?.headers]) { - for (const [name, value] of Object.entries(headers ?? {})) { - if (name.toLowerCase() === "anthropic-beta") - configuredFeatures = value; - } - } - if (configuredFeatures === null) - return []; - if (configuredFeatures !== void 0) { - return [ - ...new Set(configuredFeatures.split(",").map((feature) => feature.trim()).filter((feature) => feature.length > 0)) - ]; - } - const features = []; - if (isOAuthToken2) - features.push("claude-code-20250219", "oauth-2025-04-20"); - if (shouldUseFineGrainedToolStreamingBeta(model2, context)) - features.push(FINE_GRAINED_TOOL_STREAMING_BETA); - if (model2.reasoning && options?.thinkingEnabled === true && (options.interleavedThinking ?? true) && model2.compat?.forceAdaptiveThinking !== true) { - features.push(INTERLEAVED_THINKING_BETA); - } - if (shouldUseServerSideFallbackBeta(model2)) - features.push(SERVER_SIDE_FALLBACK_BETA); - if (model2.compat?.supportsMidConvoEffort === true) { - features.push(MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA); - } - if (nativeToolChanges) - features.push(INLINE_TOOLS_BETA); - return [...new Set(features)]; -} -function buildParams2(model2, context, isOAuthToken2, options, disablePreferredStrictTools = false) { - const { cacheControl } = getCacheControl(model2, options?.cacheRetention, options?.env); - const compat = getAnthropicCompat(model2); - const initialSystemMessage = getInitialSystemMessage(context.messages); - const initialSystemText = initialSystemMessage ? getSystemMessageText(initialSystemMessage) : ""; - const transformedMessages = transformMessages(context.messages, model2, normalizeToolCallId); - const conversationMessages = initialSystemMessage ? transformedMessages.slice(1) : transformedMessages; - let hasPreferredStrictTools = false; - const convertToolDefinitions = (tools, toolCacheControl2) => { - const definitions = convertTools(tools, isOAuthToken2, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl2, disablePreferredStrictTools); - if (definitions.some((definition, index) => definition.strict === true && prefersJsonSchemaStrictSampling(tools[index]))) { - hasPreferredStrictTools = true; - } - return definitions; - }; - const initialTools = initialSystemMessage?.toolsAdded ?? []; - const nativeToolChanges = compat.supportsMidConvoSystemMessages && compat.supportsMidConvoToolChanges && initialTools.length > 0; - const thinkingDisabled = model2.reasoning && options?.thinkingEnabled === false && model2.thinkingLevelMap?.off !== null; - const effortMessages = model2.compat?.supportsMidConvoEffort === true && !thinkingDisabled; - const converted = convertMessages(conversationMessages, isOAuthToken2, cacheControl, compat.allowEmptySignature, effortMessages ? model2.provider : void 0, nativeToolChanges ? convertToolDefinitions : void 0); - const activeEffort = options?.effort ?? "high"; - const betaFeatures = getBetaFeatures(model2, context, isOAuthToken2, nativeToolChanges, options); - const params = { - model: model2.id, - messages: effortMessages ? insertThinkingLevelMessages(converted, activeEffort) : converted.messages, - max_tokens: options?.maxTokens ?? model2.maxTokens, - stream: true, - ...betaFeatures.length > 0 ? { betas: betaFeatures } : {} - }; - if (isOAuthToken2) { - params.system = [ + message.content = [ { type: "text", - text: "You are Claude Code, Anthropic's official CLI for Claude.", - ...cacheControl ? { cache_control: cacheControl } : {} - } - ]; - if (initialSystemText) { - params.system.push({ - type: "text", - text: sanitizeSurrogates(initialSystemText), - ...cacheControl ? { cache_control: cacheControl } : {} - }); - } - } else if (initialSystemText) { - params.system = [ - { - type: "text", - text: sanitizeSurrogates(initialSystemText), - ...cacheControl ? { cache_control: cacheControl } : {} + text: content, + cache_control: cacheControl } ]; + return true; } - if (options?.temperature !== void 0 && !options?.thinkingEnabled && model2.compat?.supportsMidConvoEffort !== true && compat.supportsTemperature) { - params.temperature = options.temperature; + if (!Array.isArray(content)) { + return false; } - const toolCacheControl = compat.supportsCacheControlOnTools ? cacheControl : void 0; - if (nativeToolChanges) { - params.tools = [...convertToolDefinitions(initialTools, toolCacheControl), DEFERRED_TOOL_PLACEHOLDER]; - } else { - const tools = getCurrentTools(context.messages); - if (tools.length > 0) { - params.tools = convertToolDefinitions(tools, toolCacheControl); + for (let i = content.length - 1; i >= 0; i--) { + const part = content[i]; + if (part?.type === "text") { + const textPart = part; + textPart.cache_control = cacheControl; + return true; } } - if (thinkingDisabled) { - params.thinking = { type: "disabled" }; - } else if (effortMessages) { - params.thinking = { - type: "adaptive", - display: options?.thinkingDisplay ?? "summarized", - block_binding: { prefix_mismatch_behavior: "drop_block" } - }; - params.output_config = { effort: "low" }; - } else if (model2.reasoning && options?.thinkingEnabled) { - const display = options.thinkingDisplay ?? "summarized"; - if (model2.compat?.forceAdaptiveThinking === true) { - params.thinking = { type: "adaptive", display }; - if (options.effort) { - params.output_config = { effort: options.effort }; - } - } else { - params.thinking = { - type: "enabled", - budget_tokens: options.thinkingBudgetTokens || 1024, - display - }; - } - } - if (options?.metadata) { - const userId = options.metadata.user_id; - if (typeof userId === "string") { - params.metadata = { user_id: userId }; - } - } - if (options?.toolChoice) { - if (typeof options.toolChoice === "string") { - params.tool_choice = { type: options.toolChoice }; - } else { - params.tool_choice = options.toolChoice; - } - } - const allowedFallbackModels = model2.compat?.allowedFallbackModels; - if (allowedFallbackModels && allowedFallbackModels.length > 0) { - params.fallbacks = allowedFallbackModels.map((fallback2) => ({ model: fallback2.model })); - } - return { params, hasPreferredStrictTools, providerThinkingLevel: effortMessages ? activeEffort : void 0 }; + return false; } -function normalizeToolCallId(id) { - return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64); -} -function convertToolResult(msg, content = msg.content) { - return { - type: "tool_result", - tool_use_id: msg.toolCallId, - content: convertContentBlocks(content), - is_error: msg.isError - }; -} -function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, convertToolDefinitions) { +function convertMessages2(model2, context, compat, options) { + const normalizedContext = resolveTranscript(context, compat.supportsMidConvoSystemMessages); const params = []; - const assistantLevels = /* @__PURE__ */ new Map(); - const pendingSystemMessages = []; - const flushPendingSystemMessages = () => { - params.push(...pendingSystemMessages); - pendingSystemMessages.length = 0; + const normalizeToolCallId2 = (id) => { + if (id.includes("|")) { + const separatorIndex = id.indexOf("|"); + const callId = id.slice(0, separatorIndex).replace(/[^a-zA-Z0-9_-]/g, "_"); + const itemId = id.slice(separatorIndex + 1).replace(/[^a-zA-Z0-9_-]/g, "_"); + const combinedId = itemId.length > 0 ? `${callId}_${itemId}` : callId; + if (combinedId.length <= 40) { + return combinedId; + } + const hash = shortHash(id).slice(0, 8); + const prefix = callId.slice(0, Math.max(1, 40 - hash.length - 1)); + return `${prefix}_${hash}`; + } + if (model2.provider === "openai") + return id.length > 40 ? id.slice(0, 40) : id; + return id; }; + const transformedMessages = transformMessages(normalizedContext.messages, model2, (id) => normalizeToolCallId2(id)); + const transcriptTools = resolveTranscriptTools(normalizedContext.messages, compat.supportsMidConvoSystemMessages === true && compat.supportsMidConvoToolAdditions === true ? "additions" : "none"); + const instructionRole = model2.reasoning && compat.supportsDeveloperRole ? "developer" : "system"; + let lastRole = null; + let systemIndex = 0; for (let i = 0; i < transformedMessages.length; i++) { const msg = transformedMessages[i]; + if (compat.requiresAssistantAfterToolResult && lastRole === "toolResult" && msg.role === "user") { + params.push({ + role: "assistant", + content: "I have processed the tool results." + }); + } if (msg.role === "system") { - const text = renderSystemMessageUpdate(msg); - const blocks = []; - if (text.length > 0) - blocks.push({ type: "text", text: sanitizeSurrogates(text) }); - if (convertToolDefinitions) { - const added = msg.toolsAdded ?? []; - const redefined = new Set(added.map((tool) => tool.name)); - for (const tool of msg.toolsRemoved ?? []) { - if (redefined.has(tool.name)) - continue; - blocks.push({ - type: "tool_removal", - tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name } - }); - } - for (const definition of convertToolDefinitions(added)) { - blocks.push({ type: "tool_addition", tool: { type: "tool_definition", definition } }); - } + const addedTools = systemIndex++ >= transcriptTools.foldedSystemMessages ? msg.toolsAdded ?? [] : []; + if (addedTools.length > 0) { + const kimiToolMessage = { + role: "system", + tools: convertTools2(addedTools, compat) + }; + params.push(kimiToolMessage); + } + const text = i === 0 ? getSystemMessageText(msg) : renderSystemMessageUpdate(msg); + if (text.length > 0) { + params.push({ role: instructionRole, content: sanitizeSurrogates(text) }); } - if (blocks.length > 0) - pendingSystemMessages.push({ role: "system", content: blocks }); } else if (msg.role === "user") { if (typeof msg.content === "string") { - if (msg.content.trim().length > 0) { - params.push({ - role: "user", - content: sanitizeSurrogates(msg.content) - }); - } + params.push({ + role: "user", + content: sanitizeSurrogates(msg.content) + }); } else { - const blocks = msg.content.map((item) => { + const content = msg.content.filter((item) => item.type !== "text" || item.text.length > 0).map((item) => { if (item.type === "text") { return { type: "text", text: sanitizeSurrogates(item.text) }; } else { - return convertImageBlock(item); + return { + type: "image_url", + image_url: { + url: `data:${item.mimeType};base64,${item.data}` + } + }; } }); - const filteredBlocks = blocks.filter((b) => { - if (b.type === "text") { - return b.text.trim().length > 0; - } - return true; - }); - if (filteredBlocks.length === 0) + if (content.length === 0) continue; params.push({ role: "user", - content: filteredBlocks + content }); } } else if (msg.role === "assistant") { - const blocks = []; - for (const block of msg.content) { - if (block.type === "text") { - if (block.text.trim().length === 0) - continue; - blocks.push({ - type: "text", - text: sanitizeSurrogates(block.text) - }); - } else if (block.type === "thinking") { - if (block.redacted) { - blocks.push({ - type: "redacted_thinking", - data: block.thinkingSignature - }); - continue; - } - const thinkingSignature = block.thinkingSignature; - const hasThinkingSignature = !!thinkingSignature && thinkingSignature.trim().length > 0; - if (block.thinking.trim().length === 0 && !hasThinkingSignature) - continue; - if (!hasThinkingSignature) { - blocks.push(allowEmptySignature ? { - type: "thinking", - thinking: sanitizeSurrogates(block.thinking), - signature: "" - } : { - type: "text", - text: sanitizeSurrogates(block.thinking) - }); - } else { - blocks.push({ - type: "thinking", - thinking: sanitizeSurrogates(block.thinking), - signature: thinkingSignature - }); - } - } else if (block.type === "toolCall") { - blocks.push({ - type: "tool_use", - id: block.id, - name: isOAuthToken2 ? toClaudeCodeName(block.name) : block.name, - input: block.arguments ?? {} - }); - } - } - if (blocks.length === 0) - continue; - flushPendingSystemMessages(); - const messageIndex = params.length; - params.push({ + const assistantMsg = { role: "assistant", - content: blocks - }); - if (managedProvider !== void 0 && msg.api === "anthropic-messages" && msg.provider === managedProvider && isAnthropicEffort(msg.providerThinkingLevel)) { - assistantLevels.set(messageIndex, msg.providerThinkingLevel); + content: compat.requiresAssistantAfterToolResult ? "" : null + }; + const assistantTextParts = msg.content.filter(isTextContentBlock).filter((block) => block.text.trim().length > 0).map((block) => ({ + type: "text", + text: sanitizeSurrogates(block.text) + })); + const assistantText = assistantTextParts.map((part) => part.text).join(""); + const thinkingBlocks = msg.content.filter(isThinkingContentBlock); + const toolCalls = msg.content.filter(isToolCallBlock); + const signedReasoningDetails = thinkingBlocks.map((block) => parseOpenAIReasoningDetails(block.thinkingSignature)).find((details) => details !== void 0); + const legacyReasoningDetails = toolCalls.map((toolCall) => parseLegacyEncryptedReasoningDetail(toolCall.thoughtSignature)).filter((detail) => detail !== void 0); + const preservedReasoningDetails = signedReasoningDetails ?? (legacyReasoningDetails.length > 0 ? legacyReasoningDetails : void 0); + const nonEmptyThinkingBlocks = thinkingBlocks.filter((block) => block.thinking.trim().length > 0); + if (nonEmptyThinkingBlocks.length > 0) { + if (compat.requiresThinkingAsText) { + const thinkingText = nonEmptyThinkingBlocks.map((block) => sanitizeSurrogates(block.thinking)).join("\n\n"); + assistantMsg.content = [{ type: "text", text: thinkingText }, ...assistantTextParts]; + } else { + if (assistantText.length > 0) { + assistantMsg.content = assistantText; + } + if (!preservedReasoningDetails) { + let signature = nonEmptyThinkingBlocks[0].thinkingSignature; + if (model2.provider === "opencode-go" && signature === "reasoning") { + signature = "reasoning_content"; + } + if (signature && isOpenAICompletionsReasoningField(signature)) { + assistantMsg[signature] = nonEmptyThinkingBlocks.map((block) => block.thinking).join("\n"); + } + } + } + } else if (assistantText.length > 0) { + assistantMsg.content = assistantText; } + if (toolCalls.length > 0) { + assistantMsg.tool_calls = toolCalls.map((tc) => { + const customInputProperty = options?.grammarToolInputProperties?.get(tc.name); + if (customInputProperty !== void 0) { + return { + id: tc.id, + type: "custom", + custom: { + name: tc.name, + input: sanitizeSurrogates(getGrammarToolInput(tc.name, tc.arguments, customInputProperty)) + } + }; + } + return { + id: tc.id, + type: "function", + function: { + name: tc.name, + arguments: JSON.stringify(tc.arguments) + } + }; + }); + } + if (preservedReasoningDetails) { + assistantMsg.reasoning_details = preservedReasoningDetails; + } + if (compat.requiresReasoningContentOnAssistantMessages && model2.reasoning && assistantMsg.reasoning_content === void 0) { + assistantMsg.reasoning_content = ""; + } + const content = assistantMsg.content; + const hasContent = content !== null && content !== void 0 && (typeof content === "string" ? content.length > 0 : content.length > 0); + if (!hasContent && !assistantMsg.tool_calls) { + continue; + } + params.push(assistantMsg); } else if (msg.role === "toolResult") { - const toolResults = []; - const errorImages = []; + const imageBlocks = []; let j = i; - while (j < transformedMessages.length && transformedMessages[j].role === "toolResult") { + for (; j < transformedMessages.length && transformedMessages[j].role === "toolResult"; j++) { const toolMsg = transformedMessages[j]; - const split = splitErrorToolResultImages(toolMsg); - toolResults.push(convertToolResult(toolMsg, split?.content)); - if (split) { - errorImages.push({ type: "text", text: split.caption }, ...split.images.map(convertImageBlock)); + const textResult = toolMsg.content.filter(isTextContentBlock).map((block) => block.text).join("\n"); + const hasImages = toolMsg.content.some((c) => c.type === "image"); + const hasText = textResult.trim().length > 0; + const toolResultText = hasText ? textResult : hasImages ? "(see attached image)" : "(no tool output)"; + const toolResultMsg = { + role: "tool", + content: sanitizeSurrogates(toolResultText), + tool_call_id: toolMsg.toolCallId + }; + if (compat.requiresToolResultName && toolMsg.toolName) { + toolResultMsg.name = toolMsg.toolName; + } + params.push(toolResultMsg); + if (hasImages && model2.input.includes("image")) { + for (const block of toolMsg.content) { + if (isImageContentBlock(block)) { + imageBlocks.push({ + type: "image_url", + image_url: { + url: `data:${block.mimeType};base64,${block.data}` + } + }); + } + } } - j++; } i = j - 1; - params.push({ - role: "user", - content: [...toolResults, ...errorImages] - }); - } - } - flushPendingSystemMessages(); - if (cacheControl && params.length > 0) { - const lastMessage = params[params.length - 1]; - if (lastMessage.role === "user" || lastMessage.role === "system") { - if (Array.isArray(lastMessage.content)) { - const lastBlock = lastMessage.content[lastMessage.content.length - 1]; - if (lastBlock && (lastBlock.type === "text" || lastBlock.type === "image" || lastBlock.type === "tool_result" || lastBlock.type === "tool_addition" || lastBlock.type === "tool_removal")) { - lastBlock.cache_control = cacheControl; + if (imageBlocks.length > 0) { + if (compat.requiresAssistantAfterToolResult) { + params.push({ + role: "assistant", + content: "I have processed the tool results." + }); } - } else if (typeof lastMessage.content === "string") { - lastMessage.content = [ - { - type: "text", - text: lastMessage.content, - cache_control: cacheControl - } - ]; + params.push({ + role: "user", + content: [ + { + type: "text", + text: "Attached image(s) from tool result:" + }, + ...imageBlocks + ] + }); + lastRole = "user"; + } else { + lastRole = "toolResult"; } + continue; } + lastRole = msg.role; } - return { messages: params, assistantLevels }; + return params; } -function isAnthropicEffort(value) { - return value === "low" || value === "medium" || value === "high" || value === "xhigh" || value === "max"; -} -function insertThinkingLevelMessages(converted, activeEffort) { - const messages = []; - for (let index = 0; index < converted.messages.length; index++) { - const historicalEffort = converted.assistantLevels.get(index); - if (historicalEffort !== void 0) { - messages.push({ role: "system", content: [], output_config: { effort: historicalEffort } }); +function convertTools2(tools, compat) { + return tools.map((tool) => { + const grammar = resolveGrammarConstrainedSampling(tool, compat.supportsOpenAIGrammarTools); + if (grammar) { + return { + type: "custom", + custom: { + name: tool.name, + description: tool.description, + format: { + type: "grammar", + grammar: { + syntax: grammar.format, + definition: grammar.definition + } + } + } + }; } - messages.push(converted.messages[index]); - } - messages.push({ role: "system", content: [], output_config: { effort: activeEffort } }); - return messages; -} -function shouldUseFineGrainedToolStreamingBeta(model2, context) { - return getCurrentTools(context.messages).length > 0 && !getAnthropicCompat(model2).supportsEagerToolInputStreaming; -} -function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl, disablePreferredStrictTools = false) { - if (!tools) - return []; - return tools.map((tool, index) => { - const strict = disablePreferredStrictTools && prefersJsonSchemaStrictSampling(tool) ? void 0 : resolveJsonSchemaStrictSampling(tool, supportsStrictTools, isAnthropicStrictUnsupportedKeyword); - const parameters = getJsonSchemaToolParameters(tool, strict); - const schema4 = parameters; - const legacyInputSchema = { - type: "object", - properties: schema4.properties ?? {}, - required: schema4.required ?? [] - }; - const inputSchema = strict === true ? { - ...parameters, - ...legacyInputSchema - } : legacyInputSchema; + const strict = resolveJsonSchemaStrictSampling(tool, compat.supportsStrictMode !== false); return { - name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name, - description: tool.description, - ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {}, - ...strict === true ? { strict: true } : {}, - input_schema: inputSchema, - ...cacheControl && index === tools.length - 1 ? { cache_control: cacheControl } : {} + type: "function", + function: { + name: tool.name, + description: tool.description, + parameters: getJsonSchemaToolParameters(tool, strict), + // Only include strict if provider supports it. Some reject unknown fields. + ...compat.supportsStrictMode !== false && { strict: strict ?? false } + } }; }); } -function mapStopReason2(reason, stopDetails) { +function parseChunkUsage(rawUsage, model2) { + const promptTokens = rawUsage.prompt_tokens || 0; + const cacheReadTokens = rawUsage.prompt_tokens_details?.cached_tokens ?? rawUsage.prompt_cache_hit_tokens ?? rawUsage.cached_tokens ?? 0; + const cacheWriteTokens = rawUsage.prompt_tokens_details?.cache_write_tokens || 0; + const input = Math.max(0, promptTokens - cacheReadTokens - cacheWriteTokens); + const outputTokens = rawUsage.completion_tokens || 0; + const usage = { + input, + output: outputTokens, + cacheRead: cacheReadTokens, + cacheWrite: cacheWriteTokens, + reasoning: rawUsage.completion_tokens_details?.reasoning_tokens || 0, + totalTokens: input + outputTokens + cacheReadTokens + cacheWriteTokens, + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } + }; + calculateCost(model2, usage); + if (isOpenRouterModel(model2)) { + applyOpenRouterReportedCost(usage, rawUsage); + } + return usage; +} +function mapStopReason3(reason) { + if (reason === null) + return { stopReason: "stop" }; switch (reason) { - case "end_turn": + case "stop": + case "end": return { stopReason: "stop" }; - case "max_tokens": + case "length": return { stopReason: "length" }; - case "tool_use": + case "function_call": + case "tool_calls": return { stopReason: "toolUse" }; - case "refusal": + case "content_filter": + return { stopReason: "error", errorMessage: "Provider finish_reason: content_filter" }; + case "network_error": + return { stopReason: "error", errorMessage: "Provider finish_reason: network_error" }; + default: return { stopReason: "error", - errorMessage: stopDetails?.explanation || `The model refused to complete the request` + errorMessage: `Provider finish_reason: ${reason}` }; - case "pause_turn": - return { stopReason: "stop" }; - case "stop_sequence": - return { stopReason: "stop" }; - // We don't supply stop sequences, so this should never happen - case "sensitive": - return { stopReason: "error", errorMessage: "Provider stopped with: sensitive" }; - default: - throw new Error(`Unhandled stop reason: ${reason}`); } } -var claudeCodeVersion, claudeCodeTools, ccToolLookup, toClaudeCodeName, fromClaudeCodeName, FINE_GRAINED_TOOL_STREAMING_BETA, INTERLEAVED_THINKING_BETA, SERVER_SIDE_FALLBACK_BETA, MID_CONVERSATION_OUTPUT_CONFIG_BETA, THINKING_BINDING_CONTROLS_BETA, INLINE_TOOLS_BETA, DEFERRED_TOOL_PLACEHOLDER, PiAnthropic, federationClient, ANTHROPIC_MESSAGE_EVENTS, stream3, streamSimple2, ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS, ANTHROPIC_STRICT_STRING_FORMATS, isAnthropicStrictUnsupportedKeyword; -var init_anthropic_messages = __esm({ - "node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js"() { - init_sdk(); - init_env_api_keys(); +function detectCompat(model2) { + const provider2 = model2.provider; + const baseUrl = model2.baseUrl; + const isZai = provider2 === "zai" || provider2 === "zai-coding-cn" || baseUrl.includes("api.z.ai") || baseUrl.includes("open.bigmodel.cn"); + const isTogether = provider2 === "together" || baseUrl.includes("api.together.ai") || baseUrl.includes("api.together.xyz"); + const isMoonshot = provider2 === "moonshotai" || provider2 === "moonshotai-cn" || baseUrl.includes("api.moonshot."); + const isOpenRouter2 = provider2 === "openrouter" || baseUrl.includes("openrouter.ai"); + const isCloudflareWorkersAI = provider2 === "cloudflare-workers-ai" || baseUrl.includes("api.cloudflare.com"); + const isCloudflareAiGateway = provider2 === "cloudflare-ai-gateway" || baseUrl.includes("gateway.ai.cloudflare.com"); + const isNvidia = provider2 === "nvidia" || baseUrl.includes("integrate.api.nvidia.com"); + const isAntLing = provider2 === "ant-ling" || baseUrl.includes("api.ant-ling.com"); + const isCerebras = provider2 === "cerebras" || baseUrl.includes("cerebras.ai"); + const isDeepSeek = provider2 === "deepseek" || baseUrl.toLowerCase().includes("deepseek.com"); + const isNonStandard = isNvidia || isCerebras || provider2 === "xai" || baseUrl.includes("api.x.ai") || isTogether || baseUrl.includes("chutes.ai") || isDeepSeek || isZai || isMoonshot || provider2 === "opencode" || baseUrl.includes("opencode.ai") || isCloudflareWorkersAI || isCloudflareAiGateway || isAntLing; + const useMaxTokens = baseUrl.includes("chutes.ai") || isDeepSeek || isMoonshot || isCloudflareAiGateway || isTogether || isNvidia || isAntLing || isZai; + const isGrok = provider2 === "xai" || baseUrl.includes("api.x.ai"); + const isOpenRouterDeveloperRoleModel = isOpenRouter2 && (model2.id.startsWith("anthropic/") || model2.id.startsWith("openai/")); + const cacheControlFormat = provider2 === "openrouter" && model2.id.startsWith("anthropic/") ? "anthropic" : void 0; + return { + supportsStore: !isNonStandard, + supportsDeveloperRole: isOpenRouterDeveloperRoleModel || !isNonStandard && !isOpenRouter2, + supportsReasoningEffort: !isGrok && !isZai && !isMoonshot && !isTogether && !isCloudflareAiGateway && !isNvidia && !isAntLing, + supportsUsageInStreaming: true, + supportsFinishReason: true, + maxTokensField: useMaxTokens ? "max_tokens" : "max_completion_tokens", + requiresToolResultName: false, + requiresAssistantAfterToolResult: false, + requiresThinkingAsText: false, + requiresReasoningContentOnAssistantMessages: isDeepSeek, + thinkingFormat: isDeepSeek ? "deepseek" : isZai ? "zai" : isTogether ? "together" : isAntLing ? "ant-ling" : isOpenRouter2 ? "openrouter" : "openai", + openRouterRouting: {}, + vercelGatewayRouting: {}, + chatTemplateKwargs: {}, + chatTemplateArgs: {}, + zaiToolStream: false, + supportsThinkingTokenBudget: false, + thinkingTokenBudgetField: void 0, + // OpenAI compatibility alone does not imply strict JSON-schema tool support. + supportsStrictMode: false, + supportsOpenAIGrammarTools: false, + supportsMidConvoSystemMessages: false, + supportsMidConvoToolAdditions: false, + cacheControlFormat, + sendSessionAffinityHeaders: isOpenRouter2, + sessionAffinityFormat: isOpenRouter2 ? "openrouter" : "openai", + supportsLongCacheRetention: !(isTogether || isCloudflareWorkersAI || isCloudflareAiGateway || isNvidia || isAntLing) + }; +} +function getCompat2(model2) { + const detected = detectCompat(model2); + if (!model2.compat) + return detected; + return { + supportsStore: model2.compat.supportsStore ?? detected.supportsStore, + supportsDeveloperRole: model2.compat.supportsDeveloperRole ?? detected.supportsDeveloperRole, + supportsReasoningEffort: model2.compat.supportsReasoningEffort ?? detected.supportsReasoningEffort, + supportsUsageInStreaming: model2.compat.supportsUsageInStreaming ?? detected.supportsUsageInStreaming, + supportsFinishReason: model2.compat.supportsFinishReason ?? detected.supportsFinishReason, + maxTokensField: model2.compat.maxTokensField ?? detected.maxTokensField, + requiresToolResultName: model2.compat.requiresToolResultName ?? detected.requiresToolResultName, + requiresAssistantAfterToolResult: model2.compat.requiresAssistantAfterToolResult ?? detected.requiresAssistantAfterToolResult, + requiresThinkingAsText: model2.compat.requiresThinkingAsText ?? detected.requiresThinkingAsText, + requiresReasoningContentOnAssistantMessages: model2.compat.requiresReasoningContentOnAssistantMessages ?? detected.requiresReasoningContentOnAssistantMessages, + thinkingFormat: model2.compat.thinkingFormat ?? detected.thinkingFormat, + openRouterRouting: model2.compat.openRouterRouting ?? {}, + vercelGatewayRouting: model2.compat.vercelGatewayRouting ?? detected.vercelGatewayRouting, + chatTemplateKwargs: model2.compat.chatTemplateKwargs ?? detected.chatTemplateKwargs, + chatTemplateArgs: model2.compat.chatTemplateArgs ?? detected.chatTemplateArgs, + zaiToolStream: model2.compat.zaiToolStream ?? detected.zaiToolStream, + supportsThinkingTokenBudget: model2.compat.supportsThinkingTokenBudget ?? detected.supportsThinkingTokenBudget, + thinkingTokenBudgetField: model2.compat.thinkingTokenBudgetField ?? detected.thinkingTokenBudgetField, + supportsStrictMode: model2.compat.supportsStrictMode ?? detected.supportsStrictMode, + supportsOpenAIGrammarTools: model2.compat.supportsOpenAIGrammarTools ?? detected.supportsOpenAIGrammarTools, + supportsMidConvoSystemMessages: model2.compat.supportsMidConvoSystemMessages ?? detected.supportsMidConvoSystemMessages, + supportsMidConvoToolAdditions: model2.compat.supportsMidConvoToolAdditions ?? detected.supportsMidConvoToolAdditions, + cacheControlFormat: model2.compat.cacheControlFormat ?? detected.cacheControlFormat, + sendSessionAffinityHeaders: model2.compat.sendSessionAffinityHeaders ?? detected.sendSessionAffinityHeaders, + sessionAffinityFormat: model2.compat.sessionAffinityFormat ?? detected.sessionAffinityFormat, + supportsLongCacheRetention: model2.compat.supportsLongCacheRetention ?? detected.supportsLongCacheRetention, + vllmPriority: model2.compat.vllmPriority + }; +} +var OPENAI_COMPLETIONS_REASONING_FIELDS, stream4, streamSimple3; +var init_openai_completions = __esm({ + "node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js"() { + init_openai(); init_models(); - init_diagnostics(); + init_error_body(); init_event_stream(); - init_headers(); + init_hash(); + init_headers2(); init_identity(); - init_json_parse(); init_openrouter_cost(); init_provider_env(); init_provider_retry(); @@ -40679,68 +41699,13 @@ var init_anthropic_messages = __esm({ init_transcript(); init_constrained_sampling(); init_github_copilot_headers(); + init_openai_prompt_cache(); init_simple_options(); init_transform_messages(); - claudeCodeVersion = "2.1.280"; - claudeCodeTools = [ - "Read", - "Write", - "Edit", - "Bash", - "Grep", - "Glob", - "AskUserQuestion", - "EnterPlanMode", - "ExitPlanMode", - "KillShell", - "NotebookEdit", - "Skill", - "Task", - "TaskOutput", - "TodoWrite", - "WebFetch", - "WebSearch" - ]; - ccToolLookup = new Map(claudeCodeTools.map((t) => [t.toLowerCase(), t])); - toClaudeCodeName = (name) => ccToolLookup.get(name.toLowerCase()) ?? name; - fromClaudeCodeName = (name, tools) => { - if (tools && tools.length > 0) { - const lowerName = name.toLowerCase(); - const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName); - if (matchedTool) - return matchedTool.name; - } - return name; - }; - FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14"; - INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14"; - SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01"; - MID_CONVERSATION_OUTPUT_CONFIG_BETA = "mid-conversation-output-config-2026-07-01"; - THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"; - INLINE_TOOLS_BETA = "inline-tools-2026-09-15"; - DEFERRED_TOOL_PLACEHOLDER = { - name: "__pi_deferred_placeholder__", - description: "Reserved placeholder. Never available. Never call this.", - input_schema: { type: "object", properties: {}, required: [] }, - defer_loading: true - }; - PiAnthropic = class extends Anthropic { - _shouldResolveDefaultCredentials() { - return false; - } - }; - ANTHROPIC_MESSAGE_EVENTS = /* @__PURE__ */ new Set([ - "message_start", - "message_delta", - "message_stop", - "content_block_start", - "content_block_delta", - "content_block_stop" - ]); - stream3 = (model2, context, options) => { - const stream4 = new AssistantMessageEventStream(); - const normalizedContext = resolveTranscript(context, getAnthropicCompat(model2).supportsMidConvoSystemMessages); - const currentTools = getCurrentTools(normalizedContext.messages); + OPENAI_COMPLETIONS_REASONING_FIELDS = ["reasoning", "reasoning_content", "reasoning_text"]; + stream4 = (model2, context, options) => { + const stream5 = new AssistantMessageEventStream(); + const normalizedContext = resolveTranscript(context, getCompat2(model2).supportsMidConvoSystemMessages); (async () => { const output = { role: "assistant", @@ -40759,628 +41724,410 @@ var init_anthropic_messages = __esm({ stopReason: "pending", timestamp: Date.now() }; + let streamedReasoningDetails; + const applyStreamedReasoningDetails = (block) => { + if (streamedReasoningDetails !== void 0) { + block.thinkingSignature = JSON.stringify(streamedReasoningDetails); + } + }; try { - let client; - let isOAuth; - let usageModel = model2; - let inputTransformations; - if (options?.client) { - client = options.client; - isOAuth = false; - } else { - const apiKey = options?.apiKey; - const federation = getAnthropicFederation(model2, apiKey, options?.headers, options?.env); - if (!federation) - assertRequestAuth(model2.provider, apiKey, options?.headers); - let copilotDynamicHeaders; - if (model2.provider === "github-copilot") { - const hasImages = hasCopilotVisionInput(normalizedContext.messages); - copilotDynamicHeaders = buildCopilotDynamicHeaders({ - messages: normalizedContext.messages, - hasImages - }); - } - const cacheRetention = resolveCacheRetention2(options?.cacheRetention, options?.env); - const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; - const created = createClient2(model2, apiKey, options?.headers, options?.fetch, copilotDynamicHeaders, cacheSessionId, federation, options?.identity); - client = created.client; - isOAuth = created.isOAuthToken; + const apiKey = getClientApiKey2(model2.provider, options?.apiKey, options?.headers); + const compat = getCompat2(model2); + const grammarToolInputProperties = createGrammarToolInputProperties(getDeclaredTools(normalizedContext.messages), compat.supportsOpenAIGrammarTools); + const cacheRetention = resolveCacheRetention3(options?.cacheRetention, options?.env); + const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId; + const client = createClient3(model2, normalizedContext, apiKey, options?.headers, options?.identity, options?.fetch, cacheSessionId, compat); + let params = buildParams3(model2, normalizedContext, options, compat, cacheRetention, grammarToolInputProperties); + const nextParams = await options?.onPayload?.(params, model2); + if (nextParams !== void 0) { + params = nextParams; } const requestOptions = { ...options?.signal ? { signal: options.signal } : {}, ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {}, maxRetries: 0 }; - let disablePreferredStrictTools = false; - let response; - for (; ; ) { - options?.signal?.throwIfAborted(); - const built = buildParams2(model2, normalizedContext, isOAuth, options, disablePreferredStrictTools); - if (built.providerThinkingLevel) - output.providerThinkingLevel = built.providerThinkingLevel; - let params = built.params; - const nextParams = await options?.onPayload?.(params, model2); - if (nextParams !== void 0) { - params = { ...nextParams, stream: true }; + const { data: openaiStream, response } = await retryProviderRequest(() => client.chat.completions.create(params, requestOptions).withResponse(), { + maxRetries: options?.maxRetries, + maxRetryDelayMs: options?.maxRetryDelayMs, + signal: options?.signal + }); + await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); + stream5.push({ type: "start", partial: output }); + let textBlock = null; + let thinkingBlock = null; + let hasFinishReason = false; + const toolCallBlocksByIndex = /* @__PURE__ */ new Map(); + const toolCallBlocksById = /* @__PURE__ */ new Map(); + const toolCallStates = /* @__PURE__ */ new Map(); + const blocks = output.content; + const getContentIndex = (block) => blocks.indexOf(block); + const customInput2 = (property) => ({ + kind: "custom", + property, + buffer: { input: "", started: false, closed: false } + }); + const finishBlock = (block) => { + const contentIndex = getContentIndex(block); + if (contentIndex === -1) { + return; } - try { - response = await retryProviderRequest(() => client.beta.messages.create(params, requestOptions).asResponse(), { - maxRetries: options?.maxRetries, - maxRetryDelayMs: options?.maxRetryDelayMs, - signal: options?.signal + if (block.type === "text") { + stream5.push({ + type: "text_end", + contentIndex, + content: block.text, + partial: output }); - break; - } catch (error) { - if (options?.signal?.aborted || disablePreferredStrictTools || !built.hasPreferredStrictTools || !(error instanceof Anthropic.APIError) || error.status !== 400 || error.type !== "invalid_request_error" || !isStrictToolLimitErrorMessage(error.message)) { - throw error; + } else if (block.type === "thinking") { + applyStreamedReasoningDetails(block); + stream5.push({ + type: "thinking_end", + contentIndex, + content: block.thinking, + partial: output + }); + } else if (block.type === "toolCall") { + const input = toolCallStates.get(block).input; + toolCallStates.delete(block); + if (input.kind === "custom") { + const delta = closeGrammarToolInputJson(input.buffer, input.property, void 0); + if (delta !== void 0) { + stream5.push({ + type: "toolcall_delta", + contentIndex, + delta, + partial: output + }); + } + } else { + Object.assign(block, input.arguments.finish()); } - disablePreferredStrictTools = true; - appendAssistantMessageDiagnostic(output, { - type: "anthropic_strict_tools_fallback", - timestamp: Date.now(), - error: { message: error.message }, - details: { reason: "strict_tool_limits_exceeded" } + stream5.push({ + type: "toolcall_end", + contentIndex, + toolCall: block, + partial: output }); } + }; + const ensureTextBlock = () => { + if (!textBlock) { + textBlock = { type: "text", text: "" }; + blocks.push(textBlock); + stream5.push({ type: "text_start", contentIndex: getContentIndex(textBlock), partial: output }); + } + return textBlock; + }; + const ensureThinkingBlock = (thinkingSignature) => { + if (!thinkingBlock) { + thinkingBlock = { + type: "thinking", + thinking: "", + thinkingSignature + }; + blocks.push(thinkingBlock); + stream5.push({ type: "thinking_start", contentIndex: getContentIndex(thinkingBlock), partial: output }); + } + return thinkingBlock; + }; + const ensureToolCallBlock = (toolCall) => { + const streamIndex = typeof toolCall.index === "number" ? toolCall.index : void 0; + const name = toolCall.function?.name ?? toolCall.custom?.name ?? ""; + let block = streamIndex !== void 0 ? toolCallBlocksByIndex.get(streamIndex) : void 0; + if (!block && toolCall.id) { + block = toolCallBlocksById.get(toolCall.id); + } + if (!block) { + const customInputProperty = toolCall.custom && !toolCall.function ? grammarToolInputProperties.get(name) ?? "input" : void 0; + block = { + type: "toolCall", + id: toolCall.id || "", + name, + arguments: customInputProperty !== void 0 ? { [customInputProperty]: "" } : {} + }; + toolCallStates.set(block, { + streamIndex, + input: customInputProperty !== void 0 ? customInput2(customInputProperty) : { kind: "json", arguments: new ToolCallArgumentsStream() } + }); + if (streamIndex !== void 0) { + toolCallBlocksByIndex.set(streamIndex, block); + } + if (toolCall.id) { + toolCallBlocksById.set(toolCall.id, block); + } + blocks.push(block); + stream5.push({ + type: "toolcall_start", + contentIndex: getContentIndex(block), + partial: output + }); + } + const state2 = toolCallStates.get(block); + if (streamIndex !== void 0 && state2.streamIndex === void 0) { + state2.streamIndex = streamIndex; + toolCallBlocksByIndex.set(streamIndex, block); + } + if (toolCall.id) { + toolCallBlocksById.set(toolCall.id, block); + } + if (!block.name && name) { + block.name = name; + } + if (toolCall.custom && !toolCall.function && state2.input.kind !== "custom") { + const customInputProperty = grammarToolInputProperties.get(block.name) ?? "input"; + block.arguments = { [customInputProperty]: "" }; + state2.input = customInput2(customInputProperty); + } + return { block, state: state2 }; + }; + for await (const chunk of openaiStream) { + await options?.onProviderStreamEvent?.(chunk, model2); + if (!chunk || typeof chunk !== "object") + continue; + output.responseId ||= chunk.id; + if (typeof chunk.model === "string" && chunk.model.length > 0 && chunk.model !== model2.id) { + output.responseModel ||= chunk.model; + } + if (chunk.usage) { + output.usage = parseChunkUsage(chunk.usage, model2); + } + const choice = Array.isArray(chunk.choices) ? chunk.choices[0] : void 0; + if (!choice) + continue; + if (!chunk.usage && choice.usage) { + output.usage = parseChunkUsage(choice.usage, model2); + } + if (choice.finish_reason) { + output.rawStopReason = choice.finish_reason; + const finishReasonResult = mapStopReason3(choice.finish_reason); + output.stopReason = finishReasonResult.stopReason; + if (finishReasonResult.errorMessage) { + output.errorMessage = finishReasonResult.errorMessage; + } + hasFinishReason = true; + } + if (choice.delta) { + const reasoningFields = ["reasoning_content", "reasoning", "reasoning_text"]; + const deltaFields = choice.delta; + let foundReasoningField = null; + for (const field of reasoningFields) { + const value2 = deltaFields[field]; + if (typeof value2 === "string" && value2.length > 0) { + foundReasoningField = field; + break; + } + } + if (foundReasoningField) { + const delta = deltaFields[foundReasoningField]; + if (typeof delta === "string" && delta.length > 0) { + const thinkingSignature = model2.provider === "opencode-go" && foundReasoningField === "reasoning" ? "reasoning_content" : foundReasoningField; + const block = ensureThinkingBlock(thinkingSignature); + block.thinking += delta; + stream5.push({ + type: "thinking_delta", + contentIndex: getContentIndex(block), + delta, + partial: output + }); + } + } + const reasoningDetails = choice.delta.reasoning_details; + if (Array.isArray(reasoningDetails)) { + for (const detail of reasoningDetails) { + if (!isOpenAIReasoningDetail(detail)) + continue; + ensureThinkingBlock(""); + streamedReasoningDetails ??= []; + appendOpenAIReasoningDetail(streamedReasoningDetails, detail); + } + } + if (choice.delta.content !== null && choice.delta.content !== void 0 && choice.delta.content.length > 0) { + const block = ensureTextBlock(); + block.text += choice.delta.content; + stream5.push({ + type: "text_delta", + contentIndex: getContentIndex(block), + delta: choice.delta.content, + partial: output + }); + } + if (choice?.delta?.tool_calls) { + for (const toolCall of choice.delta.tool_calls) { + const { block, state: state2 } = ensureToolCallBlock(toolCall); + if (!block.id && toolCall.id) { + block.id = toolCall.id; + toolCallBlocksById.set(toolCall.id, block); + } + const name = toolCall.function?.name ?? toolCall.custom?.name; + if (!block.name && name) { + block.name = name; + } + let delta = ""; + const input = state2.input; + if (toolCall.function?.arguments && input.kind === "json") { + delta = toolCall.function.arguments; + block.arguments = input.arguments.append(delta); + } else if (toolCall.custom?.input && input.kind === "custom") { + delta = appendGrammarToolInputJsonDelta(input.buffer, input.property, toolCall.custom.input) ?? ""; + block.arguments = { [input.property]: input.buffer.input }; + } + stream5.push({ + type: "toolcall_delta", + contentIndex: getContentIndex(block), + delta, + partial: output + }); + } + } + } } - await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model2); - stream4.push({ type: "start", partial: output }); - const openBlocks = /* @__PURE__ */ new Map(); - const openBlock = (anthropicIndex) => { - const open = openBlocks.get(anthropicIndex); - return open === void 0 ? void 0 : { ...open, block: output.content[open.contentIndex] }; - }; - for await (const event of iterateAnthropicEvents(response, options?.signal)) { - await options?.onProviderStreamEvent?.(event, model2); - if (event.type === "message_start") { - output.responseId = event.message.id; - const transformations = event.message.input_transformations; - if (Array.isArray(transformations)) - inputTransformations = transformations; - const responseModel = event.message.model; - if (responseModel !== model2.id) - output.responseModel = responseModel; - const fallbackCost = responseModel === model2.id ? void 0 : model2.compat?.allowedFallbackModels?.find((fallback2) => fallback2.provider === model2.provider && fallback2.model === responseModel)?.cost; - usageModel = fallbackCost ? { ...model2, id: responseModel, cost: fallbackCost } : model2; - output.usage.input = event.message.usage.input_tokens || 0; - output.usage.output = event.message.usage.output_tokens || 0; - output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0; - output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0; - output.usage.cacheWrite1h = event.message.usage.cache_creation?.ephemeral_1h_input_tokens || 0; - output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; - calculateCost(usageModel, output.usage); - } else if (event.type === "content_block_start") { - if (event.content_block.type === "fallback") { - if (output.content.length > 0) { - throw new Error("Anthropic performed an unsupported mid-output model fallback"); - } - continue; - } - if (event.content_block.type === "text") { - output.content.push({ type: "text", text: event.content_block.text ?? "" }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "thinking") { - output.content.push({ - type: "thinking", - thinking: event.content_block.thinking ?? "", - thinkingSignature: event.content_block.signature ?? "" - }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "redacted_thinking") { - output.content.push({ - type: "thinking", - thinking: "[Reasoning redacted]", - thinkingSignature: event.content_block.data, - redacted: true - }); - openBlocks.set(event.index, { contentIndex: output.content.length - 1 }); - stream4.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output }); - } else if (event.content_block.type === "tool_use") { - output.content.push({ - type: "toolCall", - id: event.content_block.id, - name: isOAuth ? fromClaudeCodeName(event.content_block.name, currentTools) : event.content_block.name, - arguments: event.content_block.input ?? {} - }); - openBlocks.set(event.index, { - contentIndex: output.content.length - 1, - arguments: new ToolCallArgumentsStream() - }); - stream4.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output }); - } - } else if (event.type === "content_block_delta") { - const open = openBlock(event.index); - if (event.delta.type === "text_delta") { - if (open?.block.type === "text") { - open.block.text += event.delta.text; - stream4.push({ - type: "text_delta", - contentIndex: open.contentIndex, - delta: event.delta.text, - partial: output - }); - } - } else if (event.delta.type === "thinking_delta") { - if (open?.block.type === "thinking") { - open.block.thinking += event.delta.thinking; - stream4.push({ - type: "thinking_delta", - contentIndex: open.contentIndex, - delta: event.delta.thinking, - partial: output - }); - } - } else if (event.delta.type === "input_json_delta") { - if (open?.block.type === "toolCall" && open.arguments !== void 0) { - open.block.arguments = open.arguments.append(event.delta.partial_json); - stream4.push({ - type: "toolcall_delta", - contentIndex: open.contentIndex, - delta: event.delta.partial_json, - partial: output - }); - } - } else if (event.delta.type === "signature_delta") { - if (open?.block.type === "thinking") { - open.block.thinkingSignature = open.block.thinkingSignature || ""; - open.block.thinkingSignature += event.delta.signature; - } - } - } else if (event.type === "content_block_stop") { - const open = openBlock(event.index); - openBlocks.delete(event.index); - if (open) { - const { block, contentIndex: index } = open; - if (block.type === "text") { - stream4.push({ - type: "text_end", - contentIndex: index, - content: block.text, - partial: output - }); - } else if (block.type === "thinking") { - stream4.push({ - type: "thinking_end", - contentIndex: index, - content: block.thinking, - partial: output - }); - } else if (block.type === "toolCall" && open.arguments !== void 0) { - Object.assign(block, open.arguments.finish()); - stream4.push({ - type: "toolcall_end", - contentIndex: index, - toolCall: block, - partial: output - }); - } - } - } else if (event.type === "message_delta") { - const transformations = event.input_transformations; - if (Array.isArray(transformations)) - inputTransformations = transformations; - if (event.delta.stop_reason) { - output.rawStopReason = event.delta.stop_reason; - const stopReasonResult = mapStopReason2(event.delta.stop_reason, event.delta.stop_details); - output.stopReason = stopReasonResult.stopReason; - if (stopReasonResult.errorMessage) { - output.errorMessage = stopReasonResult.errorMessage; - } - } - if (event.usage) { - if (event.usage.input_tokens != null) { - output.usage.input = event.usage.input_tokens; - } - if (event.usage.output_tokens != null) { - output.usage.output = event.usage.output_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - output.usage.cacheRead = event.usage.cache_read_input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - output.usage.cacheWrite = event.usage.cache_creation_input_tokens; - } - const cacheCreation = event.usage.cache_creation; - if (cacheCreation?.ephemeral_1h_input_tokens != null) { - output.usage.cacheWrite1h = cacheCreation.ephemeral_1h_input_tokens; - } - const thinkingTokens = event.usage.output_tokens_details?.thinking_tokens; - if (thinkingTokens != null) { - output.usage.reasoning = thinkingTokens; - } - } - output.usage.totalTokens = output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite; - calculateCost(usageModel, output.usage); - if (isOpenRouterModel(model2) && event.usage) { - applyOpenRouterReportedCost(output.usage, event.usage); - } - } + for (const block of blocks) { + finishBlock(block); } if (options?.signal?.aborted) { throw new Error("Request was aborted"); } - if (output.stopReason === "pending") { - throw new Error("Anthropic stream ended without a stop reason"); + if (output.stopReason === "aborted") { + throw new Error("Request was aborted"); } - if (output.stopReason === "aborted" || output.stopReason === "error") { - throw new Error(output.errorMessage || "An unknown error occurred"); + if (!hasFinishReason && !compat.supportsFinishReason) { + output.stopReason = output.content.some((block) => block.type === "toolCall") ? "toolUse" : "stop"; } - if (inputTransformations && inputTransformations.length > 0) { - appendAssistantMessageDiagnostic(output, { - type: "anthropic_input_transformations", - timestamp: Date.now(), - details: { - transformations: inputTransformations.map((transformation) => ({ - type: transformation.type ?? void 0, - path: transformation.path ?? void 0, - reason: transformation.reason ?? void 0 - })) - } - }); + if (output.stopReason === "error") { + throw new Error(output.errorMessage || "Provider returned an error stop reason"); } - stream4.push({ type: "done", reason: output.stopReason, message: output }); - stream4.end(); + if (compat.supportsFinishReason && !hasFinishReason || output.stopReason === "pending") { + throw new Error("Stream ended without finish_reason"); + } + stream5.push({ type: "done", reason: output.stopReason, message: output }); + stream5.end(); } catch (error) { + for (const block of output.content) { + if (block.type === "thinking") { + applyStreamedReasoningDetails(block); + } + } output.stopReason = options?.signal?.aborted ? "aborted" : "error"; - output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error); - stream4.push({ type: "error", reason: output.stopReason, error: output }); - stream4.end(); + output.errorMessage = formatProviderError(normalizeProviderError(error)); + const rawMetadata = error?.error?.metadata?.raw; + if (rawMetadata && !output.errorMessage.includes(String(rawMetadata))) { + output.errorMessage += ` +${rawMetadata}`; + } + stream5.push({ type: "error", reason: output.stopReason, error: output }); + stream5.end(); } })(); - return stream4; + return stream5; }; - streamSimple2 = (model2, context, options) => { - if (!getAnthropicFederation(model2, options?.apiKey, options?.headers, options?.env)) { - assertRequestAuth(model2.provider, options?.apiKey, options?.headers); - } + streamSimple3 = (model2, context, options) => { + getClientApiKey2(model2.provider, options?.apiKey, options?.headers); const base = { ...buildBaseOptions(model2, context, options, options?.apiKey), toolChoice: options?.toolChoice }; - if (!options?.reasoning) { - return stream3(model2, context, { - ...base, - thinkingEnabled: false - }); - } - if (model2.compat?.forceAdaptiveThinking === true) { - const effort = mapThinkingLevelToEffort(model2, options.reasoning); - return stream3(model2, context, { - ...base, - thinkingEnabled: true, - effort - }); - } - const adjusted = adjustMaxTokensForThinking(base.maxTokens, model2.maxTokens, options.reasoning, options.thinkingBudgets); - const maxTokens = clampMaxTokensToContext(model2, context, adjusted.maxTokens); - return stream3(model2, context, { + const clampedReasoning = options?.reasoning ? clampThinkingLevel(model2, options.reasoning) : void 0; + const reasoningEffort = clampedReasoning === "off" ? void 0 : clampedReasoning; + return stream4(model2, context, { ...base, - maxTokens, - thinkingEnabled: true, - thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)) + reasoningEffort, + thinkingBudgets: options?.thinkingBudgets }); }; - ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS = /* @__PURE__ */ new Set([ - "minimum", - "maximum", - "exclusiveMinimum", - "exclusiveMaximum", - "multipleOf", - "maxItems", - "uniqueItems", - "minContains", - "maxContains", - "minProperties", - "maxProperties" - ]); - ANTHROPIC_STRICT_STRING_FORMATS = /* @__PURE__ */ new Set([ - "date-time", - "time", - "date", - "duration", - "email", - "hostname", - "uri", - "ipv4", - "ipv6", - "uuid" - ]); - isAnthropicStrictUnsupportedKeyword = (key, value) => { - if (ANTHROPIC_STRICT_UNSUPPORTED_KEYWORDS.has(key)) - return true; - if (key === "minItems") - return value !== 0 && value !== 1; - if (key === "format") - return typeof value !== "string" || !ANTHROPIC_STRICT_STRING_FORMATS.has(value); - return false; - }; } }); -// proxy-models.ts +// models.ts init_models(); -// node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js -var openAIDecisionsApi = () => ({ - classify: async (model2, context, options) => (await Promise.resolve().then(() => (init_openai_decisions(), openai_decisions_exports))).classify(model2, context, options) -}); - -// node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js -init_lazy(); -var openAIResponsesApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_responses(), openai_responses_exports))); - -// node_modules/@earendil-works/pi-ai/dist/auth/helpers.js -function envApiKeyAuth(name, envVars) { - return { - name, - login: async (interaction) => { - interaction.signal.throwIfAborted(); - const key = await interaction.prompt({ type: "secret", message: `Enter ${name}` }); - interaction.signal.throwIfAborted(); - return { type: "api_key", key }; - }, - resolve: async ({ ctx, credential, signal }) => { - signal.throwIfAborted(); - if (credential?.key) { - return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" }; - } - for (const envVar of envVars) { - const value = await ctx.env(envVar); - signal.throwIfAborted(); - if (value) - return { auth: { apiKey: value }, source: envVar }; - } - return void 0; - } - }; -} -function lazyOAuth(input) { - let promise; - const loaded = () => { - promise ??= input.load(); - return promise; - }; - return { - name: input.name, - isSubscription: input.isSubscription, - loginLabel: input.loginLabel, - login: async (interaction, options) => (await loaded()).login(interaction, options), - refresh: async (credential, signal) => (await loaded()).refresh(credential, signal), - toAuth: async (credential) => (await loaded()).toAuth(credential) - }; -} - -// node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js -var __rewriteRelativeImportExtension2 = function(path4, preserveJsx) { - if (typeof path4 === "string" && /^\.\.?\//.test(path4)) { - return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return path4; -}; -var importOAuthModule = (specifier) => { - const runtimeSpecifier = import.meta.url.endsWith(".js") ? specifier.replace(/\.ts$/, ".js") : specifier; - return import(__rewriteRelativeImportExtension2(runtimeSpecifier)); -}; -var bundledLoaders; -var loadAnthropicOAuth = async () => { - if (bundledLoaders) - return bundledLoaders.anthropic(); - return (await importOAuthModule("./anthropic.ts")).anthropicOAuth; -}; -var loadOpenAIChatGPTOAuth = async () => { - if (bundledLoaders) - return bundledLoaders.openaiChatGPT(); - return (await importOAuthModule("./openai-chatgpt.ts")).openaiChatGPTOAuth; -}; - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.js -init_models(); - -// node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json -var openai_default = { "openai-decisions": { "classifier:gpt-6-luna": { type: "classifier", id: "gpt-6-luna", name: "GPT-6 Luna", api: "openai-decisions", provider: "openai", baseUrl: "https://api.openai.com/v1", input: ["text", "image"], cost: { input: 0.1, output: 0, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 0.2, output: 0, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 922e3 } }, "openai-responses": { "chat:chat-latest": { id: "chat-latest", name: "Chat Latest", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4": { 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, compat: { supportsStrictMode: true }, type: "chat" }, "chat:gpt-4-turbo": { 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: 128e3, maxTokens: 4096, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1-mini": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4.1-nano": { 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, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-05-13": { 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: 128e3, maxTokens: 4096, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-08-06": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-2024-11-20": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-4o-mini": { 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: 128e3, maxTokens: 16384, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5": { id: "gpt-5", name: "GPT-5", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-chat-latest": { id: "gpt-5-chat-latest", name: "GPT-5 Chat Latest", api: "openai-responses", baseUrl: "https://api.openai.com/v1", provider: "openai", reasoning: false, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 128e3, maxTokens: 16384, thinkingLevelMap: { off: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-mini": { id: "gpt-5-mini", name: "GPT-5 Mini", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.25, output: 2, cacheRead: 0.025, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-nano": { id: "gpt-5-nano", name: "GPT-5 Nano", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.05, output: 0.4, cacheRead: 5e-3, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: "minimal", low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5-pro": { id: "gpt-5-pro", name: "GPT-5 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 15, output: 120, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: null, high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.1": { id: "gpt-5.1", name: "GPT-5.1", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.25, output: 10, cacheRead: 0.125, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.2": { id: "gpt-5.2", name: "GPT-5.2", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.2-pro": { id: "gpt-5.2-pro", name: "GPT-5.2 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 21, output: 168, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.3-codex": { id: "gpt-5.3-codex", name: "GPT-5.3 Codex", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.3-codex-spark": { 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, input: ["text", "image"], cost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, contextWindow: 128e3, maxTokens: 32e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4": { id: "gpt-5.4", name: "GPT-5.4", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 5, output: 22.5, cacheRead: 0.5, cacheWrite: 0 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-mini": { id: "gpt-5.4-mini", name: "GPT-5.4 mini", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-nano": { id: "gpt-5.4-nano", name: "GPT-5.4 nano", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.2, output: 1.25, cacheRead: 0.02, cacheWrite: 0 }, contextWindow: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.4-pro": { id: "gpt-5.4-pro", name: "GPT-5.4 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 30, output: 180, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 60, output: 270, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.5": { id: "gpt-5.5", name: "GPT-5.5", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 10, output: 45, cacheRead: 1, cacheWrite: 0 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsMidConvoSystemMessages: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.5-pro": { id: "gpt-5.5-pro", name: "GPT-5.5 Pro", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 30, output: 180, cacheRead: 0, cacheWrite: 0, tiers: [{ inputTokensAbove: 272e3, input: 60, output: 270, cacheRead: 0, cacheWrite: 0 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: null, medium: "medium", high: "high", xhigh: "xhigh", max: null }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-cyber": { id: "gpt-5.6-cyber", name: "GPT-5.6 Cyber", 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: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-luna": { id: "gpt-5.6-luna", name: "GPT-5.6 Luna", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25, tiers: [{ inputTokensAbove: 272e3, input: 0.4, output: 1.8, cacheRead: 0.04, cacheWrite: 0.5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-sol": { id: "gpt-5.6-sol", name: "GPT-5.6 Sol", 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, tiers: [{ inputTokensAbove: 272e3, input: 8, output: 30, cacheRead: 0.8, cacheWrite: 10 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-5.6-terra": { id: "gpt-5.6-terra", name: "GPT-5.6 Terra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 18, cacheRead: 0.4, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-astra": { id: "gpt-6-astra", name: "GPT-6 Astra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5, tiers: [{ inputTokensAbove: 272e3, input: 20, output: 75, cacheRead: 2, cacheWrite: 25 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-luna": { id: "gpt-6-luna", name: "GPT-6 Luna", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125, tiers: [{ inputTokensAbove: 272e3, input: 0.2, output: 0.75, cacheRead: 0.02, cacheWrite: 0.25 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6-sol": { id: "gpt-6-sol", name: "GPT-6 Sol", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 15, cacheRead: 0.4, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6.1-sol": { id: "gpt-6.1-sol", name: "GPT-6.1 Sol", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5, tiers: [{ inputTokensAbove: 272e3, input: 4, output: 15, cacheRead: 0.2, cacheWrite: 5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-6.1-terra": { id: "gpt-6.1-terra", name: "GPT-6.1 Terra", api: "openai-responses", provider: "openai", baseUrl: "https://api.openai.com/v1", reasoning: true, input: ["text", "image"], cost: { input: 1, output: 5, cacheRead: 0.05, cacheWrite: 1.25, tiers: [{ inputTokensAbove: 272e3, input: 2, output: 7.5, cacheRead: 0.1, cacheWrite: 2.5 }] }, contextWindow: 272e3, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsOpenAIGrammarTools: true, supportsAdditionalTools: true, supportsToolSearch: true, supportsMidConvoSystemMessages: true, supportsExplicitPromptCacheMode: true, supportsMidConvoEffort: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-daybreak-blue-latest": { 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, tiers: [{ inputTokensAbove: 272e3, input: 8, output: 30, cacheRead: 0.8, cacheWrite: 10 }] }, contextWindow: 105e4, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:gpt-daybreak-red-latest": { 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: 4e5, maxTokens: 128e3, thinkingLevelMap: { off: "none", minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { supportsStrictMode: true, supportsExplicitPromptCacheMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o1": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o1-pro": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o3": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o3-mini": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, type: "chat" }, "chat:o3-pro": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:o4-mini": { 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: 2e5, maxTokens: 1e5, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: null, max: null }, compat: { supportsStrictMode: true }, inputLimits: { maxRequestBytes: 536870912, images: { maxPerRequest: 1500, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" } } }; - -// node_modules/@earendil-works/pi-ai/dist/model-catalog.js -function flattenModelCatalog(groups, type) { - return Object.fromEntries(Object.values(groups).flatMap((models2) => Object.values(models2)).filter((model2) => model2.type === type).map((model2) => [model2.id, model2])); -} -function flattenChatModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "chat"); -} -function flattenImageModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "image"); -} -function flattenClassifierModelCatalog(_provider, groups) { - return flattenModelCatalog(groups, "classifier"); -} - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js -var OPENAI_MODELS = flattenChatModelCatalog("openai", openai_default); -var OPENAI_IMAGE_MODELS = flattenImageModelCatalog("openai", openai_default); -var OPENAI_CLASSIFIER_MODELS = flattenClassifierModelCatalog("openai", openai_default); - -// node_modules/@earendil-works/pi-ai/dist/providers/openai.js -function openaiProvider() { - return createProvider({ - id: "openai", - name: "OpenAI", - baseUrl: "https://api.openai.com/v1", - auth: { - apiKey: envApiKeyAuth("OpenAI API key", ["OPENAI_API_KEY"]), - oauth: lazyOAuth({ - name: "OpenAI (ChatGPT subscription)", - isSubscription: true, - loginLabel: "Sign in with ChatGPT", - load: loadOpenAIChatGPTOAuth - }) - }, - models: [ - ...Object.values(OPENAI_MODELS), - ...Object.values(OPENAI_CLASSIFIER_MODELS) - ], - // Sign in with ChatGPT tokens only reach the Responses API; the Decisions API rejects them. - filterAllModels: (models2, credential) => credential?.type === "oauth" ? models2.filter((model2) => !isModelType(model2, "classifier")) : models2, - api: openAIResponsesApi(), - classifiers: { - "openai-decisions": openAIDecisionsApi() - } - }); -} - // node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js init_lazy(); var anthropicMessagesApi = () => lazyApi(() => Promise.resolve().then(() => (init_anthropic_messages(), anthropic_messages_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js -init_env_api_keys(); -init_models(); +// node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js +init_lazy(); +var openAIResponsesApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_responses(), openai_responses_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json -var anthropic_default = { "anthropic-messages": { "chat:claude-fable-5": { id: "claude-fable-5", name: "Claude Fable 5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true, allowedFallbackModels: [{ provider: "anthropic", model: "claude-opus-4-8", cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 } }, { provider: "anthropic", model: "claude-opus-5", cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 } }] }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-fable-5-1": { id: "claude-fable-5-1", name: "Claude Fable 5.1", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-4-5-20251001": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-haiku-5-5": { id: "claude-haiku-5-5", name: "Claude Haiku 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125, tiers: [{ inputTokensAbove: 1e5, input: 0.5, output: 2.5, cacheRead: 0.05, cacheWrite: 0.625 }] }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-5-20251101": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-6": { id: "claude-opus-4-6", name: "Claude Opus 4.6", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-7": { id: "claude-opus-4-7", name: "Claude Opus 4.7", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-4-8": { id: "claude-opus-4-8", name: "Claude Opus 4.8", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-5": { id: "claude-opus-5", name: "Claude Opus 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-opus-5-5": { id: "claude-opus-5-5", name: "Claude Opus 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-5": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-5-20250929": { 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: 2e5, maxTokens: 64e3, compat: { supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 100, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-4-6": { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6", 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: 1e6, maxTokens: 128e3, thinkingLevelMap: { max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-5": { id: "claude-sonnet-5", name: "Claude Sonnet 5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" }, "chat:claude-sonnet-5-5": { id: "claude-sonnet-5-5", name: "Claude Sonnet 5.5", api: "anthropic-messages", provider: "anthropic", baseUrl: "https://api.anthropic.com", reasoning: true, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 }, contextWindow: 1e6, maxTokens: 128e3, thinkingLevelMap: { off: null, minimal: null, low: "low", medium: "medium", high: "high", xhigh: "xhigh", max: "max" }, compat: { forceAdaptiveThinking: true, supportsTemperature: false, supportsMidConvoEffort: true, supportsMidConvoSystemMessages: true, supportsMidConvoToolChanges: true, supportsStrictTools: true }, promptCache: { short: 300, long: 3600 }, inputLimits: { maxRequestBytes: 33554432, images: { maxPerRequest: 600, resize: { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4718592, jpegQuality: 80 } } }, type: "chat" } } }; +// node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js +init_lazy(); +var openAICompletionsApi = () => lazyApi(() => Promise.resolve().then(() => (init_openai_completions(), openai_completions_exports))); -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js -var ANTHROPIC_MODELS = flattenChatModelCatalog("anthropic", anthropic_default); -var ANTHROPIC_IMAGE_MODELS = flattenImageModelCatalog("anthropic", anthropic_default); -var ANTHROPIC_CLASSIFIER_MODELS = flattenClassifierModelCatalog("anthropic", anthropic_default); - -// node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js -function anthropicApiKeyAuth() { +// models.ts +var CONFIG = "/etc/sausage/config.yaml"; +var adapters = { + "anthropic-messages": anthropicMessagesApi, + "openai-responses": openAIResponsesApi, + "openai-chat-completions": openAICompletionsApi +}; +function resolveModel(provider2, settings, entry2, catalog2) { + const override2 = typeof entry2 === "string" ? { id: entry2 } : entry2; + const id = override2.id; + const known = catalog2[settings.catalog ?? provider2]?.models?.[id]; + const metadata = { + context_window: known?.limit?.context, + max_tokens: known?.limit?.output, + reasoning: known?.reasoning, + cost: known?.cost, + ...override2 + }; + const cost = { ...known?.cost, ...override2.cost }; + const missing = ["context_window", "max_tokens", "reasoning"].filter((key) => metadata[key] === void 0); + for (const key of ["input", "output", "cache_read", "cache_write"]) if (cost[key] === void 0) missing.push(`cost.${key}`); + if (missing.length) throw new Error(`${CONFIG}: ${provider2}/${id} lacks ${missing.join(", ")}`); + const extra = Object.keys(override2).filter((key) => !["id", "context_window", "max_tokens", "reasoning", "cost"].includes(key)); + const extraCost = Object.keys(override2.cost ?? {}).filter((key) => !["input", "output", "cache_read", "cache_write"].includes(key)); + if (extra.length || extraCost.length) throw new Error(`${CONFIG}: invalid overrides for ${provider2}/${id}: ${[...extra, ...extraCost].join(", ")}`); return { - name: "Anthropic API key", - login: async (interaction) => { - interaction.signal.throwIfAborted(); - const key = await interaction.prompt({ type: "secret", message: "Enter Anthropic API key" }); - interaction.signal.throwIfAborted(); - return { type: "api_key", key }; - }, - resolve: async ({ ctx, credential, signal }) => { - signal.throwIfAborted(); - if (credential?.key) { - return { auth: { apiKey: credential.key }, env: credential.env, source: "stored credential" }; - } - const authToken = await ctx.env(ANTHROPIC_AUTH_TOKEN_ENV); - signal.throwIfAborted(); - if (authToken) { - return { - auth: { headers: { Authorization: `Bearer ${authToken}` } }, - source: ANTHROPIC_AUTH_TOKEN_ENV - }; - } - for (const envVar of [ANTHROPIC_OAUTH_TOKEN_ENV, ANTHROPIC_API_KEY_ENV]) { - const apiKey = await ctx.env(envVar); - signal.throwIfAborted(); - if (apiKey) - return { auth: { apiKey }, source: envVar }; - } - const federation = {}; - for (const envVar of [ - ANTHROPIC_FEDERATION_RULE_ID_ENV, - ANTHROPIC_ORGANIZATION_ID_ENV, - ANTHROPIC_IDENTITY_TOKEN_FILE_ENV - ]) { - const value = await ctx.env(envVar); - signal.throwIfAborted(); - if (!value) - return void 0; - federation[envVar] = value; - } - for (const envVar of [ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_WORKSPACE_ID_ENV]) { - const value = await ctx.env(envVar); - signal.throwIfAborted(); - if (value) - federation[envVar] = value; - } - return { auth: {}, env: federation, source: "workload identity federation" }; - } + id, + name: known?.name ?? id, + provider: provider2, + api: settings.type === "openai-chat-completions" ? "openai-completions" : settings.type, + baseUrl: settings.base_url, + contextWindow: metadata.context_window, + maxTokens: metadata.max_tokens, + reasoning: metadata.reasoning, + input: known?.modalities?.input?.filter((type) => ["text", "image"].includes(type)) ?? ["text"], + cost: { input: cost.input, output: cost.output, cacheRead: cost.cache_read, cacheWrite: cost.cache_write } }; } -function anthropicProvider() { - return createProvider({ - id: "anthropic", - name: "Anthropic", - baseUrl: "https://api.anthropic.com", - auth: { - apiKey: anthropicApiKeyAuth(), - oauth: lazyOAuth({ - name: "Anthropic (Claude Pro/Max)", - isSubscription: true, - load: loadAnthropicOAuth - }) - }, - models: Object.values(ANTHROPIC_MODELS), - api: anthropicMessagesApi() - }); -} - -// proxy-models.ts -async function proxyModels(proxy, readProxy2 = async () => proxy) { - const models2 = createModels(); - const base = proxy.base_url.replace(/\/$/, ""); - let catalog = []; +async function modelCatalog() { + let updated; try { - if (proxy.base_url && proxy.api_key) { - const response = await fetch(`${base}/v1/models`, { - headers: { Authorization: `Bearer ${proxy.api_key}` }, - signal: AbortSignal.timeout(5e3) - }); - if (response.ok) catalog = (await response.json()).data ?? []; - } + const response = await fetch("https://models.dev/api.json", { signal: AbortSignal.timeout(5e3) }); + if (response.ok) updated = await response.json(); } catch { } - for (const [provider2, api, path4, fallback2] of [ - [openaiProvider(), "openai-responses", "/v1/responses", "gpt-6.1-sol"], - [anthropicProvider(), "anthropic-messages", "/apis/anthropic/v1/messages", "claude-opus-5-5"] - ]) { - const rows = catalog.filter((row) => row.creator === provider2.id && row.endpoints?.some((endpoint) => endpoint.api === api)); - const entries = (rows.length ? rows : [{ id: fallback2 }]).map((row) => { - const endpoint = row.endpoints?.find((endpoint2) => endpoint2.api === api)?.path ?? path4; - const suffix = api === "anthropic-messages" ? "/v1/messages" : "/responses"; - const baseUrl = `${base}${endpoint.slice(0, -suffix.length)}`; - const price = row.providers?.[0]?.pricing; - const scale = price?.currency === "USD" ? 1e6 / price.unit_tokens : 0; - return { - id: row.id, - name: row.name ?? row.id, - provider: provider2.id, - api, - baseUrl, - reasoning: row.capabilities?.reasoning ?? true, - input: ["text"], - thinkingLevelMap: { - off: null, - minimal: null, - ...Object.fromEntries((row.capabilities?.reasoning_options?.find((option) => option.type === "effort")?.values ?? []).map((level) => [level, level])) - }, - compat: api === "anthropic-messages" ? { forceAdaptiveThinking: row.capabilities?.reasoning_options?.some((option) => option.type === "effort") ?? true } : void 0, - cost: { - input: (price?.input ?? 0) * scale, - output: (price?.output ?? 0) * scale, - cacheRead: (price?.cached_input ?? 0) * scale, - cacheWrite: (price?.cache_write ?? 0) * scale - }, - contextWindow: row.limits?.context_window ?? 2e5, - maxTokens: 4096 - }; - }); - models2.setProvider({ - ...provider2, - baseUrl: entries[0].baseUrl, - getModels: () => entries, - auth: { apiKey: { name: "Sausage proxy", resolve: async () => { - const current = await readProxy2(); - if (!current.base_url || !current.api_key) throw new Error("Set proxy.base_url and proxy.api_key in /etc/sausage/config.yaml before a model request"); - return { auth: { - apiKey: current.api_key, - baseUrl: current.base_url.replace(/\/$/, "") + entries[0].baseUrl.slice(base.length), - headers: { "Shopify-Usage-Tag": JSON.stringify(["pi", "sausage"]) } - }, source: "/etc/sausage/config.yaml" }; - } } } - }); - } - return models2; + return Deno.core.ops.op_model_catalog(updated ?? null); +} +async function configuredModels(readProviders2, catalog2) { + const models3 = createModels(); + let installed = /* @__PURE__ */ new Set(); + models3.refreshConfig = async () => { + const settings = await readProviders2(); + const next = new Set(Object.keys(settings)); + for (const name of installed) if (!next.has(name)) models3.deleteProvider(name); + for (const [name, value2] of Object.entries(settings)) { + const adapter = adapters[value2.type]; + if (!adapter) throw new Error(`${CONFIG}: unknown API type for provider ${name}: ${value2.type}`); + const entries2 = (value2.models ?? []).map((entry2) => resolveModel(name, value2, entry2, catalog2)); + models3.setProvider(createProvider({ + id: name, + name, + baseUrl: value2.base_url, + models: entries2, + api: adapter(), + auth: { apiKey: { name: `${name} API key`, resolve: async () => { + const current = (await readProviders2())[name]; + if (!current?.api_key || !current.base_url) throw new Error(`${CONFIG}: set providers.${name}.api_key and base_url before a model request`); + return { auth: { apiKey: current.api_key, baseUrl: current.base_url }, source: CONFIG }; + } } } + })); + } + installed = next; + }; + await models3.refreshConfig(); + return models3; } // node_modules/@earendil-works/pi-schema/dist/builders.js @@ -41393,11 +42140,11 @@ function num(options = {}) { function bool(options = {}) { return { type: "boolean", ...options }; } -function lit(value, options = {}) { - return { const: value, ...options }; +function lit(value2, options = {}) { + return { const: value2, ...options }; } -function union(schemas, options = {}) { - return { anyOf: schemas, ...options }; +function union(schemas2, options = {}) { + return { anyOf: schemas2, ...options }; } function arr(items, options = {}) { return { type: "array", items, ...options }; @@ -41432,26 +42179,12886 @@ function obj(properties, options = {}) { }; } +// node_modules/@earendil-works/pi-schema/dist/resolver.js +var DEFAULT_BASE = "https://json-schema.invalid/root.json"; +var Resolver = class { + draft; + rootBase; + /** Schema object to the base URI it was indexed under. */ + baseOf = /* @__PURE__ */ new Map(); + /** URI (with a `#name` fragment) of every `$dynamicAnchor`, to its schema. */ + dynamicAnchors = /* @__PURE__ */ new Map(); + root; + options; + registry = /* @__PURE__ */ new Map(); + rejectUnresolved; + /** The references that named nothing and resolved to `false` (with `unresolvedRefs: "reject"`). */ + unresolved = /* @__PURE__ */ new Set(); + resources = /* @__PURE__ */ new Map(); + anchors = /* @__PURE__ */ new Map(); + indexed = false; + constructor(root2, options) { + this.draft = options.draft === "7" ? "7" : "2020-12"; + this.root = root2; + this.options = options; + this.rejectUnresolved = options.unresolvedRefs === "reject"; + this.rootBase = isSchemaObject(root2) ? this.baseFor(root2, DEFAULT_BASE) : DEFAULT_BASE; + } + /** + * The base URI of `node`, whose parent has `base`: its `$id` changes it, unless draft 7 makes the `$id` inert. Once + * the schema is indexed, the indexed base (a resolved reference target already has its own). + */ + baseFor(node, base) { + const indexed = this.baseOf.get(node); + if (indexed !== void 0) + return indexed; + const id = node.$id; + if (typeof id !== "string") + return base; + if (this.draft === "7" && (typeof node.$ref === "string" || id.startsWith("#"))) + return base; + return documentOf(resolveUri(id, base)); + } + /** Indexes the root schema and the registered documents' URIs (once). */ + ensureIndexed() { + if (this.indexed) + return; + this.indexed = true; + for (const [uri, schema4] of Object.entries(this.options.schemas ?? {})) { + this.registry.set(documentOf(resolveUri(uri, DEFAULT_BASE)), schema4); + } + this.resources.set(DEFAULT_BASE, this.root); + this.index(this.root, DEFAULT_BASE); + } + /** + * The schema a reference names, with the base URI it compiles under. Throws if it names nothing, or, with + * `unresolvedRefs: "reject"`, resolves to `false`, the schema no value passes. + */ + resolve(ref, base) { + this.ensureIndexed(); + if (!this.rejectUnresolved) + return this.find(ref, base); + try { + return this.find(ref, base); + } catch { + this.unresolved.add(resolveUri(ref, base)); + return { node: false, base }; + } + } + /** Whether `ref`, from `base`, named nothing and resolved to `false`. */ + isUnresolved(ref, base) { + return this.unresolved.has(resolveUri(ref, base)); + } + find(ref, base) { + const uri = resolveUri(ref, base); + const doc = documentOf(uri); + const fragment = uri.length > doc.length ? decodeURIComponent(uri.slice(doc.length + 1)) : ""; + const root2 = this.resources.has(doc) ? this.resources.get(doc) : this.load(doc); + if (root2 === void 0) + throw new Error(`Unresolved $ref ${ref} (no schema registered for ${doc})`); + if (fragment === "") + return { node: root2, base: doc }; + if (fragment.startsWith("/")) + return this.pointer(root2, doc, fragment); + const target = this.anchors.get(`${doc}#${fragment}`); + if (target === void 0) + throw new Error(`Unresolved $ref ${ref} (no anchor ${fragment} in ${doc})`); + return { node: target, base: this.baseOf.get(target) ?? doc }; + } + /** Whether `node` is the root of the schema resource at `base`. */ + isResource(node, base) { + this.ensureIndexed(); + return this.resources.get(base) === node; + } + // Walks only keywords that hold subschemas: an `$id` inside `enum`, `const` or an unknown keyword names nothing. + index(node, base) { + if (!isSchemaObject(node) || this.baseOf.has(node)) + return; + let b = base; + const refOnly = this.draft === "7" && typeof node.$ref === "string"; + if (!refOnly && typeof node.$id === "string") { + if (this.draft === "7" && node.$id.startsWith("#")) + this.anchors.set(documentOf(b) + node.$id, node); + else { + const uri = resolveUri(node.$id, b); + b = documentOf(uri); + this.resources.set(b, node); + if (uri.length > b.length + 1) + this.anchors.set(uri, node); + } + } + this.baseOf.set(node, b); + if (refOnly) + return; + if (this.draft !== "7") { + if (typeof node.$anchor === "string") + this.anchors.set(`${b}#${node.$anchor}`, node); + if (typeof node.$dynamicAnchor === "string") { + this.anchors.set(`${b}#${node.$dynamicAnchor}`, node); + this.dynamicAnchors.set(`${b}#${node.$dynamicAnchor}`, node); + } + } + for (const key of SCHEMA_KEYWORDS) + this.index(node[key], b); + for (const key of MAP_KEYWORDS) { + const map3 = node[key]; + if (isSchemaObject(map3)) + for (const k of Object.keys(map3)) + this.index(map3[k], b); + } + for (const key of ARRAY_KEYWORDS) { + const list = node[key]; + if (Array.isArray(list)) + for (const s of list) + this.index(s, b); + } + } + load(doc) { + const schema4 = this.registry.get(doc); + if (schema4 === void 0) + return void 0; + this.resources.set(doc, schema4); + this.index(schema4, doc); + return schema4; + } + pointer(root2, base, fragment) { + let node = root2; + let b = base; + for (const raw of fragment.split("/").slice(1)) { + const key = raw.replace(/~1/g, "/").replace(/~0/g, "~"); + node = typeof node === "object" && node !== null && Object.hasOwn(node, key) ? node[key] : void 0; + if (node === void 0) + throw new Error(`Unresolved $ref #${fragment} in ${base}`); + if (typeof node === "object" && node !== null) + b = this.baseOf.get(node) ?? b; + } + return { node, base: b }; + } +}; +var SCHEMA_KEYWORDS = [ + "additionalProperties", + "propertyNames", + "contains", + "not", + "if", + "then", + "else", + "unevaluatedProperties", + "unevaluatedItems", + "additionalItems", + "contentSchema", + "items" +]; +var MAP_KEYWORDS = ["properties", "patternProperties", "$defs", "definitions", "dependentSchemas", "dependencies"]; +var ARRAY_KEYWORDS = ["allOf", "anyOf", "oneOf", "prefixItems", "items"]; +function isSchemaObject(value2) { + return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); +} +function resolveUri(ref, base) { + try { + return new URL(ref, base).href; + } catch { + return ref.startsWith("#") ? documentOf(base) + ref : ref; + } +} +function documentOf(uri) { + const hash = uri.indexOf("#"); + return hash < 0 ? uri : uri.slice(0, hash); +} + +// node_modules/@earendil-works/pi-schema/dist/shared.js +function sharedRegex(source) { + const hit = regexes.get(source)?.deref(); + if (hit !== void 0) + return hit; + let re; + try { + re = new RegExp(source, "u"); + } catch { + re = new RegExp(source); + } + regexes.set(source, new WeakRef(re)); + regexCleanup.register(re, source); + return re; +} +var regexes = /* @__PURE__ */ new Map(); +var regexCleanup = new FinalizationRegistry((source) => { + if (regexes.get(source)?.deref() === void 0) + regexes.delete(source); +}); + +// node_modules/@earendil-works/pi-schema/dist/coerce.js +var Coercer = class { + c; + schema; + /** + * The (schema node, value) pairs pass 2 is converting through a re-entry point, as a stack. Conversion can enter + * a node again with the same value only through a `$ref` or by wrapping a single value into an array (also for + * schemas that cycle through shared JS objects): a recursive schema that meets a value no branch accepts would + * convert it without end. A pair already on the stack (primitives by value, objects by reference) leaves the value + * unchanged. Only those two points push, so schemas without references or wraps pay nothing. + */ + entered = []; + /** How often a re-entry was cut short in this coerce() call; results computed across one are not memoized. */ + cuts = 0; + /** + * Results of `$ref` targets by (node, value) within one coerce() call: a recursive union whose branches all + * convert the same children (and all fail) would convert them once per branch, exponentially in the depth. + */ + memo = void 0; + constructor(compiler2, schema4) { + this.c = compiler2; + this.schema = schema4; + } + /** `value` coerced: a copy along the changed paths only, or `value` itself when nothing changes. */ + coerce(value2) { + const base = this.c.r.rootBase; + const withoutNulls = this.dropOptionalNulls(value2, this.schema, base); + return this.coerceTypes(this.convertOnly(withoutNulls), this.schema, base); + } + /** Pass 2 alone, as TypeBox's `Value.Convert` (the TypeBox conformance tests run it). */ + convertOnly(value2) { + try { + return this.convert(this.schema, this.c.r.rootBase, value2); + } finally { + this.memo = void 0; + this.cuts = 0; + } + } + /** `node` converted for `value` at a re-entry point: unchanged when that pair is already being converted. */ + reenter(node, base, value2, memoize) { + const entered = this.entered; + for (let i = 0; i < entered.length; i += 2) { + if (entered[i] === node && Object.is(entered[i + 1], value2)) { + this.cuts++; + return value2; + } + } + const memo = memoize ? this.memo?.get(node) : void 0; + if (memo?.has(value2)) + return memo.get(value2); + const cuts = this.cuts; + entered.push(node, value2); + let result; + try { + result = this.convert(node, base, value2); + } finally { + entered.length -= 2; + } + if (memoize && this.cuts === cuts) { + this.memo ??= /* @__PURE__ */ new Map(); + let values = this.memo.get(node); + if (values === void 0) { + values = /* @__PURE__ */ new Map(); + this.memo.set(node, values); + } + values.set(value2, result); + } + return result; + } + /** Whether `value` passes the schema `node`; undefined when `node` cannot be compiled. */ + passes(node, base, value2) { + try { + return this.c.check(node, this.baseOf(node, base))(value2); + } catch { + return void 0; + } + } + baseOf(node, base) { + return isSchemaObject(node) ? this.c.r.baseOf.get(node) ?? base : base; + } + // --------------------------------------------------------------------------------------------------------------- + // Pass 1: optional nulls + // --------------------------------------------------------------------------------------------------------------- + dropOptionalNulls(value2, schema4, base) { + if (!isSchemaObject(schema4)) + return value2; + const b = this.baseOf(schema4, base); + if (Array.isArray(value2)) { + return mapItems(value2, (item, i) => { + const itemSchema = itemSchemaAt(schema4, i); + return itemSchema === void 0 ? item : this.dropOptionalNulls(item, itemSchema, b); + }); + } + if (!isPlainObject(value2)) + return value2; + const properties = isSchemaObject(schema4.properties) ? schema4.properties : {}; + const patterns = isSchemaObject(schema4.patternProperties) ? Object.entries(schema4.patternProperties).map(([pattern, item]) => [sharedRegex(pattern), item]) : []; + const additional = isSchemaObject(schema4.additionalProperties) ? schema4.additionalProperties : void 0; + if (patterns.length === 0 && additional === void 0 && !isSchemaObject(schema4.properties)) + return value2; + const required = new Set(Array.isArray(schema4.required) ? schema4.required : []); + let out; + const set2 = (key, next) => { + if (next === (out ?? value2)[key]) + return; + out ??= { ...value2 }; + out[key] = next; + }; + for (const [key, property] of Object.entries(properties)) { + if (!Object.hasOwn(value2, key)) + continue; + const isRef = isSchemaObject(property) && typeof property.$ref === "string"; + if (value2[key] === null && !required.has(key) && !isRef && this.passes(property, b, null) === false) { + out ??= { ...value2 }; + delete out[key]; + continue; + } + set2(key, this.dropOptionalNulls(value2[key], property, b)); + } + if (patterns.length > 0 || additional !== void 0) { + for (const key of Object.keys(value2)) { + let matched = Object.hasOwn(properties, key); + for (const [pattern, item] of patterns) { + if (!pattern.test(key)) + continue; + matched = true; + set2(key, this.dropOptionalNulls((out ?? value2)[key], item, b)); + } + if (!matched && additional !== void 0) + set2(key, this.dropOptionalNulls(value2[key], additional, b)); + } + } + return out ?? value2; + } + // --------------------------------------------------------------------------------------------------------------- + // Pass 2: TypeBox's conversion rules + // --------------------------------------------------------------------------------------------------------------- + convert(node, base, value2) { + if (!isSchemaObject(node)) + return value2; + const b = this.baseOf(node, base); + if (typeof node.$ref === "string") { + let target; + try { + target = this.c.r.resolve(node.$ref, b); + } catch { + return value2; + } + return isSchemaObject(target.node) ? this.reenter(target.node, target.base, value2, true) : value2; + } + return this.convertNode(node, b, value2); + } + /** One schema node's conversion: its first keyword among `const`, `enum`, the unions, `allOf` and `type`. */ + convertNode(node, b, value2) { + if (Object.hasOwn(node, "const")) + return convertLiteral(node.const, value2); + if (Array.isArray(node.enum)) + return this.convertEnum(node, node.enum, b, value2); + if (Array.isArray(node.anyOf)) + return this.convertUnion(node, node.anyOf, b, value2); + if (Array.isArray(node.oneOf)) + return this.convertUnion(node, node.oneOf, b, value2); + if (Array.isArray(node.allOf)) { + let next = value2; + for (const member of node.allOf) + next = this.convert(member, b, next); + return this.convertMembers(node, b, next); + } + switch (node.type) { + case "string": + return orValue(tryString(value2), value2); + case "number": + return orValue(tryNumber(value2), value2); + case "integer": { + const result = tryNumber(value2); + return result === void 0 ? value2 : Math.trunc(result.value); + } + case "boolean": + return orValue(tryBoolean(value2), value2); + case "null": + return orValue(tryNull(value2), value2); + case "array": + return this.convertArray(node, b, value2); + case "object": + return this.convertObject(node, b, value2); + case void 0: + if (node.properties !== void 0 || node.patternProperties !== void 0) { + return this.convertObject(node, b, value2); + } + if (node.items !== void 0 || node.prefixItems !== void 0) + return this.convertArray(node, b, value2); + return value2; + default: + return value2; + } + } + /** An enum is a union of its values: a member stays, else the first value the input converts to. */ + convertEnum(node, values, base, value2) { + if (values.some((member) => member === value2)) + return value2; + for (const member of values) { + const candidate = convertLiteral(member, value2); + if (candidate !== value2 && this.passes(node, base, candidate) === true) + return candidate; + } + return value2; + } + /** + * A value one branch accepts stays; else the first branch's conversion that the whole union accepts. Branches are + * converted in order and only until one is accepted, so a later recursive branch is not entered needlessly. A node + * that also declares members (plain JSON Schema; TypeBox's never do) converts them into each candidate before it is + * checked, so a branch is not discarded for a sibling property that is converted after it. + */ + convertUnion(node, branches, base, value2) { + if (branches.some((branch) => this.passes(branch, base, value2) === true)) + return this.convertMembers(node, base, value2); + for (const branch of branches) { + const candidate = this.convertMembers(node, base, this.convert(branch, base, value2)); + if (this.passes(node, base, candidate) === true) + return candidate; + } + return this.convertMembers(node, base, value2); + } + /** The object members of a union or intersection node, when it declares any. */ + convertMembers(node, base, value2) { + const declares = node.properties !== void 0 || node.patternProperties !== void 0 || node.additionalProperties !== void 0; + return declares ? this.convertObject(node, base, value2) : value2; + } + convertArray(node, base, value2) { + const prefix = Array.isArray(node.items) ? node.items : Array.isArray(node.prefixItems) ? node.prefixItems : void 0; + if (prefix !== void 0) { + if (!Array.isArray(value2)) + return value2; + const rest = Array.isArray(node.items) ? void 0 : node.items; + return mapItems(value2, (item2, i) => { + const schema4 = i < prefix.length ? prefix[i] : rest; + return schema4 === void 0 ? item2 : this.convert(schema4, base, item2); + }); + } + if (Array.isArray(value2)) { + return node.items === void 0 ? value2 : mapItems(value2, (item2) => this.convert(node.items, base, item2)); + } + const item = node.items; + return [isSchemaObject(item) ? this.reenter(item, base, value2, false) : value2]; + } + convertObject(node, base, value2) { + if (!isPlainObject(value2)) + return value2; + const properties = isSchemaObject(node.properties) ? node.properties : {}; + const patterns = isSchemaObject(node.patternProperties) ? Object.entries(node.patternProperties).map(([pattern, schema4]) => [sharedRegex(pattern), schema4]) : []; + const additional = isSchemaObject(node.additionalProperties) ? node.additionalProperties : void 0; + let out; + for (const key of Object.keys(value2)) { + if (value2[key] === void 0) + continue; + let next = value2[key]; + let matched = Object.hasOwn(properties, key); + if (matched) + next = this.convert(properties[key], base, next); + for (const [pattern, schema4] of patterns) { + if (!pattern.test(key)) + continue; + matched = true; + next = this.convert(schema4, base, next); + } + if (!matched && additional !== void 0) + next = this.convert(additional, base, next); + if (next !== value2[key]) { + out ??= { ...value2 }; + out[key] = next; + } + } + return out ?? value2; + } + // --------------------------------------------------------------------------------------------------------------- + // Pass 3: primitive coercion by type + // --------------------------------------------------------------------------------------------------------------- + coerceTypes(value2, schema4, base) { + if (!isSchemaObject(schema4)) + return value2; + const b = this.baseOf(schema4, base); + let next = value2; + if (Array.isArray(schema4.allOf)) + for (const member of schema4.allOf) + next = this.coerceTypes(next, member, b); + if (Array.isArray(schema4.anyOf)) + next = this.coerceUnion(next, schema4.anyOf, b); + if (Array.isArray(schema4.oneOf)) + next = this.coerceUnion(next, schema4.oneOf, b); + const types = typesOf(schema4); + const matchesUnionMember = types.length > 1 && types.some((type) => matchesType(next, type)); + if (types.length > 0 && !matchesUnionMember) { + for (const type of types) { + const candidate = coercePrimitive(next, type); + if (candidate !== next) { + next = candidate; + break; + } + } + } + if (types.includes("object") && isPlainObject(next)) + next = this.coerceProperties(next, schema4, b); + if (types.includes("array") && Array.isArray(next)) + next = this.coerceItems(next, schema4, b); + return next; + } + coerceUnion(value2, branches, base) { + for (const branch of branches) + if (this.passes(branch, base, value2) === true) + return value2; + for (const branch of branches) { + const coerced = this.coerceTypes(value2, branch, base); + if (this.passes(branch, base, coerced) === true) + return coerced; + } + return value2; + } + coerceProperties(value2, schema4, base) { + const properties = isSchemaObject(schema4.properties) ? schema4.properties : {}; + const patterns = isSchemaObject(schema4.patternProperties) ? Object.entries(schema4.patternProperties).map(([pattern, item]) => [sharedRegex(pattern), item]) : []; + const additional = isSchemaObject(schema4.additionalProperties) ? schema4.additionalProperties : void 0; + let out; + const set2 = (key, next) => { + if (next === (out ?? value2)[key]) + return; + out ??= { ...value2 }; + out[key] = next; + }; + for (const [key, property] of Object.entries(properties)) { + if (key in value2) + set2(key, this.coerceTypes(value2[key], property, base)); + } + for (const key of Object.keys(value2)) { + let matched = Object.hasOwn(properties, key); + for (const [pattern, item] of patterns) { + if (!pattern.test(key)) + continue; + matched = true; + set2(key, this.coerceTypes((out ?? value2)[key], item, base)); + } + if (!matched && additional !== void 0) + set2(key, this.coerceTypes(value2[key], additional, base)); + } + return out ?? value2; + } + coerceItems(value2, schema4, base) { + return mapItems(value2, (item, i) => { + const itemSchema = itemSchemaAt(schema4, i); + return isSchemaObject(itemSchema) ? this.coerceTypes(item, itemSchema, base) : item; + }); + } +}; +function itemSchemaAt(schema4, index) { + if (Array.isArray(schema4.items)) + return schema4.items[index]; + if (Array.isArray(schema4.prefixItems) && index < schema4.prefixItems.length) + return schema4.prefixItems[index]; + return schema4.items; +} +function mapItems(items, map3) { + let out; + for (let i = 0; i < items.length; i++) { + const next = map3(items[i], i); + if (next === items[i]) + continue; + out ??= items.slice(); + out[i] = next; + } + return out ?? items; +} +function orValue(result, value2) { + return result === void 0 ? value2 : result.value; +} +function convertLiteral(literal, value2) { + if (literal === value2) + return value2; + const result = typeof literal === "string" ? tryString(value2) : typeof literal === "number" ? tryNumber(value2) : typeof literal === "boolean" ? tryBoolean(value2) : void 0; + return result !== void 0 && result.value === literal ? result.value : value2; +} +function tryString(value2) { + if (typeof value2 === "bigint" || typeof value2 === "boolean" || isFiniteNumber(value2)) + return { value: String(value2) }; + if (value2 === null) + return { value: "null" }; + if (typeof value2 === "string") + return { value: value2 }; + if (value2 === void 0) + return { value: "" }; + return void 0; +} +var MAX_BIGINT = BigInt(Number.MAX_SAFE_INTEGER); +var MIN_BIGINT = BigInt(Number.MIN_SAFE_INTEGER); +function tryNumber(value2) { + if (typeof value2 === "bigint") + return value2 <= MAX_BIGINT && value2 >= MIN_BIGINT ? { value: Number(value2) } : void 0; + if (typeof value2 === "boolean") + return { value: value2 ? 1 : 0 }; + if (isFiniteNumber(value2)) + return { value: value2 }; + if (value2 === null || value2 === void 0) + return { value: 0 }; + if (typeof value2 !== "string") + return void 0; + const coerced = +value2; + if (Number.isFinite(coerced)) + return { value: coerced }; + const lowercase = value2.toLowerCase(); + if (lowercase === "false") + return { value: 0 }; + if (lowercase === "true") + return { value: 1 }; + const big = bigIntOfString(value2); + return big !== void 0 && big <= MAX_BIGINT && big >= MIN_BIGINT ? { value: Number(big) } : void 0; +} +function bigIntOfString(value2) { + if (/^-?(0|[1-9]\d*)n$/.test(value2)) + return BigInt(value2.slice(0, -1)); + if (/^-?(0|[1-9]\d*)\.\d+$/.test(value2)) + return BigInt(value2.split(".")[0]); + if (/^-?(0|[1-9]\d*)$/.test(value2)) + return BigInt(value2); + return void 0; +} +function tryBoolean(value2) { + if (typeof value2 === "bigint") + return value2 === 0n ? { value: false } : value2 === 1n ? { value: true } : void 0; + if (typeof value2 === "boolean") + return { value: value2 }; + if (isFiniteNumber(value2)) + return value2 === 0 ? { value: false } : value2 === 1 ? { value: true } : void 0; + if (value2 === null || value2 === void 0) + return { value: false }; + if (typeof value2 !== "string") + return void 0; + const lowercase = value2.toLowerCase(); + if (lowercase === "false" || value2 === "0") + return { value: false }; + if (lowercase === "true" || value2 === "1") + return { value: true }; + return void 0; +} +function tryNull(value2) { + if (typeof value2 === "bigint") + return value2 === 0n ? { value: null } : void 0; + if (typeof value2 === "boolean") + return value2 === false ? { value: null } : void 0; + if (isFiniteNumber(value2)) + return value2 === 0 ? { value: null } : void 0; + if (value2 === null || value2 === void 0) + return { value: null }; + if (typeof value2 !== "string") + return void 0; + const lowercase = value2.toLowerCase(); + return lowercase === "undefined" || lowercase === "null" || value2 === "" || value2 === "0" ? { value: null } : void 0; +} +function isFiniteNumber(value2) { + return typeof value2 === "number" && Number.isFinite(value2); +} +function typesOf(schema4) { + if (typeof schema4.type === "string") + return [schema4.type]; + if (Array.isArray(schema4.type)) + return schema4.type.filter((type) => typeof type === "string"); + return []; +} +function matchesType(value2, type) { + switch (type) { + case "number": + return typeof value2 === "number"; + case "integer": + return typeof value2 === "number" && Number.isInteger(value2); + case "boolean": + return typeof value2 === "boolean"; + case "string": + return typeof value2 === "string"; + case "null": + return value2 === null; + case "array": + return Array.isArray(value2); + case "object": + return isPlainObject(value2); + default: + return false; + } +} +function coercePrimitive(value2, type) { + switch (type) { + case "number": + case "integer": { + if (value2 === null) + return 0; + if (typeof value2 === "string" && value2.trim() !== "") { + const parsed = Number(value2); + if (type === "number" ? Number.isFinite(parsed) : Number.isInteger(parsed)) + return parsed; + } + if (typeof value2 === "boolean") + return value2 ? 1 : 0; + return value2; + } + case "boolean": + if (value2 === null) + return false; + if (value2 === "true" || value2 === 1) + return true; + if (value2 === "false" || value2 === 0) + return false; + return value2; + case "string": + if (value2 === null) + return ""; + if (typeof value2 === "number" || typeof value2 === "boolean") + return String(value2); + return value2; + case "null": + return value2 === "" || value2 === 0 || value2 === false ? null : value2; + default: + return value2; + } +} +function isPlainObject(value2) { + return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/checks.js +var ALWAYS = () => true; +var NEVER = () => false; +var IS_STRING = (v) => typeof v === "string"; +var IS_NUMBER = (v) => typeof v === "number"; +var IS_INTEGER = (v) => Number.isInteger(v); +var IS_BOOLEAN = (v) => typeof v === "boolean"; +var IS_NULL = (v) => v === null; +var IS_ARRAY = (v) => Array.isArray(v); +var IS_BYTES = (v) => v instanceof Uint8Array; +var IS_OBJECT = (v) => isObject(v); +function isObject(v) { + return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Uint8Array); +} +var TYPE_CHECKS = /* @__PURE__ */ new Map([ + ["string", IS_STRING], + ["number", IS_NUMBER], + ["integer", IS_INTEGER], + ["boolean", IS_BOOLEAN], + ["null", IS_NULL], + ["array", IS_ARRAY], + ["object", IS_OBJECT], + ["bytes", IS_BYTES] +]); +var LEAF_CODES = /* @__PURE__ */ new Map([ + [IS_STRING, 1], + [IS_NUMBER, 2], + [IS_INTEGER, 3], + [IS_BOOLEAN, 4], + [IS_NULL, 5], + [ALWAYS, 6] +]); +function leafOk(code, x) { + switch (code) { + case 1: + return typeof x === "string"; + case 2: + return typeof x === "number"; + case 3: + return Number.isInteger(x); + case 4: + return typeof x === "boolean"; + case 5: + return x === null; + default: + return true; + } +} +var GUARD_NONE = 0; +var GUARD_STRICT = 1; +var GUARD_LOOSE = 2; +var CODE = 7; +var REQUIRED = 8; +var INHERITED = 16; +function and(parts) { + switch (parts.length) { + case 0: + return ALWAYS; + case 1: + return parts[0]; + case 2: { + const [a, b] = parts; + return (v) => a(v) && b(v); + } + case 3: { + const [a, b, c] = parts; + return (v) => a(v) && b(v) && c(v); + } + default: + return (v) => { + for (let i = 0; i < parts.length; i++) + if (!parts[i](v)) + return false; + return true; + }; + } +} +function indirect(slot) { + return (v) => slot.check(v); +} +function scopedCheck(scope, uri, check) { + return (v) => { + scope.push(uri); + const ok2 = check(v); + scope.pop(); + return ok2; + }; +} +function typeCheck(types) { + const checks = types.map((t) => (typeof t === "string" ? TYPE_CHECKS.get(t) : void 0) ?? NEVER); + if (checks.length === 1) + return checks[0]; + return (v) => { + for (let i = 0; i < checks.length; i++) + if (checks[i](v)) + return true; + return false; + }; +} +function bytesCheck(min, max) { + return (v) => v instanceof Uint8Array && v.length >= min && v.length <= max; +} +function codePoints(s) { + let n = 0; + for (let i = 0; i < s.length; i++, n++) { + const c = s.charCodeAt(i); + if (c >= 55296 && c <= 56319 && i + 1 < s.length) { + const next = s.charCodeAt(i + 1); + if (next >= 56320 && next <= 57343) + i++; + } + } + return n; +} +function lengthOk(s, min, max) { + const units = s.length; + if (units < min) + return false; + if (units < 2 * min && codePoints(s) < min) + return false; + return units <= max || codePoints(s) <= max; +} +function stringCheck(strict, min, max, re, format) { + if (re !== void 0 && min === 0 && max === Number.POSITIVE_INFINITY && format === void 0) { + return strict ? (v) => typeof v === "string" && re.test(v) : (v) => typeof v !== "string" || re.test(v); + } + if (re === void 0 && format === void 0) { + return strict ? (v) => typeof v === "string" && lengthOk(v, min, max) : (v) => typeof v !== "string" || lengthOk(v, min, max); + } + return (v) => { + if (typeof v !== "string") + return !strict; + return lengthOk(v, min, max) && (re === void 0 || re.test(v)) && (format === void 0 || format(v)); + }; +} +function numberCheck(mode, min, max, xmin, xmax, multipleOf) { + return (v) => { + if (typeof v !== "number") + return mode === 0; + if (mode === 2 && !Number.isInteger(v)) + return false; + return v >= min && v <= max && v > xmin && v < xmax && (multipleOf === void 0 || isMultiple(v, multipleOf)); + }; +} +function isMultiple(v, d) { + const q = v / d; + if (Number.isInteger(q)) + return true; + if (!Number.isFinite(q)) + return v % d === 0; + const [vc, ve] = decimal(v); + const [dc, de] = decimal(d); + return ve >= de ? vc * 10n ** BigInt(ve - de) % dc === 0n : vc % (dc * 10n ** BigInt(de - ve)) === 0n; +} +function decimal(x) { + const [mantissa, exponent = "0"] = Math.abs(x).toString().split("e"); + const point = mantissa.indexOf("."); + const fraction = point < 0 ? 0 : mantissa.length - point - 1; + return [BigInt(mantissa.replace(".", "")), Number(exponent) - fraction]; +} +function guardObject(inner, strict) { + return strict ? (v) => isObject(v) && inner(v) : (v) => !isObject(v) || inner(v); +} +function guardArray(inner, strict) { + return strict ? (v) => Array.isArray(v) && inner(v) : (v) => !Array.isArray(v) || inner(v); +} +function declaredObject(entries2, requiredCount, closed, guard) { + const n = entries2.length; + return (v) => { + if (guard !== GUARD_NONE && !isObject(v)) + return guard === GUARD_LOOSE; + const o = v; + let required = 0; + for (const k in o) { + let i = 0; + while (i < n && entries2[i] !== k) + i += 3; + if (i === n) { + if (closed) + return false; + continue; + } + const x = o[k]; + if (x === void 0) + continue; + const f = entries2[i + 2]; + const c = f & CODE; + if (c !== 0 ? !leafOk(c, x) : !entries2[i + 1](x)) + return false; + if (f & REQUIRED) + required++; + } + return required === requiredCount; + }; +} +function openObject(entries2, keys, extraRequired, patterns, additional, guard) { + const known = patterns.length > 0 || additional !== void 0 ? new Set(keys) : void 0; + return (v) => { + if (guard !== GUARD_NONE && !isObject(v)) + return guard === GUARD_LOOSE; + const o = v; + for (let i = 0; i < entries2.length; i += 3) { + const k = entries2[i]; + const x = o[k]; + const f = entries2[i + 2]; + if (x === void 0 || f & INHERITED && !Object.hasOwn(o, k)) { + if (f & REQUIRED) + return false; + continue; + } + const c = f & CODE; + if (c !== 0 ? !leafOk(c, x) : !entries2[i + 1](x)) + return false; + } + for (let i = 0; i < extraRequired.length; i++) + if (!Object.hasOwn(o, extraRequired[i])) + return false; + if (known === void 0) + return true; + for (const k of Object.keys(o)) { + let matched = known.has(k); + for (let i = 0; i < patterns.length; i++) { + if (patterns[i][0].test(k)) { + matched = true; + if (!patterns[i][1](o[k])) + return false; + } + } + if (!matched && additional !== void 0 && !additional(o[k])) + return false; + } + return true; + }; +} +function propertyNamesCheck(check) { + return (v) => { + for (const k in v) + if (!check(k)) + return false; + return true; + }; +} +function propertyCountCheck(min, max) { + return (v) => { + let n = 0; + for (const _ in v) + n++; + return n >= min && n <= max; + }; +} +function dependentRequiredCheck(entries2) { + return (v) => { + const o = v; + for (const [k, list] of entries2) + if (Object.hasOwn(o, k)) { + for (const r of list) + if (!Object.hasOwn(o, r)) + return false; + } + return true; + }; +} +function dependentSchemasCheck(entries2) { + return (v) => { + for (const [k, check] of entries2) + if (Object.hasOwn(v, k) && !check(v)) + return false; + return true; + }; +} +function listCheck(guard, min, max, prefix, rest) { + const n = prefix.length; + const code = rest === void 0 ? 0 : LEAF_CODES.get(rest) ?? 0; + return (v) => { + if (!Array.isArray(v)) + return guard === GUARD_LOOSE; + const length = v.length; + if (length < min || length > max) + return false; + const m = length < n ? length : n; + for (let i = 0; i < m; i++) + if (!prefix[i](v[i])) + return false; + if (rest === void 0) + return true; + if (code !== 0) { + for (let i = n; i < length; i++) + if (!leafOk(code, v[i])) + return false; + return true; + } + for (let i = n; i < length; i++) + if (!rest(v[i])) + return false; + return true; + }; +} +function itemsCheck(prefix, rest) { + return listCheck(GUARD_NONE, 0, Number.POSITIVE_INFINITY, prefix, rest); +} +function lengthCheck(min, max) { + return (v) => v.length >= min && v.length <= max; +} +function containsCheck(check, min, max) { + return (v) => { + const list = v; + let n = 0; + for (let i = 0; i < list.length; i++) + if (check(list[i]) && ++n > max) + return false; + return n >= min; + }; +} +function uniqueCheck(v) { + const list = v; + for (let i = 1; i < list.length; i++) + for (let j = 0; j < i; j++) + if (deepEqual(list[i], list[j])) + return false; + return true; +} +function enumCheck(values) { + const primitives = values.filter((x) => typeof x !== "object" || x === null); + if (primitives.length === values.length && primitives.length <= 8) { + return (v) => { + for (let i = 0; i < primitives.length; i++) + if (primitives[i] === v) + return true; + return false; + }; + } + const set2 = new Set(primitives); + const objects = values.filter((x) => typeof x === "object" && x !== null); + return (v) => set2.has(v) || typeof v === "object" && objects.some((o) => deepEqual(v, o)); +} +function constCheck(value2) { + if (typeof value2 !== "object" || value2 === null) + return (v) => v === value2; + return (v) => deepEqual(v, value2); +} +function anyCheck(checks) { + return (v) => { + for (let i = 0; i < checks.length; i++) + if (checks[i](v)) + return true; + return false; + }; +} +function oneCheck(checks) { + return (v) => { + let n = 0; + for (let i = 0; i < checks.length; i++) + if (checks[i](v) && ++n > 1) + return false; + return n === 1; + }; +} +function notCheck(check) { + return (v) => !check(v); +} +function ifCheck(cond, then, otherwise) { + return (v) => cond(v) ? then(v) : otherwise(v); +} +function taggedCheck(key, tags, checks) { + return (v) => { + if (!isObject(v)) + return false; + const tag = v[key]; + for (let i = 0; i < tags.length; i++) + if (tags[i] === tag) + return checks[i](v); + return false; + }; +} +function deepEqual(a, b) { + if (a === b) + return true; + if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) + return false; + const array = Array.isArray(a); + if (array !== Array.isArray(b)) + return false; + if (array) { + const x2 = a; + const y2 = b; + if (x2.length !== y2.length) + return false; + for (let i = 0; i < x2.length; i++) + if (!deepEqual(x2[i], y2[i])) + return false; + return true; + } + const x = a; + const y = b; + const keys = Object.keys(x); + if (keys.length !== Object.keys(y).length) + return false; + for (const k of keys) + if (!Object.hasOwn(y, k) || !deepEqual(x[k], y[k])) + return false; + return true; +} + +// node_modules/@earendil-works/pi-schema/dist/annotations.js +function newAnnotations() { + return { props: null, allProps: false, items: 0, allItems: false, indexes: null }; +} +function merge(a, b) { + if (b.props !== null) + for (const k of b.props) + addProp(a, k); + a.allProps ||= b.allProps; + if (b.items > a.items) + a.items = b.items; + a.allItems ||= b.allItems; + if (b.indexes !== null) + for (const i of b.indexes) + addIndex(a, i); +} +function addProp(a, key) { + if (a.props === null) + a.props = /* @__PURE__ */ new Set(); + a.props.add(key); +} +function addIndex(a, index) { + if (a.indexes === null) + a.indexes = /* @__PURE__ */ new Set(); + a.indexes.add(index); +} +var ANNOTATING_TRUE = () => true; +var ANNOTATING_FALSE = () => false; +function indirectAnnotating(slot) { + return (v, a) => slot.check(v, a); +} +function ignoreAnnotations(check) { + return (v) => check(v); +} +function withFreshAnnotations(check) { + return (v) => check(v, newAnnotations()); +} +function scopedAnnotating(scope, uri, check) { + return (v, a) => { + scope.push(uri); + const ok2 = check(v, a); + scope.pop(); + return ok2; + }; +} +function isolateAnnotations(check) { + return (v, a) => { + const b = newAnnotations(); + if (!check(v, b)) + return false; + merge(a, b); + return true; + }; +} +function annotateAll(plain, parts) { + return (v, a) => { + if (!plain(v)) + return false; + for (let i = 0; i < parts.length; i++) + if (!parts[i](v, a)) + return false; + return true; + }; +} +function annotateObject(props, patterns, additional) { + const declared = new Set(props.map(([k]) => k)); + return (v, a) => { + if (!isObject(v)) + return true; + const seen = []; + for (const [k, check] of props) { + if (!Object.hasOwn(v, k)) + continue; + if (!check(v[k])) + return false; + seen.push(k); + } + for (const k of Object.keys(v)) { + let matched = declared.has(k); + for (const [re, check] of patterns) { + if (re.test(k)) { + if (!check(v[k])) + return false; + matched = true; + seen.push(k); + } + } + if (!matched && additional !== void 0) { + if (!additional(v[k])) + return false; + seen.push(k); + } + } + for (const k of seen) + addProp(a, k); + return true; + }; +} +function annotateArray(prefix, rest, contains, minContains, maxContains) { + return (v, a) => { + if (!Array.isArray(v)) + return true; + const m = Math.min(v.length, prefix.length); + for (let i = 0; i < m; i++) + if (!prefix[i](v[i])) + return false; + if (rest !== void 0) { + for (let i = prefix.length; i < v.length; i++) + if (!rest(v[i])) + return false; + a.allItems = true; + } + if (m > a.items) + a.items = m; + if (contains !== void 0) { + let n = 0; + for (let i = 0; i < v.length; i++) { + if (contains(v[i])) { + n++; + addIndex(a, i); + } + } + if (n < minContains || n > maxContains) + return false; + } + return true; + }; +} +function annotateAny(branches, exactlyOne) { + return (v, a) => { + let n = 0; + for (const branch of branches) { + const b = newAnnotations(); + if (branch(v, b)) { + n++; + merge(a, b); + } + } + return exactlyOne ? n === 1 : n > 0; + }; +} +function annotateIf(cond, then, otherwise) { + return (v, a) => { + const b = newAnnotations(); + if (cond(v, b)) { + merge(a, b); + return then === void 0 || then(v, a); + } + return otherwise === void 0 || otherwise(v, a); + }; +} +function annotateDependent(key, check) { + return (v, a) => !isObject(v) || !Object.hasOwn(v, key) || check(v, a); +} +function unevaluatedProperties(check) { + return (v, a) => { + if (!isObject(v) || a.allProps) + return true; + for (const k of Object.keys(v)) + if (!(a.props?.has(k) ?? false) && !check(v[k])) + return false; + a.allProps = true; + return true; + }; +} +function unevaluatedItems(check) { + return (v, a) => { + if (!Array.isArray(v) || a.allItems) + return true; + for (let i = a.items; i < v.length; i++) + if (!(a.indexes?.has(i) ?? false) && !check(v[i])) + return false; + a.allItems = true; + return true; + }; +} + +// node_modules/@earendil-works/pi-schema/dist/compiler.js +var RESTART = /* @__PURE__ */ Symbol("restart"); +var Compiler = class { + r; + draft; + formats; + /** Whether checks track the dynamic scope (the schema has a bookended `$dynamicRef`). */ + dynamic; + schema; + scope; + cache = /* @__PURE__ */ new Map(); + annotatingCache = /* @__PURE__ */ new Map(); + constructor(schema4, options, dynamic) { + this.schema = schema4; + this.r = new Resolver(schema4, options); + this.draft = this.r.draft; + this.formats = options.formats; + this.dynamic = dynamic; + this.scope = []; + } + /** The check of the root schema. */ + root() { + return this.check(this.schema, this.r.rootBase); + } + /** The check of a schema (cached by schema object; a recursive reference goes through an indirection). */ + check(node, base) { + if (node === true) + return ALWAYS; + if (node === false) + return NEVER; + if (!isSchemaObject(node)) + throw new Error(`A schema must be an object or a boolean, got ${JSON.stringify(node)}`); + const cached = this.cache.get(node); + if (cached !== void 0) + return cached; + const bare = this.bareType(node); + if (bare !== void 0) + return bare; + const slot = { check: void 0 }; + this.cache.set(node, indirect(slot)); + const check = this.build(node, this.r.baseFor(node, base)); + slot.check = check; + this.cache.set(node, check); + return check; + } + build(node, base) { + if (this.draft === "7" && typeof node.$ref === "string") + return this.ref(node.$ref, base); + if (this.draft !== "7" && (node.unevaluatedProperties !== void 0 || node.unevaluatedItems !== void 0)) { + return withFreshAnnotations(this.annotating(node, base)); + } + const check = this.plain(node, base); + return this.dynamic && this.r.isResource(node, base) ? scopedCheck(this.scope, base, check) : check; + } + /** + * The module-level check of a schema that is only a `type` (with annotations), `ALWAYS` for one with no assertion + * at all; undefined for every other schema. These are the most common subschemas and cost nothing to share. + */ + bareType(node) { + let type; + for (const k in node) { + if (k === "type") + type = node.type; + else if (!NEUTRAL_KEYWORDS.has(k)) + return void 0; + } + if (type === void 0) + return ALWAYS; + return typeof type === "string" ? TYPE_CHECKS.get(type) : void 0; + } + /** Every keyword of `node`, not tracking annotations. */ + plain(node, base) { + const parts = []; + const types = node.type === void 0 ? void 0 : Array.isArray(node.type) ? node.type : [node.type]; + const single = types?.length === 1 ? types[0] : void 0; + let typeInGroup = false; + if (single === "bytes") { + parts.push(bytesCheck(number(node.minLength) ?? 0, number(node.maxLength) ?? Number.POSITIVE_INFINITY)); + typeInGroup = true; + } else { + const string2 = this.stringGroup(node, single === "string"); + if (string2 !== void 0) + parts.push(string2); + const numeric = single === "number" || single === "integer"; + const number2 = this.numberGroup(node, single === "number" ? 1 : single === "integer" ? 2 : 0); + if (number2 !== void 0) + parts.push(number2); + const object = this.objectGroup(node, base, single === "object"); + if (object !== void 0) + parts.push(object); + const array = this.arrayGroup(node, base, single === "array"); + if (array !== void 0) + parts.push(array); + typeInGroup = single === "string" && string2 !== void 0 || numeric && number2 !== void 0 || single === "object" && object !== void 0 || single === "array" && array !== void 0; + } + if (types !== void 0 && !typeInGroup) + parts.unshift(typeCheck(types)); + this.inPlace(node, base, parts); + return and(parts); + } + // The keywords that apply to the value itself, whatever its type. + inPlace(node, base, parts) { + if (Array.isArray(node.enum)) + parts.push(enumCheck(node.enum)); + if (Object.hasOwn(node, "const")) + parts.push(constCheck(node.const)); + if (Array.isArray(node.allOf)) + parts.push(and(node.allOf.map((s) => this.check(s, base)))); + if (Array.isArray(node.anyOf)) + parts.push(this.union(node.anyOf, base, false)); + if (Array.isArray(node.oneOf)) + parts.push(this.union(node.oneOf, base, true)); + if (node.not !== void 0) + parts.push(notCheck(this.check(node.not, base))); + if (node.if !== void 0 && (node.then !== void 0 || node.else !== void 0)) { + const then = node.then === void 0 ? ALWAYS : this.check(node.then, base); + const otherwise = node.else === void 0 ? ALWAYS : this.check(node.else, base); + parts.push(ifCheck(this.check(node.if, base), then, otherwise)); + } + if (typeof node.$ref === "string") + parts.push(this.ref(node.$ref, base)); + if (this.draft !== "7" && typeof node.$dynamicRef === "string") { + parts.push(this.dynamicRef(node.$dynamicRef, base)); + } + } + union(branches, base, exactlyOne) { + const checks = () => branches.map((s) => this.check(s, base)); + return constUnion(branches, exactlyOne) ?? this.tagged(branches, base) ?? (exactlyOne ? oneCheck(checks()) : anyCheck(checks())); + } + ref(ref, base) { + const target = this.r.resolve(ref, base); + const check = this.check(target.node, target.base); + return this.dynamic && target.base !== base ? scopedCheck(this.scope, target.base, check) : check; + } + dynamicRef(ref, base) { + const resolved = this.bookended(ref, base); + if (resolved === void 0) + return this.ref(ref, base); + const { initial, name } = resolved; + const fallback = this.check(initial.node, initial.base); + const lookup = this.dynamicLookup(name, (node, b) => this.check(node, b)); + const scope = this.scope; + return (v) => { + for (let i = 0; i < scope.length; i++) { + const check = lookup(scope[i]); + if (check !== null) + return check(v); + } + return fallback(v); + }; + } + /** The initial target and anchor name of a `$dynamicRef` that resolves dynamically, or undefined for a plain ref. */ + bookended(ref, base) { + const initial = this.r.resolve(ref, base); + const uri = resolveUri(ref, base); + const name = uri.slice(documentOf(uri).length + 1); + const anchored = isSchemaObject(initial.node) && initial.node.$dynamicAnchor === name; + if (name === "" || name.startsWith("/") || !anchored) + return void 0; + if (!this.dynamic) + throw RESTART; + return { initial, name }; + } + // Resolved at run time against the dynamic scope, so a schema with a bookended $dynamicRef keeps its compiler. + dynamicLookup(name, compile2) { + const found = /* @__PURE__ */ new Map(); + return (uri) => { + const key = `${uri}#${name}`; + let check = found.get(key); + if (check === void 0) { + const target = this.r.dynamicAnchors.get(key); + check = target === void 0 ? null : compile2(target, this.r.baseOf.get(target) ?? uri); + found.set(key, check); + } + return check; + }; + } + /** anyOf/oneOf whose branches are all objects with a distinct required const on one key: the tag picks the branch. */ + tagged(branches, base) { + if (branches.length < 2) + return void 0; + const resolved = []; + for (const branch of branches) { + if (!isSchemaObject(branch)) + return void 0; + const ref = typeof branch.$ref === "string" && Object.keys(branch).length === 1 ? branch.$ref : void 0; + const node = ref === void 0 ? branch : this.r.resolve(ref, this.r.baseFor(branch, base)).node; + if (!isSchemaObject(node)) + return void 0; + resolved.push(node); + } + const first = resolved[0].properties; + if (!isSchemaObject(first)) + return void 0; + for (const key of Object.keys(first)) { + const tags = resolved.map((s) => tagOf(s, key)); + if (tags.some((t) => t === void 0) || new Set(tags).size !== tags.length) + continue; + return taggedCheck(key, tags, branches.map((s) => this.check(s, base))); + } + return void 0; + } + stringGroup(node, strict) { + const min = number(node.minLength) ?? 0; + const max = number(node.maxLength) ?? Number.POSITIVE_INFINITY; + const re = typeof node.pattern === "string" ? sharedRegex(node.pattern) : void 0; + const format = this.formats !== void 0 && typeof node.format === "string" && Object.hasOwn(this.formats, node.format) ? this.formats[node.format] : void 0; + if (min === 0 && max === Number.POSITIVE_INFINITY && re === void 0 && format === void 0) + return void 0; + return stringCheck(strict, min, max, re, format); + } + numberGroup(node, mode) { + const min = number(node.minimum); + const max = number(node.maximum); + const xmin = number(node.exclusiveMinimum); + const xmax = number(node.exclusiveMaximum); + const multipleOf = number(node.multipleOf); + if ([min, max, xmin, xmax, multipleOf].every((x) => x === void 0)) + return void 0; + const inf = Number.POSITIVE_INFINITY; + return numberCheck(mode, min ?? -inf, max ?? inf, xmin ?? -inf, xmax ?? inf, multipleOf); + } + objectGroup(node, base, strict) { + const onlyCore = OBJECT_EXTRAS.every((k) => node[k] === void 0); + const core = this.objectCore(node, base, onlyCore ? strict ? GUARD_STRICT : GUARD_LOOSE : GUARD_NONE); + if (core !== void 0 && onlyCore) + return core; + const parts = core === void 0 ? [] : [core]; + if (node.propertyNames !== void 0) + parts.push(propertyNamesCheck(this.check(node.propertyNames, base))); + const minProperties = number(node.minProperties); + const maxProperties = number(node.maxProperties); + if (minProperties !== void 0 || maxProperties !== void 0) { + parts.push(propertyCountCheck(minProperties ?? 0, maxProperties ?? Number.POSITIVE_INFINITY)); + } + const dependentRequired = []; + const dependentSchemas = []; + if (this.draft !== "7") { + for (const [k, list] of entries(node.dependentRequired)) + if (Array.isArray(list)) + dependentRequired.push([k, list]); + for (const [k, s] of entries(node.dependentSchemas)) + dependentSchemas.push([k, this.check(s, base)]); + } + for (const [k, d] of entries(node.dependencies)) { + if (Array.isArray(d)) + dependentRequired.push([k, d]); + else + dependentSchemas.push([k, this.check(d, base)]); + } + if (dependentRequired.length > 0) + parts.push(dependentRequiredCheck(dependentRequired)); + if (dependentSchemas.length > 0) + parts.push(dependentSchemasCheck(dependentSchemas)); + if (parts.length === 0) + return strict ? IS_OBJECT : void 0; + return guardObject(and(parts), strict); + } + objectCore(node, base, guard) { + const properties = isSchemaObject(node.properties) ? node.properties : {}; + const required = Array.isArray(node.required) ? node.required.filter((k) => typeof k === "string") : []; + const patterns = isSchemaObject(node.patternProperties) ? node.patternProperties : {}; + const additional = node.additionalProperties; + const keys = Object.keys(properties); + const patternKeys = Object.keys(patterns); + if (keys.length + required.length + patternKeys.length === 0 && (additional === void 0 || additional === true)) { + return void 0; + } + const entries2 = []; + for (const k of keys) { + const check = this.check(properties[k], base); + const flags = (LEAF_CODES.get(check) ?? 0) | (required.includes(k) ? REQUIRED : 0) | (k in Object.prototype ? INHERITED : 0); + entries2.push(k, check, flags); + } + const extraRequired = required.filter((k) => !Object.hasOwn(properties, k)); + const pats = patternKeys.map((p) => [sharedRegex(p), this.check(patterns[p], base)]); + const extra = additional === void 0 || additional === true ? void 0 : this.check(additional, base); + if (pats.length === 0 && extraRequired.length === 0 && (extra === void 0 || additional === false)) { + const requiredCount = keys.filter((k) => required.includes(k)).length; + return declaredObject(entries2, requiredCount, additional === false, guard); + } + return openObject(entries2, keys, extraRequired, pats, extra, guard); + } + arrayGroup(node, base, strict) { + let prefix = []; + let rest; + if (Array.isArray(node.items)) { + prefix = node.items; + rest = node.additionalItems; + } else { + if (this.draft !== "7" && Array.isArray(node.prefixItems)) + prefix = node.prefixItems; + rest = node.items; + } + const prefixChecks = prefix.map((s) => this.check(s, base)); + const restCheck = rest === void 0 || rest === true ? void 0 : this.check(rest, base); + const minItems = number(node.minItems); + const maxItems = number(node.maxItems); + if (node.contains === void 0 && node.uniqueItems !== true && (prefixChecks.length > 0 || restCheck !== void 0)) { + const guard = strict ? GUARD_STRICT : GUARD_LOOSE; + return listCheck(guard, minItems ?? 0, maxItems ?? Number.POSITIVE_INFINITY, prefixChecks, restCheck); + } + const parts = []; + if (prefixChecks.length > 0 || restCheck !== void 0) + parts.push(itemsCheck(prefixChecks, restCheck)); + if (minItems !== void 0 || maxItems !== void 0) { + parts.push(lengthCheck(minItems ?? 0, maxItems ?? Number.POSITIVE_INFINITY)); + } + if (node.contains !== void 0) { + const min = this.draft === "7" ? 1 : number(node.minContains) ?? 1; + const max = this.draft === "7" ? Number.POSITIVE_INFINITY : number(node.maxContains) ?? Number.POSITIVE_INFINITY; + parts.push(containsCheck(this.check(node.contains, base), min, max)); + } + if (node.uniqueItems === true) + parts.push(uniqueCheck); + if (parts.length === 0) + return strict ? IS_ARRAY : void 0; + return guardArray(and(parts), strict); + } + /** The annotating check of a schema evaluated in place (only below `unevaluatedProperties`/`unevaluatedItems`). */ + annotating(node, base) { + if (node === true) + return ANNOTATING_TRUE; + if (node === false) + return ANNOTATING_FALSE; + if (!isSchemaObject(node)) + throw new Error(`A schema must be an object or a boolean, got ${JSON.stringify(node)}`); + const cached = this.annotatingCache.get(node); + if (cached !== void 0) + return cached; + const slot = { check: void 0 }; + this.annotatingCache.set(node, indirectAnnotating(slot)); + const check = this.buildAnnotating(node, this.r.baseFor(node, base)); + slot.check = check; + this.annotatingCache.set(node, check); + return check; + } + buildAnnotating(node, base) { + const rest = {}; + let annotates = false; + for (const k of Object.keys(node)) { + if (ANNOTATING.has(k)) + annotates = true; + else + rest[k] = node[k]; + } + const plain = this.plain(rest, base); + const parts = []; + if (annotates) + this.annotatingParts(node, base, parts); + const all = parts.length === 0 ? ignoreAnnotations(plain) : annotateAll(plain, parts); + const own = node.unevaluatedProperties !== void 0 || node.unevaluatedItems !== void 0 ? isolateAnnotations(all) : all; + return this.dynamic && this.r.isResource(node, base) ? scopedAnnotating(this.scope, base, own) : own; + } + annotatingParts(node, base, parts) { + if (node.properties !== void 0 || node.patternProperties !== void 0 || node.additionalProperties !== void 0) { + const props = entries(node.properties).map(([k, s]) => [k, this.check(s, base)]); + const pats = entries(node.patternProperties).map(([p, s]) => [sharedRegex(p), this.check(s, base)]); + const extra = node.additionalProperties === void 0 ? void 0 : this.check(node.additionalProperties, base); + parts.push(annotateObject(props, pats, extra)); + } + if (node.prefixItems !== void 0 || node.items !== void 0 || node.contains !== void 0) { + const prefix = Array.isArray(node.prefixItems) ? node.prefixItems : Array.isArray(node.items) ? node.items : []; + const rest = Array.isArray(node.items) ? node.additionalItems : node.items; + parts.push(annotateArray(prefix.map((s) => this.check(s, base)), rest === void 0 ? void 0 : this.check(rest, base), node.contains === void 0 ? void 0 : this.check(node.contains, base), number(node.minContains) ?? 1, number(node.maxContains) ?? Number.POSITIVE_INFINITY)); + } + if (Array.isArray(node.allOf)) + for (const s of node.allOf) + parts.push(this.annotating(s, base)); + if (Array.isArray(node.anyOf)) + parts.push(annotateAny(node.anyOf.map((s) => this.annotating(s, base)), false)); + if (Array.isArray(node.oneOf)) + parts.push(annotateAny(node.oneOf.map((s) => this.annotating(s, base)), true)); + if (node.if !== void 0) { + const then = node.then === void 0 ? void 0 : this.annotating(node.then, base); + const otherwise = node.else === void 0 ? void 0 : this.annotating(node.else, base); + parts.push(annotateIf(this.annotating(node.if, base), then, otherwise)); + } + if (typeof node.$ref === "string") + parts.push(this.annotatingRef(node.$ref, base)); + if (typeof node.$dynamicRef === "string") + parts.push(this.annotatingDynamicRef(node.$dynamicRef, base)); + for (const [k, s] of entries(node.dependentSchemas)) + parts.push(annotateDependent(k, this.annotating(s, base))); + if (node.unevaluatedProperties !== void 0) { + parts.push(unevaluatedProperties(this.check(node.unevaluatedProperties, base))); + } + if (node.unevaluatedItems !== void 0) + parts.push(unevaluatedItems(this.check(node.unevaluatedItems, base))); + } + annotatingRef(ref, base) { + const target = this.r.resolve(ref, base); + const check = this.annotating(target.node, target.base); + return this.dynamic && target.base !== base ? scopedAnnotating(this.scope, target.base, check) : check; + } + annotatingDynamicRef(ref, base) { + const resolved = this.bookended(ref, base); + if (resolved === void 0) + return this.annotatingRef(ref, base); + const { initial, name } = resolved; + const fallback = this.annotating(initial.node, initial.base); + const lookup = this.dynamicLookup(name, (node, b) => this.annotating(node, b)); + const scope = this.scope; + return (v, a) => { + for (let i = 0; i < scope.length; i++) { + const check = lookup(scope[i]); + if (check !== null) + return check(v, a); + } + return fallback(v, a); + }; + } +}; +var NEUTRAL_KEYWORDS = /* @__PURE__ */ new Set([ + "$schema", + "$comment", + "title", + "description", + "default", + "examples", + "deprecated", + "readOnly", + "writeOnly", + "$defs", + "definitions", + "contentEncoding", + "contentMediaType", + "minContains", + "maxContains", + "$vocabulary" +]); +var OBJECT_EXTRAS = [ + "propertyNames", + "minProperties", + "maxProperties", + "dependentRequired", + "dependentSchemas", + "dependencies" +]; +var ANNOTATING = /* @__PURE__ */ new Set([ + "properties", + "patternProperties", + "additionalProperties", + "prefixItems", + "items", + "additionalItems", + "contains", + "minContains", + "maxContains", + "allOf", + "anyOf", + "oneOf", + "if", + "then", + "else", + "$ref", + "$dynamicRef", + "dependentSchemas", + "unevaluatedProperties", + "unevaluatedItems" +]); +function constUnion(branches, exactlyOne) { + const values = []; + for (const branch of branches) { + if (!isSchemaObject(branch) || !Object.hasOwn(branch, "const")) + return void 0; + for (const k of Object.keys(branch)) + if (k !== "const" && !NEUTRAL_KEYWORDS.has(k)) + return void 0; + if (typeof branch.const === "object" && branch.const !== null) + return void 0; + if (exactlyOne && values.includes(branch.const)) + return void 0; + values.push(branch.const); + } + return enumCheck(values); +} +function tagOf(branch, key) { + const properties = branch.properties; + if (branch.type !== "object" || !Array.isArray(branch.required) || !branch.required.includes(key)) + return void 0; + const tag = isSchemaObject(properties) ? properties[key] : void 0; + if (!isSchemaObject(tag) || !Object.hasOwn(tag, "const")) + return void 0; + return typeof tag.const === "object" && tag.const !== null ? void 0 : tag.const; +} +function number(value2) { + return typeof value2 === "number" ? value2 : void 0; +} +function entries(value2) { + return isSchemaObject(value2) ? Object.entries(value2) : []; +} + +// node_modules/@earendil-works/pi-schema/dist/explain.js +var Explainer = class { + c; + schema; + /** + * The errors of `$ref` targets for object values, within one errors() call: a recursive union explains each branch + * to pick the one to blame, and every branch would explain the same children again, exponentially in the depth. + */ + memo = void 0; + constructor(compiler2, schema4) { + this.c = compiler2; + this.schema = schema4; + compiler2.root(); + } + /** The errors of `value`, at least one (`value` failed the check). */ + errors(value2) { + const out = []; + try { + this.walk(this.schema, this.c.r.rootBase, value2, "", out); + } finally { + this.memo = void 0; + } + if (out.length === 0) + out.push({ path: "", keyword: "schema", message: "invalid" }); + return out; + } + ok(node, base, v) { + return this.c.check(node, base)(v); + } + // For $dynamicRef schemas this check runs outside the original dynamic scope, so their errors are approximate. + walk(node, base, v, path5, out) { + if (node === true) + return; + if (node === false) { + out.push({ path: path5, keyword: "false", message: "no value is allowed here" }); + return; + } + if (!isSchemaObject(node)) + return; + const b = this.c.r.baseFor(node, base); + if (this.ok(node, b, v)) + return; + const start = out.length; + const push = (keyword, message, at = path5) => { + out.push({ path: at, keyword, message }); + }; + if (this.c.draft === "7" && typeof node.$ref === "string") { + this.walkRef(node.$ref, b, v, path5, out); + return; + } + if (node.type !== void 0) { + const types = Array.isArray(node.type) ? node.type : [node.type]; + const checks = types.map((t) => (typeof t === "string" ? TYPE_CHECKS.get(t) : void 0) ?? NEVER); + if (!checks.some((check) => check(v))) { + push("type", `expected ${types.join(" or ")}, got ${typeName(v)}`); + return; + } + } + if (Array.isArray(node.enum) && !enumCheck(node.enum)(v)) + push("enum", `expected one of ${listValues(node.enum)}`); + if (Object.hasOwn(node, "const") && !constCheck(node.const)(v)) + push("const", `expected ${JSON.stringify(node.const)}`); + if (typeof v === "string" && node.type !== "bytes") + this.walkString(node, v, push); + if (v instanceof Uint8Array && node.type === "bytes") + this.walkBytes(node, v, push); + if (typeof v === "number") + this.walkNumber(node, v, push); + if (isObject(v)) + this.walkObject(node, b, v, path5, out, push); + if (Array.isArray(v)) + this.walkArray(node, b, v, path5, out, push); + if (Array.isArray(node.allOf)) + for (const s of node.allOf) + this.walk(s, b, v, path5, out); + if (Array.isArray(node.anyOf)) + this.walkUnion(node.anyOf, b, v, path5, out, false); + if (Array.isArray(node.oneOf)) + this.walkUnion(node.oneOf, b, v, path5, out, true); + if (node.not !== void 0 && this.ok(node.not, b, v)) + push("not", "must not match the schema in not"); + if (node.if !== void 0) { + const branch = this.ok(node.if, b, v) ? node.then : node.else; + if (branch !== void 0) + this.walk(branch, b, v, path5, out); + } + if (typeof node.$ref === "string") + this.walkRef(node.$ref, b, v, path5, out); + if (out.length === start && (node.unevaluatedProperties !== void 0 || node.unevaluatedItems !== void 0)) { + this.walkUnevaluated(node, b, v, path5, out); + } + if (out.length === start && typeof node.$dynamicRef === "string") { + push("$dynamicRef", "does not match the dynamically referenced schema"); + } + } + walkRef(ref, base, v, path5, out) { + const target = this.c.r.resolve(ref, base); + if (target.node === false && this.c.r.isUnresolved(ref, base)) { + out.push({ path: path5, keyword: "$ref", message: `unresolved reference ${ref}` }); + return; + } + if (!isSchemaObject(target.node) || typeof v !== "object" || v === null) { + this.walk(target.node, target.base, v, path5, out); + return; + } + this.memo ??= /* @__PURE__ */ new Map(); + let values = this.memo.get(target.node); + const known = values?.get(v); + if (known !== void 0 && known.path === path5) { + out.push(...known.errors); + return; + } + const errors = []; + this.walk(target.node, target.base, v, path5, errors); + if (values === void 0) { + values = /* @__PURE__ */ new Map(); + this.memo.set(target.node, values); + } + values.set(v, { path: path5, errors }); + out.push(...errors); + } + walkString(node, v, push) { + const n = codePoints(v); + if (typeof node.minLength === "number" && n < node.minLength) { + push("minLength", `expected at least ${node.minLength} characters`); + } + if (typeof node.maxLength === "number" && n > node.maxLength) { + push("maxLength", `expected at most ${node.maxLength} characters`); + } + if (typeof node.pattern === "string" && !sharedRegex(node.pattern).test(v)) { + push("pattern", `expected to match ${node.pattern}`); + } + const formats2 = this.c.formats; + const format = formats2 !== void 0 && typeof node.format === "string" && Object.hasOwn(formats2, node.format) ? formats2[node.format] : void 0; + if (format !== void 0 && !format(v)) + push("format", `expected format ${node.format}`); + } + walkBytes(node, v, push) { + if (typeof node.minLength === "number" && v.length < node.minLength) { + push("minLength", `expected at least ${node.minLength} bytes`); + } + if (typeof node.maxLength === "number" && v.length > node.maxLength) { + push("maxLength", `expected at most ${node.maxLength} bytes`); + } + } + walkNumber(node, v, push) { + if (typeof node.minimum === "number" && v < node.minimum) + push("minimum", `expected >= ${node.minimum}`); + if (typeof node.maximum === "number" && v > node.maximum) + push("maximum", `expected <= ${node.maximum}`); + if (typeof node.exclusiveMinimum === "number" && v <= node.exclusiveMinimum) { + push("exclusiveMinimum", `expected > ${node.exclusiveMinimum}`); + } + if (typeof node.exclusiveMaximum === "number" && v >= node.exclusiveMaximum) { + push("exclusiveMaximum", `expected < ${node.exclusiveMaximum}`); + } + if (typeof node.multipleOf === "number" && !isMultiple(v, node.multipleOf)) { + push("multipleOf", `expected a multiple of ${node.multipleOf}`); + } + } + walkObject(node, b, v, path5, out, push) { + const properties = isSchemaObject(node.properties) ? node.properties : {}; + const required = Array.isArray(node.required) ? node.required : []; + for (const k of required) { + if (typeof k === "string" && (!Object.hasOwn(v, k) || v[k] === void 0)) + push("required", "missing", pointer(path5, k)); + } + for (const k of Object.keys(properties)) { + if (Object.hasOwn(v, k) && v[k] !== void 0) + this.walk(properties[k], b, v[k], pointer(path5, k), out); + } + const patterns = isSchemaObject(node.patternProperties) ? Object.entries(node.patternProperties) : []; + for (const k of Object.keys(v)) { + let matched = Object.hasOwn(properties, k); + for (const [p, s] of patterns) { + if (sharedRegex(p).test(k)) { + matched = true; + this.walk(s, b, v[k], pointer(path5, k), out); + } + } + if (!matched && node.additionalProperties !== void 0) { + if (node.additionalProperties === false) + push("additionalProperties", "unknown field", pointer(path5, k)); + else + this.walk(node.additionalProperties, b, v[k], pointer(path5, k), out); + } + if (node.propertyNames !== void 0 && !this.ok(node.propertyNames, b, k)) { + push("propertyNames", "invalid property name", pointer(path5, k)); + } + } + const count = Object.keys(v).length; + if (typeof node.minProperties === "number" && count < node.minProperties) { + push("minProperties", `expected at least ${node.minProperties} properties`); + } + if (typeof node.maxProperties === "number" && count > node.maxProperties) { + push("maxProperties", `expected at most ${node.maxProperties} properties`); + } + const dependencies = { + ...this.c.draft === "7" || !isSchemaObject(node.dependentRequired) ? {} : node.dependentRequired, + ...isSchemaObject(node.dependencies) ? node.dependencies : {} + }; + for (const [k, d] of Object.entries(dependencies)) { + if (!Object.hasOwn(v, k)) + continue; + if (!Array.isArray(d)) + this.walk(d, b, v, path5, out); + else + for (const r of d) + if (!Object.hasOwn(v, r)) + push("dependentRequired", `required when ${k} is present`, pointer(path5, r)); + } + if (this.c.draft !== "7" && isSchemaObject(node.dependentSchemas)) { + for (const [k, s] of Object.entries(node.dependentSchemas)) + if (Object.hasOwn(v, k)) + this.walk(s, b, v, path5, out); + } + } + walkArray(node, b, v, path5, out, push) { + let prefix = []; + let rest; + if (Array.isArray(node.items)) { + prefix = node.items; + rest = node.additionalItems; + } else { + if (this.c.draft !== "7" && Array.isArray(node.prefixItems)) + prefix = node.prefixItems; + rest = node.items; + } + for (let i = 0; i < v.length; i++) { + const s = i < prefix.length ? prefix[i] : rest; + if (s !== void 0) + this.walk(s, b, v[i], `${path5}/${i}`, out); + } + if (typeof node.minItems === "number" && v.length < node.minItems) { + push("minItems", `expected at least ${node.minItems} items`); + } + if (typeof node.maxItems === "number" && v.length > node.maxItems) { + push("maxItems", `expected at most ${node.maxItems} items`); + } + if (node.uniqueItems === true && !uniqueCheck(v)) + push("uniqueItems", "expected unique items"); + if (node.contains !== void 0) { + const draft7 = this.c.draft === "7"; + const min = draft7 || typeof node.minContains !== "number" ? 1 : node.minContains; + const max = draft7 || typeof node.maxContains !== "number" ? Number.POSITIVE_INFINITY : node.maxContains; + if (!containsCheck(this.c.check(node.contains, b), min, max)(v)) { + push("contains", containsMessage(min, max)); + } + } + } + walkUnion(branches, b, v, path5, out, exactlyOne) { + const matches = branches.filter((s) => this.ok(s, b, v)).length; + if (matches === 1 || !exactlyOne && matches > 0) + return; + const keyword = exactlyOne ? "oneOf" : "anyOf"; + if (matches > 1) { + out.push({ path: path5, keyword, message: "matches more than one alternative" }); + return; + } + const tag = this.tagOf(branches, b); + if (tag !== void 0 && isObject(v)) { + const i = tag.values.indexOf(v[tag.key]); + if (i < 0) + out.push({ + path: pointer(path5, tag.key), + keyword, + message: `expected one of ${listValues(tag.values)}` + }); + else + this.walk(branches[i], b, v, path5, out); + return; + } + let best; + for (const s of branches) { + const errors = []; + this.walk(s, b, v, path5, errors); + if (errors.length === 0) + continue; + const declared = isObject(v) ? this.declaredKeys(s, b, v) : 0; + const better = best === void 0 || declared > best.declared || declared === best.declared && errors[0].path.length > best.errors[0].path.length; + if (better) + best = { errors, declared }; + } + out.push(...best?.errors ?? [{ path: path5, keyword, message: "matches no alternative" }]); + } + /** How many of the keys of `v` the branch `s` (through a `$ref`) declares in `properties`. */ + declaredKeys(s, b, v) { + const node = isSchemaObject(s) && typeof s.$ref === "string" ? this.c.r.resolve(s.$ref, b).node : s; + const properties = isSchemaObject(node) && isSchemaObject(node.properties) ? node.properties : {}; + return Object.keys(v).filter((k) => Object.hasOwn(properties, k)).length; + } + tagOf(branches, b) { + const resolved = branches.map((s) => isSchemaObject(s) && typeof s.$ref === "string" ? this.c.r.resolve(s.$ref, b).node : s); + const first = resolved[0]; + if (!isSchemaObject(first) || !isSchemaObject(first.properties)) + return void 0; + for (const key of Object.keys(first.properties)) { + const values = resolved.map((s) => { + const tag = isSchemaObject(s) && isSchemaObject(s.properties) ? s.properties[key] : void 0; + return isSchemaObject(tag) ? tag.const : void 0; + }); + const primitive = values.every((x) => x !== void 0 && (typeof x !== "object" || x === null)); + if (primitive && new Set(values).size === values.length) + return { key, values }; + } + return void 0; + } + walkUnevaluated(node, b, v, path5, out) { + const { unevaluatedProperties: unevaluatedProperties2, unevaluatedItems: unevaluatedItems2, ...rest } = node; + const a = newAnnotations(); + this.c.annotating(rest, b)(v, a); + if (isObject(v) && unevaluatedProperties2 !== void 0 && !a.allProps) { + for (const k of Object.keys(v)) { + if (a.props?.has(k)) + continue; + if (unevaluatedProperties2 === false) { + out.push({ path: pointer(path5, k), keyword: "unevaluatedProperties", message: "unknown field" }); + } else + this.walk(unevaluatedProperties2, b, v[k], pointer(path5, k), out); + } + } + if (Array.isArray(v) && unevaluatedItems2 !== void 0 && !a.allItems) { + for (let i = a.items; i < v.length; i++) { + if (a.indexes?.has(i)) + continue; + if (unevaluatedItems2 === false) { + out.push({ path: `${path5}/${i}`, keyword: "unevaluatedItems", message: "unexpected item" }); + } else + this.walk(unevaluatedItems2, b, v[i], `${path5}/${i}`, out); + } + } + } +}; +var LISTED_VALUES = 20; +function listValues(values) { + if (values.length <= LISTED_VALUES) + return JSON.stringify(values); + const listed = JSON.stringify(values.slice(0, LISTED_VALUES)); + return `${listed.slice(0, -1)}, ... and ${values.length - LISTED_VALUES} more]`; +} +function containsMessage(min, max) { + if (max === Number.POSITIVE_INFINITY) + return `expected at least ${min} matching ${min === 1 ? "item" : "items"}`; + if (min === 0) + return `expected at most ${max} matching ${max === 1 ? "item" : "items"}`; + return `expected between ${min} and ${max} matching items`; +} +function pointer(path5, key) { + return `${path5}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`; +} +function typeName(v) { + if (v === null) + return "null"; + if (Array.isArray(v)) + return "array"; + if (v instanceof Uint8Array) + return "bytes"; + if (typeof v === "number" && Number.isInteger(v)) + return "integer"; + return typeof v; +} + +// node_modules/@earendil-works/pi-schema/dist/validator.js +function compile(schema4, options = NO_OPTIONS) { + const check = compileCheck(schema4, options); + return options.coerce === true ? new CoercingValidator(schema4, options, check) : new Validator(schema4, options, check); +} +var NO_OPTIONS = Object.freeze({}); +var Validator = class { + /** Whether `value` is valid. A plain function: it may be passed around without its validator. */ + check; + schema; + options; + explainer = void 0; + constructor(schema4, options, check) { + this.check = check; + this.schema = schema4; + this.options = options; + } + /** + * Why `value` is invalid: one error per failing keyword, `[]` when it is valid. Built on the first failure and + * kept, so a validator whose values always pass never pays for it. + */ + errors(value2) { + if (this.check(value2)) + return []; + this.explainer ??= new Explainer(compiler(this.schema, this.options), this.schema); + return this.explainer.errors(value2); + } +}; +var CoercingValidator = class extends Validator { + coercer = void 0; + /** + * `value` coerced towards the schema: numeric strings to numbers, `"true"` to `true`, a single value to a one-item + * array, an optional `null` dropped, the first union branch the value converts to (the README lists every rule). + * Only the changed paths are copied; `value` comes back itself when nothing changes, and is never modified. Values + * that cannot be coerced stay as they are. The rules are built on the first call. + */ + coerce(value2) { + this.coercer ??= new Coercer(compiler(this.schema, this.options), this.schema); + return this.coercer.coerce(value2); + } + /** Coerces `value`, then checks it: the coerced value when it is valid, else its errors. */ + parse(value2) { + const coerced = this.coerce(value2); + return this.check(coerced) ? { ok: true, value: coerced } : { ok: false, errors: this.errors(coerced) }; + } +}; +function compileCheck(schema4, options) { + return compiler(schema4, options).root(); +} +function compiler(schema4, options) { + const plain = new Compiler(schema4, options, false); + try { + plain.root(); + return plain; + } catch (error) { + if (error !== RESTART) + throw error; + return new Compiler(schema4, options, true); + } +} + +// node_modules/@earendil-works/chord/dist/json.js +var DATA_DESCRIPTOR = { + value: void 0, + writable: true, + enumerable: true, + configurable: true +}; +function copyJson(value2, options) { + return copy(value2, void 0, options?.omitUndefinedProperties === true); +} +function copy(value2, ancestors, omitUndefinedProperties) { + if (value2 === null || typeof value2 === "string" || typeof value2 === "boolean") + return value2; + if (typeof value2 === "number") { + if (Number.isFinite(value2)) + return value2; + throw new TypeError("Value contains a non-finite number and is not strict JSON"); + } + if (typeof value2 !== "object") + throw new TypeError(`Value contains a non-JSON ${typeof value2}; expected strict JSON`); + const active = ancestors ?? /* @__PURE__ */ new Set(); + if (active.has(value2)) + throw new TypeError("Value contains cycles and is not strict JSON"); + active.add(value2); + try { + if (Array.isArray(value2)) { + if (Object.getPrototypeOf(value2) !== Array.prototype || Reflect.ownKeys(value2).length !== value2.length + 1) { + throw new TypeError("Value must contain strict JSON dense plain arrays"); + } + const result2 = new Array(value2.length); + for (let index = 0; index < value2.length; index++) { + const descriptor = Object.getOwnPropertyDescriptor(value2, index); + if (descriptor === void 0 || !descriptor.enumerable || !("value" in descriptor)) { + throw new TypeError("Value must contain strict JSON enumerable indexed data properties"); + } + defineData(result2, String(index), copy(descriptor.value, active, omitUndefinedProperties)); + } + return result2; + } + const prototype = Object.getPrototypeOf(value2); + if (prototype !== Object.prototype && prototype !== null) { + throw new TypeError("Value must contain strict JSON plain objects or arrays"); + } + const result = Object.create(prototype); + for (const key of Reflect.ownKeys(value2)) { + if (typeof key === "symbol") + throw new TypeError("Value contains a symbol key and is not strict JSON"); + const descriptor = Object.getOwnPropertyDescriptor(value2, key); + if (!descriptor.enumerable || !("value" in descriptor)) { + throw new TypeError("Value must contain strict JSON enumerable data properties"); + } + if (descriptor.value === void 0 && omitUndefinedProperties) + continue; + defineData(result, key, copy(descriptor.value, active, omitUndefinedProperties)); + } + return result; + } finally { + active.delete(value2); + } +} +function defineData(target, key, value2) { + DATA_DESCRIPTOR.value = value2; + Object.defineProperty(target, key, DATA_DESCRIPTOR); + DATA_DESCRIPTOR.value = void 0; +} + +// node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js +var DATA_DESCRIPTOR2 = { + value: void 0, + writable: true, + enumerable: true, + configurable: true +}; +function applyImmutableTrusted(target, operations) { + let root2 = target; + const owned = /* @__PURE__ */ new WeakSet(); + for (const operation of operations) { + if (operation[0] === "r") { + root2 = operation[1]; + continue; + } + if (operation[0] === "p" || operation[0] === "m") { + const copied2 = copyPath(root2, operation[1], operation[1].length, owned); + root2 = copied2.root; + if (!Array.isArray(copied2.target)) + throw new TypeError("Trusted array operation target is not an array"); + if (operation[0] === "p") + spliceTrusted(copied2.target, operation[2], operation[3], operation[4]); + else + permuteTrusted(copied2.target, operation[2]); + continue; + } + const path5 = operation[1]; + const copied = copyPath(root2, path5, path5.length - 1, owned); + root2 = copied.root; + const key = path5[path5.length - 1]; + switch (operation[0]) { + case "s": + defineData2(copied.target, key, operation[2]); + break; + case "d": + if (Array.isArray(copied.target)) { + if (typeof key !== "number") + throw new TypeError("Trusted array deletion key is not numeric"); + spliceTrusted(copied.target, key, 1, []); + } else + Reflect.deleteProperty(copied.target, key); + break; + case "a": { + const current = read(copied.target, key); + if (typeof current !== "string") + throw new TypeError("Trusted append target is not a string"); + defineData2(copied.target, key, `${current}${operation[2]}`); + break; + } + case "t": { + const current = read(copied.target, key); + if (typeof current !== "string") + throw new TypeError("Trusted truncate target is not a string"); + defineData2(copied.target, key, current.slice(operation[2])); + break; + } + } + } + return root2; +} +function copyPath(root2, path5, length, owned) { + if (!isContainer(root2)) + throw new TypeError("Trusted operation root is not a container"); + let copiedRoot = root2; + if (!owned.has(root2)) { + copiedRoot = shallowCopy(root2); + owned.add(copiedRoot); + } + let destination = copiedRoot; + for (let index = 0; index < length; index++) { + const segment = path5[index]; + const child = read(destination, segment); + if (!isContainer(child)) + throw new TypeError("Trusted operation path is not a container"); + if (owned.has(child)) { + destination = child; + continue; + } + const copy2 = shallowCopy(child); + defineData2(destination, segment, copy2); + owned.add(copy2); + destination = copy2; + } + return { root: copiedRoot, target: destination }; +} +function shallowCopy(value2) { + if (Array.isArray(value2)) + return Array.from(value2); + return Object.getPrototypeOf(value2) === null ? Object.assign(/* @__PURE__ */ Object.create(null), value2) : { ...value2 }; +} +function read(target, key) { + return target[key]; +} +function defineData2(target, key, value2) { + DATA_DESCRIPTOR2.value = value2; + Object.defineProperty(target, key, DATA_DESCRIPTOR2); + DATA_DESCRIPTOR2.value = void 0; +} +function spliceTrusted(target, start, remove, items) { + const oldLength = target.length; + const delta = items.length - remove; + if (delta > 0) { + target.length = oldLength + delta; + target.copyWithin(start + items.length, start + remove, oldLength); + } else if (delta < 0) { + target.copyWithin(start + items.length, start + remove, oldLength); + target.length = oldLength + delta; + } + for (let index = 0; index < items.length; index++) + defineData2(target, start + index, items[index]); +} +function permuteTrusted(target, permutation) { + if (target.length !== permutation.length) + throw new TypeError("Trusted permutation length mismatch"); + const previous = target.slice(); + for (let index = 0; index < permutation.length; index++) + target[index] = previous[permutation[index]]; +} +function isContainer(value2) { + return value2 !== null && typeof value2 === "object"; +} + +// node_modules/@earendil-works/chord/dist/delta/tracker.js +var NODE = /* @__PURE__ */ Symbol("chord.delta.overlay.node"); +var PREPARED = /* @__PURE__ */ new WeakMap(); +var RELEASED = {}; +var ARRAY_MUTATORS = /* @__PURE__ */ new Set([ + "push", + "pop", + "shift", + "unshift", + "splice", + "reverse", + "sort", + "fill", + "copyWithin" +]); +var MAX_DELTA_OPERATIONS = 4096; +var MAX_SIMPLE_OBJECT_NODES = 128; +var DATA_DESCRIPTOR3 = { + value: void 0, + writable: true, + enumerable: true, + configurable: true +}; +var PreparedImpl = class { + #context; + value; + base; + ops; + constructor(context, value2, operations) { + this.#context = context; + this.value = value2; + this.base = context.baseValue; + this.ops = operations; + PREPARED.set(this, context); + } + get baseRevision() { + return this.#context.baseRevision; + } + abort() { + abortContext(this.#context); + } +}; +var ChangeImpl = class { + #context; + #preparedStatus; + #settled = false; + constructor(context) { + this.#context = context; + } + get state() { + const state2 = this.#context?.root?.proxy; + if (state2 === void 0) + throw new TypeError("Cannot use a settled overlay"); + return state2; + } + prepare() { + if (this.#settled) + throw new Error("Change has already been settled"); + const context = this.#context; + assertWritable(context); + context.status.value = "prepared"; + try { + if (!context.replacement) + context.ops = context.dirty.length === 0 ? [] : emitOperations(context); + const prepared = materializePrepared(context); + this.#preparedStatus = context.status; + this.#settled = true; + return prepared; + } catch (error) { + context.status.value = "aborted"; + clearContext(context); + this.#settled = true; + throw error; + } finally { + this.#context = void 0; + } + } + abort() { + if (this.#settled) { + if (this.#preparedStatus?.value === "prepared") + this.#preparedStatus.value = "aborted"; + this.#preparedStatus = void 0; + return; + } + this.#settled = true; + abortContext(this.#context); + this.#context = void 0; + } +}; +var TrackerImpl = class { + #owner = {}; + #open; + #competitors; + #selfRef; + #value; + #revision = 0; + #pruneBudget = 256; + constructor(initial) { + this.#value = initial; + this.#selfRef = new WeakRef(this); + } + get value() { + return this.#value; + } + get revision() { + return this.#revision; + } + beginChange() { + const context = createContext(this.#selfRef, this.#owner, this.#revision, this.#value, false, this.#value); + if (this.#open !== void 0) + this.#demote(this.#open); + this.#open = context; + return new ChangeImpl(context); + } + prepareReplace(value2) { + const context = createContext(this.#selfRef, this.#owner, this.#revision, value2, true, this.#value); + context.status.value = "prepared"; + try { + return materializePrepared(context); + } catch (error) { + context.status.value = "aborted"; + clearContext(context); + throw error; + } + } + adopt(prepared) { + const context = PREPARED.get(prepared); + if (context?.owner !== this.#owner) + throw new Error("Prepared change belongs to a different tracker"); + if (context.status.value === "consumed") + throw new Error("Prepared change has already been used"); + if (context.status.value === "aborted") + throw new Error("Prepared change has been aborted"); + if (context.status.value === "stale") + throw new Error("Prepared change is stale"); + if (context.status.value !== "prepared") + throw new Error("Prepared change is not ready"); + if (context.baseRevision !== this.#revision) { + context.status.value = "stale"; + clearContext(context); + throw new Error("Prepared change is stale"); + } + if (this.#value !== prepared.base) { + context.status.value = "stale"; + throw new Error("Prepared change is stale"); + } + this.#value = prepared.value; + context.status.value = "consumed"; + this.#revision += 1; + this.#invalidate(context); + } + releaseContext(context) { + if (this.#open === context) + this.#open = void 0; + else if (context.registryRef !== void 0) + this.#competitors?.delete(context.registryRef); + context.registryRef = void 0; + } + #demote(context) { + const reference = new WeakRef(context); + context.registryRef = reference; + this.#competitors ??= /* @__PURE__ */ new Set(); + this.#competitors.add(reference); + this.#pruneBudget -= 1; + if (this.#pruneBudget === 0) { + for (const entry2 of this.#competitors) { + if (entry2.deref() === void 0) + this.#competitors.delete(entry2); + } + this.#pruneBudget = Math.max(256, this.#competitors.size); + } + } + #invalidate(winner) { + const open = this.#open; + const competitors = this.#competitors; + this.#open = void 0; + this.#competitors = void 0; + this.#pruneBudget = 256; + if (open !== void 0) + staleCompetitor(open, winner); + if (competitors === void 0) + return; + for (const reference of competitors) { + const context = reference.deref(); + if (context !== void 0) + staleCompetitor(context, winner); + } + } + replacementBase(context) { + return context.baseRevision === this.#revision ? this.#value : void 0; + } +}; +function staleCompetitor(context, winner) { + if (context === winner) + return; + if (context.status.value === "open" || context.status.value === "prepared") + context.status.value = "stale"; + context.registryRef = void 0; + releaseOverlayReferences(context); +} +function track(initial) { + return new TrackerImpl(initial); +} +function appendText(draft, key, text) { + const node = draft[NODE]; + if (node === void 0) + throw new TypeError("appendText() needs a draft"); + assertWritable(node.context); + const name = String(key); + const current = Array.isArray(nodeBase(node)) || !objectHas(node, name) ? void 0 : objectValue(node, name); + if (typeof current !== "string") + throw new TypeError(`appendText() needs a string at ${JSON.stringify(name)}`); + if (text.length === 0) + return; + const owned = ownedSlice2(text, 0); + const appended = node.appends?.get(name) ?? (hasObjectWrite(node, name) ? void 0 : ""); + setObjectWrite(node, name, current + owned); + markDirty(node); + if (appended !== void 0) { + node.appends ??= /* @__PURE__ */ new Map(); + node.appends.set(name, appended + owned); + } +} +function materializePrepared(context) { + const operations = ensureOperations(context); + const base = context.baseValue; + const value2 = operations.length === 0 ? base : context.simpleObjectMaterialization ? cloneNode(context.root) : materializeOperations(base, operations); + const prepared = new PreparedImpl(context, value2, operations); + if (context.nodes.length > 4096) + releaseOverlayReferences(context); + else + clearContext(context); + return prepared; +} +function materializeOperations(base, operations) { + for (const operation of operations) { + if (operation[0] === "p" || operation[0] === "m") + return applyImmutable(base, operations); + } + return applyImmutableTrusted(base, operations); +} +function createContext(tracker, owner, baseRevision, root2, replacement, base) { + const context = { + owner, + tracker, + baseRevision, + status: { value: "open" }, + root: void 0, + bases: [], + stored: void 0, + dirty: [], + nodes: [], + rawNodes: void 0, + ops: void 0, + replacement, + replacementNoop: false, + baseValue: base, + overlayReleased: false, + simpleObjectMaterialization: false, + registryRef: void 0 + }; + context.root = createNode(context, root2, void 0); + return context; +} +var sharedObjectHandler = { + deleteProperty(target, property) { + return deleteProperty(nodeForTarget(target), property); + }, + defineProperty(target) { + assertWritable(nodeForTarget(target).context); + throw new TypeError("Defining overlay properties is not supported"); + }, + get(target, property) { + if (property === "then") { + const node2 = target[NODE]; + if (node2 === void 0 || isSettledContext(node2.context)) + return void 0; + } + const node = nodeForTarget(target); + if (property === NODE) + return node; + return getProperty(node, property); + }, + getOwnPropertyDescriptor(target, property) { + return getDescriptor(nodeForTarget(target), property); + }, + getPrototypeOf(target) { + const node = nodeForTarget(target); + assertReadable(node.context); + return Object.getPrototypeOf(nodeBase(node)); + }, + has(target, property) { + return hasProperty(nodeForTarget(target), property); + }, + isExtensible(target) { + assertReadable(nodeForTarget(target).context); + return true; + }, + ownKeys(target) { + return ownKeys(nodeForTarget(target)); + }, + preventExtensions(target) { + assertWritable(nodeForTarget(target).context); + throw new TypeError("Overlays cannot be made non-extensible"); + }, + set(target, property, value2) { + return setProperty(nodeForTarget(target), property, value2); + }, + setPrototypeOf(target) { + assertWritable(nodeForTarget(target).context); + throw new TypeError("Changing an overlay prototype is not supported"); + } +}; +var sharedArrayHandler = sharedObjectHandler; +function createNode(context, base, parent2, parentKind = 0, parentKey = "", parentSource = void 0, parentPlacement = false) { + const existing = context.rawNodes?.get(base); + if (existing !== void 0) + return existing; + const target = Array.isArray(base) ? [] : {}; + const baseIndex = context.bases.length; + const parentIndex = parent2?.baseIndex ?? -1; + context.bases.push(base); + const node = { + context, + baseIndex, + parentIndex, + parentKind, + parentKey, + parentPlacement, + target, + proxy: target + }; + if (parentSource !== void 0) + node.parentSource = parentSource; + target[NODE] = node; + node.proxy = new Proxy(target, Array.isArray(base) ? sharedArrayHandler : sharedObjectHandler); + if (parent2 !== void 0) { + context.rawNodes ??= /* @__PURE__ */ new WeakMap(); + context.rawNodes.set(base, node); + } + context.nodes.push(node); + return node; +} +function nodeBase(node) { + return node.context.bases[node.baseIndex]; +} +function nodeParent(node) { + return node.parentIndex < 0 ? void 0 : node.context.nodes[node.parentIndex]; +} +function storeValue(context, value2) { + if (!isContainer2(value2)) + return value2; + context.stored ??= []; + const index = context.stored.length; + context.stored.push(value2); + return { index }; +} +function storedValue(context, reference) { + return typeof reference === "object" && reference !== null ? context.stored[reference.index] : reference; +} +function replaceStoredValue(context, reference, value2) { + if (isContainer2(value2)) { + if (typeof reference === "object" && reference !== null) { + context.stored[reference.index] = value2; + return reference; + } + return storeValue(context, value2); + } + if (typeof reference === "object" && reference !== null) + context.stored[reference.index] = RELEASED; + return value2; +} +function releaseStoredValue(context, reference) { + if (typeof reference === "object" && reference !== null) + context.stored[reference.index] = RELEASED; +} +function nodeForTarget(target) { + const node = target[NODE]; + if (node === void 0) + throw new TypeError("Cannot use a settled overlay"); + return node; +} +function isSettledContext(context) { + return context.overlayReleased || context.status.value === "consumed" || context.status.value === "aborted" || context.status.value === "stale"; +} +function assertReadable(context) { + if (isSettledContext(context)) + throw new TypeError("Cannot use a settled overlay"); +} +function assertWritable(context) { + assertReadable(context); + if (context.status.value !== "open") + throw new TypeError("Prepared overlays are read-only"); +} +function getProperty(node, property) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + const overlay = arrayOverlay(node); + if (property === "length") + return arrayLength(overlay); + if (ARRAY_MUTATORS.has(property)) + return arrayMutators[property]; + const index = arrayIndex(property); + if (index !== void 0) + return getArrayIndex(node, index); + return Reflect.get(Array.prototype, property, node.proxy); + } + if (typeof property === "symbol") + return Reflect.get(nodeBase(node), property, node.proxy); + const key = String(property); + if (!objectHas(node, key)) { + if (isObjectDeleted(node, key) || Object.hasOwn(nodeBase(node), key)) + return void 0; + return Reflect.get(nodeBase(node), property, node.proxy); + } + const value2 = objectValue(node, key); + if (!isContainer2(value2)) + return value2; + return createNode(node.context, value2, node, 0, key, void 0, hasObjectWrite(node, key)).proxy; +} +function getArrayIndex(node, index) { + const overlay = arrayOverlay(node); + if (index >= arrayLength(overlay)) + return void 0; + const piece = locatePiece(overlay, index); + const sourceIndex = piece.start + piece.step * overlay.locatedOffset; + const value2 = entryValueAt(node, piece, sourceIndex); + if (!isContainer2(value2)) + return value2; + return createNode(node.context, value2, node, piece.kind === "base" ? 1 : 2, sourceIndex, piece.kind === "insert" ? piece.source : void 0, piece.kind === "insert" || hasEntryOverrideAt(overlay, piece, sourceIndex)).proxy; +} +function setProperty(node, property, supplied2) { + assertWritable(node.context); + if (typeof property === "symbol") + throw new TypeError("Symbol writes are not supported"); + if (Array.isArray(nodeBase(node))) { + if (property === "length") { + setArrayLength(node, toArrayLength(supplied2)); + return true; + } + const index = arrayIndex(property); + if (index === void 0) + throw new TypeError("Only array indices and length can be written"); + if (index > arrayLength(arrayOverlay(node))) + throw new TypeError("Overlay arrays cannot contain holes"); + setArrayIndex(node, index, clonePlacement(supplied2)); + return true; + } + const key = String(property); + if (supplied2 === void 0) + return deleteProperty(node, key); + const stored = clonePlacement(supplied2); + const current = objectValue(node, key); + const wasDeleted = isObjectDeleted(node, key); + if (!wasDeleted && !isContainer2(stored) && current === stored) + return true; + node.appends?.delete(key); + setObjectWrite(node, key, stored); + if (wasDeleted && Object.hasOwn(nodeBase(node), key)) { + if (node.readded === void 0) + node.readded = /* @__PURE__ */ new Set(); + node.readded.add(key); + } + deleteObjectDeletion(node, key); + markDirty(node); + return true; +} +function deleteProperty(node, property) { + assertWritable(node.context); + if (typeof property === "symbol") + throw new TypeError("Symbol writes are not supported"); + if (Array.isArray(nodeBase(node))) + throw new TypeError("Overlay arrays cannot contain holes"); + const key = String(property); + if (!objectHas(node, key)) + return true; + node.appends?.delete(key); + deleteObjectWrite(node, key); + node.readded?.delete(key); + setObjectDeletion(node, key); + markDirty(node); + return true; +} +function hasProperty(node, property) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + if (property === "length") + return true; + const index = arrayIndex(property); + if (index !== void 0) + return index < arrayLength(arrayOverlay(node)); + return property in Array.prototype; + } + return typeof property === "symbol" ? property in nodeBase(node) : objectHas(node, String(property)); +} +function ownKeys(node) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + const length = arrayLength(arrayOverlay(node)); + const keys2 = new Array(length + 1); + for (let index = 0; index < length; index++) + keys2[index] = String(index); + keys2[length] = "length"; + return keys2; + } + let existingKeysOnly = node.deleteKey === void 0 && node.deletes === void 0 && node.readded === void 0 && (node.writeKey === void 0 || Object.hasOwn(nodeBase(node), node.writeKey)); + if (existingKeysOnly && node.writes !== void 0) { + for (const key of node.writes.keys()) { + if (!Object.hasOwn(nodeBase(node), key)) { + existingKeysOnly = false; + break; + } + } + } + if (existingKeysOnly) + return Object.keys(nodeBase(node)); + const keys = Object.keys(nodeBase(node)).filter((key) => !isObjectDeleted(node, key) && !node.readded?.has(key)); + const seen = new Set(keys); + if (node.writeKey !== void 0 && !seen.has(node.writeKey)) { + keys.push(node.writeKey); + seen.add(node.writeKey); + } + if (node.writes !== void 0) { + for (const key of node.writes.keys()) { + if (seen.has(key)) + continue; + keys.push(key); + seen.add(key); + } + } + const indices = []; + const strings = []; + for (const key of keys) { + const index = arrayIndex(key); + if (index === void 0) + strings.push(key); + else + indices.push(index); + } + indices.sort((left, right) => left - right); + return [...indices.map(String), ...strings]; +} +function getDescriptor(node, property) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + if (property === "length") { + const length = arrayLength(arrayOverlay(node)); + node.target.length = length; + return Reflect.getOwnPropertyDescriptor(node.target, "length"); + } + const index = arrayIndex(property); + if (index === void 0 || index >= arrayLength(arrayOverlay(node))) + return void 0; + } else { + if (typeof property === "symbol" || !objectHas(node, String(property))) + return void 0; + } + return { + configurable: true, + enumerable: true, + writable: node.context.status.value === "open", + value: getProperty(node, property) + }; +} +function hasObjectWrite(node, key) { + return node.writeKey === key || (node.writes?.has(key) ?? false); +} +function setObjectWrite(node, key, value2) { + if (node.writes !== void 0) { + const reference = node.writes.get(key); + node.writes.set(key, reference === void 0 ? storeValue(node.context, value2) : replaceStoredValue(node.context, reference, value2)); + return; + } + if (node.writeKey === void 0 || node.writeKey === key) { + node.writeKey = key; + node.writeValue = node.writeValue === void 0 ? storeValue(node.context, value2) : replaceStoredValue(node.context, node.writeValue, value2); + return; + } + node.writes = /* @__PURE__ */ new Map(); + node.writes.set(node.writeKey, node.writeValue); + node.writes.set(key, storeValue(node.context, value2)); + node.writeKey = void 0; + node.writeValue = void 0; +} +function deleteObjectWrite(node, key) { + if (node.writeKey === key) { + node.writeKey = void 0; + releaseStoredValue(node.context, node.writeValue); + node.writeValue = void 0; + } else { + const reference = node.writes?.get(key); + if (reference !== void 0) + releaseStoredValue(node.context, reference); + node.writes?.delete(key); + } +} +function isObjectDeleted(node, key) { + return node.deleteKey === key || (node.deletes?.has(key) ?? false); +} +function setObjectDeletion(node, key) { + if (node.deletes !== void 0) { + node.deletes.add(key); + return; + } + if (node.deleteKey === void 0 || node.deleteKey === key) { + node.deleteKey = key; + return; + } + node.deletes = /* @__PURE__ */ new Set(); + node.deletes.add(node.deleteKey); + node.deletes.add(key); + node.deleteKey = void 0; +} +function deleteObjectDeletion(node, key) { + if (node.deleteKey === key) + node.deleteKey = void 0; + else + node.deletes?.delete(key); +} +function objectHas(node, key) { + if (isObjectDeleted(node, key)) + return false; + return hasObjectWrite(node, key) || Object.hasOwn(nodeBase(node), key); +} +function objectValue(node, key) { + if (node.writeKey === key) + return storedValue(node.context, node.writeValue); + const reference = node.writes?.get(key); + if (reference !== void 0) + return storedValue(node.context, reference); + return nodeBase(node)[key]; +} +function markDirty(node) { + if (node.dirty) + return; + node.dirty = true; + node.context.dirty.push(node); + for (let parent2 = nodeParent(node); parent2 !== void 0; parent2 = nodeParent(parent2)) + parent2.subtreeDirty = true; +} +function arrayOverlay(node) { + if (node.array !== void 0) + return node.array; + const base = nodeBase(node); + const overlay = { + root: void 0, + pieces: void 0, + baseOverrides: void 0, + insertOverrides: void 0, + structural: false, + generation: 0, + plan: void 0, + seed: 2654435769, + locatedOffset: 0, + baseLocations: void 0, + insertLocations: void 0 + }; + if (base.length > 0) + overlay.root = createPieceNode(overlay, { kind: "base", start: 0, length: base.length, step: 1 }); + node.array = overlay; + return overlay; +} +function baseOverridesForWrite(overlay) { + if (overlay.baseOverrides === void 0) + overlay.baseOverrides = /* @__PURE__ */ new Map(); + return overlay.baseOverrides; +} +function insertOverridesForWrite(overlay) { + if (overlay.insertOverrides === void 0) + overlay.insertOverrides = /* @__PURE__ */ new Map(); + return overlay.insertOverrides; +} +function nextPiecePriority(overlay) { + let value2 = overlay.seed; + value2 ^= value2 << 13; + value2 ^= value2 >>> 17; + value2 ^= value2 << 5; + overlay.seed = value2 >>> 0; + return overlay.seed; +} +function treeElements(node) { + return node?.elements ?? 0; +} +function updatePieceNode(node) { + node.elements = treeElements(node.left) + node.piece.length + treeElements(node.right); +} +function createPieceNode(overlay, piece) { + return { piece, left: void 0, right: void 0, priority: nextPiecePriority(overlay), elements: piece.length }; +} +function mergePieceTrees(left, right) { + if (left === void 0) + return right; + if (right === void 0) + return left; + if (left.priority >= right.priority) { + left.right = mergePieceTrees(left.right, right); + updatePieceNode(left); + return left; + } + right.left = mergePieceTrees(left, right.left); + updatePieceNode(right); + return right; +} +function splitPieceTree(overlay, root2, index) { + if (root2 === void 0) + return [void 0, void 0]; + const leftLength = treeElements(root2.left); + if (index < leftLength) { + const [left, right] = splitPieceTree(overlay, root2.left, index); + root2.left = right; + updatePieceNode(root2); + return [left, root2]; + } + const pieceEnd = leftLength + root2.piece.length; + if (index > pieceEnd) { + const [left, right] = splitPieceTree(overlay, root2.right, index - pieceEnd); + root2.right = left; + updatePieceNode(root2); + return [root2, right]; + } + if (index === leftLength) { + const left = root2.left; + root2.left = void 0; + updatePieceNode(root2); + return [left, root2]; + } + if (index === pieceEnd) { + const right = root2.right; + root2.right = void 0; + updatePieceNode(root2); + return [root2, right]; + } + const offset = index - leftLength; + const first = { ...root2.piece, length: offset }; + const second = { + ...root2.piece, + start: root2.piece.start + root2.piece.step * offset, + length: root2.piece.length - offset + }; + return [ + mergePieceTrees(root2.left, createPieceNode(overlay, first)), + mergePieceTrees(createPieceNode(overlay, second), root2.right) + ]; +} +function leftmostPieceNode(node) { + while (node.left !== void 0) + node = node.left; + return node; +} +function rightmostPieceNode(node) { + while (node.right !== void 0) + node = node.right; + return node; +} +function mergeablePieces(left, right) { + if (left.kind !== right.kind) + return false; + if (left.kind === "insert" && left.source !== right.source) + return false; + if (left.length === 1 && right.length === 1) + return Math.abs(right.start - left.start) === 1; + return left.step === right.step && left.start + left.step * left.length === right.start; +} +function joinNormalized(overlay, left, right) { + if (left === void 0) + return right; + if (right === void 0) + return left; + const leftPiece = rightmostPieceNode(left).piece; + const rightPiece = leftmostPieceNode(right).piece; + if (!mergeablePieces(leftPiece, rightPiece)) + return mergePieceTrees(left, right); + const [leftRest] = splitPieceTree(overlay, left, treeElements(left) - leftPiece.length); + const [, rightRest] = splitPieceTree(overlay, right, rightPiece.length); + const step = leftPiece.length === 1 ? rightPiece.start - leftPiece.start : leftPiece.step; + const combined = leftPiece.kind === "base" ? { kind: "base", start: leftPiece.start, length: leftPiece.length + rightPiece.length, step } : { + kind: "insert", + source: leftPiece.source, + start: leftPiece.start, + length: leftPiece.length + rightPiece.length, + step + }; + return joinNormalized(overlay, joinNormalized(overlay, leftRest, createPieceNode(overlay, combined)), rightRest); +} +function flattenPieceTree(node, output) { + if (node === void 0) + return; + flattenPieceTree(node.left, output); + output.push(node.piece); + flattenPieceTree(node.right, output); +} +function piecesOf(overlay) { + if (overlay.pieces === void 0) { + overlay.pieces = []; + flattenPieceTree(overlay.root, overlay.pieces); + } + return overlay.pieces; +} +function treeFromPieces(overlay, pieces) { + mergePieces(pieces); + let root2; + for (const piece of pieces) + root2 = mergePieceTrees(root2, createPieceNode(overlay, piece)); + return root2; +} +function replaceAllPieces(overlay, pieces) { + overlay.root = treeFromPieces(overlay, pieces); + overlay.pieces = void 0; + overlay.baseLocations = void 0; + overlay.insertLocations = void 0; +} +function arrayLength(overlay) { + return treeElements(overlay.root); +} +function locatePiece(overlay, index) { + let node = overlay.root; + while (node !== void 0) { + const leftLength = treeElements(node.left); + if (index < leftLength) + node = node.left; + else if (index >= leftLength + node.piece.length) { + index -= leftLength + node.piece.length; + node = node.right; + } else { + overlay.locatedOffset = index - leftLength; + return node.piece; + } + } + throw new RangeError("Array overlay index is out of range"); +} +function arrayIndex(property) { + if (typeof property !== "string" || property.length === 0 || property.length > 10) + return void 0; + if (property === "0") + return 0; + const first = property.charCodeAt(0); + if (first < 49 || first > 57) + return void 0; + let index = first - 48; + for (let offset = 1; offset < property.length; offset++) { + const digit = property.charCodeAt(offset) - 48; + if (digit < 0 || digit > 9) + return void 0; + index = index * 10 + digit; + if (index >= 4294967295) + return void 0; + } + return index; +} +function entryValueAt(node, piece, sourceIndex) { + const overlay = arrayOverlay(node); + if (piece.kind === "base") { + const valueIndex = overlay.baseOverrides?.get(sourceIndex); + return valueIndex === void 0 ? nodeBase(node)[sourceIndex] : storedValue(node.context, valueIndex); + } + const overrides = overlay.insertOverrides?.get(piece.source); + const reference = overrides?.has(sourceIndex) ? overrides.get(sourceIndex) : piece.source.refs[sourceIndex]; + return storedValue(node.context, reference); +} +function hasEntryOverrideAt(overlay, piece, sourceIndex) { + return piece.kind === "base" ? overlay.baseOverrides?.has(sourceIndex) ?? false : overlay.insertOverrides?.get(piece.source)?.has(sourceIndex) ?? false; +} +function extendRightmostPiece(node, amount) { + if (node.right !== void 0) + extendRightmostPiece(node.right, amount); + else + node.piece.length += amount; + updatePieceNode(node); +} +function invalidatePieceCaches(overlay) { + overlay.pieces = void 0; + overlay.baseLocations = void 0; + overlay.insertLocations = void 0; + overlay.plan = void 0; +} +function replacePieceRange(node, index, remove, inserted) { + if (remove === 0 && inserted.length === 0) + return; + const overlay = arrayOverlay(node); + if (remove === 0 && index === arrayLength(overlay) && inserted.length === 1 && overlay.root !== void 0) { + const addition = inserted[0]; + const tail = rightmostPieceNode(overlay.root).piece; + if (addition.kind === "insert" && tail.kind === "insert" && tail.step === 1 && tail.start + tail.length === tail.source.refs.length) { + for (let offset = 0; offset < addition.length; offset++) { + tail.source.refs.push(addition.source.refs[addition.start + offset]); + } + extendRightmostPiece(overlay.root, addition.length); + invalidatePieceCaches(overlay); + overlay.structural = true; + overlay.generation += 1; + markDirty(node); + return; + } + } + const [left, rest] = splitPieceTree(overlay, overlay.root, index); + const [, right] = splitPieceTree(overlay, rest, remove); + const middle = treeFromPieces(overlay, inserted); + overlay.root = joinNormalized(overlay, joinNormalized(overlay, left, middle), right); + invalidatePieceCaches(overlay); + overlay.structural = true; + overlay.generation += 1; + markDirty(node); +} +function mergePieces(pieces) { + for (let index = 1; index < pieces.length; ) { + const left = pieces[index - 1]; + const right = pieces[index]; + const sameSource = left.kind === right.kind && (left.kind === "base" || left.source === right.source); + if (sameSource && left.length === 1 && right.length === 1 && Math.abs(right.start - left.start) === 1) { + left.step = right.start - left.start; + left.length = 2; + pieces.splice(index, 1); + } else if (sameSource && left.step === right.step && left.start + left.step * left.length === right.start) { + left.length += right.length; + pieces.splice(index, 1); + } else + index += 1; + } +} +function insertPiece(node, items, start = 0) { + if (items.length === start) + return []; + const refs = []; + for (let index = start; index < items.length; index++) + refs.push(storeValue(node.context, items[index])); + return [{ kind: "insert", source: { refs }, start: 0, length: refs.length, step: 1 }]; +} +function insertPlacementPiece(node, values, start = 0) { + if (values.length === start) + return []; + const storedLength = node.context.stored?.length ?? 0; + try { + for (let index = start; index < values.length; index++) + values[index] = storeValue(node.context, clonePlacement(values[index])); + } catch (error) { + if (node.context.stored !== void 0) + node.context.stored.length = storedLength; + throw error; + } + return [ + { + kind: "insert", + source: { refs: values }, + start, + length: values.length - start, + step: 1 + } + ]; +} +function setArrayIndex(node, index, stored) { + const overlay = arrayOverlay(node); + const length = arrayLength(overlay); + if (index === length) { + replacePieceRange(node, length, 0, insertPiece(node, [stored])); + return; + } + const piece = locatePiece(overlay, index); + const sourceIndex = piece.start + piece.step * overlay.locatedOffset; + const current = entryValueAt(node, piece, sourceIndex); + if (!isContainer2(stored) && current === stored) + return; + if (piece.kind === "base") { + const existingIndex = overlay.baseOverrides?.get(sourceIndex); + if (!isContainer2(stored) && stored === nodeBase(node)[sourceIndex]) { + if (existingIndex !== void 0) + releaseStoredValue(node.context, existingIndex); + overlay.baseOverrides?.delete(sourceIndex); + } else if (existingIndex === void 0) { + baseOverridesForWrite(overlay).set(sourceIndex, storeValue(node.context, stored)); + } else + overlay.baseOverrides.set(sourceIndex, replaceStoredValue(node.context, existingIndex, stored)); + } else { + let overrides = overlay.insertOverrides?.get(piece.source); + const existingIndex = overrides?.get(sourceIndex); + if (!isContainer2(stored) && stored === storedValue(node.context, piece.source.refs[sourceIndex])) { + if (existingIndex !== void 0) + releaseStoredValue(node.context, existingIndex); + overrides?.delete(sourceIndex); + if (overrides?.size === 0) + overlay.insertOverrides?.delete(piece.source); + } else { + if (overrides === void 0) { + overrides = /* @__PURE__ */ new Map(); + insertOverridesForWrite(overlay).set(piece.source, overrides); + } + if (existingIndex === void 0) + overrides.set(sourceIndex, storeValue(node.context, stored)); + else + overrides.set(sourceIndex, replaceStoredValue(node.context, existingIndex, stored)); + } + } + markDirty(node); +} +function setArrayLength(node, next) { + const current = arrayLength(arrayOverlay(node)); + if (next === current) + return; + if (next < current) + replacePieceRange(node, next, current - next, []); + else + replacePieceRange(node, current, 0, insertPiece(node, Array.from({ length: next - current }, () => null))); +} +function toArrayLength(value2) { + const number2 = Number(value2); + if (!Number.isInteger(number2) || number2 < 0 || number2 >= 4294967296) + throw new RangeError("Invalid array length"); + return number2; +} +function toIntegerOrInfinity(value2) { + const number2 = Number(value2); + if (Number.isNaN(number2) || number2 === 0) + return 0; + return Number.isFinite(number2) ? Math.trunc(number2) : number2; +} +function clampIndex(value2, length) { + if (value2 === Number.NEGATIVE_INFINITY) + return 0; + if (value2 < 0) + return Math.max(length + value2, 0); + return Math.min(value2, length); +} +function mutatorNode(receiver) { + if (!isContainer2(receiver)) + return void 0; + const node = Reflect.get(receiver, NODE); + if (node === void 0) + return void 0; + if (!Array.isArray(nodeBase(node))) + throw new TypeError("Array mutator called on incompatible receiver"); + assertWritable(node.context); + return node; +} +var arrayMutators = { + push(...items) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.push, this, items); + const length = arrayLength(arrayOverlay(node)); + replacePieceRange(node, length, 0, insertPlacementPiece(node, items)); + return length + items.length; + }, + pop() { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.pop, this, []); + const length = arrayLength(arrayOverlay(node)); + if (length === 0) + return void 0; + const value2 = getArrayIndex(node, length - 1); + replacePieceRange(node, length - 1, 1, []); + return value2; + }, + shift() { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.shift, this, []); + const length = arrayLength(arrayOverlay(node)); + if (length === 0) + return void 0; + const value2 = getArrayIndex(node, 0); + replacePieceRange(node, 0, 1, []); + return value2; + }, + unshift(...items) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.unshift, this, items); + replacePieceRange(node, 0, 0, insertPlacementPiece(node, items)); + return arrayLength(arrayOverlay(node)); + }, + splice(...args) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.splice, this, args); + const length = arrayLength(arrayOverlay(node)); + const start = args.length === 0 ? 0 : clampIndex(toIntegerOrInfinity(args[0]), length); + const remove = args.length === 0 ? 0 : args.length === 1 ? length - start : Math.min(Math.max(toIntegerOrInfinity(args[1]), 0), length - start); + const removed = Array.from({ length: remove }, (_, offset) => getArrayIndex(node, start + offset)); + const itemStart = Math.min(2, args.length); + const itemCount = Math.max(args.length - 2, 0); + replacePieceRange(node, start, remove, insertPlacementPiece(node, args, itemStart)); + setArrayLength(node, length - remove + itemCount); + return removed; + }, + reverse() { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.reverse, this, []); + const overlay = arrayOverlay(node); + if (arrayLength(overlay) < 2) + return node.proxy; + const pieces = [...piecesOf(overlay)].reverse(); + for (const piece of pieces) { + piece.start += piece.step * (piece.length - 1); + piece.step = piece.step === 1 ? -1 : 1; + } + replaceAllPieces(overlay, pieces); + overlay.structural = true; + overlay.generation += 1; + overlay.plan = void 0; + markDirty(node); + return node.proxy; + }, + sort(comparator) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.sort, this, [comparator]); + if (comparator !== void 0 && typeof comparator !== "function") + throw new TypeError("Comparator must be a function"); + const overlay = arrayOverlay(node); + const insertedSources = []; + const insertedIndices = []; + const insertedValues = []; + const baseValues = new Array(nodeBase(node).length); + const order = []; + for (const piece of piecesOf(overlay)) { + for (let offset = 0; offset < piece.length; offset++) { + const sourceIndex = piece.start + piece.step * offset; + if (piece.kind === "base") { + order.push(sourceIndex); + baseValues[sourceIndex] = publicSortValue(node, sourceIndex, insertedSources, insertedIndices); + } else { + insertedSources.push(piece.source); + insertedIndices.push(sourceIndex); + const token = -insertedSources.length; + order.push(token); + insertedValues.push(publicSortValue(node, token, insertedSources, insertedIndices)); + } + } + } + const baseSnapshot = /* @__PURE__ */ new Map(); + for (const [index, valueIndex] of overlay.baseOverrides ?? []) + baseSnapshot.set(index, storedValue(node.context, valueIndex)); + const insertSnapshots = /* @__PURE__ */ new Map(); + for (const [source, overrides] of overlay.insertOverrides ?? []) { + const snapshot = /* @__PURE__ */ new Map(); + for (const [index, valueIndex] of overrides) + snapshot.set(index, storedValue(node.context, valueIndex)); + insertSnapshots.set(source, snapshot); + } + const generation = overlay.generation; + order.sort((left, right) => { + const leftValue = left < 0 ? insertedValues[-left - 1] : baseValues[left]; + const rightValue = right < 0 ? insertedValues[-right - 1] : baseValues[right]; + if (typeof comparator === "function") + return Number(comparator(leftValue, rightValue)); + const a = String(leftValue); + const b = String(rightValue); + return a < b ? -1 : a > b ? 1 : 0; + }); + if (baseSnapshot.size > 0 || insertSnapshots.size > 0 || (overlay.baseOverrides?.size ?? 0) > 0 || (overlay.insertOverrides?.size ?? 0) > 0) { + for (const token of order) { + restoreSortOverride(node, token, insertedSources, insertedIndices, baseSnapshot, insertSnapshots); + } + } + const comparatorWasStructural = overlay.generation !== generation; + const currentLength = arrayLength(overlay); + const samePrefix = currentLength >= order.length && order.every((token, index) => sameSortTokenAt(overlay, index, token, insertedSources, insertedIndices)); + if (!samePrefix) { + replacePieceRange(node, 0, Math.min(order.length, currentLength), piecesFromSortOrder(order, insertedSources, insertedIndices)); + } + if (comparatorWasStructural) + deduplicateArrayEntries(node); + return node.proxy; + }, + fill(supplied2, startArg, endArg) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.fill, this, [supplied2, startArg, endArg]); + const length = arrayLength(arrayOverlay(node)); + const start = startArg === void 0 ? 0 : clampIndex(toIntegerOrInfinity(startArg), length); + const end = endArg === void 0 ? length : clampIndex(toIntegerOrInfinity(endArg), length); + if (end <= start) + return node.proxy; + const items = Array.from({ length: end - start }, () => clonePlacement(supplied2)); + replacePieceRange(node, start, end - start, insertPiece(node, items)); + return node.proxy; + }, + copyWithin(targetArg, startArg, endArg) { + const node = mutatorNode(this); + if (node === void 0) + return Reflect.apply(Array.prototype.copyWithin, this, [targetArg, startArg, endArg]); + const length = arrayLength(arrayOverlay(node)); + const target = clampIndex(toIntegerOrInfinity(targetArg), length); + const start = clampIndex(toIntegerOrInfinity(startArg), length); + const end = endArg === void 0 ? length : clampIndex(toIntegerOrInfinity(endArg), length); + const count = Math.min(Math.max(end - start, 0), length - target); + const values = Array.from({ length: count }, (_, offset) => clonePlacement(getArrayIndex(node, start + offset))); + replacePieceRange(node, target, count, insertPiece(node, values)); + return node.proxy; + } +}; +function sortTokenSource(token, sources) { + return token < 0 ? sources[-token - 1] : void 0; +} +function sortTokenIndex(token, indices) { + return token < 0 ? indices[-token - 1] : token; +} +function publicSortValue(node, token, sources, indices) { + const overlay = arrayOverlay(node); + const source = sortTokenSource(token, sources); + const sourceIndex = sortTokenIndex(token, indices); + const overrideIndex = source === void 0 ? overlay.baseOverrides?.get(sourceIndex) : overlay.insertOverrides?.get(source)?.get(sourceIndex); + const value2 = overrideIndex !== void 0 ? storedValue(node.context, overrideIndex) : source === void 0 ? nodeBase(node)[sourceIndex] : storedValue(node.context, source.refs[sourceIndex]); + if (!isContainer2(value2)) + return value2; + return createNode(node.context, value2, node, source === void 0 ? 1 : 2, sourceIndex, source, source !== void 0 || (overlay.baseOverrides?.has(sourceIndex) ?? false)).proxy; +} +function restoreSortOverride(node, token, sources, indices, baseSnapshot, insertSnapshots) { + const overlay = arrayOverlay(node); + const source = sortTokenSource(token, sources); + const sourceIndex = sortTokenIndex(token, indices); + if (source === void 0) { + const existingIndex2 = overlay.baseOverrides?.get(sourceIndex); + const snapshotValue2 = baseSnapshot.get(sourceIndex); + if (snapshotValue2 !== void 0) { + if (existingIndex2 === void 0) + baseOverridesForWrite(overlay).set(sourceIndex, storeValue(node.context, snapshotValue2)); + else + overlay.baseOverrides.set(sourceIndex, replaceStoredValue(node.context, existingIndex2, snapshotValue2)); + } else { + if (existingIndex2 !== void 0) + releaseStoredValue(node.context, existingIndex2); + overlay.baseOverrides?.delete(sourceIndex); + } + return; + } + let overrides = overlay.insertOverrides?.get(source); + const existingIndex = overrides?.get(sourceIndex); + const snapshotValue = insertSnapshots.get(source)?.get(sourceIndex); + if (snapshotValue !== void 0) { + if (overrides === void 0) { + overrides = /* @__PURE__ */ new Map(); + insertOverridesForWrite(overlay).set(source, overrides); + } + if (existingIndex === void 0) + overrides.set(sourceIndex, storeValue(node.context, snapshotValue)); + else + overrides.set(sourceIndex, replaceStoredValue(node.context, existingIndex, snapshotValue)); + } else { + if (existingIndex !== void 0) + releaseStoredValue(node.context, existingIndex); + overrides?.delete(sourceIndex); + if (overrides?.size === 0) + overlay.insertOverrides?.delete(source); + } +} +function sameSortTokenAt(overlay, logicalIndex, token, sources, indices) { + const piece = locatePiece(overlay, logicalIndex); + const sourceIndex = piece.start + piece.step * overlay.locatedOffset; + const tokenSource = sortTokenSource(token, sources); + return sourceIndex === sortTokenIndex(token, indices) && (piece.kind === "base" && tokenSource === void 0 || piece.kind === "insert" && piece.source === tokenSource); +} +function deduplicateArrayEntries(node) { + const overlay = arrayOverlay(node); + const seenBase = /* @__PURE__ */ new Set(); + const seenInsert = /* @__PURE__ */ new Map(); + const next = []; + let duplicated = false; + for (const piece of piecesOf(overlay)) { + for (let offset = 0; offset < piece.length; offset++) { + const sourceIndex = piece.start + piece.step * offset; + let seen; + if (piece.kind === "base") { + seen = seenBase.has(sourceIndex); + seenBase.add(sourceIndex); + } else { + let indices = seenInsert.get(piece.source); + if (indices === void 0) { + indices = /* @__PURE__ */ new Set(); + seenInsert.set(piece.source, indices); + } + seen = indices.has(sourceIndex); + indices.add(sourceIndex); + } + if (seen) { + duplicated = true; + appendMergedPiece(next, insertPiece(node, [clonePlacementStored(entryValueAt(node, piece, sourceIndex), node.context)])[0]); + } else + appendMergedPiece(next, singletonPiece(piece, sourceIndex)); + } + } + if (!duplicated) + return; + replaceAllPieces(overlay, next); + overlay.structural = true; + overlay.generation += 1; + overlay.plan = void 0; + markDirty(node); +} +function piecesFromSortOrder(order, sources, indices) { + const pieces = []; + for (const token of order) { + const source = token < 0 ? sources[-token - 1] : void 0; + const sourceIndex = token < 0 ? indices[-token - 1] : token; + const previous = pieces.at(-1); + const sameSource = previous !== void 0 && (source === void 0 && previous.kind === "base" || source !== void 0 && previous.kind === "insert" && previous.source === source); + if (previous !== void 0 && sameSource) { + if (previous.length === 1) { + const step = sourceIndex - previous.start; + if (step === 1 || step === -1) { + previous.step = step; + previous.length = 2; + continue; + } + } else if (previous.start + previous.step * previous.length === sourceIndex) { + previous.length += 1; + continue; + } + } + pieces.push(source === void 0 ? { kind: "base", start: sourceIndex, length: 1, step: 1 } : { kind: "insert", source, start: sourceIndex, length: 1, step: 1 }); + } + return pieces; +} +function appendMergedPiece(pieces, piece) { + const previous = pieces.at(-1); + const sameSource = previous !== void 0 && previous.kind === piece.kind && (previous.kind === "base" || previous.source === piece.source); + if (previous !== void 0 && sameSource && previous.length === 1 && piece.length === 1) { + const step = piece.start - previous.start; + if (step === 1 || step === -1) { + previous.step = step; + previous.length = 2; + return; + } + } + if (previous !== void 0 && sameSource && previous.step === piece.step && previous.start + previous.step * previous.length === piece.start) { + previous.length += piece.length; + } else + pieces.push(piece); +} +function singletonPiece(piece, sourceIndex) { + return piece.kind === "base" ? { kind: "base", start: sourceIndex, length: 1, step: 1 } : { kind: "insert", source: piece.source, start: sourceIndex, length: 1, step: 1 }; +} +function clonePlacement(value2) { + const proxyNode = isContainer2(value2) ? Reflect.get(value2, NODE) : void 0; + return proxyNode === void 0 ? copyJson(value2) : clonePlacementNode(proxyNode); +} +function cloneNode(node) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + const overlay = arrayOverlay(node); + const result2 = []; + for (const piece of piecesOf(overlay)) { + for (let offset = 0; offset < piece.length; offset++) { + const sourceIndex = piece.start + piece.step * offset; + result2.push(cloneStored(entryValueAt(node, piece, sourceIndex), node.context)); + } + } + return result2; + } + const result = Object.create(Object.getPrototypeOf(nodeBase(node))); + for (const key of ownKeys(node)) + defineData3(result, key, cloneStored(objectValue(node, key), node.context)); + return result; +} +function cloneStored(value2, context) { + if (!isContainer2(value2)) + return value2; + const node = context.rawNodes?.get(value2); + return node === void 0 || !node.dirty && !node.subtreeDirty ? value2 : cloneNode(node); +} +function clonePlacementNode(node) { + assertReadable(node.context); + if (Array.isArray(nodeBase(node))) { + const overlay = arrayOverlay(node); + const result2 = []; + for (const piece of piecesOf(overlay)) { + for (let offset = 0; offset < piece.length; offset++) { + const sourceIndex = piece.start + piece.step * offset; + result2.push(clonePlacementStored(entryValueAt(node, piece, sourceIndex), node.context)); + } + } + return result2; + } + const result = Object.create(Object.getPrototypeOf(nodeBase(node))); + for (const key of ownKeys(node)) + defineData3(result, key, clonePlacementStored(objectValue(node, key), node.context)); + return result; +} +function clonePlacementStored(value2, context) { + if (!isContainer2(value2)) + return copyJson(value2); + const node = context.rawNodes?.get(value2); + return node === void 0 ? copyJson(value2) : clonePlacementNode(node); +} +function defineData3(target, key, value2) { + DATA_DESCRIPTOR3.value = value2; + Object.defineProperty(target, key, DATA_DESCRIPTOR3); + DATA_DESCRIPTOR3.value = void 0; +} +function emitOperations(context) { + const simple = emitSimpleObjectOperations(context); + if (simple !== void 0) + return simple; + const operations = []; + const forcedFolds = /* @__PURE__ */ new Map(); + const emissionPaths = /* @__PURE__ */ new Map(); + const denseIndices = /* @__PURE__ */ new Map(); + for (const node of context.dirty) { + recordDenseArrayPosition(node, denseIndices); + if (Array.isArray(nodeBase(node))) { + const overlay = arrayOverlay(node); + if (!overlay.structural && (overlay.baseOverrides?.size ?? 0) > 0) { + let candidates = denseIndices.get(node); + if (candidates === void 0) { + candidates = { indices: [], bits: void 0, length: nodeBase(node).length }; + denseIndices.set(node, candidates); + } + for (const index of overlay.baseOverrides.keys()) + addDenseCandidate(candidates, index); + } + } + } + const denseRegions = /* @__PURE__ */ new Map(); + for (const [array, candidates] of denseIndices) { + const path5 = resolvePath2(array); + if (path5 === void 0 || path5.some((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment))) { + continue; + } + const regions = buildDenseRegions(candidates); + if (regions.length > 0) + denseRegions.set(array, regions); + } + for (const node of context.dirty) { + const path5 = resolvePath2(node); + if (path5 === void 0) + continue; + if (hasCoveringDenseRegion(node, path5, denseRegions)) + continue; + emissionPaths.set(node, path5); + if (!Array.isArray(nodeBase(node)) && hasReservedMutation(node)) + forcedFolds.set(node, path5); + const reservedAt = path5.findIndex((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment)); + if (reservedAt >= 0) { + let ancestor = node; + for (let depth = path5.length; depth > reservedAt; depth--) + ancestor = nodeParent(ancestor); + forcedFolds.set(ancestor, path5.slice(0, reservedAt)); + } + } + for (const [node, path5] of forcedFolds) + emissionPaths.set(node, path5); + for (const node of denseRegions.keys()) { + const path5 = resolvePath2(node); + if (path5 !== void 0 && !hasCoveringDenseRegion(node, path5, denseRegions)) + emissionPaths.set(node, path5); + } + let maxDepth = 0; + for (const path5 of emissionPaths.values()) + maxDepth = Math.max(maxDepth, path5.length); + const buckets = Array.from({ length: maxDepth + 1 }, () => []); + for (const [node, path5] of emissionPaths) + buckets[path5.length].push(node); + const folded = /* @__PURE__ */ new Set(); + for (const bucket of buckets) { + for (const node of bucket) { + const path5 = emissionPaths.get(node); + if (hasPlacementAncestor(node) || hasFoldedAncestor(node, folded)) + continue; + if (forcedFolds.has(node)) { + emitSet(operations, path5, cloneNode(node)); + folded.add(node); + continue; + } + if (Array.isArray(nodeBase(node))) + emitArrayOperations(node, path5, operations, denseRegions.get(node)); + else + emitObjectOperations(node, path5, operations); + if (operations.length > MAX_DELTA_OPERATIONS) { + locatedDenseArray = void 0; + return [["r", cloneNode(context.root)]]; + } + } + } + locatedDenseArray = void 0; + return operations; +} +function emitSimpleObjectOperations(context) { + const nodes = []; + for (const node of context.dirty) { + if (Array.isArray(nodeBase(node)) || hasReservedMutation(node) || hasPlacementAncestor(node)) + return void 0; + for (let parent2 = nodeParent(node); parent2 !== void 0; parent2 = nodeParent(parent2)) { + if (Array.isArray(nodeBase(parent2))) + return void 0; + } + const path5 = resolvePath2(node); + if (path5 === void 0) + continue; + for (const segment of path5) { + if (typeof segment === "string" && RESERVED_SEGMENTS.has(segment)) + return void 0; + } + nodes.push(node); + if (nodes.length > MAX_SIMPLE_OBJECT_NODES) + return void 0; + } + for (let index = 1; index < nodes.length; index++) { + const node = nodes[index]; + const depth = node.preparedPath.length; + let at = index; + while (at > 0 && nodes[at - 1].preparedPath.length > depth) { + nodes[at] = nodes[at - 1]; + at -= 1; + } + nodes[at] = node; + } + const operations = []; + let canMaterializeDirectly = true; + for (const node of nodes) { + if (emitObjectOperations(node, node.preparedPath, operations)) + canMaterializeDirectly = false; + if (operations.length > MAX_DELTA_OPERATIONS) + return [["r", cloneNode(context.root)]]; + } + context.simpleObjectMaterialization = canMaterializeDirectly; + return operations; +} +var locatedDenseArray; +var locatedDenseIndex = 0; +function locateDenseArrayPosition(node) { + let child = node; + for (let parent2 = nodeParent(child); parent2 !== void 0; parent2 = nodeParent(child)) { + if (Array.isArray(nodeBase(parent2))) { + const overlay = arrayOverlay(parent2); + if (child.parentKind !== 1 || overlay.structural) + return false; + const sourceIndex = child.parentKey; + const valueIndex = overlay.baseOverrides?.get(sourceIndex); + const current = valueIndex === void 0 ? nodeBase(parent2)[sourceIndex] : storedValue(parent2.context, valueIndex); + if (current !== nodeBase(child)) + return false; + locatedDenseArray = parent2; + locatedDenseIndex = sourceIndex; + return true; + } + child = parent2; + } + return false; +} +function hasCoveringDenseRegion(node, path5, denseRegions) { + for (let parent2 = nodeParent(node); parent2 !== void 0; parent2 = nodeParent(parent2)) { + const regions = denseRegions.get(parent2); + if (regions === void 0) + continue; + const parentPath = resolvePath2(parent2); + if (parentPath === void 0 || path5.length <= parentPath.length) + continue; + let matches = true; + for (let index2 = 0; index2 < parentPath.length; index2++) { + if (path5[index2] !== parentPath[index2]) { + matches = false; + break; + } + } + if (!matches) + continue; + const index = path5[parentPath.length]; + if (typeof index === "number" && regionContaining(regions, index)) + return true; + } + return false; +} +function addDenseCandidate(candidates, index) { + if (candidates.bits !== void 0) { + candidates.bits[index] = 1; + return; + } + candidates.indices.push(index); + if (candidates.indices.length < 256) + return; + candidates.bits = new Uint8Array(candidates.length); + for (const existing of candidates.indices) + candidates.bits[existing] = 1; + candidates.indices.length = 0; +} +function recordDenseArrayPosition(node, groups) { + if (!locateDenseArrayPosition(node)) + return; + let candidates = groups.get(locatedDenseArray); + if (candidates === void 0) { + candidates = { indices: [], bits: void 0, length: nodeBase(locatedDenseArray).length }; + groups.set(locatedDenseArray, candidates); + } + addDenseCandidate(candidates, locatedDenseIndex); +} +function buildDenseRegions(candidates) { + if (candidates.bits === void 0) + return []; + const regions = []; + const bits = candidates.bits; + for (let at = 0; at < bits.length; ) { + while (at < bits.length && bits[at] === 0) + at += 1; + if (at === bits.length) + break; + const start = at; + let end = at; + let count = 0; + let gap = 0; + while (at < bits.length) { + if (bits[at] !== 0) { + count += 1; + end = at; + gap = 0; + } else if (++gap > 1) + break; + at += 1; + } + const length = end - start + 1; + if (count >= 256 && count * 2 >= length) + regions.push({ start, length }); + } + return regions; +} +function regionContaining(regions, index) { + for (const region of regions) + if (index >= region.start && index < region.start + region.length) + return true; + return false; +} +function hasReservedMutation(node) { + if (node.writeKey !== void 0 && RESERVED_SEGMENTS.has(node.writeKey)) + return true; + if (node.deleteKey !== void 0 && RESERVED_SEGMENTS.has(node.deleteKey)) + return true; + if (node.writes !== void 0) { + for (const key of node.writes.keys()) + if (RESERVED_SEGMENTS.has(key)) + return true; + } + if (node.deletes !== void 0) { + for (const key of node.deletes) + if (RESERVED_SEGMENTS.has(key)) + return true; + } + return false; +} +function hasFoldedAncestor(node, folded) { + for (let parent2 = nodeParent(node); parent2 !== void 0; parent2 = nodeParent(parent2)) + if (folded.has(parent2)) + return true; + return false; +} +function hasPlacementAncestor(node) { + for (let current = node; current !== void 0; current = nodeParent(current)) { + if (nodeParent(current) !== void 0 && current.parentPlacement) + return true; + } + return false; +} +function emitObjectWrite(node, path5, operations, key, value2) { + const nextPath = [...path5, key]; + const appended = node.appends?.get(key); + if (appended !== void 0) { + operations.push(["a", nextPath, appended]); + return false; + } + const before = node.readded?.has(key) || !Object.hasOwn(nodeBase(node), key) ? void 0 : nodeBase(node)[key]; + const after = cloneStored(value2, node.context); + const emitted = emitChangedValue(operations, nextPath, before, after); + return isContainer2(before) && isContainer2(after) && !emitted; +} +function emitObjectOperations(node, path5, operations) { + if (node.readded !== void 0) { + for (const key of node.readded) { + if (Object.hasOwn(nodeBase(node), key)) + operations.push(["d", [...path5, key]]); + } + } + let normalizedContainerWrite = false; + if (node.writeKey !== void 0) + normalizedContainerWrite = emitObjectWrite(node, path5, operations, node.writeKey, objectValue(node, node.writeKey)); + if (node.writes !== void 0) { + for (const [key, valueIndex] of node.writes) { + if (operations.length > MAX_DELTA_OPERATIONS) + return normalizedContainerWrite; + if (emitObjectWrite(node, path5, operations, key, storedValue(node.context, valueIndex))) + normalizedContainerWrite = true; + } + } + if (node.deleteKey !== void 0 && Object.hasOwn(nodeBase(node), node.deleteKey)) { + operations.push(["d", [...path5, node.deleteKey]]); + } + if (node.deletes !== void 0) { + for (const key of node.deletes) { + if (operations.length > MAX_DELTA_OPERATIONS) + return normalizedContainerWrite; + if (Object.hasOwn(nodeBase(node), key)) + operations.push(["d", [...path5, key]]); + } + } + return normalizedContainerWrite; +} +function buildArrayPlan(node) { + const overlay = arrayOverlay(node); + if (overlay.plan !== void 0) + return overlay.plan; + const base = nodeBase(node); + const pieces = piecesOf(overlay); + overlay.plan = orderedArrayPlan(base.length, pieces) ?? elementArrayPlan(base.length, pieces); + return overlay.plan; +} +function orderedArrayPlan(baseLength, pieces) { + const ranges = []; + for (const piece of pieces) { + if (piece.kind !== "base" || piece.length === 0) + continue; + if (piece.step !== 1 && piece.length > 1) + return void 0; + if (ranges.length > 0 && piece.start <= ranges[ranges.length - 1]) + return void 0; + ranges.push(piece.start, piece.start + piece.length - 1); + } + const removeRuns = []; + let end = baseLength; + for (let index = ranges.length - 2; index >= -2; index -= 2) { + const start = index >= 0 ? ranges[index + 1] + 1 : 0; + if (end > start) + removeRuns.push(start, end - start); + if (index >= 0) + end = ranges[index]; + } + return { removeRuns, permutation: void 0, insertRuns: insertRunsOf(pieces) }; +} +function elementArrayPlan(baseLength, pieces) { + const retained = new Uint8Array(baseLength); + const targetBase = []; + for (const piece of pieces) { + if (piece.kind !== "base") + continue; + for (let offset = 0; offset < piece.length; offset++) { + const index = piece.start + piece.step * offset; + retained[index] = 1; + targetBase.push(index); + } + } + const removeRuns = []; + for (let end = baseLength; end > 0; ) { + if (retained[end - 1] !== 0) { + end -= 1; + continue; + } + let start = end - 1; + while (start > 0 && retained[start - 1] === 0) + start -= 1; + removeRuns.push(start, end - start); + end = start; + } + const retainedBase = []; + for (let index = 0; index < retained.length; index++) + if (retained[index] !== 0) + retainedBase.push(index); + let permutation; + if (targetBase.some((value2, index) => value2 !== retainedBase[index])) { + const positions = new Map(retainedBase.map((value2, index) => [value2, index])); + permutation = targetBase.map((value2) => positions.get(value2)); + } + return { removeRuns, permutation, insertRuns: insertRunsOf(pieces) }; +} +function insertRunsOf(pieces) { + const insertRuns = []; + let logicalIndex = 0; + for (let pieceIndex = 0; pieceIndex < pieces.length; ) { + const piece = pieces[pieceIndex]; + if (piece.kind === "base") { + logicalIndex += piece.length; + pieceIndex += 1; + continue; + } + const startPiece = pieceIndex; + while (pieceIndex < pieces.length && pieces[pieceIndex].kind === "insert") { + logicalIndex += pieces[pieceIndex].length; + pieceIndex += 1; + } + insertRuns.push(logicalIndex - rangeLength(pieces, startPiece, pieceIndex), startPiece, pieceIndex); + } + return insertRuns; +} +function rangeLength(pieces, start, end) { + let length = 0; + for (let index = start; index < end; index++) + length += pieces[index].length; + return length; +} +function emitArrayOperations(node, path5, operations, denseRegions) { + const overlay = arrayOverlay(node); + const base = nodeBase(node); + if (denseRegions !== void 0) { + for (const region of denseRegions) { + if (operations.length > MAX_DELTA_OPERATIONS) + return; + operations.push(["p", path5, region.start, region.length, cloneArrayRegion(node, region)]); + } + } + if (overlay.structural) { + const plan = buildArrayPlan(node); + for (let index = 0; index < plan.removeRuns.length; index += 2) { + if (operations.length > MAX_DELTA_OPERATIONS) + return; + operations.push(["p", path5, plan.removeRuns[index], plan.removeRuns[index + 1], []]); + } + if (plan.permutation !== void 0) + operations.push(["m", path5, plan.permutation]); + const pieces = piecesOf(overlay); + for (let run2 = 0; run2 < plan.insertRuns.length; run2 += 3) { + if (operations.length > MAX_DELTA_OPERATIONS) + return; + const logicalIndex = plan.insertRuns[run2]; + const items = []; + for (let pieceIndex = plan.insertRuns[run2 + 1]; pieceIndex < plan.insertRuns[run2 + 2]; pieceIndex++) { + const piece = pieces[pieceIndex]; + for (let offset = 0; offset < piece.length; offset++) { + const sourceIndex = piece.start + piece.step * offset; + items.push(cloneStored(entryValueAt(node, piece, sourceIndex), node.context)); + } + } + operations.push(["p", path5, logicalIndex, 0, items]); + } + } + for (const [baseIndex, valueIndex] of overlay.baseOverrides ?? []) { + if (operations.length > MAX_DELTA_OPERATIONS) + return; + const index = findEntryIndex(overlay, 1, baseIndex, void 0); + if (index === void 0 || denseRegions !== void 0 && regionContaining(denseRegions, index)) + continue; + emitChangedValue(operations, [...path5, index], base[baseIndex], cloneStored(storedValue(node.context, valueIndex), node.context)); + } +} +function cloneArrayRegion(node, region) { + const overlay = arrayOverlay(node); + const result = []; + for (let index = region.start; index < region.start + region.length; index++) { + const piece = locatePiece(overlay, index); + const sourceIndex = piece.start + piece.step * overlay.locatedOffset; + result.push(cloneStored(entryValueAt(node, piece, sourceIndex), node.context)); + } + return result; +} +function emitChangedValue(operations, path5, before, after) { + if (!isContainer2(after) && before === after) + return false; + if (isContainer2(before) && isContainer2(after) && equalTrustedJson(before, after)) + return false; + if (typeof before === "string" && typeof after === "string") { + if (after.length > before.length && after.slice(0, before.length) === before) { + operations.push(["a", path5, ownedSlice2(after, before.length)]); + return true; + } + const shared = overlap(before, after, 65536); + if (shared > 0) { + operations.push(["t", path5, before.length - shared]); + if (after.length > shared) + operations.push(["a", path5, ownedSlice2(after, shared)]); + return true; + } + } + operations.push(["s", path5, after]); + return true; +} +function emitSet(operations, path5, value2) { + if (path5.length === 0) + operations.push(["r", value2]); + else + operations.push(["s", path5, value2]); +} +function resolvePath2(node) { + if (node.preparedPath !== void 0) + return node.preparedPath; + const parent2 = nodeParent(node); + if (parent2 === void 0) { + node.preparedPath = []; + return node.preparedPath; + } + const parentPath = resolvePath2(parent2); + if (parentPath === void 0) + return void 0; + if (node.parentKind === 0) { + const key = node.parentKey; + if (!objectHas(parent2, key) || objectValue(parent2, key) !== nodeBase(node)) + return void 0; + node.preparedPath = [...parentPath, key]; + return node.preparedPath; + } + const overlay = arrayOverlay(parent2); + const index = findEntryIndex(overlay, node.parentKind, node.parentKey, node.parentSource); + if (index === void 0) + return void 0; + const piece = locatePiece(overlay, index); + if (entryValueAt(parent2, piece, node.parentKey) !== nodeBase(node)) + return void 0; + node.preparedPath = [...parentPath, index]; + return node.preparedPath; +} +function ensurePieceLocations(overlay) { + if (overlay.baseLocations !== void 0) + return; + overlay.baseLocations = []; + overlay.insertLocations = /* @__PURE__ */ new Map(); + let logicalStart = 0; + for (const piece of piecesOf(overlay)) { + const last = piece.start + piece.step * (piece.length - 1); + const location = { + piece, + logicalStart, + minimum: Math.min(piece.start, last), + maximum: Math.max(piece.start, last) + }; + if (piece.kind === "base") + overlay.baseLocations.push(location); + else { + let locations = overlay.insertLocations.get(piece.source); + if (locations === void 0) { + locations = []; + overlay.insertLocations.set(piece.source, locations); + } + locations.push(location); + } + logicalStart += piece.length; + } + const byMinimum = (left, right) => left.minimum - right.minimum; + overlay.baseLocations.sort(byMinimum); + for (const locations of overlay.insertLocations.values()) + locations.sort(byMinimum); +} +function findEntryIndex(overlay, kind, sourceIndex, source) { + if (kind === 1 && !overlay.structural) + return sourceIndex; + ensurePieceLocations(overlay); + const locations = kind === 1 ? overlay.baseLocations : overlay.insertLocations.get(source); + if (locations === void 0) + return void 0; + let low = 0; + let high = locations.length; + while (low < high) { + const middle = low + high >>> 1; + if (locations[middle].minimum <= sourceIndex) + low = middle + 1; + else + high = middle; + } + const location = locations[low - 1]; + if (location === void 0 || sourceIndex > location.maximum) + return void 0; + const offset = (sourceIndex - location.piece.start) / location.piece.step; + return offset >= 0 && offset < location.piece.length ? location.logicalStart + offset : void 0; +} +function ensureOperations(context) { + if (context.ops !== void 0) + return context.ops; + assertReadable(context); + if (context.replacement) { + const base = context.tracker.deref()?.replacementBase(context); + context.replacementNoop = base !== void 0 && equalTrustedJson(base, nodeBase(context.root)); + context.ops = context.replacementNoop ? [] : [["r", nodeBase(context.root)]]; + } else + context.ops = emitOperations(context); + return context.ops; +} +function equalTrustedJson(left, right) { + if (left === right) + return true; + if (!isContainer2(left) || !isContainer2(right) || Array.isArray(left) !== Array.isArray(right)) + return false; + if (Array.isArray(left)) { + const other2 = right; + if (left.length !== other2.length) + return false; + for (let index = 0; index < left.length; index++) + if (!equalTrustedJson(left[index], other2[index])) + return false; + return true; + } + const other = right; + const keys = Object.keys(left); + if (keys.length !== Object.keys(other).length) + return false; + for (const key of keys) + if (!Object.hasOwn(other, key) || !equalTrustedJson(left[key], other[key])) + return false; + return true; +} +function abortContext(context) { + if (context.status.value === "aborted" || context.status.value === "consumed" || context.status.value === "stale") + return; + context.status.value = "aborted"; + clearContext(context); +} +function releaseOverlayReferences(context) { + context.tracker.deref()?.releaseContext(context); + if (locatedDenseArray?.context === context) + locatedDenseArray = void 0; + context.overlayReleased = true; + context.dirty.length = 0; + context.nodes.length = 0; + context.rawNodes = void 0; + context.ops = void 0; + context.root = void 0; + context.bases = void 0; + context.stored = void 0; + context.baseValue = void 0; +} +function clearContext(context) { + context.tracker.deref()?.releaseContext(context); + if (locatedDenseArray?.context === context) + locatedDenseArray = void 0; + for (const node of context.nodes) { + if (Array.isArray(node.target)) + node.target.length = 0; + Reflect.deleteProperty(node.target, NODE); + node.writes?.clear(); + node.deletes?.clear(); + node.readded?.clear(); + if (node.array?.pieces !== void 0) + node.array.pieces.length = 0; + if (node.array !== void 0) { + node.array.root = void 0; + node.array.baseLocations = void 0; + node.array.insertLocations = void 0; + } + node.array?.baseOverrides?.clear(); + node.array?.insertOverrides?.clear(); + node.parentSource = void 0; + node.target = RELEASED; + node.proxy = RELEASED; + node.writeKey = void 0; + node.writeValue = void 0; + node.writes = void 0; + node.deleteKey = void 0; + node.deletes = void 0; + node.readded = void 0; + node.array = void 0; + node.subtreeDirty = void 0; + node.preparedPath = void 0; + } + context.dirty.length = 0; + context.nodes.length = 0; + context.rawNodes = void 0; + context.ops = void 0; + context.root = void 0; + context.bases = void 0; + context.stored = void 0; + context.baseValue = void 0; + context.overlayReleased = true; +} +function isContainer2(value2) { + return value2 !== null && typeof value2 === "object"; +} + +// node_modules/@earendil-works/chord/dist/delta/pending.js +var MAX_PENDING_OPS = 1e4; +var EMPTY3 = { kind: "empty" }; +var REPLACE = { kind: "replace" }; +var NO_OPS = { kind: "ops", ops: [] }; +var REPLACE_TAKE = { kind: "replace" }; +var PendingOps = class { + #state = EMPTY3; + /** Queue the ops of one commit. */ + push(ops3) { + if (ops3.length === 0) + return; + const state2 = this.#state; + if (ops3[0][0] === "r") { + this.#state = { kind: "batch", ops: ops3 }; + return; + } + switch (state2.kind) { + case "empty": + this.#state = { kind: "batch", ops: ops3 }; + return; + case "batch": { + const folding = { kind: "folding", ops: [], leaves: /* @__PURE__ */ new Map() }; + this.#state = folding; + if (this.#fold(state2.ops, folding)) + this.#fold(ops3, folding); + return; + } + case "folding": + this.#fold(ops3, state2); + return; + case "replace": + return; + } + } + /** + * Pending ops after folding; 1 once overflowed (the replacement the owner sends). One batch is counted as received, + * so a single commit larger than `MAX_PENDING_OPS` counts in full until a second one arrives and overflows. + */ + get size() { + const state2 = this.#state; + if (state2.kind === "empty") + return 0; + return state2.kind === "replace" ? 1 : state2.ops.length; + } + /** Hand over everything pending and start empty. */ + take() { + const state2 = this.#state; + this.#state = EMPTY3; + switch (state2.kind) { + case "empty": + return NO_OPS; + case "batch": + case "folding": + return { kind: "ops", ops: state2.ops }; + case "replace": + return REPLACE_TAKE; + } + } + /** Fold `ops` into `folding`; false once the queue overflowed into `replace`. */ + #fold(ops3, folding) { + for (const op2 of ops3) { + switch (op2[0]) { + case "r": + folding.ops.length = 0; + folding.leaves.clear(); + break; + case "a": + if (mergeLeaf(op2, folding)) + continue; + break; + case "s": + if (isPrimitive(op2[2])) { + if (mergeLeaf(op2, folding)) + continue; + } else if (folding.leaves.size > 0) + folding.leaves.clear(); + break; + default: + if (folding.leaves.size > 0) + folding.leaves.clear(); + } + folding.ops.push(op2); + if (folding.ops.length > MAX_PENDING_OPS) { + this.#state = REPLACE; + return false; + } + } + return true; + } +}; +var isPrimitive = (value2) => value2 === null || typeof value2 !== "object"; +function mergeLeaf(op2, folding) { + const key = pathKey(op2[1]); + const at = folding.leaves.get(key); + if (at !== void 0) { + const merged = merge2(folding.ops[at], op2); + if (merged !== void 0) { + folding.ops[at] = merged; + return true; + } + } + folding.leaves.set(key, folding.ops.length); + return false; +} +function pathKey(path5) { + return JSON.stringify(path5); +} +function merge2(previous, next) { + if (next[0] === "s") + return next; + if (previous[0] === "a") + return ["a", previous[1], previous[2] + next[2]]; + if (typeof previous[2] === "string") + return ["s", previous[1], previous[2] + next[2]]; + return void 0; +} + +// node_modules/@earendil-works/chord/dist/delta/index.js +var isObj3 = (value2) => value2 !== null && typeof value2 === "object"; +function overlap(a, b, scan, probe = 64, maxCandidates = 8) { + if (a.length === 0 || b.length === 0 || scan === 0) + return 0; + const tail = a.length > scan ? a.slice(a.length - scan) : a; + for (const h of [Math.min(probe, b.length), 1]) { + const head = b.slice(0, h); + let tried = 0; + for (let k = tail.indexOf(head); k !== -1; k = tail.indexOf(head, k + 1)) { + if (++tried > maxCandidates) + break; + const n = tail.length - k; + if (n <= b.length && tail.slice(k) === b.slice(0, n)) + return n; + } + if (h === 1) + break; + } + return 0; +} +function ownedSlice2(text, start, end = text.length) { + return `${text.slice(start, end)} `.slice(0, -1); +} +var RESERVED_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); +var UnsafePathError = class extends Error { + // Not a parameter property: Node's --experimental-strip-types rejects those, + // and these files are meant to run under it directly. + segment; + constructor(segment) { + super(`unsafe path segment: ${String(segment)}`); + this.segment = segment; + this.name = "UnsafePathError"; + } +}; +function assertValidOp(op2) { + if (!Array.isArray(op2) || op2.length === 0) + throw new TypeError("op is not a tuple"); + switch (op2[0]) { + case "r": + if (op2.length !== 2) + throw new TypeError("r arity"); + return; + case "s": + if (op2.length !== 3) + throw new TypeError("s arity"); + assertPathArg(op2[1], true); + return; + case "d": + if (op2.length !== 2) + throw new TypeError("d arity"); + assertPathArg(op2[1], true); + return; + case "a": + if (op2.length !== 3 || typeof op2[2] !== "string") + throw new TypeError("a shape"); + assertPathArg(op2[1], true); + return; + case "t": + if (op2.length !== 3 || !Number.isInteger(op2[2]) || op2[2] < 0) + throw new TypeError("t shape"); + assertPathArg(op2[1], true); + return; + case "p": { + if (op2.length !== 5) + throw new TypeError("p arity"); + assertPathArg(op2[1]); + if (!Number.isInteger(op2[2]) || op2[2] < 0) + throw new TypeError("p index"); + if (!Number.isInteger(op2[3]) || op2[3] < 0) + throw new TypeError("p remove"); + if (!Array.isArray(op2[4])) + throw new TypeError("p items"); + return; + } + case "m": + if (op2.length !== 3) + throw new TypeError("m arity"); + assertPathArg(op2[1]); + assertPermutation(op2[2]); + return; + // Silently skipping an unknown verb is how a newer producer's op vanishes. + default: + throw new TypeError(`unknown op verb: ${String(op2[0])}`); + } +} +function assertPathArg(p, nonEmpty = false) { + if (!Array.isArray(p)) + throw new TypeError("path is not an array"); + if (nonEmpty && p.length === 0) + throw new TypeError("path is empty"); + assertSafePath(p); +} +function assertPermutation(value2) { + if (!Array.isArray(value2)) + throw new TypeError("m permutation is not an array"); + const seen = new Uint8Array(value2.length); + for (const index of value2) { + if (!Number.isInteger(index) || index < 0 || index >= value2.length || seen[index] !== 0) { + throw new TypeError("m permutation is not a bijection"); + } + seen[index] = 1; + } +} +function assertSafePath(path5) { + for (const seg of path5) { + if (typeof seg === "string") { + if (RESERVED_SEGMENTS.has(seg)) + throw new UnsafePathError(seg); + } else if (!Number.isInteger(seg) || seg < 0) { + throw new UnsafePathError(seg); + } + } +} +function assertIndexInRange(parent2, index) { + if (index > parent2.length) + throw new UnsafePathError(index); +} +var PathError = class extends Error { + path; + constructor(path5) { + super(`unresolvable path: ${JSON.stringify(path5)}`); + this.path = path5; + this.name = "PathError"; + } +}; +function apply(target, ops3) { + return applyOps(target, ops3); +} +function applyOps(target, ops3) { + let root2 = target; + for (const op2 of ops3) { + assertValidOp(op2); + if (op2[0] === "r") { + root2 = op2[1]; + continue; + } + const path5 = op2[1]; + assertSafePath(path5); + if (op2[0] === "p") { + const target_ = path5.length === 0 ? root2 : resolve(root2, path5); + if (!Array.isArray(target_)) + throw new PathError(path5); + target_.splice(op2[2], op2[3]); + const chunkSize = 1e4; + for (let offset = 0; offset < op2[4].length; offset += chunkSize) { + target_.splice(op2[2] + offset, 0, ...op2[4].slice(offset, offset + chunkSize)); + } + continue; + } + if (op2[0] === "m") { + const target_ = path5.length === 0 ? root2 : resolve(root2, path5); + if (!Array.isArray(target_) || target_.length !== op2[2].length) + throw new PathError(path5); + const previous = target_.slice(); + for (let index = 0; index < op2[2].length; index++) + target_[index] = previous[op2[2][index]]; + continue; + } + const parent2 = resolve(root2, path5.slice(0, -1)); + const key = path5[path5.length - 1]; + if (Array.isArray(parent2)) { + if (typeof key !== "number") + throw new UnsafePathError(key); + assertIndexInRange(parent2, key); + } + const write = (value2) => { + Object.defineProperty(parent2, key, { value: value2, writable: true, enumerable: true, configurable: true }); + }; + const read2 = () => Object.hasOwn(parent2, key) ? parent2[key] : void 0; + switch (op2[0]) { + case "s": + write(op2[2]); + break; + case "d": + if (Array.isArray(parent2)) { + if (typeof key !== "number" || key >= parent2.length) + throw new PathError(path5); + parent2.splice(key, 1); + } else + delete parent2[key]; + break; + case "a": { + const current = read2(); + if (typeof current !== "string") + throw new PathError(path5); + write(`${current}${op2[2]}`); + break; + } + case "t": { + const current = read2(); + if (typeof current !== "string") + throw new PathError(path5); + write(current.slice(op2[2])); + break; + } + } + } + return root2; +} +function applyImmutable(target, ops3) { + return applyImmutableBatches(target, [ops3]); +} +function applyImmutableBatches(target, batches) { + let root2 = target; + const owned = /* @__PURE__ */ new WeakSet(); + for (const ops3 of batches) { + for (const op2 of ops3) { + assertValidOp(op2); + if (op2[0] === "r") { + root2 = op2[1]; + continue; + } + if (op2[0] === "p") { + const appended = appendCopy(root2, op2, owned); + if (appended !== void 0) { + root2 = appended; + continue; + } + } + root2 = copyContainers(root2, op2[0] === "p" || op2[0] === "m" ? op2[1] : op2[1].slice(0, -1), owned); + root2 = applyOps(root2, [op2]); + } + } + return root2; +} +function appendCopy(root2, op2, owned) { + const [, path5, index, deleteCount, items] = op2; + if (deleteCount !== 0) + return void 0; + let target = root2; + for (const segment of path5) { + const valid = typeof segment === "string" ? !RESERVED_SEGMENTS.has(segment) && isObj3(target) && !Array.isArray(target) : Number.isInteger(segment) && segment >= 0 && Array.isArray(target); + if (!valid || !Object.hasOwn(target, segment)) + return void 0; + target = target[segment]; + } + if (!Array.isArray(target) || owned.has(target) || index !== target.length) + return void 0; + const appended = target.concat(items); + owned.add(appended); + if (path5.length === 0) + return appended; + const parentPath = path5.slice(0, -1); + const copiedRoot = copyContainers(root2, parentPath, owned); + Object.defineProperty(resolve(copiedRoot, parentPath), path5[path5.length - 1], { + value: appended, + writable: true, + enumerable: true, + configurable: true + }); + return copiedRoot; +} +function copyContainers(root2, path5, owned) { + const copy2 = (value2) => { + if (Array.isArray(value2)) + return value2.slice(); + if (!isObj3(value2)) + throw new PathError(path5); + return Object.getPrototypeOf(value2) === null ? Object.assign(/* @__PURE__ */ Object.create(null), value2) : { ...value2 }; + }; + if (!isObj3(root2)) + throw new PathError(path5); + let copiedRoot; + if (owned.has(root2)) + copiedRoot = root2; + else { + copiedRoot = copy2(root2); + owned.add(copiedRoot); + } + let destination = copiedRoot; + for (const segment of path5) { + if (!Object.hasOwn(destination, segment)) + throw new PathError(path5); + if (Array.isArray(destination) && typeof segment !== "number") + throw new UnsafePathError(segment); + const child = destination[segment]; + if (!isObj3(child)) + throw new PathError(path5); + if (owned.has(child)) { + destination = child; + continue; + } + const copiedChild = copy2(child); + Object.defineProperty(destination, segment, { + value: copiedChild, + writable: true, + enumerable: true, + configurable: true + }); + owned.add(copiedChild); + destination = copiedChild; + } + return copiedRoot; +} +function resolveValue(root2, path5) { + let node = root2; + for (const seg of path5) { + if (!isObj3(node)) + throw new PathError(path5); + if (Array.isArray(node) && typeof seg !== "number") + throw new UnsafePathError(seg); + if (!Object.hasOwn(node, seg)) + throw new PathError(path5); + node = node[seg]; + } + return node; +} +function resolve(root2, path5) { + const node = resolveValue(root2, path5); + if (!isObj3(node)) + throw new PathError(path5); + return node; +} + +// node_modules/@earendil-works/chord/dist/context/index.js +init_dist(); +var ABORT_SIGNAL_CONTEXT_KEY = Object.freeze({ + token: /* @__PURE__ */ Symbol("chord.abortSignal") +}); +var TELEMETRY_CONTEXT_KEY = Object.freeze({ + token: /* @__PURE__ */ Symbol("chord.telemetry") +}); +var BaseContext = class { + get abortSignal() { + return this.value(ABORT_SIGNAL_CONTEXT_KEY); + } + get telemetry() { + return this.value(TELEMETRY_CONTEXT_KEY) ?? NOOP_TELEMETRY_CONTEXT; + } +}; +var EmptyContext = class extends BaseContext { + #name; + constructor(name) { + super(); + this.#name = name; + } + value(_key) { + return void 0; + } + toString() { + return this.#name; + } +}; +var ContextValue = class extends BaseContext { + #parent; + #key; + #value; + constructor(parent2, key, value2) { + super(); + this.#parent = parent2; + this.#key = key; + this.#value = value2; + } + value(key) { + if (key.token === this.#key.token) + return this.#value; + return this.#parent.value(key); + } + toString() { + return `${this.#parent}.WithValue(${this.#key.token.description ?? "anonymous"})`; + } +}; +var BACKGROUND_CONTEXT = new EmptyContext("[Context BACKGROUND_CONTEXT]"); +var TODO_CONTEXT = new EmptyContext("[Context TODO_CONTEXT]"); +function withContextValue(key, value2, parent2) { + return new ContextValue(parent2, key, value2); +} +function withTelemetry(telemetry, context) { + return withContextValue(TELEMETRY_CONTEXT_KEY, telemetry, context); +} +function withAbortSignal(signal, context) { + const parentSignal = context.abortSignal; + const combined = parentSignal === void 0 ? signal : AbortSignal.any([parentSignal, signal]); + return withContextValue(ABORT_SIGNAL_CONTEXT_KEY, combined, context); +} +function withoutAbortSignal(context) { + return withContextValue(ABORT_SIGNAL_CONTEXT_KEY, void 0, context); +} +function awaitWithContext(promise, context) { + const signal = context.abortSignal; + if (signal === void 0) + return promise; + if (signal.aborted) + return Promise.reject(abortError(signal)); + return new Promise((resolve2, reject2) => { + const onAbort = () => reject2(abortError(signal)); + signal.addEventListener("abort", onAbort, { once: true }); + void promise.then((value2) => { + signal.removeEventListener("abort", onAbort); + resolve2(value2); + }, (error) => { + signal.removeEventListener("abort", onAbort); + reject2(error); + }); + }); +} +function abortError(signal) { + const reason = signal.reason; + return reason instanceof Error ? reason : new DOMException("The operation was aborted", "AbortError"); +} + +// node_modules/@earendil-works/chord/dist/watch.js +var STOPPED = { kind: "stopped" }; +var ABORTED = { kind: "aborted" }; +var ENDED = { kind: "ended" }; +var WatchLifecycle = class { + #detach; + #report; + #closed = Promise.withResolvers(); + #value; + #listener; + #started = false; + #scheduled = false; + #running = false; + /** Set by `endAfterDelivery()`: the source sends nothing more; the watch ends `ended` once it delivered the rest. */ + #ending = false; + /** Set once, by `#terminate()`. */ + #end; + #abortSignal; + #abortListener; + constructor(value2, detach, report2) { + this.#value = value2; + this.#detach = detach; + this.#report = report2; + } + get value() { + return this.#value; + } + get closed() { + return this.#closed.promise; + } + start(listener) { + if (this.#started) + throw new Error("Watch is already started"); + if (this.#end !== void 0) + throw new Error("Watch is stopped"); + this.#started = true; + this.#listener = listener; + this.#schedule(); + } + stop() { + this.#terminate(STOPPED); + return this.#closed.promise; + } + /** End the watch `aborted` when `signal` aborts; installed once. */ + observeAbort(signal) { + if (this.#abortSignal !== void 0) + throw new Error("Watch abort is already installed"); + if (this.#end !== void 0) + return; + this.#abortSignal = signal; + this.#abortListener = () => this.abort(); + signal.addEventListener("abort", this.#abortListener, { once: true }); + if (signal.aborted) + this.abort(); + } + /** End the watch `aborted`: its acquisition context was aborted. */ + abort() { + this.#terminate(ABORTED); + } + /** + * End the watch with `end` at once, dropping what is pending: the source closed (`ended`), or failed for good + * (`failed`). A failure the source may recover from is a `failed` call instead (`fail()`). + */ + end(end) { + this.#terminate(end); + } + /** + * The source sends nothing more after its last frames, such as a retirement: take no more frames, deliver what is + * pending, then end `ended`, after the running call returns, if one runs. Until then the watch stays attached, so + * `end()`, `stop()`, an abort, and a throwing listener still end it first; a watch never started keeps what is + * pending until one of them or `start()`. + */ + endAfterDelivery() { + if (this.#end !== void 0 || this.#ending) + return; + this.#ending = true; + if (!this.#running && this.pendingContext === void 0) + this.#terminate(ENDED); + } + /** Whether the watch still takes frames: it has not ended, and its source has not ended. */ + get open() { + return this.#end === void 0 && !this.#ending; + } + /** Something became pending: deliver it once started, never inline. */ + pending() { + if (this.#started) + this.#schedule(); + } + #schedule() { + if (this.#scheduled || this.#running || this.#end !== void 0) + return; + this.#scheduled = true; + queueMicrotask(() => { + this.#scheduled = false; + void this.#drain(); + }); + } + /** + * Deliver until nothing is pending; what arrives during a call is taken after it returns. A watch whose source ended + * ends once it delivered the rest and its last call returned. + */ + async #drain() { + if (this.#running || this.#end !== void 0 || !this.#started) + return; + this.#running = true; + try { + while (this.#end === void 0) { + const listener = this.#listener; + if (listener === void 0) + break; + const frameContext = this.pendingContext; + if (frameContext === void 0) { + if (this.#ending) + this.#terminate(ENDED); + break; + } + const call = this.next(); + if (call.kind === "value") + this.#value = call.value; + try { + await listener(call, withoutAbortSignal(frameContext)); + } catch (error) { + if (this.#end === void 0) { + this.#report?.(error); + this.#terminate({ kind: "listener_error", error: toError(error) }); + } + break; + } + } + } finally { + this.#running = false; + } + } + /** + * End the watch, once: detach, drop what is pending and every reference into the source, and settle `closed`. A + * callback already running keeps running. + */ + #terminate(end) { + if (this.#end !== void 0) + return; + this.#end = end; + const detach = this.#detach; + this.#detach = void 0; + this.#report = void 0; + this.#listener = void 0; + this.release(); + if (this.#abortListener !== void 0) + this.#abortSignal?.removeEventListener("abort", this.#abortListener); + this.#abortSignal = void 0; + this.#abortListener = void 0; + detach?.(); + this.#closed.resolve(end); + } +}; +function toError(error) { + if (error instanceof Error) + return error; + try { + return new Error(String(error)); + } catch { + return new Error(Object.prototype.toString.call(error)); + } +} +var Watch = class extends WatchLifecycle { + #ops = new PendingOps(); + /** + * The source's call while it is the only frame pending: the call passes it on, with no allocation. A second frame + * drops it, so its ops stay only as long as `PendingOps` keeps them (folded, or dropped by an overflow). + */ + #lone; + /** The newest frame's value and context, while a call is pending; the context also marks that one is. */ + #newestValue; + #newestContext; + /** A pending frame was a retirement. */ + #retired = false; + /** The newest frame was a failure: the next call is this. */ + #failure; + /** A failure came after the last value call: the next value call replaces the root, and ops are not kept. */ + #replace = false; + /** + * Queue the frame `call`. A value's ops turn the previous value into it, and `retired` says the document the watch + * follows was retired, which the next value call reports however many frames it folds; a failure is `fail()`. + */ + advance(call, context) { + if (call.kind === "failed") { + this.#fail(call, context); + return; + } + if (!this.open) + return; + if (this.#replace) { + this.#failure = void 0; + } else { + this.#lone = this.#newestContext === void 0 ? call : void 0; + this.#ops.push(call.ops); + } + this.#newestValue = call.value; + this.#newestContext = context; + if (call.retired) + this.#retired = true; + this.pending(); + } + /** + * Queue a failure the source may recover from: the pending frames are dropped (`value` keeps the last delivered + * value), the listener gets `{ kind: "failed", error }`, and the next value arrives as `[["r", value]]`. + */ + fail(error, context) { + this.#fail({ kind: "failed", error }, context); + } + #fail(call, context) { + if (!this.open) + return; + this.#ops.take(); + this.#lone = void 0; + this.#newestValue = void 0; + this.#failure = call; + this.#newestContext = context; + this.#replace = true; + this.pending(); + } + get pendingContext() { + return this.#newestContext; + } + next() { + if (this.#replace) + return this.#nextAfterFailure(); + const lone = this.#lone; + const value2 = this.#newestValue; + const batch = this.#ops.take(); + const retired = this.#retired; + this.#lone = void 0; + this.#newestValue = void 0; + this.#newestContext = void 0; + this.#retired = false; + if (lone !== void 0) + return lone; + const ops3 = batch.kind === "ops" ? batch.ops : [["r", value2]]; + return { kind: "value", value: value2, ops: ops3, retired }; + } + /** The pending failure, or the value after one as a root replacement (no ops were kept since the failure). */ + #nextAfterFailure() { + const failure2 = this.#failure; + this.#newestContext = void 0; + if (failure2 !== void 0) { + this.#failure = void 0; + return failure2; + } + const value2 = this.#newestValue; + const retired = this.#retired; + this.#newestValue = void 0; + this.#retired = false; + this.#replace = false; + return { kind: "value", value: value2, ops: [["r", value2]], retired }; + } + release() { + this.#ops.take(); + this.#lone = void 0; + this.#newestValue = void 0; + this.#newestContext = void 0; + this.#retired = false; + this.#failure = void 0; + this.#replace = false; + } +}; + +// node_modules/@earendil-works/pi-durable/dist/ids.js +function idFromNumber(value2) { + return value2; +} +function seqFromNumber(value2) { + return value2; +} + // node_modules/@earendil-works/pi-durable/dist/documents.js function defineDoc(definition) { validateDefinition(definition); return { definition }; } +function defineDocFamily(definition) { + validateDefinition(definition); + return { definition }; +} function validateDefinition(definition) { if (!Number.isSafeInteger(definition.version) || definition.version < 1) { throw new TypeError(`Document ${definition.kind} version must be a positive integer`); } } +function resolveAddress(definition, args) { + let index = 0; + let scope; + switch (definition.scope) { + case "session": + scope = { kind: "session" }; + break; + case "conversation": + scope = { kind: "conversation", conversationId: ownerId(args[index++], definition) }; + break; + case "task": + scope = { kind: "task", taskId: ownerId(args[index++], definition) }; + break; + } + const key = definition.family === true ? args[index++] : void 0; + const address = key === void 0 ? { kind: definition.kind, scope } : { kind: definition.kind, scope, key }; + return { address, id: addressId(address), nextArgument: index }; +} +function ownerId(value2, definition) { + if (typeof value2 !== "number" || !Number.isSafeInteger(value2)) { + throw new TypeError(`Document ${definition.kind} requires a ${definition.scope} ID`); + } + return idFromNumber(value2); +} +function addressId(address) { + const owner = address.scope.kind === "session" ? null : address.scope.kind === "conversation" ? address.scope.conversationId : address.scope.taskId; + return JSON.stringify([address.kind, address.scope.kind, owner, address.key ?? null]); +} +function documentCreate(definition, address, id) { + const key = address.key === void 0 ? {} : { key: address.key }; + switch (address.scope.kind) { + case "session": + return { id, kind: address.kind, ...key, scope: address.scope }; + case "task": + return { id, kind: address.kind, ...key, scope: address.scope }; + case "conversation": + return { + id, + kind: address.kind, + ...key, + scope: address.scope, + history: definition.history, + fork: definition.fork + }; + } +} +function checkRecordScope(definition, record) { + if (record.scope.kind !== definition.scope || record.scope.kind === "conversation" && (record.history !== definition.history || record.fork !== definition.fork)) { + throw new TypeError(`Document ${record.id} (${record.kind}) does not match the supplied definition semantics`); + } +} +function checkRecordVersion(definition, record, version) { + if (version > definition.version) { + throw new Error(`Document ${record.id} (${record.kind}) has newer version ${version} than ${definition.version}`); + } + if (version < definition.version && definition.migrate === void 0) { + throw new Error(`Document ${record.id} (${record.kind}) requires migration from version ${version}`); + } +} +function materializeDocument(definition, stored) { + return materializeDocumentValue(definition, stored.record, stored.version, stored.value); +} +function materializeDocumentValue(definition, record, version, value2) { + checkRecordScope(definition, record); + checkRecordVersion(definition, record, version); + if (version === definition.version) + return value2; + return copyJson(definition.migrate(value2, version)); +} + +// node_modules/@earendil-works/pi-durable/dist/entries.js +function defineEntry(kind) { + if (typeof kind !== "string" || kind.length === 0) + throw new TypeError("Entry kind must be a non-empty string"); + return { + kind, + is: (entry2) => entry2 !== void 0 && entry2.kind === kind + }; +} +var UserEntry = defineEntry("pi.user"); +var AssistantEntry = defineEntry("pi.assistant"); +var SystemEntry = defineEntry("pi.system"); +var ToolResultEntry = defineEntry("pi.tool-result"); +var ResetEntry = defineEntry("pi.reset"); +var CompactionEntry = defineEntry("pi.compaction"); + +// node_modules/@earendil-works/pi-durable/dist/errors.js +function errorMessage(error) { + if (error instanceof Error) + return error.message; + try { + return String(error); + } catch { + return Object.prototype.toString.call(error); + } +} +var ReadAfterWrite = class extends Error { + /** `operation` names the call, such as `Tx.task()`. */ + constructor(operation) { + super(`${operation} cannot read tables after the first table write`); + this.name = "ReadAfterWrite"; + } +}; +var StorageRequestError = class extends Error { + constructor(message) { + super(message); + this.name = "StorageRequestError"; + } +}; +var SessionFailed = class extends Error { + constructor(cause) { + super("Session failed after a storage error; close and reopen it", { cause }); + this.name = "SessionFailed"; + } +}; +var ReadOnlySession = class extends Error { + constructor(what) { + super(`Read-only Harness: ${what} refused`); + this.name = "ReadOnlySession"; + } +}; +var ConversationBusy = class extends Error { + conversationId; + constructor(conversationId) { + super(`Conversation ${conversationId} is busy`); + this.name = "ConversationBusy"; + this.conversationId = conversationId; + } +}; +var ConversationIdle = class extends Error { + conversationId; + constructor(conversationId) { + super(`Conversation ${conversationId} is idle`); + this.name = "ConversationIdle"; + this.conversationId = conversationId; + } +}; + +// node_modules/@earendil-works/pi-durable/dist/timers.js +var MAX_TIMER_DELAY = 2147483647; +var inWorkers = typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers"; +var nativeTimer = (callback, delayMs, options) => { + if (options.background && inWorkers) + return void 0; + const arm = (remaining) => { + const next = setTimeout(() => { + if (remaining > MAX_TIMER_DELAY) + handle = arm(remaining - MAX_TIMER_DELAY); + else + callback(); + }, Math.min(remaining, MAX_TIMER_DELAY)); + if (options.background) + next.unref?.(); + return next; + }; + let handle = arm(Math.max(0, delayMs)); + if (options.background && typeof handle.unref !== "function") { + clearTimeout(handle); + return void 0; + } + return () => clearTimeout(handle); +}; +function hostTimers(setTimer, report2) { + const arm = setTimer ?? nativeTimer; + let reported = false; + const fallBack = (error) => { + if (reported) + return; + reported = true; + report2(error); + }; + return { + foreground: (callback, delayMs) => { + try { + const disarm = arm(callback, delayMs, { background: false }); + if (disarm !== void 0) + return disarm; + fallBack(new Error("HarnessOptions.setTimer declined a timer that paces work; using setTimeout")); + } catch (error) { + fallBack(error); + } + return nativeTimer(callback, delayMs, { background: false }); + }, + background: (callback, delayMs) => { + try { + return arm(callback, delayMs, { background: true }); + } catch (error) { + report2(error); + return void 0; + } + } + }; +} + +// node_modules/@earendil-works/pi-durable/dist/session/cached-storage.js +var CachedStorage = class { + #storage; + #conversations = new Lru(4096); + /** Live (non-terminal) task records, until their task ends. */ + #liveTasks = /* @__PURE__ */ new Map(); + /** + * Tasks some task waits on, or waited on until its wait ended and it has not moved on since: how many such waits name + * each, and its ended record once it ended. + */ + #awaited = /* @__PURE__ */ new Map(); + /** Per task that waits, or left its wait and has not changed since: what it waited on, and whether it left. */ + #waits = /* @__PURE__ */ new Map(); + // Ended task records carry inputs and outcomes, such as a tool call's arguments, so fewer are kept. + #tasks = new Lru(256); + #submissions = new Lru(256); + /** Per record with a read in flight: the reads, and how many published commits wrote it since the first began. */ + #reads = /* @__PURE__ */ new Map(); + constructor(storage2) { + this.#storage = storage2; + } + /** The backend's own scope for a publication (`Storage.publishing`), when it has one. */ + get publishing() { + return scopeOf(this.#storage); + } + /** Pass the batches through; the Session applies each one with `published()` when it publishes it. */ + commit(batches, receive, context) { + return this.#storage.commit(batches, receive, context); + } + /** + * Apply a batch `commit()` stored, when the Session publishes it. Its records are frozen in place and kept as + * they are, no copies: the Session's components that follow the publication, such as the scheduler's live tasks, + * hold the same objects, so a live task's record is in memory once. + */ + published(writes) { + for (const write of writes) { + switch (write.type) { + case "conversation": + this.#wrote(write.value.id); + this.#conversations.set(write.value.id, freeze(write.value)); + break; + case "task": + this.#wrote(write.value.id); + this.#followWait(write.value); + this.#keepTask(freeze(write.value)); + break; + case "submission": + this.#wrote(write.value.id); + this.#submissions.set(write.value.id, freeze(write.value)); + break; + } + } + } + mintId() { + return this.#storage.mintId(); + } + conversation(id, context) { + const cached = this.#conversations.get(id); + if (cached !== void 0) + return Promise.resolve(cached); + return this.#keep(id, () => this.#storage.conversation(id, context), (record) => this.#conversations.set(id, record)); + } + scanConversations(query, limit3, cursor, context) { + return this.#storage.scanConversations(query, limit3, cursor, context); + } + entry(first, second, third) { + if (third === void 0) + return this.#storage.entry(first, second); + return this.#storage.entry(first, second, third); + } + findLatestHeadMarker(conversationId, atOrBeforeEntryId, context) { + return this.#storage.findLatestHeadMarker(conversationId, atOrBeforeEntryId, context); + } + scanEntries(query, limit3, cursor, context) { + return this.#storage.scanEntries(query, limit3, cursor, context); + } + task(id, context) { + const cached = this.#liveTasks.get(id) ?? this.#awaited.get(id)?.record ?? this.#tasks.get(id); + if (cached !== void 0) + return Promise.resolve(cached); + return this.#keep(id, () => this.#storage.task(id, context), (record) => this.#keepTask(record)); + } + scanTasks(query, limit3, cursor, context) { + return this.#storage.scanTasks(query, limit3, cursor, context); + } + /** Cached as written only: this process writes every submission it settles, and a read one is usually settled. */ + submission(id, context) { + const cached = this.#submissions.get(id); + return cached === void 0 ? this.#storage.submission(id, context) : Promise.resolve(cached); + } + scanSubmissions(query, limit3, cursor, context) { + return this.#storage.scanSubmissions(query, limit3, cursor, context); + } + submissionByRequest(conversationId, requestId, context) { + return this.#storage.submissionByRequest(conversationId, requestId, context); + } + findDocument(address, at, context) { + return this.#storage.findDocument(address, at, context); + } + document(id, at, context) { + return this.#storage.document(id, at, context); + } + scanDocuments(query, limit3, cursor, context) { + return this.#storage.scanDocuments(query, limit3, cursor, context); + } + close(context) { + return this.#storage.close(context); + } + /** Records kept per table, for tests that bound memory. */ + get sizes() { + return { + conversations: this.#conversations.size, + tasks: this.#tasks.size, + liveTasks: this.#liveTasks.size, + awaited: this.#awaited.size, + waits: this.#waits.size, + submissions: this.#submissions.size + }; + } + /** Keep a frozen task record: a live one until its task ends, an ended one in the bounded table. */ + #keepTask(record) { + if (record.state.status === "terminal") { + this.#liveTasks.delete(record.id); + const awaited = this.#awaited.get(record.id); + if (awaited !== void 0) + awaited.record = record; + else + this.#tasks.set(record.id, record); + return; + } + this.#tasks.delete(record.id); + this.#liveTasks.set(record.id, record); + } + /** + * Follow a task's waits from its written record: a wait holds the ended records of its `on` until the task, after + * leaving the wait, changes again (or ends), as the phase that resumes reads their outcomes before its next commit. + */ + #followWait(record) { + const wait = this.#waits.get(record.id); + if (record.state.status === "waiting") { + if (wait !== void 0) + this.#release(wait.on); + const on = record.state.on; + this.#waits.set(record.id, { on, left: false }); + for (const id of on) { + let awaited = this.#awaited.get(id); + if (awaited === void 0) { + const ended = this.#tasks.get(id); + this.#tasks.delete(id); + awaited = ended === void 0 ? { count: 0 } : { count: 0, record: ended }; + this.#awaited.set(id, awaited); + } + awaited.count++; + } + return; + } + if (wait === void 0) + return; + if (!wait.left && record.state.status !== "terminal") { + wait.left = true; + return; + } + this.#waits.delete(record.id); + this.#release(wait.on); + } + /** A wait on `on` is over: what no other wait names goes back to the bounded table. */ + #release(on) { + for (const id of on) { + const awaited = this.#awaited.get(id); + if (--awaited.count > 0) + continue; + this.#awaited.delete(id); + if (awaited.record !== void 0) + this.#tasks.set(id, awaited.record); + } + } + /** A published commit wrote record `id`: a read of it in flight may have missed that. */ + #wrote(id) { + const reads = this.#reads.get(id); + if (reads !== void 0) + reads.version++; + } + /** Resolve with a read's result, frozen; keep a found record unless a commit published since wrote it. */ + async #keep(id, read2, keep) { + let reads = this.#reads.get(id); + if (reads === void 0) { + reads = { count: 0, version: 0 }; + this.#reads.set(id, reads); + } + reads.count++; + const version = reads.version; + let value2; + try { + value2 = await read2(); + } finally { + if (--reads.count === 0) + this.#reads.delete(id); + } + if (value2 === void 0) + return void 0; + freeze(value2); + if (reads.version === version) + keep(value2); + return value2; + } + /** Records with a read in flight, for tests that bound memory. */ + get readsInFlight() { + return this.#reads.size; + } +}; +function scopeOf(storage2) { + if (storage2.publishing === void 0) + return void 0; + return (publish2, context) => storage2.publishing(publish2, context); +} +var Lru = class { + #map = /* @__PURE__ */ new Map(); + #capacity; + constructor(capacity) { + this.#capacity = capacity; + } + get(key) { + const value2 = this.#map.get(key); + if (value2 === void 0) + return void 0; + this.#map.delete(key); + this.#map.set(key, value2); + return value2; + } + get size() { + return this.#map.size; + } + delete(key) { + this.#map.delete(key); + } + set(key, value2) { + this.#map.delete(key); + this.#map.set(key, value2); + if (this.#map.size > this.#capacity) + this.#map.delete(this.#map.keys().next().value); + } +}; +function freeze(value2) { + if (value2 === null || typeof value2 !== "object" || Object.isFrozen(value2)) + return value2; + for (const child of Object.values(value2)) + freeze(child); + return Object.freeze(value2); +} + +// node_modules/@earendil-works/pi-durable/dist/session/conversation-tails.js +var LATEST_CAPACITY = 4096; +var MARKER_CAPACITY = 256; +var ConversationTails = class { + /** Newest entry ID per conversation, `null` for none. */ + #latest = /* @__PURE__ */ new Map(); + /** Newest head marker per conversation, `null` for none. */ + #markers = /* @__PURE__ */ new Map(); + /** The newest entry ID visible from `conversationId`, read with `read` when not known. */ + async latest(conversationId, read2) { + const known = use(this.#latest, conversationId); + if (known !== void 0) + return known ?? void 0; + const latest = await read2(); + put(this.#latest, conversationId, latest ?? null, LATEST_CAPACITY); + return latest; + } + /** + * The newest visible head marker at or before `atOrBefore` (any when `undefined`), read with `read` when not known. + * The newest marker answers every cutoff at or after it, and no marker answers every cutoff. + */ + async marker(conversationId, atOrBefore, read2) { + const marker = use(this.#markers, conversationId); + if (marker === null) + return void 0; + if (marker !== void 0 && (atOrBefore === void 0 || atOrBefore >= marker.id)) + return marker; + const latest = this.#latest.get(conversationId); + const found = await read2(); + if (atOrBefore === void 0 || latest !== void 0 && (latest ?? 0) <= atOrBefore) { + put(this.#markers, conversationId, found === void 0 ? null : freeze2(found), MARKER_CAPACITY); + } + return found; + } + /** The newest entry ID of `conversationId` if known, without reading: `null` for none, `undefined` when unknown. */ + peek(conversationId) { + return this.#latest.get(conversationId); + } + /** At a commit's publication: apply a durable batch. */ + apply(writes) { + for (const write of writes) { + if (write.type === "conversation") { + if (write.value.parent !== void 0) + continue; + put(this.#latest, write.value.id, null, LATEST_CAPACITY); + put(this.#markers, write.value.id, null, MARKER_CAPACITY); + } else if (write.type === "entry") { + const entry2 = write.value; + put(this.#latest, entry2.conversationId, entry2.id, LATEST_CAPACITY); + if (entry2.head !== void 0) { + put(this.#markers, entry2.conversationId, freeze2(entry2), MARKER_CAPACITY); + } + } + } + } + /** How many conversations have their newest entry kept, for tests that bound memory. */ + get size() { + return this.#latest.size; + } + /** How many conversations have their newest head marker kept, for tests that bound memory. */ + get markers() { + return this.#markers.size; + } +}; +function use(map3, key) { + const value2 = map3.get(key); + if (value2 === void 0) + return void 0; + map3.delete(key); + map3.set(key, value2); + return value2; +} +function put(map3, key, value2, capacity) { + map3.delete(key); + map3.set(key, value2); + if (map3.size > capacity) + map3.delete(map3.keys().next().value); +} +function freeze2(value2) { + if (value2 === null || typeof value2 !== "object" || Object.isFrozen(value2)) + return value2; + for (const child of Object.values(value2)) + freeze2(child); + return Object.freeze(value2); +} + +// node_modules/@earendil-works/pi-durable/dist/session/keys.js +function taskKey(id) { + return `task:${id}`; +} +function conversationKey(id) { + return `conv:${id}`; +} +function entryKey(id) { + return `entry:${id}`; +} +function appendKey(id) { + return `entry-append:${id}`; +} +function submissionKey(id) { + return `sub:${id}`; +} +function requestKey(conversationId, requestId) { + return `req:${conversationId}:${requestId}`; +} +function documentKey(addressId2) { + return `doc:${addressId2}`; +} +function incarnationKey(id) { + return `docid:${id}`; +} +function scopeKey(scope) { + switch (scope.kind) { + case "session": + return "docscope:session"; + case "conversation": + return `docscope:c${scope.conversationId}`; + case "task": + return `docscope:t${scope.taskId}`; + } +} +function ownedKey(node) { + return `owned:${node}`; +} +var ROOTS_KEY = "roots"; +var INTENT_KEY = "intent"; +var ALL_KEYS = "*"; +function tableKeys(writes, keys) { + for (const write of writes) { + switch (write.type) { + case "conversation": + keys.push(conversationKey(write.value.id)); + break; + case "entry": + keys.push(entryKey(write.value.id), appendKey(write.value.conversationId)); + break; + case "task": + keys.push(taskKey(write.value.id)); + break; + case "submission": + keys.push(submissionKey(write.value.id)); + if (write.value.requestId !== void 0) { + keys.push(requestKey(write.value.conversationId, write.value.requestId)); + } + break; + } + } +} +var GatedStorage = class { + #storage; + #touch; + constructor(storage2, touch) { + this.#storage = storage2; + this.#touch = touch; + } + commit(batches, receive, context) { + return this.#storage.commit(batches, receive, context); + } + mintId() { + return this.#storage.mintId(); + } + conversation(id, context) { + return this.#after(conversationKey(id), () => this.#storage.conversation(id, context)); + } + scanConversations(query, limit3, cursor, context) { + return this.#after(ALL_KEYS, () => this.#storage.scanConversations(query, limit3, cursor, context)); + } + entry(first, second, third) { + if (third === void 0) { + const id2 = first; + return this.#after(entryKey(id2), () => this.#storage.entry(id2, second)); + } + const conversationId = first; + const id = second; + return this.#after(conversationKey(conversationId), () => this.#after(entryKey(id), () => this.#storage.entry(conversationId, id, third))); + } + findLatestHeadMarker(conversationId, atOrBeforeEntryId, context) { + return this.#afterEntries(conversationId, () => this.#storage.findLatestHeadMarker(conversationId, atOrBeforeEntryId, context)); + } + scanEntries(query, limit3, cursor, context) { + return this.#afterEntries(query.conversationId, () => this.#storage.scanEntries(query, limit3, cursor, context)); + } + task(id, context) { + return this.#after(taskKey(id), () => this.#storage.task(id, context)); + } + scanTasks(query, limit3, cursor, context) { + return this.#after(ALL_KEYS, () => this.#storage.scanTasks(query, limit3, cursor, context)); + } + submission(id, context) { + return this.#after(submissionKey(id), () => this.#storage.submission(id, context)); + } + scanSubmissions(query, limit3, cursor, context) { + return this.#after(ALL_KEYS, () => this.#storage.scanSubmissions(query, limit3, cursor, context)); + } + submissionByRequest(conversationId, requestId, context) { + return this.#after(requestKey(conversationId, requestId), () => this.#storage.submissionByRequest(conversationId, requestId, context)); + } + findDocument(address, at, context) { + return this.#after(documentKey(addressId(address)), () => this.#storage.findDocument(address, at, context)); + } + document(id, at, context) { + return this.#after(incarnationKey(id), () => this.#storage.document(id, at, context)); + } + scanDocuments(query, limit3, cursor, context) { + return this.#after(scopeKey(query.scope), () => this.#storage.scanDocuments(query, limit3, cursor, context)); + } + close(context) { + return this.#storage.close(context); + } + /** + * Run a read of a conversation's entries once neither its appends nor its creation has an unpublished writer: Storage + * refuses the read of a conversation it does not have yet. + */ + #afterEntries(conversationId, read2) { + return this.#after(conversationKey(conversationId), () => this.#after(appendKey(conversationId), read2)); + } + /** Run `read` once `key` has no unpublished writer. */ + #after(key, read2) { + const gate = this.#touch(key); + return gate === void 0 ? read2() : gate.then(read2); + } +}; + +// node_modules/@earendil-works/pi-durable/dist/types.js +var ROOT_CONVERSATION_ID = 1; + +// node_modules/@earendil-works/pi-durable/dist/session/forks.js +var SCAN_PAGE_SIZE = 256; +async function prepareForkDocumentCopies(storage2, parentConversationId, at, childConversationId, context) { + const entry2 = await storage2.entry(parentConversationId, at, context); + if (entry2 === void 0) + throw new Error(`Entry ${at} is not visible from conversation ${parentConversationId}`); + const copies = []; + const copiedAddresses = /* @__PURE__ */ new Set(); + await collectCopies(storage2, { kind: "conversation", conversationId: entry2.entry.conversationId }, entry2.commitSeq, "asOf", childConversationId, copies, copiedAddresses, context); + await collectCopies(storage2, { kind: "conversation", conversationId: parentConversationId }, "current", "current", childConversationId, copies, copiedAddresses, context); + return copies; +} +async function collectCopies(storage2, scope, at, policy, childConversationId, copies, copiedAddresses, context) { + let cursor; + do { + const page2 = await storage2.scanDocuments({ scope, at }, SCAN_PAGE_SIZE, cursor, context); + for (const source of page2.items) { + if (source.scope.kind !== "conversation" || source.fork !== policy) + continue; + const id = await storage2.mintId(); + const identity = { + id, + kind: source.kind, + ...source.key === void 0 ? {} : { key: source.key }, + scope: { kind: "conversation", conversationId: childConversationId } + }; + const record = source.history === "latest" ? { ...identity, history: "latest", fork: source.fork } : { ...identity, history: "rewindable", fork: source.fork }; + const copyAddress = addressId(record); + if (copiedAddresses.has(copyAddress)) { + const member = record.key === void 0 ? record.kind : `${record.kind}/${record.key}`; + throw new Error(`Fork selects multiple source documents for ${member}`); + } + copiedAddresses.add(copyAddress); + copies.push({ record, source: { id: source.id, at } }); + } + cursor = page2.next; + } while (cursor !== void 0); +} + +// node_modules/@earendil-works/pi-durable/dist/session/transaction.js +function applySubmissionChange(current, change) { + if (current.status === "done" || current.status === "unanswered") + return current; + if (change.status === "placed") { + if (current.status !== "queued") + throw new Error(`Submission ${current.id} is not queued`); + const status = current.type === "input" ? "placed" : "done"; + return { ...current, status, entry: change.entry }; + } + if (change.status === "done" && current.status !== "placed") { + throw new Error(`Submission ${current.id} is not a placed input or continue`); + } + return { ...current, ...change }; +} +var INTERNAL_SCAN_PAGE_SIZE = 256; +var EMPTY_OPERATIONS = []; +var TABLE_JSON_COPY_OPTIONS = { omitUndefinedProperties: true }; +var Transaction = class { + #host; + #context; + #scope; + #pendingOperations = /* @__PURE__ */ new Set(); + #sealed = false; + #hasTableWrite = false; + /** Atomic batch; conversation and entry writes stage eagerly, while task and document writes assemble later. */ + #writes = []; + #createdConversationIds = /* @__PURE__ */ new Set(); + #forkSourceConversationIds = /* @__PURE__ */ new Set(); + #forkSourceDocumentIds = /* @__PURE__ */ new Set(); + /** One entry per task touched by a public read, candidate write, or document-owner lookup. */ + #tasksById = /* @__PURE__ */ new Map(); + /** Submissions created by this transaction, by ID. */ + #submissions = /* @__PURE__ */ new Map(); + /** Submission settlements and placements in staging order; resolved against the latest candidate record during assembly. */ + #submissionChanges = []; + /** Write and publication plans of every staged incarnation, built during assembly. */ + #plans = []; + /** Every document acquisition or retirement marker in staging order. */ + #documents = []; + /** Latest transaction-local incarnation or retirement marker at each logical address. */ + #latestDocumentByAddress = /* @__PURE__ */ new Map(); + constructor(host, context, scope = {}) { + this.#host = host; + this.#context = context; + this.#scope = scope; + } + /** Internal: the context of the commit this transaction belongs to. */ + get context() { + return this.#context; + } + /** Internal: whether a table write was staged, after which table reads throw `ReadAfterWrite`. */ + get hasTableWrite() { + return this.#hasTableWrite; + } + /** + * Internal: whether `tx` is a transaction of a commit of the Session behind `host`. A brand check, so a proxy or + * another wrapper of a transaction is not one. + */ + static ownedBy(tx, host) { + return #host in tx && tx.#host === host; + } + // ─── Table reads ──────────────────────────────────────────────────────── + conversation(id) { + return this.#read("conversation", () => this.#host.storage.conversation(id, this.#context)); + } + entry(first, second) { + const kind = typeof first === "number" ? void 0 : first.kind; + const id = typeof first === "number" ? first : second; + return this.#read("entry", async () => { + const entry2 = (await this.#host.storage.entry(id, this.#context))?.entry; + return kind === void 0 || entry2?.kind === kind ? entry2 : void 0; + }); + } + task(id) { + return this.#read("task", () => this.#committedTask(id)); + } + scanConversations(query, limit3, cursor) { + return this.#read("scanConversations", () => this.#host.storage.scanConversations(query, limit3, cursor, this.#context)); + } + scanEntries(query, limit3, cursor) { + return this.#read("scanEntries", () => this.#host.storage.scanEntries(query, limit3, cursor, this.#context)); + } + latestHeadMarker(conversationId) { + return this.#read("latestHeadMarker", () => this.#host.latestHeadMarker(conversationId, this.#context)); + } + latestEntryId(conversationId) { + return this.#read("latestEntryId", () => this.#host.latestEntryId(conversationId, this.#context)); + } + scanTasks(query, limit3, cursor) { + return this.#read("scanTasks", () => this.#host.storage.scanTasks(query, limit3, cursor, this.#context)); + } + /** Internal: committed submission record. */ + submission(id) { + return this.#read("submission", () => this.#host.storage.submission(id, this.#context)); + } + /** Committed submission with a conversation-scoped request ID. */ + submissionByRequest(conversationId, requestId) { + return this.#read("submissionByRequest", () => this.#host.storage.submissionByRequest(conversationId, requestId, this.#context)); + } + // ─── Table writes ─────────────────────────────────────────────────────── + createConversation(options) { + return this.#write(() => this.#stageConversation(void 0, options.ownership)); + } + /** Internal final-form bootstrap path for the reserved root identity. */ + createRootConversation() { + return this.#write(() => this.#stageConversation(void 0, { kind: "ownerless" }, ROOT_CONVERSATION_ID)); + } + forkConversation(parentConversationId, at, options) { + return this.#write(() => this.#stageConversation({ conversationId: parentConversationId, at }, options.ownership)); + } + async #stageConversation(parent2, ownership, reservedId) { + const ownerTaskId = ownership.kind === "task" ? ownership.taskId : void 0; + const id = reservedId ?? await this.#host.storage.mintId(); + this.#assertOpen(); + let owner; + if (ownerTaskId !== void 0) { + const task = await this.#currentTask(ownerTaskId); + this.#assertOpen(); + if (task === void 0) + throw new Error(`Conversation owner task ${ownerTaskId} does not exist`); + owner = { conversationId: task.conversationId, taskId: ownerTaskId }; + } + const record = { + id, + ...parent2 === void 0 ? {} : { parent: parent2 }, + ...owner === void 0 ? {} : { owner } + }; + const copies = parent2 === void 0 ? [] : await prepareForkDocumentCopies(this.#host.storage, parent2.conversationId, parent2.at, id, this.#context); + this.#assertOpen(); + for (const copy2 of copies) { + this.#forkSourceDocumentIds.add(copy2.source.id); + const entry2 = { + addressId: addressId(copy2.record), + address: copy2.record, + target: { kind: "fork-copy", ...copy2 }, + retireOnCommit: false + }; + this.#documents.push(entry2); + this.#latestDocumentByAddress.set(entry2.addressId, entry2); + } + if (parent2 !== void 0) + this.#forkSourceConversationIds.add(parent2.conversationId); + this.#createdConversationIds.add(id); + this.#writes.push({ type: "conversation", value: record }); + await this.#host.conversationCreated(this, record); + this.#assertOpen(); + return record; + } + beforeInput(conversationId, input) { + return this.#read("beforeInput", () => this.#host.beforeInput(this, conversationId, input, this.#context)); + } + appendEntry(first, second, third) { + if (typeof first === "number") + return this.#appendEntry(first, second); + return this.#appendEntry(second, { ...third, kind: first.kind }); + } + #appendEntry(conversationId, value2) { + return this.#write(async () => { + await this.#requireConversation(conversationId); + this.#assertOpen(); + const id = await this.#host.storage.mintId(); + this.#assertOpen(); + const { head, ...rest } = value2; + const record = copyJson({ + ...rest, + id, + conversationId, + head: head === "self" ? id : head, + byTaskId: this.#scope.taskId + }, TABLE_JSON_COPY_OPTIONS); + this.#writes.push({ type: "entry", value: record }); + return record; + }); + } + createTask(task, input, options) { + return this.#write(async () => { + if (options.submissionIds !== void 0) { + let trace; + let links; + for (let index = 0; index < options.submissionIds.length; index++) { + const id2 = options.submissionIds[index]; + const submission2 = this.#submissions.get(id2) ?? await this.#host.storage.submission(id2, this.#context); + if (index === 0) + trace = submission2?.trace ?? "root"; + else if (submission2?.trace !== void 0) { + links ??= []; + links.push(submission2.trace); + } + } + options = { ...options, trace, links }; + } + const ownership = options.ownership; + let owner; + if (ownership.kind === "task") { + owner = await this.#currentTask(ownership.taskId); + this.#assertOpen(); + if (owner === void 0) + throw new Error(`Task owner ${ownership.taskId} does not exist`); + if (options.background === true) + throw new TypeError("A child task cannot be background"); + if (options.conversationId !== void 0 && options.conversationId !== owner.conversationId) { + throw new Error(`A child task lives in its owner's conversation ${owner.conversationId}`); + } + } + const conversationId = owner?.conversationId ?? options.conversationId ?? this.#scope.conversationId; + if (conversationId === void 0) + throw new TypeError("Tx.createTask() requires options.conversationId"); + await this.#requireConversation(conversationId); + this.#assertOpen(); + const definition = task.definition; + const checkpoint = definition.initial(input); + const id = await this.#host.storage.mintId(); + this.#assertOpen(); + const record = copyJson({ + id, + conversationId, + kind: definition.name, + version: definition.version, + input, + trace: options.trace === "root" ? void 0 : options.trace ?? this.#context.telemetry.propagation?.inject(this.#context.telemetry), + links: options.links, + ...owner === void 0 ? {} : { owner: owner.id }, + background: options.background ?? false, + abortRequested: false, + ...options.abandonOnRestart === true ? { abandonOnRestart: true } : {}, + state: { status: "pending", checkpoint } + }, TABLE_JSON_COPY_OPTIONS); + this.#tasksById.set(id, { write: { kind: "create", record } }); + return id; + }); + } + /** Create a raw submission record with a fresh ID; no admission rules apply. */ + createSubmission(create) { + return this.#write(async () => { + await this.#requireConversation(create.conversationId); + this.#assertOpen(); + const id = await this.#host.storage.mintId(); + this.#assertOpen(); + const record = copyJson({ ...create, id }, TABLE_JSON_COPY_OPTIONS); + this.#submissions.set(id, record); + return record; + }); + } + /** + * Settle a submission. Resolved during assembly against the transaction's latest candidate record, falling back to + * committed state, so it is not a caller table read and works after the first table write. + */ + settleSubmission(id, settlement) { + this.#assertOpen(); + this.#hasTableWrite = true; + this.#submissionChanges.push({ id, change: copyJson(settlement) }); + } + /** Place a queued submission at `entry`; resolved during assembly like `settleSubmission()`. */ + placeSubmission(id, entry2) { + this.#assertOpen(); + this.#hasTableWrite = true; + this.#submissionChanges.push({ id, change: { status: "placed", entry: entry2 } }); + } + /** Internal: replace one task record completely. Tasks change their own state through their runtime. */ + setTask(value2) { + this.#assertOpen(); + this.#hasTableWrite = true; + const task = this.#taskEntry(value2.id); + const candidate = task.write?.record; + if (candidate?.state.status === "terminal") { + throw new Error(`Task ${value2.id} already has a terminal candidate`); + } + if (candidate !== void 0 && candidate.conversationId !== value2.conversationId) { + throw new Error(`Task ${value2.id} cannot change conversations`); + } + task.write = { + kind: task.write?.kind === "create" ? "create" : "replace", + record: copyJson(this.#stampTimes(value2, candidate), TABLE_JSON_COPY_OPTIONS) + }; + } + /** Internal: candidate records of the tasks this transaction created or replaced so far. */ + stagedTasks() { + const records = []; + for (const task of this.#tasksById.values()) + if (task.write !== void 0) + records.push(task.write.record); + return records; + } + /** Internal: IDs of the tasks this transaction creates. */ + createdTaskIds() { + const ids = []; + for (const [id, task] of this.#tasksById) + if (task.write?.kind === "create") + ids.push(id); + return ids; + } + /** Internal: conversations this transaction created or forked so far. */ + stagedConversations() { + const records = []; + for (const write of this.#writes) + if (write.type === "conversation") + records.push(write.value); + return records; + } + doc(token, ...args) { + try { + this.#assertOpen(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + this.#assertTaskDocumentsOpen(resolved); + const latest = this.#latestDocumentByAddress.get(resolved.id); + if (latest !== void 0 && !latest.retireOnCommit) { + if (latest.draftPromise !== void 0) + return latest.draftPromise; + if (latest.target?.kind === "fork-copy") { + latest.draftPromise = this.#track(this.#acquireForkCopy(latest, definition, latest.target)); + return latest.draftPromise; + } + } + const seed = definition.family === true ? copyJson(args[resolved.nextArgument]) : void 0; + const docEntry = { + addressId: resolved.id, + address: resolved.address, + definition, + retireOnCommit: false + }; + this.#documents.push(docEntry); + this.#latestDocumentByAddress.set(docEntry.addressId, docEntry); + docEntry.draftPromise = this.#track(this.#acquire(docEntry, seed, latest?.retireOnCommit === true)); + return docEntry.draftPromise; + } catch (error) { + return Promise.reject(error); + } + } + retireDoc(token, ...args) { + try { + this.#assertOpen(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + const latest = this.#latestDocumentByAddress.get(resolved.id); + if (latest?.retireOnCommit) + return Promise.resolve(); + if (latest?.target?.kind === "fork-copy") { + checkRecordScope(definition, latest.target.record); + latest.retireOnCommit = true; + return Promise.resolve(); + } + if (latest?.draftPromise !== void 0) { + latest.retireOnCommit = true; + return this.#track(latest.draftPromise.then(() => void 0)); + } + const entry2 = { + addressId: resolved.id, + address: resolved.address, + definition, + retireOnCommit: true + }; + this.#documents.push(entry2); + this.#latestDocumentByAddress.set(entry2.addressId, entry2); + return this.#track(this.#findRetirement(entry2)); + } catch (error) { + return Promise.reject(error); + } + } + async #acquire(entry2, seed, skipLoad) { + const definition = entry2.definition; + const loaded = skipLoad ? void 0 : await this.#host.load(definition, entry2.addressId, entry2.address, this.#context); + this.#assertOpen(); + if (loaded !== void 0) { + checkRecordScope(definition, loaded.record); + checkRecordVersion(definition, loaded.record, loaded.storedVersion); + entry2.target = { kind: "loaded", document: loaded }; + entry2.change = loaded.tracker.beginChange(); + return entry2.change.state; + } + const scope = entry2.address.scope; + if (scope.kind === "conversation") + await this.#requireConversation(scope.conversationId); + if (scope.kind === "task") { + const task = await this.#currentTask(scope.taskId); + if (task === void 0) + throw new Error(`Task ${scope.taskId} does not exist`); + if (task.state.status === "terminal") + throw new Error(`Task ${scope.taskId} is terminal`); + } + this.#assertOpen(); + const value2 = copyJson(definition.family === true ? definition.initial(seed) : definition.initial()); + const id = await this.#host.storage.mintId(); + this.#assertOpen(); + const tracker = track(value2); + entry2.target = { + kind: "created", + record: documentCreate(definition, entry2.address, id), + version: definition.version, + tracker + }; + entry2.change = tracker.beginChange(); + return entry2.change.state; + } + async #acquireForkCopy(entry2, definition, target) { + const stored = await this.#host.storage.document(target.source.id, target.source.at, this.#context); + this.#assertOpen(); + if (stored === void 0) { + throw new Error(`Fork source document ${target.source.id} cannot be read`); + } + if (stored.record.scope.kind !== "conversation" || stored.record.kind !== target.record.kind || stored.record.key !== target.record.key || stored.record.history !== target.record.history || stored.record.fork !== target.record.fork) { + throw new Error(`Fork source document ${target.source.id} does not match the copied record`); + } + const value2 = materializeDocumentValue(definition, target.record, stored.version, stored.value); + const tracker = track(value2); + entry2.definition = definition; + entry2.target = { kind: "created", record: target.record, version: definition.version, tracker }; + entry2.change = tracker.beginChange(); + return entry2.change.state; + } + async #findRetirement(entry2) { + const gate = this.#host.touch(documentKey(entry2.addressId)); + if (gate !== void 0) + await gate; + const record = this.#host.cached(entry2.addressId)?.record ?? await this.#host.storage.findDocument(entry2.address, "current", this.#context); + this.#assertOpen(); + if (record === void 0) + return; + checkRecordScope(entry2.definition, record); + entry2.target = { kind: "retire-only", record }; + } + // ─── Settlement ───────────────────────────────────────────────────────── + /** Seal after callback failure: abort every change and observe every pending operation. */ + async settleFailure() { + this.#sealed = true; + this.#abortChanges(); + await Promise.allSettled(this.#pendingOperations); + this.#context = BACKGROUND_CONTEXT; + } + /** + * Seal after callback success, prepare every open change, and assemble the atomic batch. + * Any failure aborts every change before Storage admission. + */ + async settleSuccess() { + this.#sealed = true; + if (this.#pendingOperations.size > 0) { + this.#abortChanges(); + await Promise.allSettled(this.#pendingOperations); + this.#context = BACKGROUND_CONTEXT; + throw new Error("Session commit callback settled before its pending Tx operations"); + } + try { + for (const document of this.#documents) { + if (document.change !== void 0) + document.prepared = document.change.prepare(); + } + return await this.#assemble(); + } catch (error) { + this.#abortChanges(); + throw error; + } finally { + this.#context = BACKGROUND_CONTEXT; + } + } + /** Abort every prepared change after Storage failure or when no write is required. */ + discard() { + this.#abortChanges(); + } + /** + * Internal: what a deferred commit holds in memory instead of storing (`CommitPersistence`), each changed incarnation + * with its operations and whether they selected a base; `undefined` when the commit must be stored. It may be held + * only when every write changes an existing `latest`, `initial`-fork conversation document at its stored version. + */ + holdable() { + if (this.#writes.some((write) => write.type !== "document.change")) + return void 0; + const held = []; + for (const plan of this.#plans) { + const { content, change } = plan; + if (content === void 0 && !plan.retire) + continue; + if (plan.retire || change?.loaded === void 0 || content?.type !== "document.change") + return void 0; + const { loaded, prepared, version } = change; + const record = loaded.record; + if (record.scope.kind !== "conversation" || record.history !== "latest" || record.fork !== "initial") { + return void 0; + } + if (loaded.storedVersion !== version) + return void 0; + held.push({ loaded, ops: prepared.ops, base: content.content.kind === "base" }); + } + return held; + } + /** + * Internal: adopt a held commit (`holdable()`) in memory only. Trackers advance by pointer swap; stored versions and + * delta counts stay, as nothing was stored. Returns its publication for the Session's own observers. + */ + adoptHeld() { + const publications = []; + for (const plan of this.#plans) { + const { tracker, prepared, version, loaded } = plan.change; + if (prepared.ops.length === 0) { + prepared.abort(); + continue; + } + tracker.adopt(prepared); + const record = loaded.record; + const conversationId = plan.conversationId; + publications.push({ + type: "document", + kind: "change", + record, + conversationId, + version, + value: prepared.value, + ops: prepared.ops + }); + } + return publications; + } + /** + * Internal: store the held changes of every incarnation this commit reads or writes in front of its own, so a stored + * document never misses an operation its later ones build on. Called right before Storage admission, after every + * fallible step, because it empties the holds: a failure earlier keeps them. Returns the holds it took. + */ + takeHeld(held) { + const taken = []; + for (const plan of this.#plans) { + if (!("createdAt" in plan.record)) + continue; + const hold = held(plan.record.id); + if (hold === void 0) + continue; + taken.push(hold); + const own = plan.content?.type === "document.change" ? plan.content : void 0; + const change = plan.change; + const value2 = change?.prepared.value ?? hold.loaded.tracker.value; + const stored = storeHeld(hold, change?.prepared.ops ?? EMPTY_OPERATIONS, value2, hold.loaded.valueVersion); + const content = own?.content.kind === "base" ? own.content : stored.content; + const write = { type: "document.change", id: plan.record.id, content }; + if (own !== void 0) + this.#writes[this.#writes.indexOf(own)] = write; + else + this.#insertBeforeRetirement(write); + if (!plan.retire) + plan.held = { ops: stored.ops, observed: own !== void 0 }; + plan.content = write; + if (plan.record.scope.kind === "conversation") + plan.conversationId = plan.record.scope.conversationId; + } + return taken; + } + /** + * Internal: the keys this commit writes, once settled (and after `takeHeld()`), for the Session's unpublished write + * set: its table records, and the address and incarnation of every document it creates, changes, or retires, with + * the scope of every incarnation it creates or retires. + */ + writeKeys() { + const keys = []; + tableKeys(this.#writes, keys); + for (const plan of this.#plans) { + if (plan.content === void 0 && !plan.retire) + continue; + keys.push(documentKey(plan.addressId), incarnationKey(plan.record.id)); + if (plan.retire || !("createdAt" in plan.record)) + keys.push(scopeKey(plan.record.scope)); + } + return keys; + } + /** Stage a content write for an incarnation, before its retirement when it retires. */ + #insertBeforeRetirement(write) { + const at = this.#writes.findIndex((candidate) => candidate.type === "document.retire" && candidate.id === write.id); + if (at < 0) + this.#writes.push(write); + else + this.#writes.splice(at, 0, write); + } + /** Adopt every prepared change by pointer swap after Storage success and describe the publication. */ + adopt(seq2) { + const publications = []; + let stored; + for (const plan of this.#plans) { + const committed = "createdAt" in plan.record; + let record = committed ? plan.record : { ...plan.record, createdAt: seq2 }; + if (plan.retire) + record = { ...record, retiredAt: seq2 }; + const change = plan.change; + if (change !== void 0) { + const { tracker, prepared, loaded, version } = change; + if (loaded === void 0 ? !plan.retire : prepared.ops.length > 0) + tracker.adopt(prepared); + else + prepared.abort(); + if (loaded !== void 0) { + if (loaded.storedVersion < version) + loaded.storedVersion = version; + if (plan.content?.type === "document.change") { + if (plan.content.content.kind === "base") + loaded.deltasSinceBase = 0; + else + loaded.deltasSinceBase++; + } + } else if (!plan.retire) { + this.#host.install({ + addressId: plan.addressId, + record, + storedVersion: version, + valueVersion: version, + deltasSinceBase: 0, + tracker + }); + } + } + if (plan.retire && committed) + this.#host.evict(plan.addressId, record.id); + const publication = describe(plan, record); + if (publication === void 0) + continue; + const held = plan.held; + if (held === void 0) { + publications.push(publication); + stored?.push(publication); + continue; + } + stored ??= [...publications]; + if (held.observed) + publications.push(publication); + stored.push(publication.type === "document" && publication.kind === "change" ? { ...publication, ops: held.ops } : publication); + } + return { observed: publications, stored: stored ?? publications }; + } + async #assemble() { + const storage2 = this.#host.storage; + const plans = this.#plans; + for (const document of this.#documents) { + const plan = planDocument(document); + if (plan !== void 0) + plans.push(plan); + } + this.#rejectForkSourceWrites(plans); + await this.#validateOwners(); + for (const [id, task] of this.#tasksById) { + if (task.write?.kind !== "replace") + continue; + const committed = await this.#committedTask(id); + if (committed === void 0) + throw new Error(`Task ${id} does not exist`); + if (committed.state.status === "terminal") + throw new Error(`Task ${id} is already terminal`); + if (committed.conversationId !== task.write.record.conversationId) { + throw new Error(`Task ${id} cannot change conversations`); + } + } + const terminalTaskIds = /* @__PURE__ */ new Set(); + for (const task of this.#tasksById.values()) { + if (task.write?.record.state.status === "terminal") + terminalTaskIds.add(task.write.record.id); + } + if (terminalTaskIds.size > 0) { + const retiring = /* @__PURE__ */ new Set(); + for (const plan of plans) { + const scope = plan.record.scope; + if (scope.kind !== "task" || !terminalTaskIds.has(scope.taskId)) + continue; + plan.retire = true; + retiring.add(plan.record.id); + } + const retire = (record) => { + if (retiring.has(record.id)) + return; + plans.push({ addressId: addressId(record), record, retire: true }); + retiring.add(record.id); + }; + for (const taskId of terminalTaskIds) { + if (this.#tasksById.get(taskId)?.write?.kind === "create") + continue; + const gate = this.#host.touch(scopeKey({ kind: "task", taskId })); + if (gate !== void 0) + await gate; + const known = this.#host.taskDocuments(taskId); + if (known !== void 0) { + for (const record of known) + retire(record); + continue; + } + let cursor; + do { + const page2 = await storage2.scanDocuments({ scope: { kind: "task", taskId }, at: "current" }, INTERNAL_SCAN_PAGE_SIZE, cursor, this.#context); + for (const record of page2.items) + retire(record); + cursor = page2.next; + } while (cursor !== void 0); + } + } + for (const plan of plans) { + if (!publishes(plan)) + continue; + const scope = plan.record.scope; + if (scope.kind === "conversation") + plan.conversationId = scope.conversationId; + if (scope.kind !== "task") + continue; + const task = this.#taskEntry(scope.taskId); + if (task.publicationConversationId === void 0) { + const current = await this.#currentTask(scope.taskId); + if (current !== void 0) + task.publicationConversationId = current.conversationId; + } + plan.conversationId = task.publicationConversationId; + } + for (const { id, change } of this.#submissionChanges) { + const current = this.#submissions.get(id) ?? await storage2.submission(id, this.#context); + if (current === void 0) + throw new Error(`Submission ${id} does not exist`); + const next = applySubmissionChange(current, change); + if (next !== current) + this.#submissions.set(id, next); + } + const writes = this.#writes; + for (const value2 of this.#submissions.values()) + writes.push({ type: "submission", value: value2 }); + for (const task of this.#tasksById.values()) { + if (task.write !== void 0) + writes.push({ type: "task", value: task.write.record }); + } + for (const plan of plans) { + const change = plan.change; + if (plan.content?.type === "document.change" && plan.content.content.kind === "delta" && change?.loaded) { + const { prepared, version } = change; + const info = { deltasSinceBase: change.loaded.deltasSinceBase }; + if (change.definition.checkpointWhen(prepared.value, prepared.ops, info)) { + plan.content = { ...plan.content, content: { version, kind: "base", value: prepared.value } }; + } + } + if (plan.content !== void 0) + writes.push(plan.content); + if (plan.retire) + writes.push({ type: "document.retire", id: plan.record.id }); + } + return writes; + } + // ─── Helpers ──────────────────────────────────────────────────────────── + /** + * New owned work needs a live owner, judged on the owner's final candidate: not `completing`, terminal, or + * abort-marked. A task therefore cannot create owned work in the commit that finishes it (spec §5.5). + */ + async #validateOwners() { + const owners = []; + for (const write of this.#writes) { + if (write.type !== "conversation" || write.value.owner === void 0) + continue; + owners.push({ what: "Conversation owner task", taskId: write.value.owner.taskId }); + } + for (const task of this.#tasksById.values()) { + const record = task.write?.kind === "create" ? task.write.record : void 0; + if (record?.owner !== void 0) + owners.push({ what: "Task owner", taskId: record.owner }); + } + for (const { what, taskId } of owners) { + const task = await this.#currentTask(taskId); + if (task === void 0) + throw new Error(`${what} ${taskId} does not exist`); + if (task.state.status === "terminal" || task.state.status === "completing") { + throw new Error(`${what} ${taskId} is ${task.state.status}`); + } + if (task.abortRequested) + throw new Error(`${what} ${taskId} is abort-marked`); + } + } + #rejectForkSourceWrites(plans) { + for (const plan of plans) { + if (plan.content === void 0 && !plan.retire) + continue; + const record = plan.record; + if (this.#forkSourceDocumentIds.has(record.id)) { + throw new Error(`Cannot change fork source document ${record.id} in the fork transaction`); + } + const scope = plan.record.scope; + if (scope.kind === "conversation" && this.#forkSourceConversationIds.has(scope.conversationId) && record.scope.kind === "conversation" && record.fork === "current") { + throw new Error(`Cannot fork conversation ${scope.conversationId} while changing its current-policy documents`); + } + } + } + #abortChanges() { + for (const document of this.#documents) + document.change?.abort(); + } + #assertOpen() { + if (this.#sealed) + throw new Error("Transaction has settled"); + } + #assertTaskDocumentsOpen(resolved) { + const scope = resolved.address.scope; + if (scope.kind === "task" && this.#tasksById.get(scope.taskId)?.write?.record.state.status === "terminal") { + throw new Error(`Task ${scope.taskId} is terminal`); + } + } + /** Register an operation so callback settlement can reject and drain it. */ + #track(operation) { + this.#pendingOperations.add(operation); + const settle3 = () => { + this.#pendingOperations.delete(operation); + }; + operation.then(settle3, settle3); + return operation; + } + #read(method, read2) { + try { + this.#assertOpen(); + if (this.#hasTableWrite) + throw new ReadAfterWrite(`Tx.${method}()`); + return this.#track(read2()); + } catch (error) { + return Promise.reject(error); + } + } + #write(write) { + try { + this.#assertOpen(); + this.#hasTableWrite = true; + return this.#track(write()); + } catch (error) { + return Promise.reject(error); + } + } + async #requireConversation(id) { + if (this.#createdConversationIds.has(id)) + return; + if (await this.#host.storage.conversation(id, this.#context) === void 0) { + throw new Error(`Conversation ${id} does not exist`); + } + } + /** + * Lifecycle times: `startedAt` on the first change to `running`, `endedAt` on the change to `terminal`. Once set, + * they carry over from the replaced record; records written before they existed lack them. + */ + #stampTimes(value2, candidate) { + const status = value2.state.status; + const now = (stamps) => stamps ? this.#host.now() : void 0; + const startedAt = candidate?.startedAt ?? value2.startedAt ?? now(status === "running"); + const endedAt = candidate?.endedAt ?? value2.endedAt ?? now(status === "terminal"); + if (startedAt === value2.startedAt && endedAt === value2.endedAt) + return value2; + return { + ...value2, + ...startedAt === void 0 ? {} : { startedAt }, + ...endedAt === void 0 ? {} : { endedAt } + }; + } + #taskEntry(id) { + let task = this.#tasksById.get(id); + if (task === void 0) { + task = {}; + this.#tasksById.set(id, task); + } + return task; + } + /** Latest candidate task record, falling back to committed state; not a caller table read. */ + async #currentTask(id) { + return this.#tasksById.get(id)?.write?.record ?? await this.#committedTask(id); + } + #committedTask(id) { + const task = this.#taskEntry(id); + task.committedRead ??= this.#host.storage.task(id, this.#context); + return task.committedRead; + } +}; +function planDocument(document) { + const target = document.target; + if (target === void 0) + return void 0; + const plan = { addressId: document.addressId, retire: document.retireOnCommit }; + switch (target.kind) { + case "created": { + const prepared = document.prepared; + const { record, version, tracker } = target; + const content = { version, kind: "base", value: prepared.value }; + return { + ...plan, + record, + content: { type: "document.create", record, content }, + change: { tracker, prepared, version } + }; + } + case "fork-copy": + return { + ...plan, + record: target.record, + content: { type: "document.copy", record: target.record, source: target.source } + }; + case "retire-only": + return { ...plan, record: target.record }; + case "loaded": { + const loaded = target.document; + const definition = document.definition; + const prepared = document.prepared; + const version = definition.version; + const id = loaded.record.id; + const content = loaded.storedVersion < version ? { type: "document.change", id, content: { version, kind: "base", value: prepared.value } } : prepared.ops.length > 0 ? { type: "document.change", id, content: { version, kind: "delta", ops: prepared.ops } } : void 0; + const change = { + tracker: loaded.tracker, + prepared, + version, + loaded, + definition + }; + return { ...plan, record: loaded.record, change, ...content === void 0 ? {} : { content } }; + } + } +} +function describe(plan, record) { + const conversationId = plan.conversationId; + if (plan.retire) + return { type: "document", kind: "retire", record, conversationId }; + if (plan.content?.type === "document.copy") { + return { type: "document.copy", record, conversationId, source: plan.content.source }; + } + const change = plan.change; + if (change === void 0 || !publishes(plan)) + return void 0; + const ops3 = change.loaded === void 0 ? EMPTY_OPERATIONS : change.prepared.ops; + return { + type: "document", + kind: "change", + record, + conversationId, + version: change.version, + value: change.prepared.value, + ops: ops3 + }; +} +function storeHeld(hold, ops3, value2, version) { + hold.pending.push(ops3); + const taken = hold.pending.take(); + if (taken.kind === "replace") + return { content: { version, kind: "base", value: value2 }, ops: [["r", value2]] }; + if (hold.base) + return { content: { version, kind: "base", value: value2 }, ops: taken.ops }; + return { content: { version, kind: "delta", ops: taken.ops }, ops: taken.ops }; +} +function publishes(plan) { + return plan.retire || plan.change?.loaded === void 0 || plan.content !== void 0; +} + +// node_modules/@earendil-works/pi-durable/dist/session/writer.js +var SESSION_FAILED = { kind: "failed" }; +var Writer = class { + #host; + /** Admitted parts not yet sent, in line order. */ + #queue = []; + #flight = false; + /** Per key, the newest unpublished part that writes it. */ + #unpublished = /* @__PURE__ */ new Map(); + /** The newest admitted part that is not yet published, whose gate opens after every earlier one's. */ + #newest; + constructor(host) { + this.#host = host; + } + /** Admit a part: register its keys, queue it, and send it at once unless a call is in flight. */ + admit(spec) { + const outcome = Promise.withResolvers(); + outcome.promise.catch(() => { + }); + const part = { + ...spec, + outcome: outcome.promise, + settle: { + resolve: () => { + part.done = true; + outcome.resolve(); + }, + reject: (error) => { + part.done = true; + outcome.reject(error); + } + }, + done: false, + gate: Promise.withResolvers() + }; + for (const key of spec.keys) + this.#unpublished.set(key, part); + this.#newest = part; + this.#queue.push(part); + this.#pump(); + return part; + } + /** The gate of the newest unpublished writer of `key`, or `undefined` when it has none. */ + gate(key) { + return this.#unpublished.get(key)?.gate.promise; + } + /** Opens once every part admitted so far is published or never will be. */ + drained() { + return this.#newest?.gate.promise; + } + /** Keys with an unpublished writer, for tests that bound memory. */ + get unpublished() { + return this.#unpublished.size; + } + #pump() { + if (this.#flight || this.#queue.length === 0) + return; + this.#flight = true; + const parts = this.#queue; + this.#queue = []; + void this.#flush(parts); + } + /** + * Send and publish `parts`, then what was admitted meanwhile. Never rejects: a throw the writer did not expect fails + * the Session and settles the parts (`#abandon()`), so no outcome or gate is stranded. + */ + async #flush(parts) { + try { + await this.#send(parts); + } catch (error) { + this.#abandon(parts, error); + } + this.#flight = false; + this.#pump(); + } + /** Store `parts` in one call, then publish them in order; settles every one of them. */ + async #send(parts) { + const stored = parts.filter((part) => part.writes !== void 0); + const seqs = []; + let result; + let rejected; + const failed = this.#host.failure(); + if (failed !== void 0) { + for (const part of parts) + this.#unpublish(part, new SessionFailed(failed.error)); + return; + } + if (stored.length > 0) { + try { + result = await this.#host.commit(stored.map((part) => part.writes), (index, seq2) => { + seqs[index] = seq2; + }, withoutAbortSignal(stored[0].context)); + } catch (error) { + rejected = { error }; + } + } + const failedMeanwhile = this.#host.failure(); + if (failedMeanwhile !== void 0) { + for (const part of parts) + this.#unpublish(part, new SessionFailed(failedMeanwhile.error)); + return; + } + await this.#publish(parts, seqs, result, rejected); + } + /** + * Publish the received parts and held ones in order, a macrotask apart, and settle every part (group commit §3.4). A + * refusal, a rejection, or a part whose adoption or own observer throws fails the Session once the parts before it + * are published and the host observers got the last one; the parts after it are not published, and reject with + * `SessionFailed`. What the failure decides (the outcomes, and the gates of the parts it concerns) is settled only + * once the Session failed, so no job waiting at such a gate, and no later outcome, goes on as if it had not. + */ + async #publish(parts, seqs, result, rejected) { + let stop2; + const failing = []; + let storedIndex = 0; + let published = 0; + for (const part of parts) { + const index = part.writes === void 0 ? void 0 : storedIndex++; + if (stop2 !== void 0) { + const outcome = rejected !== void 0 && index !== void 0 && stop2.external !== true ? { kind: "own", error: rejected.error } : SESSION_FAILED; + failing.push({ part, outcome, published: false }); + continue; + } + const seq2 = index === void 0 ? void 0 : seqs[index]; + if (index !== void 0 && seq2 === void 0) { + const error = rejected !== void 0 ? rejected.error : index === result?.stored && "refused" in result ? result.refused : new Error("Storage committed without adopting the batch"); + failing.push({ part, outcome: { kind: "own", error }, published: false }); + stop2 = { error, at: part.index }; + continue; + } + if (published++ > 0) + await hop(); + let failure3; + let external; + const publication = this.#host.publishing(() => { + external = this.#host.failure(); + if (external !== void 0) + return; + this.#unregister(part); + try { + if (part.writes !== void 0) + this.#host.stored(part.writes); + failure3 = part.publish(seq2); + } catch (error) { + failure3 = { kind: "adoption", error }; + } + }, part.context); + if (publication !== void 0) + await publication; + if (external !== void 0) { + stop2 = { error: external.error, at: part.index, external: true }; + failing.push({ part, outcome: SESSION_FAILED, published: false }); + continue; + } + if (failure3?.kind === "adoption") { + failing.push({ part, outcome: { kind: "own", error: failure3.error }, published: true }); + stop2 = { error: failure3.error, at: part.index }; + continue; + } + if (rejected !== void 0) { + if (failure3 !== void 0) + this.#host.report(failure3.error, part.context); + failing.push({ part, outcome: { kind: "own", error: rejected.error }, published: true }); + continue; + } + if (failure3 !== void 0) + stop2 = { error: failure3.error, at: part.index }; + const failedMeanwhile = this.#host.failure(); + if (failedMeanwhile !== void 0 && failure3 === void 0) { + part.settle.reject(new SessionFailed(failedMeanwhile.error)); + } else + part.settle.resolve(); + this.#open(part); + } + if (rejected !== void 0 || stop2 !== void 0) { + await Promise.resolve(); + const own = failing.flatMap(({ part, outcome }) => outcome.kind === "own" ? [part.index] : []); + if (rejected !== void 0) + this.#host.fail(rejected.error, own[0], own); + else + this.#host.fail(stop2.error, stop2.at, own); + } + for (const { part, outcome, published: stored } of failing) { + const error = outcome.kind === "own" ? outcome.error : this.#failed(stop2.error); + if (stored) { + part.settle.reject(error); + this.#open(part); + } else + this.#unpublish(part, error); + } + const failure2 = this.#host.failure(); + if (failure2 !== void 0) { + const queued = this.#queue; + this.#queue = []; + for (const part of queued) + this.#unpublish(part, new SessionFailed(failure2.error)); + } + } + /** + * A throw the writer itself did not expect while sending or publishing `parts` (a bug): fail the Session at the first + * of them and settle every one not settled yet, so no outcome, gate, or close waits on it forever. + */ + #abandon(parts, error) { + this.#host.fail(error, parts[0].index, []); + for (const part of parts) { + if (!part.done) + this.#unpublish(part, this.#failed(error)); + this.#unregister(part); + this.#open(part); + } + } + /** `SessionFailed` with the Session's failure, or with `error` until the Session records it. */ + #failed(error) { + const failure2 = this.#host.failure(); + return new SessionFailed(failure2 !== void 0 ? failure2.error : error); + } + /** Settle a part that will never be published: discard it, reject it with `error`, and open its gate. */ + #unpublish(part, error) { + part.discard(); + part.settle.reject(error); + this.#unregister(part); + this.#open(part); + } + /** Drop the keys a part is still the newest writer of: it is published, or never will be. */ + #unregister(part) { + for (const key of part.keys) + if (this.#unpublished.get(key) === part) + this.#unpublished.delete(key); + } + /** Open a part's gate: the jobs waiting for it go on. The newest part's opens `drained()` too. */ + #open(part) { + part.gate.resolve(); + if (this.#newest === part) + this.#newest = void 0; + } +}; +function hop() { + if (typeof setImmediate === "function") + return new Promise((resolve2) => setImmediate(resolve2)); + const channel = new MessageChannel(); + return new Promise((resolve2) => { + channel.port1.onmessage = () => { + channel.port1.close(); + resolve2(); + }; + channel.port2.postMessage(void 0); + }); +} + +// node_modules/@earendil-works/pi-durable/dist/session/session.js +var NO_HOLDS = []; +var NO_OPERATIONS = []; +var NO_KEYS = []; +var MAX_OUTSTANDING = 256; +var ignore = () => { +}; +var SETTLED = Promise.resolve(); +var LISTENER = { kind: "listener_error" }; +var TELEMETRY = { kind: "host_error", callback: "telemetry" }; +var defaultRetention = 6e5; +function documentRetention(ms) { + return typeof ms === "number" && ms >= 0 ? ms : defaultRetention; +} +var DEFAULT_PERSIST_WITHIN_MS = 1e3; +function persistWithin(ms) { + return typeof ms === "number" && ms >= 0 ? ms : DEFAULT_PERSIST_WITHIN_MS; +} +var SessionImpl = class { + #storage; + /** Newest entry and head marker per conversation; none for a read-only Session, whose Storage another process writes. */ + #tails; + /** + * The current documents of each live task this Session created, so the commit that ends a task retires them without + * a scan. An entry starts with its task's creation and goes when the task is terminal: bounded by live tasks. + */ + #taskDocuments = /* @__PURE__ */ new Map(); + #documents = /* @__PURE__ */ new Map(); + /** Cached documents with no observer attached, by address, oldest use first, with the time of that use. */ + #idleDocuments = /* @__PURE__ */ new Map(); + /** Observers attached per document incarnation (record ID); a cached incarnation with any is never evicted. */ + #attachedDocuments = /* @__PURE__ */ new Map(); + #clock; + #documentRetentionMs; + #persistWithinMs; + /** Documents with held changes, by incarnation (record ID); each is pinned in the cache until they are stored. */ + #holds = /* @__PURE__ */ new Map(); + #holdTimer; + /** Refuse every commit with writes (`HarnessOptions.readOnly`). */ + #readOnly; + #timers; + /** The pending eviction: a timer for the oldest idle document, or a line job when the retention is 0. */ + #documentSweep; + #sweepJobs = 0; + /** Set once the host declined a background timer: then none is kept, and the end of each commit evicts what expired. */ + #documentTimersUnavailable = false; + /** Host commit observers (`observeCommits()`), each behind `guardObserver()`. */ + #commitListeners = /* @__PURE__ */ new Set(); + /** The Session's own listeners, such as its scheduler's: they keep memory in step with storage, so a throw fails it. */ + #internalListeners = /* @__PURE__ */ new Set(); + #closeListeners = /* @__PURE__ */ new Set(); + #host; + /** The record cache under the guard, which the writer applies each batch to at its publication. */ + #cached; + #writer; + /** The Storage jobs on the line read through: each read waits while its key has an unpublished writer. */ + #gated; + /** The end of the last line job: the line runs one job at a time. */ + #tail = Promise.resolve(); + /** Line index of the next job; outcomes are delivered in this order. */ + #nextIndex = 0; + /** The job on the line, while one runs: its index, and whether it waited at a gate. */ + #current; + /** Settles once every job so far has its outcome delivered. */ + #fence = Promise.resolve(); + #lastDelivered = -1; + /** Jobs that started on the line and have no outcome delivered yet (`MAX_OUTSTANDING`). */ + #outstanding = 0; + #room; + /** The line index whose outcome the failure is: every later job's outcome is `SessionFailed`, except `#ownOutcomes`. */ + #failAt; + /** Later jobs whose outcome is their own error all the same: the other parts of a storage call that rejected. */ + #ownOutcomes = /* @__PURE__ */ new Set(); + #closing; + #failure; + /** Set when close reaches the backend: calls that fail from then on fail because it closes. */ + #failed = Promise.withResolvers(); + #closed = Promise.withResolvers(); + get closed() { + return this.#closed.promise; + } + /** Internal: the error that failed the Session, if one did. */ + get failure() { + return this.#failure; + } + /** Internal: rejects with `SessionFailed` the moment the Session fails, before work underway has ended; never resolves. */ + get failed() { + return this.#failed.promise; + } + constructor(storage2, now = Date.now, documentRetentionMs = () => void 0, setTimer, readOnly = false, persistWithinMs = () => void 0) { + this.#failed.promise.catch(() => { + }); + this.#readOnly = readOnly; + this.#cached = readOnly ? void 0 : new CachedStorage(storage2); + this.#storage = new GuardedStorage(this.#cached ?? storage2, this); + this.#gated = new GatedStorage(this.#storage, (key) => this.touch(key)); + this.#writer = new Writer({ + commit: (batches, receive, context) => this.#storage.commit(batches, receive, context), + stored: (writes) => { + this.#cached?.published(writes); + this.#tails?.apply(writes); + }, + publishing: (publish2, context) => this.#publishing(publish2, context), + failure: () => this.#failure, + fail: (error, at, own) => this.fail(error, void 0, at, own), + report: (error, context) => this.report(error, LISTENER, context) + }); + this.#tails = readOnly ? void 0 : new ConversationTails(); + this.#timers = hostTimers(setTimer, (error) => this.report(error, { kind: "host_error", callback: "setTimer" })); + this.#clock = () => { + try { + return now(); + } catch { + return Date.now(); + } + }; + this.#documentRetentionMs = () => { + try { + return documentRetention(documentRetentionMs()); + } catch { + return documentRetention(void 0); + } + }; + this.#persistWithinMs = () => { + try { + return persistWithin(persistWithinMs()); + } catch { + return persistWithin(void 0); + } + }; + this.#host = { + storage: this.#gated, + touch: (key) => this.touch(key), + now, + cached: (id) => { + const cached = this.#documents.get(id); + if (cached !== void 0) + this.#touchDocument(id); + return cached; + }, + load: (definition, addressId2, address, context) => this.#loadDocument(definition, addressId2, address, context), + install: (document) => { + this.#documents.set(document.addressId, document); + this.#touchDocument(document.addressId); + }, + evict: (id, recordId) => { + if (this.#documents.get(id)?.record.id === recordId) + this.#dropDocument(id); + }, + beforeInput: (tx, id, input, context) => this.beforeInput(tx, id, input, context), + conversationCreated: (tx, record) => this.conversationCreated(tx, record), + taskDocuments: (taskId) => this.#taskDocuments.get(taskId)?.values(), + latestEntryId: (conversationId, context) => this.latestEntryId(conversationId, context), + latestHeadMarker: (conversationId, context) => this.latestHeadMarker(conversationId, void 0, context) + }; + } + /** The Storage behind the failure guard; every component reads and writes through it. */ + get storage() { + return this.#storage; + } + /** + * Internal, on the Session line: the newest entry ID visible from `conversationId`. Known from the Session's own + * commits when it owns its Storage, so it costs no Storage read after the first. + */ + latestEntryId(conversationId, context) { + const gate = this.#touchEntries(conversationId); + const latest = () => { + const read2 = async () => (await this.#storage.scanEntries({ conversationId }, 1, void 0, context)).items[0]?.id; + return this.#tails === void 0 ? read2() : this.#tails.latest(conversationId, read2); + }; + return gate === void 0 ? latest() : gate.then(latest); + } + /** + * Internal: the newest entry ID of `conversationId` as known from the Session's commits right now, without reading; + * `undefined` when not known (and always for a read-only Session). + */ + knownLatestEntryId(conversationId) { + return this.#tails?.peek(conversationId); + } + /** + * Internal, on the Session line: the newest visible head marker of `conversationId` at or before `atOrBefore`, any + * when `undefined`; known from the Session's own commits as `latestEntryId()` is. + */ + latestHeadMarker(conversationId, atOrBefore, context) { + const gate = this.#touchEntries(conversationId); + const marker = () => { + const read2 = () => this.#storage.findLatestHeadMarker(conversationId, atOrBefore, context); + return this.#tails === void 0 ? read2() : this.#tails.marker(conversationId, atOrBefore, read2); + }; + return gate === void 0 ? marker() : gate.then(marker); + } + /** + * On the line: wait for what an unpublished commit wrote of a conversation's entries, its appends and its creation, + * as reading them from Storage fails for a conversation not stored yet. + */ + #touchEntries(conversationId) { + const created = this.touch(conversationKey(conversationId)); + const appended = this.touch(appendKey(conversationId)); + if (created === void 0) + return appended; + return appended === void 0 ? created : Promise.all([created, appended]).then(ignore); + } + /** + * Internal, on the line: wait, while `key` has an unpublished writer (for `ALL_KEYS`, while anything is unpublished), + * until it is published, then check that the Session is healthy; `undefined` when there is nothing to wait for. A + * job's every read touches its key first, so it never observes state an earlier job admitted and the writer has not + * published. + */ + touch(key) { + const gate = key === ALL_KEYS ? this.#writer.drained() : this.#writer.gate(key); + if (gate === void 0) + return void 0; + if (this.#current !== void 0) + this.#current.hit = true; + return gate.then(() => this.#assertHealthy()); + } + commit(change, context, options) { + return this.commitWith(change, context, void 0, options); + } + /** + * Internal: fail the Session with `error`, the first wins, and report it once. Admission ends, and close listeners run + * now; they read the error from `failure`. The Storage guard calls this; the Harness also calls it for a throw in its + * scheduler's own commits. `at` is the line index of the job whose outcome the failure is, by default the job on the + * line: later jobs' outcomes become `SessionFailed`. + */ + fail(error, context, at, own) { + if (this.#failure !== void 0) + return; + this.#failure = { error }; + this.#failAt = at ?? this.#current?.index ?? this.#lastDelivered; + if (own !== void 0) + for (const index of own) + this.#ownOutcomes.add(index); + this.#failed.reject(new SessionFailed(error)); + this.close(BACKGROUND_CONTEXT).catch(() => { + }); + this.report(error, { kind: "storage_failed" }, context); + } + /** + * Internal commit exposing the concrete transaction and its internal operations, such as the reserved-ID root + * bootstrap and task replacement. `scope` sets the default `tx.createTask()` conversation and the task attributed to + * appended entries. + */ + commitWith(change, context, scope, options) { + let withinMs; + try { + this.assertUsable(); + withinMs = this.#deferral(options?.persistence); + } catch (error) { + return Promise.reject(error); + } + return this.#enqueue((index) => this.#runCommit(change, context, scope, withinMs, index)); + } + /** + * Internal: `commitWith()` for a commit of the scheduler's own whose outcome goes only to scheduler code. When it + * writes nothing and waited at no gate, it is equivalent to having run before every unpublished commit, so its + * outcome is delivered at once, ahead of theirs. One that writes is never exempt: its outcome waits for its own + * publication and every earlier outcome, so no invocation starts on a reservation that is not durable. + */ + commitInternal(change, context) { + try { + this.assertUsable(); + } catch (error) { + return Promise.reject(error); + } + return this.#enqueue((index) => this.#runCommit(change, context, void 0, void 0, index), true); + } + /** + * Internal, on the line: call `end` once the outcome of the job on the line settles, its commit published or never to + * be; at once off the line. + */ + onJobEnd(end) { + const job = this.#current; + if (job === void 0) { + end(); + return; + } + if (job.ends === void 0) + job.ends = [end]; + else + job.ends.push(end); + } + /** Internal: the Storage jobs on the line read through (`touch()`); off the line, use the plain one. */ + get lineStorage() { + return this.#gated; + } + /** How long a commit may stay in memory before it is stored; `undefined` when it is immediate. */ + #deferral(persistence) { + if (persistence?.kind !== "deferred") + return void 0; + const ms = persistence.withinMs; + if (ms === void 0) + return this.#persistWithinMs(); + if (typeof ms !== "number" || !(ms >= 0)) { + throw new TypeError("CommitPersistence.withinMs must be a number of milliseconds, 0 or more"); + } + return ms; + } + /** Internal: whether `tx` is the transaction of one of this Session's commits. */ + ownsTransaction(tx) { + return Transaction.ownedBy(tx, this.#host); + } + /** + * Internal: run a read-only job on the mutation line so multi-read derivations observe one committed state. It reads + * through `storage`, whose reads wait for the publication of what the line admitted before; its outcome comes after + * theirs. + */ + readOnLine(job) { + try { + this.assertUsable(); + } catch (error) { + return Promise.reject(error); + } + return this.#enqueue(async () => { + this.#assertHealthy(); + return { value: await job(this.#gated) }; + }); + } + /** + * Internal: a conversation document's current incarnation and value, for a job already running on the line (see + * `readOnLine()`). Absent documents are `undefined`. + */ + async conversationDocumentOnLine(token, conversationId, context) { + const definition = token.definition; + const resolved = resolveAddress(definition, [conversationId, context]); + const loaded = await this.#loadDocument(definition, resolved.id, resolved.address, context); + if (loaded === void 0) + return void 0; + checkRecordScope(definition, loaded.record); + checkRecordVersion(definition, loaded.record, loaded.storedVersion); + return { record: loaded.record, version: loaded.valueVersion, value: loaded.tracker.value }; + } + async snapshot(token, ...args) { + this.assertUsable(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + const context = args[resolved.nextArgument]; + const cached = this.#documents.get(resolved.id); + if (cached?.valueVersion === definition.version) + this.#touchDocument(resolved.id); + const loaded = cached?.valueVersion === definition.version ? cached : await this.#enqueue(async () => { + this.#assertHealthy(); + return { value: await this.#loadDocument(definition, resolved.id, resolved.address, context) }; + }); + if (loaded === void 0) + return void 0; + checkRecordScope(definition, loaded.record); + checkRecordVersion(definition, loaded.record, loaded.storedVersion); + return loaded.tracker.value; + } + watchDoc(token, ...args) { + try { + this.assertUsable(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + const context = args[resolved.nextArgument]; + const signal = context.abortSignal; + return this.#attachDocument(definition, resolved, context, (loaded) => { + const watch = this.#observeDocument(definition, loaded, createWatch, endWatch); + if (signal !== void 0) + watch.observeAbort(signal); + return watch; + }, abortWatch); + } catch (error) { + return Promise.reject(error); + } + } + observeDoc(token, ...args) { + try { + this.assertUsable(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + const observer = args[resolved.nextArgument]; + const context = args[resolved.nextArgument + 1]; + return this.#attachDocument(definition, resolved, context, (loaded) => { + const guarded = this.#observeDocument(definition, loaded, (_value, detach, report2) => guardObserver(observer, detach, report2), endGuarded); + return observation(loaded.tracker.value, guarded); + }, detachObservation); + } catch (error) { + return Promise.reject(error); + } + } + async snapshotAsOf(token, ...args) { + this.assertUsable(); + const definition = token.definition; + const resolved = resolveAddress(definition, args); + if (resolved.address.scope.kind !== "conversation") { + throw new TypeError("Session.snapshotAsOf() requires a conversation document"); + } + const conversationId = resolved.address.scope.conversationId; + const atValue = args[resolved.nextArgument]; + if (typeof atValue !== "number" || !Number.isSafeInteger(atValue)) { + throw new TypeError("Session.snapshotAsOf() requires an entry ID"); + } + const at = idFromNumber(atValue); + const context = args[resolved.nextArgument + 1]; + return this.#enqueue(async () => { + this.#assertHealthy(); + const storedEntry = await this.#gated.entry(conversationId, at, context); + if (storedEntry === void 0) { + throw new Error(`Entry ${at} is not visible from conversation ${conversationId}`); + } + const address = { + ...resolved.address, + scope: { kind: "conversation", conversationId: storedEntry.entry.conversationId } + }; + const record = await this.#gated.findDocument(address, storedEntry.commitSeq, context); + if (record === void 0) + return { value: void 0 }; + const stored = await this.#gated.document(record.id, storedEntry.commitSeq, context); + if (stored === void 0) { + throw new Error(`Historical document ${record.id} (${record.kind}) cannot be read`); + } + return { value: materializeDocument(definition, stored) }; + }); + } + close(context) { + if (this.#closing === void 0) { + const cleanup = withoutAbortSignal(context); + this.#closing = Promise.resolve().then(() => this.beforeClose()).then(() => this.#maintain(async () => { + await this.#drained(); + let unstored; + if (this.#failure === void 0 && this.#holds.size > 0) { + await this.#storeHolds(() => [...this.#holds.values()], cleanup).catch((error) => { + unstored = { error }; + }); + } + const observers = [...this.#commitListeners]; + this.#commitListeners.clear(); + const end = closeEnds(this.#failure).observer; + for (const observer of observers) + observer.end(end); + this.#internalListeners.clear(); + this.#documents.clear(); + this.#idleDocuments.clear(); + this.#attachedDocuments.clear(); + this.#holds.clear(); + this.#taskDocuments.clear(); + try { + await this.#storage.close(cleanup); + } catch (error) { + if (this.#failure === void 0) { + this.#failure = { error }; + this.report(error, { kind: "storage_failed" }); + } + throw error; + } + if (unstored !== void 0) + throw unstored.error; + })).finally(() => { + const failure2 = this.#failure; + this.#closed.resolve(failure2 === void 0 ? { kind: "closed" } : { kind: "failed", error: failure2.error }); + }); + this.#notifyClose(); + } + return awaitWithContext(this.#closing, context); + } + /** Run the close listeners once, each on its own: one that fails is reported, and the rest still run. */ + #notifyClose() { + this.#documentSweep?.disarm?.(); + this.#documentSweep = void 0; + this.#holdTimer?.disarm(); + this.#holdTimer = void 0; + const listeners = [...this.#closeListeners]; + this.#closeListeners.clear(); + for (const listener of listeners) + contained(listener, (error) => this.report(error)); + } + /** + * Internal: the Session's failure, and errors of listeners, which never fail what ran them; `info` defaults to a + * listener. A plain Session drops them. + */ + report(_error, _info = LISTENER, _context) { + } + async beforeInput(_tx, _id, _input, _context) { + return []; + } + /** + * Runs inside every transaction that creates or forks a conversation, after the conversation record is staged. A + * plain Session stages nothing; a Harness stages its built-in documents. + */ + conversationCreated(_tx, _record) { + return Promise.resolve(); + } + /** + * Internal, for `beforeClose()`: on the line, after every commit admitted before the seal has settled, write what + * `writes()` returns then straight to Storage. Nothing is published, since the Session is closing; a failed Session + * writes nothing. + */ + writeAtClose(writes) { + return this.#maintain(async (index) => { + await this.#drained(); + if (this.#failure !== void 0) + return; + const batch = writes(); + if (batch.length === 0) + return; + const context = BACKGROUND_CONTEXT; + await this.#writer.admit({ + index, + writes: batch, + keys: [], + context, + publish: () => void 0, + discard: ignore + }).outcome; + }); + } + /** + * Keys a commit writes besides its records' (`Transaction.writeKeys()`), at its admission, on the line: a Harness + * adds the ownership memberships its task changes write. A plain Session adds none. + */ + membershipKeys(_tx) { + return NO_KEYS; + } + /** Runs after close seals admission and before the line closes Storage; must not reject. */ + beforeClose() { + return Promise.resolve(); + } + /** + * Attach a synchronous observer of every stored commit, with exactly what it stored (`CommitPublication`). Its + * `advance` runs one microtask after the commit's publication, which follows its storage call, in line order, before + * every wait the commit resolves and every abort it queues (in no order with watch listeners); it must not block or + * call Session operations. A throw is reported, detaches it, and ends it `listener_error`; `end` gets the Session's + * close after its last publication. + */ + observeCommits(observer) { + this.assertUsable(); + const guarded = guardObserver(observer, () => this.#commitListeners.delete(guarded), (error, context) => this.report(error, LISTENER, context)); + this.#commitListeners.add(guarded); + return { detach: () => guarded.detach() }; + } + /** + * Internal: follow every commit as memory adopts it (`ObservedCommit`), for the Session's own components, whose state + * follows memory. A throw leaves that state behind, so it fails the Session instead of being reported. They run at + * the commit's publication, synchronously, so they call no Storage method, run no task code, and contain every host + * callback; the waits they resolve and the aborts they queue run after host observers. + */ + followCommits(listener) { + this.assertUsable(); + this.#internalListeners.add(listener); + return () => this.#internalListeners.delete(listener); + } + /** + * Register a listener called synchronously when close begins, also when a failure closes the Session (`failure` is + * then set). It must not block or call Session operations; a throw is reported. + */ + subscribeClose(listener) { + this.assertUsable(); + this.#closeListeners.add(listener); + return () => this.#closeListeners.delete(listener); + } + /** Drop every loaded tracker on the mutation line, held changes stored first; later access cold-loads from Storage. */ + unloadDocuments() { + return this.#maintain(async () => { + if (this.#failure === void 0) + await this.#storeHolds(() => [...this.#holds.values()], BACKGROUND_CONTEXT); + this.#documents.clear(); + this.#idleDocuments.clear(); + }); + } + /** + * Internal, for tests: how many documents the cache holds, how many are idle, how many incarnations are pinned, how + * many sweep jobs were queued on the line so far, how many documents have held changes, how many live tasks have + * their documents indexed, and how many conversations have their newest entry kept. + */ + get documentCacheSizes() { + return { + cached: this.#documents.size, + idle: this.#idleDocuments.size, + attached: this.#attachedDocuments.size, + sweeps: this.#sweepJobs, + held: this.#holds.size, + taskDocuments: this.#taskDocuments.size, + tails: this.#tails?.size ?? 0 + }; + } + /** + * Internal, for tests that bound memory: jobs whose outcome is not delivered yet, keys with an unpublished writer, + * and record reads in flight in the cache. All three are 0 once the line is idle. + */ + get lineSizes() { + return { + outstanding: this.#outstanding, + unpublished: this.#writer.unpublished, + reads: this.#cached?.readsInFlight ?? 0 + }; + } + /** Note a use of a cached document: an unattached one becomes the newest idle one, and an eviction is scheduled. */ + #touchDocument(addressId2) { + const cached = this.#documents.get(addressId2); + if (cached === void 0 || this.#attachedDocuments.has(cached.record.id)) + return; + const now = this.#clock(); + const since = this.#idleDocuments.get(addressId2); + if (since !== void 0 && now - since < Math.min(1e3, this.#documentRetentionMs() / 10)) + return; + this.#idleDocuments.delete(addressId2); + this.#idleDocuments.set(addressId2, now); + if (this.#documentSweep === void 0 || this.#documentSweep.at > now + this.#documentRetentionMs()) { + this.#scheduleDocumentSweep(); + } + } + #dropDocument(addressId2) { + this.#documents.delete(addressId2); + this.#idleDocuments.delete(addressId2); + } + /** + * Schedule the eviction of the oldest idle document: on the line at once when the retention is 0, otherwise when it + * expires, by a background timer (`HarnessOptions.setTimer`), which never keeps the process alive. Where the host + * declines it, as the default does in Cloudflare Workers, none is kept: the end of each commit evicts what expired. + */ + #scheduleDocumentSweep() { + if (this.#closing !== void 0) + return; + let oldest; + for (const [addressId2, since] of this.#idleDocuments) { + if (this.#writer.gate(documentKey(addressId2)) !== void 0) + continue; + oldest = since; + break; + } + if (oldest === void 0) + return; + const at = oldest + this.#documentRetentionMs(); + if (this.#documentSweep !== void 0 && this.#documentSweep.at <= at) + return; + this.#documentSweep?.disarm?.(); + const sweep = { at, disarm: void 0 }; + const run2 = () => { + this.#sweepJobs++; + this.#maintain(async () => { + if (this.#documentSweep === sweep) + this.#documentSweep = void 0; + if (this.#closing === void 0) + this.#sweepDocuments(); + }).catch(() => { + }); + }; + const delay = at - this.#clock(); + this.#documentSweep = sweep; + if (delay <= 0) { + queueMicrotask(run2); + return; + } + if (this.#documentTimersUnavailable) { + this.#documentSweep = void 0; + return; + } + const disarm = this.#timers.background(run2, delay); + if (disarm === void 0) { + this.#documentTimersUnavailable = true; + this.#documentSweep = void 0; + return; + } + sweep.disarm = disarm; + } + /** On the line: evict the idle documents whose retention passed, oldest first, then schedule the next eviction. */ + #sweepDocuments() { + const expired = this.#clock() - this.#documentRetentionMs(); + for (const [addressId2, since] of this.#idleDocuments) { + if (since > expired) + break; + if (this.#writer.gate(documentKey(addressId2)) !== void 0) + continue; + this.#dropDocument(addressId2); + } + this.#scheduleDocumentSweep(); + } + /** Pin a cached incarnation for one observer; the returned release unpins it once, idle again after the last. */ + #pinDocument(addressId2, recordId) { + this.#attachedDocuments.set(recordId, (this.#attachedDocuments.get(recordId) ?? 0) + 1); + this.#idleDocuments.delete(addressId2); + let pinned = true; + return () => { + if (!pinned) + return; + pinned = false; + const count = (this.#attachedDocuments.get(recordId) ?? 1) - 1; + if (count > 0) { + this.#attachedDocuments.set(recordId, count); + return; + } + this.#attachedDocuments.delete(recordId); + if (this.#documents.get(addressId2)?.record.id === recordId) + this.#touchDocument(addressId2); + }; + } + async #runCommit(change, context, scope, withinMs, index) { + this.#assertHealthy(); + context.abortSignal?.throwIfAborted(); + const tx = new Transaction(this.#host, context, scope); + let result; + try { + result = await change(tx); + this.#assertHealthy(); + } catch (error) { + await tx.settleFailure(); + this.#sweepDocuments(); + throw error; + } + let writes; + try { + writes = await tx.settleSuccess(); + } catch (error) { + this.#sweepDocuments(); + throw error; + } + if (writes.length === 0) { + tx.discard(); + this.#sweepDocuments(); + return { value: result }; + } + if (this.#readOnly) { + tx.discard(); + this.#sweepDocuments(); + throw new ReadOnlySession("a commit with writes"); + } + const discard = () => tx.discard(); + if (withinMs !== void 0) { + const held = tx.holdable(); + if (held !== void 0) { + const part2 = this.#writer.admit({ + index, + writes: void 0, + keys: tx.writeKeys(), + context, + publish: () => this.#hold(tx, held, withinMs, context), + discard + }); + this.#sweepDocuments(); + return { value: result, after: part2.outcome }; + } + } + let membership = this.membershipKeys(tx); + if (!Array.isArray(membership)) { + try { + membership = await membership; + } catch (error) { + tx.discard(); + this.#sweepDocuments(); + throw error; + } + } + const taken = this.#holds.size === 0 ? NO_HOLDS : tx.takeHeld((id) => this.#holds.get(id)); + const keys = tx.writeKeys(); + for (const key of membership) + keys.push(key); + const part = this.#writer.admit({ + index, + writes, + keys, + context, + publish: (seq2) => this.#adopt(tx, writes, taken, seq2, context), + discard + }); + this.#sweepDocuments(); + return { value: result, after: part.outcome }; + } + /** + * Publish a stored commit (`Writer`), after the read caches took its writes: adopt it in memory and run its + * publication. A throw of the adoption leaves memory behind durable state; the writer fails the Session with it. + */ + #adopt(tx, writes, taken, seq2, context) { + let documents; + try { + documents = tx.adopt(seq2); + } catch (error) { + return { kind: "adoption", error }; + } + this.#indexTaskDocuments(tx, writes, documents, seq2); + const failure2 = this.#publish(seq2, writes, documents, context); + if (taken.length > 0) + this.#release(taken); + for (const document of documents.stored) + this.#touchDocument(addressId(document.record)); + return failure2 === void 0 ? void 0 : { kind: "listener", error: failure2.error }; + } + /** + * At publication: keep `#taskDocuments` in step with a stored commit: the tasks it creates start with no documents, + * task documents it creates join their task, ones it retires leave, and tasks it ends leave the index. + */ + #indexTaskDocuments(tx, writes, documents, seq2) { + for (const id of tx.createdTaskIds()) + this.#taskDocuments.set(id, /* @__PURE__ */ new Map()); + if (this.#taskDocuments.size === 0) + return; + for (const change of documents.stored) { + if (change.type !== "document" || change.record.scope.kind !== "task") + continue; + const known = this.#taskDocuments.get(change.record.scope.taskId); + if (known === void 0) + continue; + if (change.kind === "retire") + known.delete(change.record.id); + else if (change.record.createdAt === seq2) + known.set(change.record.id, change.record); + } + for (const write of writes) { + if (write.type === "task" && write.value.state.status === "terminal") + this.#taskDocuments.delete(write.value.id); + } + } + /** + * Hold a deferred commit (`Transaction.holdable()`): adopt it in memory, queue its changes per document, pinned, by + * the earliest deadline of the document's held commits, and show it to the Session's own observers. + */ + #hold(tx, held, withinMs, context) { + let documents; + try { + documents = tx.adoptHeld(); + } catch (error) { + return { kind: "adoption", error }; + } + const deadline = this.#clock() + withinMs; + for (const { loaded, ops: ops3, base } of held) { + const id = loaded.record.id; + let hold = this.#holds.get(id); + if (hold === void 0) { + const unpin = this.#pinDocument(loaded.addressId, id); + hold = { loaded, pending: new PendingOps(), base: false, deadline, unpin }; + this.#holds.set(id, hold); + } + hold.pending.push(ops3); + if (base) + hold.base = true; + if (deadline < hold.deadline) + hold.deadline = deadline; + } + this.#armHoldTimer(); + const publication = { kind: "memory", changes: documents }; + let failure2; + for (const listener of [...this.#internalListeners]) { + try { + listener(publication, context); + } catch (error) { + failure2 ??= { kind: "listener", error }; + } + } + return failure2; + } + /** + * Store the held changes `select` returns in one storage transaction, through the writer, from a job on the line. A + * barrier: they are selected once every commit admitted before is published. Memory already has them, so only + * `observeCommits()` observers see it, published as the writer publishes it. A failure fails the Session, as every + * Storage failure does. + */ + async #storeHolds(select, context) { + await this.#drained(); + const holds = select(); + if (holds.length === 0) + return; + const writes = []; + const changes = []; + const keys = []; + for (const hold of holds) { + const { record, tracker, valueVersion: version } = hold.loaded; + const value2 = tracker.value; + const stored = storeHeld(hold, NO_OPERATIONS, value2, version); + writes.push({ type: "document.change", id: record.id, content: stored.content }); + keys.push(documentKey(hold.loaded.addressId), incarnationKey(record.id)); + const conversationId = record.scope.kind === "conversation" ? record.scope.conversationId : void 0; + changes.push({ type: "document", kind: "change", record, conversationId, version, value: value2, ops: stored.ops }); + } + const publish2 = (seq2) => { + for (const [index2, hold] of holds.entries()) { + if (writes[index2].content.kind === "base") + hold.loaded.deltasSinceBase = 0; + else + hold.loaded.deltasSinceBase++; + } + if (this.#commitListeners.size > 0) + this.#notifyHosts({ seq: seq2, changes }, context); + this.#release(holds); + return void 0; + }; + const index = this.#current.index; + await this.#writer.admit({ index, writes, keys, context, publish: publish2, discard: ignore }).outcome; + } + /** After their store: forget `holds`, unpin their documents, and move the timer to the next deadline. */ + #release(holds) { + for (const hold of holds) { + this.#holds.delete(hold.loaded.record.id); + hold.unpin(); + } + this.#armHoldTimer(); + } + /** + * Keep a foreground timer (Workers refuse background ones) for the earliest deadline of the held documents. When it + * fires, every held document is stored, in one storage transaction: a deadline is the latest time, and the others + * cost little more in the same transaction. Once fired, it stays until its job ran. + */ + #armHoldTimer() { + if (this.#closing !== void 0) + return; + let at = Infinity; + for (const hold of this.#holds.values()) + if (hold.deadline < at) + at = hold.deadline; + const armed = this.#holdTimer; + if (armed !== void 0 && (armed.fired || armed.at === at)) + return; + armed?.disarm(); + this.#holdTimer = void 0; + if (at === Infinity) + return; + const timer = { at, disarm: () => { + }, fired: false }; + const run2 = () => { + timer.fired = true; + this.#maintain(async () => { + if (this.#holdTimer === timer) + this.#holdTimer = void 0; + if (this.#closing !== void 0 || this.#failure !== void 0) + return; + await this.#storeHolds(() => [...this.#holds.values()], BACKGROUND_CONTEXT); + }).catch(() => { + }); + }; + this.#holdTimer = timer; + timer.disarm = this.#timers.foreground(run2, Math.max(0, at - this.#clock())); + } + /** + * At publication: publish a stored commit. Its telemetry events first, then the dispatch to `observeCommits()` + * observers, queued before the waits and aborts the observers wake, then the Session's own observers. Never throws: + * returns the first error of an own observer, which fails the Session once its storage call settled. + */ + #publish(seq2, writes, documents, context) { + const changes = this.#commitListeners.size > 0 || this.#internalListeners.size > 0 ? [] : void 0; + for (const write of writes) { + switch (write.type) { + case "entry": + this.#event("pi.durable.entry", { "entry.id": write.value.id, "entry.kind": write.value.kind }, context); + changes?.push(write); + break; + case "submission": + if (write.value.status === "done" || write.value.status === "unanswered") { + this.#event("pi.durable.submission", { + "submission.id": write.value.id, + status: write.value.status, + "answer.entry_id": write.value.answer + }, context); + } + changes?.push(write); + break; + case "conversation": + case "task": + changes?.push(write); + } + } + if (changes === void 0) + return void 0; + const tables = changes.length; + for (const document of documents.observed) + changes.push(document); + const observed = { kind: "stored", seq: seq2, changes }; + if (this.#commitListeners.size > 0) { + const stored = documents.stored === documents.observed ? observed : { seq: seq2, changes: [...changes.slice(0, tables), ...documents.stored] }; + this.#notifyHosts(stored, context); + } + let failure2; + for (const listener of [...this.#internalListeners]) { + try { + listener(observed, context); + } catch (error) { + failure2 ??= { error }; + } + } + return failure2; + } + /** At publication: record a commit's telemetry event. A throwing adapter is reported, as publication must not throw. */ + #event(name, attributes, context) { + try { + context.telemetry.addEvent(name, attributes); + } catch (error) { + this.report(error, TELEMETRY, context); + } + } + /** + * At publication: call the `observeCommits()` observers with `publication` one microtask from now, and, queued + * before the Session's own observers run, before the waits they resolve and the aborts they queue. The observers are + * those attached when it runs; their guards report a throw. + */ + #notifyHosts(publication, context) { + void SETTLED.then(() => { + for (const observer of [...this.#commitListeners]) + observer.advance(publication, context); + }); + } + /** + * On the line, as one job: load the document at `resolved` and `attach` to it, so the attachment sees every commit + * after the value it starts from; `undefined` when absent. Cancelling `context` meanwhile rejects, after `cancel` + * undid an attachment made. + */ + async #attachDocument(definition, resolved, context, attach, cancel) { + const signal = context.abortSignal; + let cancelled = signal?.aborted ?? false; + const markCancelled = () => { + cancelled = true; + }; + signal?.addEventListener("abort", markCancelled, { once: true }); + try { + const attached = await this.#enqueue(async () => { + this.#assertHealthy(); + if (cancelled) + throw cancellationError(signal); + const loaded = await this.#loadDocument(definition, resolved.id, resolved.address, context); + if (cancelled) + throw cancellationError(signal); + return { value: loaded === void 0 ? void 0 : attach(loaded) }; + }); + if (attached === void 0) + return void 0; + if (cancelled) { + cancel(attached); + throw cancellationError(signal); + } + return attached; + } finally { + signal?.removeEventListener("abort", markCancelled); + } + } + /** + * Follow the address of the incarnation `loaded`, after checking the definition, with the observer `create` makes + * from its value, the idempotent detach, and the report of a listener error; returns that observer. It gets each + * committed change there, a retirement as a `retired` change with the last value it was given and no ops (a change + * in the retiring commit is not published), and a later incarnation as a root replacement. When the commit makes the + * owner task of a task document terminal, no later commit can change the address: after its changes the commit + * subscription and the pin go, and `ownerEnded` tells the observer, which stays subscribed to the Session's close + * until it ends (its detach drops that). `end` gets the Session's close. The current incarnation is pinned in the + * cache. The detach runs before `end`; once it ran, nothing more of the commit underway reaches the observer or pins + * anything for it. `create` and `ownerEnded` are module functions where they can be, so a watch keeps no closure of + * its caller. + */ + #observeDocument(definition, loaded, create, ownerEnded) { + checkRecordScope(definition, loaded.record); + checkRecordVersion(definition, loaded.record, loaded.storedVersion); + const addressId2 = loaded.addressId; + const address = loaded.record; + let incarnation = loaded.record.id; + let value2 = loaded.tracker.value; + let version = loaded.valueVersion; + let unpin = this.#pinDocument(addressId2, incarnation); + let unsubscribeCommit = () => { + }; + let unsubscribeClose = () => { + }; + let attached = true; + const detach = () => { + if (!attached) + return; + attached = false; + unsubscribeCommit(); + unsubscribeClose(); + unpin(); + }; + const observer = create(loaded.tracker.value, detach, (error) => this.report(error)); + unsubscribeCommit = this.followCommits((publication, context) => { + if (!attached) + return; + let ownerEnds = false; + for (const change of publication.changes) { + if (change.type === "task") { + const scope = address.scope; + if (scope.kind === "task" && change.value.id === scope.taskId && change.value.state.status === "terminal") { + ownerEnds = true; + } + continue; + } + if (change.type !== "document") + continue; + if (change.record.id !== incarnation && !atAddress(change.record, address)) + continue; + if (change.kind === "retire") { + if (change.record.id !== incarnation) + continue; + const last = value2; + incarnation = void 0; + value2 = void 0; + unpin(); + observer.advance({ kind: "value", value: last, ops: NO_OPERATIONS, retired: true }, context); + } else if (change.record.id !== incarnation || change.version !== version) { + if (change.record.id !== incarnation) { + incarnation = change.record.id; + unpin(); + unpin = this.#pinDocument(addressId2, incarnation); + } + version = change.version; + value2 = change.value; + observer.advance({ kind: "value", value: value2, ops: [["r", value2]], retired: false }, context); + } else { + if (change.ops.length === 0) + continue; + value2 = change.value; + observer.advance({ kind: "value", value: value2, ops: change.ops, retired: false }, context); + } + if (!attached) + return; + } + if (!ownerEnds) + return; + unsubscribeCommit(); + unpin(); + ownerEnded(observer); + }); + unsubscribeClose = this.subscribeClose(() => { + detach(); + observer.end(closeEndOf(observer, closeEnds(this.#failure))); + }); + return observer; + } + async #loadDocument(definition, addressId2, address, context) { + const gate = this.touch(documentKey(addressId2)); + if (gate !== void 0) + await gate; + const cached = this.#documents.get(addressId2); + if (cached?.valueVersion === definition.version) { + this.#touchDocument(addressId2); + return cached; + } + if (cached !== void 0) { + const id = cached.record.id; + await this.#storeHolds(() => { + const hold = this.#holds.get(id); + return hold === void 0 ? NO_HOLDS : [hold]; + }, context); + this.#dropDocument(addressId2); + } + const record = await this.#storage.findDocument(address, "current", context); + if (record === void 0) + return void 0; + const stored = await this.#storage.document(record.id, "current", context); + if (stored === void 0) + throw new Error(`Current document ${record.id} (${record.kind}) cannot be read`); + const value2 = materializeDocument(definition, stored); + const loaded = { + addressId: addressId2, + record: stored.record, + storedVersion: stored.version, + valueVersion: definition.version, + deltasSinceBase: stored.deltasSinceBase, + tracker: track(value2) + }; + this.#documents.set(addressId2, loaded); + this.#touchDocument(addressId2); + return loaded; + } + /** + * Run `job` on the line, after the jobs before it, and deliver its outcome in line order: once the jobs before it + * have theirs, and once its commit, if it admitted one, is published. With `exempt`, a job that admitted no commit and + * waited at no gate is delivered as soon as it has its outcome: it is equivalent to having run before every + * unpublished commit. A job + * whose outcome comes after the one a failure is gets `SessionFailed` instead. At most `MAX_OUTSTANDING` jobs wait + * for their delivery; beyond it the line waits. + */ + #enqueue(work, exempt = false) { + const job = { index: this.#nextIndex++, hit: false }; + const ran = this.#tail.then(async () => { + while (this.#outstanding >= MAX_OUTSTANDING) { + this.#room ??= Promise.withResolvers(); + await this.#room.promise; + } + this.#outstanding++; + return this.#onLine(job, work); + }); + this.#tail = ran.then(ignore, ignore); + const outcome = ran.then((result) => { + if (result.after === void 0) { + this.#ended(job); + return result.value; + } + return result.after.then(() => { + this.#ended(job); + return result.value; + }, (error) => { + this.#ended(job); + throw error; + }); + }, (error) => { + this.#ended(job); + throw error; + }); + outcome.catch(ignore); + const fence = this.#fence; + this.#fence = fence.then(() => outcome).then(ignore, ignore); + const index = job.index; + const deliver = (fenced) => (fenced ? fence.then(() => outcome) : outcome).then((value2) => { + this.#delivered(index, fenced); + if (this.#poisoned(index)) + throw new SessionFailed(this.#failure.error); + return value2; + }, (error) => { + this.#delivered(index, fenced); + throw this.#poisoned(index) ? new SessionFailed(this.#failure.error) : error; + }); + return exempt ? ran.then((result) => deliver(job.hit || result.after !== void 0), () => deliver(job.hit)) : deliver(true); + } + /** Whether job `index` comes after the failure's boundary without an outcome of its own: it gets `SessionFailed`. */ + #poisoned(index) { + return this.#failAt !== void 0 && index > this.#failAt && !this.#ownOutcomes.has(index); + } + /** The job's outcome settled: run what waited for it (`onJobEnd()`). */ + #ended(job) { + const ends = job.ends; + if (ends === void 0) + return; + job.ends = void 0; + for (const end of ends) + end(); + } + /** Run a job of the Session's own upkeep on the line: no outcome to deliver, so no fence and no `SessionFailed`. */ + #maintain(work) { + const job = { index: this.#nextIndex++, hit: false }; + const ran = this.#tail.then(() => this.#onLine(job, work)); + this.#tail = ran.then(ignore, ignore); + return ran; + } + /** Hold the line for job `index` until its line part, through admission, is done. Gates are its touches' own. */ + async #onLine(job, work) { + this.#current = job; + try { + return await work(job.index); + } finally { + this.#current = void 0; + } + } + /** A `*` barrier: once every part admitted so far is published, or never will be. */ + async #drained() { + const drained = this.#writer.drained(); + if (drained !== void 0) + await drained; + } + /** + * Run one commit's publication inside the Storage's own scope (`Storage.publishing`), such as a store host's batch; + * directly without one. `undefined` when it ran at once, else settles once it ran. A Storage that throws instead of + * running it is reported, and the publication runs directly: the commit is stored, so it must be published. + */ + #publishing(publish2, context) { + const publishing = this.#storage.publishing; + if (publishing === void 0) { + publish2(); + return void 0; + } + const done = Promise.withResolvers(); + let ran = false; + const once = () => { + if (ran) + return; + ran = true; + try { + publish2(); + } finally { + done.resolve(); + } + }; + try { + publishing(once, context); + } catch (error) { + this.report(error, LISTENER, context); + once(); + } + return done.promise; + } + /** Job `index` has its outcome: let the line go on past `MAX_OUTSTANDING`. */ + #delivered(index, fenced) { + if (fenced) + this.#lastDelivered = index; + this.#outstanding--; + const room = this.#room; + if (room !== void 0 && this.#outstanding < MAX_OUTSTANDING) { + this.#room = void 0; + room.resolve(); + } + } + /** Internal: throw `SessionFailed` when failed, else an error when closing. */ + assertUsable() { + this.#assertHealthy(); + if (this.#closing !== void 0) + throw new Error("Session is closed"); + } + #assertHealthy() { + if (this.#failure !== void 0) + throw new SessionFailed(this.#failure.error); + } +}; +function contained(callback, onError) { + try { + const result = callback(); + if (typeof result?.then === "function") + Promise.resolve(result).catch(onError); + } catch (error) { + onError(error); + } +} +function guardObserver(observer, detach, report2) { + let attached = { observer, detach, report: report2 }; + const release = () => { + const released = attached; + attached = void 0; + released?.detach(); + return released; + }; + const fault = (current, error, context) => { + current.report(error, context); + if (release() !== void 0) { + const end = { kind: "listener_error", error: toError2(error) }; + contained(() => current.observer.end(end), current.report); + } + }; + return { + advance: (call, context) => { + const current = attached; + if (current === void 0) + return; + try { + const result = current.observer.advance(call, context); + if (typeof result?.then === "function") { + Promise.resolve(result).catch((error) => fault(current, error, context)); + } + } catch (error) { + fault(current, error, context); + } + }, + end: (end) => { + const ending = release(); + if (ending !== void 0) + contained(() => ending.observer.end(end), ending.report); + }, + detach: () => { + release(); + } + }; +} +function toError2(error) { + if (error instanceof Error) + return error; + try { + return new Error(String(error)); + } catch { + return new Error(Object.prototype.toString.call(error)); + } +} +var ENDED2 = { kind: "ended" }; +function closeEnds(failure2) { + if (failure2 !== void 0) { + const failed = { kind: "failed", error: failure2.error }; + return { watch: failed, observer: failed }; + } + return { watch: ENDED2, observer: { kind: "failed", error: new Error("session closed") } }; +} +function closeEndOf(follower, ends) { + return follower instanceof Watch ? ends.watch : ends.observer; +} +function observation(value2, guarded) { + return { value: value2, detach: () => guarded.detach() }; +} +function createWatch(value2, detach, report2) { + return new Watch(value2, detach, report2); +} +function abortWatch(watch) { + watch.abort(); +} +function detachObservation(attached) { + attached.detach(); +} +function endWatch(watch) { + watch.endAfterDelivery(); +} +function endGuarded(guarded) { + guarded.end(ENDED2); +} +function atAddress(record, address) { + if (record.kind !== address.kind || record.key !== address.key) + return false; + switch (record.scope.kind) { + case "session": + return address.scope.kind === "session"; + case "conversation": + return address.scope.kind === "conversation" && address.scope.conversationId === record.scope.conversationId; + case "task": + return address.scope.kind === "task" && address.scope.taskId === record.scope.taskId; + } +} +function cancellationError(signal) { + return signal.reason instanceof Error ? signal.reason : new DOMException("The operation was aborted", "AbortError"); +} +var GuardedStorage = class { + #storage; + #latch; + /** Backend calls underway, also those off the Session line, which close waits for before it closes the backend. */ + #underway = /* @__PURE__ */ new Set(); + #closing = false; + constructor(storage2, latch) { + this.#storage = storage2; + this.#latch = latch; + } + /** The backend's own scope for a publication (`Storage.publishing`), when it has one; not a call to guard. */ + get publishing() { + return scopeOf(this.#storage); + } + /** + * Guarded like every call, but its outcome is the Session writer's to judge: it publishes the batches received first, + * then fails the Session for a refusal or a rejection, and for a Session that failed meanwhile. + */ + async commit(batches, receive, context) { + this.#assertHealthy(); + if (this.#closing) + throw new Error("Session is closed"); + const call = (async () => this.#storage.commit(batches, receive, context))(); + this.#underway.add(call); + try { + return await call; + } finally { + this.#underway.delete(call); + } + } + mintId() { + return this.#call(void 0, () => this.#storage.mintId()); + } + conversation(id, context) { + return this.#call(context, () => this.#storage.conversation(id, context)); + } + scanConversations(query, limit3, cursor, context) { + return this.#call(context, () => this.#storage.scanConversations(query, limit3, cursor, context)); + } + entry(first, second, third) { + if (third === void 0) { + const context = second; + return this.#call(context, () => this.#storage.entry(first, context)); + } + return this.#call(third, () => this.#storage.entry(first, second, third)); + } + findLatestHeadMarker(conversationId, atOrBeforeEntryId, context) { + return this.#call(context, () => this.#storage.findLatestHeadMarker(conversationId, atOrBeforeEntryId, context)); + } + scanEntries(query, limit3, cursor, context) { + return this.#call(context, () => this.#storage.scanEntries(query, limit3, cursor, context)); + } + task(id, context) { + return this.#call(context, () => this.#storage.task(id, context)); + } + scanTasks(query, limit3, cursor, context) { + return this.#call(context, () => this.#storage.scanTasks(query, limit3, cursor, context)); + } + submission(id, context) { + return this.#call(context, () => this.#storage.submission(id, context)); + } + scanSubmissions(query, limit3, cursor, context) { + return this.#call(context, () => this.#storage.scanSubmissions(query, limit3, cursor, context)); + } + submissionByRequest(conversationId, requestId, context) { + return this.#call(context, () => this.#storage.submissionByRequest(conversationId, requestId, context)); + } + findDocument(address, at, context) { + return this.#call(context, () => this.#storage.findDocument(address, at, context)); + } + document(id, at, context) { + return this.#call(context, () => this.#storage.document(id, at, context)); + } + scanDocuments(query, limit3, cursor, context) { + return this.#call(context, () => this.#storage.scanDocuments(query, limit3, cursor, context)); + } + /** + * Close the backend once every call underway has settled, so none outlives it or fails after `closed` settles. New + * calls are refused from here on: a paged read must not start its next page while the backend closes. + */ + async close(context) { + this.#closing = true; + await Promise.allSettled([...this.#underway]); + return this.#storage.close(context); + } + /** + * Run one backend call under the guard. `read` is a read's context; `commit()` and `mintId()` pass none, so nothing + * exempts their errors: once a batch is admitted, whether it committed is unknown. A call still underway when another + * fails the Session ends with `SessionFailed` too, whatever it returns: nothing it read or wrote is used. + */ + async #call(read2, run2) { + this.#assertHealthy(); + if (this.#closing) + throw new Error("Session is closed"); + let result; + const call = (async () => run2())(); + this.#underway.add(call); + try { + result = await call; + } catch (error) { + this.#assertHealthy(); + const exempt = read2 !== void 0 && (error instanceof StorageRequestError || read2.abortSignal?.aborted === true); + if (!exempt) + this.#latch.fail(error); + throw error; + } finally { + this.#underway.delete(call); + } + this.#assertHealthy(); + return result; + } + #assertHealthy() { + const failure2 = this.#latch.failure; + if (failure2 !== void 0) + throw new SessionFailed(failure2.error); + } +}; + +// node_modules/@earendil-works/pi-durable/dist/harness/agent.js +var DEFAULT_RETRY_POLICY = { + enabled: true, + maxRetries: 3, + baseDelayMs: 2e3, + maxAgentDelayMs: 6e4 +}; +var DEFAULT_COMPACTION_POLICY = { + enabled: true, + reserveTokens: 16384, + keepRecentTokens: 2e4, + backgroundTokens: 32768 +}; +var DEFAULT_PROGRESS_POLICY = { + partialIntervalMs: 100, + outputIntervalMs: 100, + persistWithinMs: 1e3 +}; +var INSTRUCTIONS_KEY = "instructions"; +var AgentDoc = defineDoc({ + kind: "pi.agent", + version: 1, + scope: "conversation", + history: "rewindable", + fork: "asOf", + initial: () => ({}), + checkpointWhen: () => true +}); +var DEFAULT_CONTEXT_RETENTION_MS = 6e5; +var DEFAULT_RESTART_LIMIT = 5; +function restartLimit(limit3) { + return typeof limit3 === "number" && limit3 >= 1 ? Math.floor(limit3) : DEFAULT_RESTART_LIMIT; +} +function resolveSettings(settings) { + const extensions = settings?.extensions; + return { + ...extensions === void 0 ? {} : { extensions }, + stream: { ...settings?.stream }, + retry: { ...DEFAULT_RETRY_POLICY, ...settings?.retry }, + compaction: { ...DEFAULT_COMPACTION_POLICY, ...settings?.compaction }, + // Field by field, so an explicitly undefined interval keeps its default. + progress: { + partialIntervalMs: settings?.progress?.partialIntervalMs ?? DEFAULT_PROGRESS_POLICY.partialIntervalMs, + outputIntervalMs: settings?.progress?.outputIntervalMs ?? DEFAULT_PROGRESS_POLICY.outputIntervalMs, + persistWithinMs: persistWithin(settings?.progress?.persistWithinMs) + }, + toolExecution: settings?.toolExecution ?? "parallel", + steeringMode: settings?.steeringMode ?? "one-at-a-time", + followUpMode: settings?.followUpMode ?? "one-at-a-time", + contextRetentionMs: settings?.contextRetentionMs ?? DEFAULT_CONTEXT_RETENTION_MS, + documentRetentionMs: documentRetention(settings?.documentRetentionMs), + afterFailedRun: settings?.afterFailedRun ?? "keep", + restartLimit: restartLimit(settings?.restartLimit) + }; +} +async function configure(tx, conversationId, change) { + const state2 = await tx.doc(AgentDoc, conversationId); + applyChange(state2, change); +} +async function addTools(tx, conversationId, added) { + const state2 = await tx.doc(AgentDoc, conversationId); + const tools = state2.tools; + if (Array.isArray(tools)) { + for (const name of added) + if (!tools.includes(name)) + tools.push(name); + } else if (tools?.remove.some((name) => added.includes(name))) { + state2.tools = { remove: tools.remove.filter((name) => !added.includes(name)) }; + } + const modelTools = state2.modelTools; + if (Array.isArray(modelTools)) { + for (const name of added) + if (!modelTools.includes(name)) + modelTools.push(name); + return; + } + const remove = (modelTools?.remove ?? []).filter((name) => !added.includes(name)); + const add = [...modelTools?.add ?? []]; + for (const name of added) + if (!add.includes(name)) + add.push(name); + state2.modelTools = { ...remove.length === 0 ? {} : { remove }, add }; +} +function applyChange(state2, change) { + const set2 = (key, value2) => { + if (value2 === void 0) + return; + if (value2 === null) + delete state2[key]; + else + state2[key] = value2; + }; + set2("model", change.model === void 0 || change.model === null ? change.model : { ...change.model }); + set2("thinkingLevel", change.thinkingLevel); + const extensions = change.extensions; + set2("extensions", extensions === void 0 || extensions === null ? extensions : isList(extensions) ? names(extensions) : { + ...extensions.add === void 0 ? {} : { add: names(extensions.add) }, + ...extensions.remove === void 0 ? {} : { remove: names(extensions.remove) } + }); + const tools = change.tools; + set2("tools", tools === void 0 || tools === null ? tools : isList(tools) ? names(tools) : { remove: names(tools.remove) }); + const modelTools = change.modelTools; + set2("modelTools", modelTools === void 0 || modelTools === null ? modelTools : isList(modelTools) ? names(modelTools) : { + ...modelTools.remove === void 0 ? {} : { remove: names(modelTools.remove) }, + ...modelTools.add === void 0 ? {} : { add: names(modelTools.add) } + }); + set2("instructions", change.instructions); + set2("cwd", change.cwd); + const maxTurns = change.maxTurns; + if (maxTurns !== void 0 && maxTurns !== null && !(Number.isSafeInteger(maxTurns) && maxTurns >= 1)) { + throw new RangeError(`maxTurns must be an integer 1 or more, got ${String(maxTurns)}`); + } + set2("maxTurns", maxTurns); +} +function isList(value2) { + return Array.isArray(value2); +} +function names(items) { + return items.map((item) => item.name); +} +async function createAgent(tx, conversation) { + if (conversation.parent !== void 0) + return; + const agent = await tx.doc(AgentDoc, conversation.id); + if (conversation.owner === void 0) + return; + const owner = await tx.doc(AgentDoc, conversation.owner.conversationId); + Object.assign(agent, copyJson(owner)); +} +function agentHooks(agent, taskName) { + const handlers = []; + for (const extension of agent.extensions) { + for (const hook2 of extension.hooks ?? []) { + if (hook2.task === taskName) + handlers.push({ extension: extension.name, handlers: hook2.handlers }); + } + } + return handlers; +} +function sectionExtension(agent, key) { + let found; + for (const extension of agent.extensions) { + const provides = extension.sections?.some((section2) => section2.key === key) === true; + const wraps = extension.wraps?.some((wrap) => "section" in wrap && wrap.section === key) === true; + if (provides || wraps) + found = extension.name; + } + return found; +} +function toolExtension(agent, name) { + let found; + for (const extension of agent.extensions) { + const provides = extension.tools?.some((tool) => tool.name === name) === true; + const wraps = extension.wraps?.some((wrap) => "tool" in wrap && wrap.tool === name) === true; + if (provides || wraps) + found = extension.name; + } + return found; +} +function resolveAgent(state2, snapshot, settings, report2) { + const extensions = selectExtensions(state2?.extensions, snapshot, settings); + const composed = /* @__PURE__ */ new Map(); + for (const extension of extensions) + for (const tool of extension.tools ?? []) + composed.set(tool.name, tool); + const sections = /* @__PURE__ */ new Map(); + for (const extension of extensions) { + for (const section2 of extension.sections ?? []) + sections.set(section2.key, section2); + } + for (const extension of extensions) { + for (const wrap of extension.wraps ?? []) { + const wrapReport = (error) => report2(error, extension.name); + if ("tool" in wrap) + applyWrap(composed, wrap.tool, (tool) => wrap.wrap(tool), (tool) => tool.name, wrapReport); + else + applyWrap(sections, wrap.section, (section2) => wrap.wrap(section2), (section2) => section2.key, wrapReport); + } + } + const enabled = filterTools([...composed.values()], state2?.tools); + const callableBy = (caller) => (tool) => tool.callers === void 0 || tool.callers.includes(caller); + const modelCallable = enabled.filter(callableBy("model")); + const tools = offeredTools(modelCallable, state2?.modelTools); + const offered = new Set(tools); + const deferred = modelCallable.filter((tool) => tool.deferred === true && !offered.has(tool)); + const callable = enabled.filter(callableBy("tools")); + const instructions = state2?.instructions; + const agentSections = [...sections.values()]; + if (instructions !== void 0) + agentSections.push({ key: INSTRUCTIONS_KEY, render: () => instructions }); + const agent = { + ...state2?.model === void 0 ? {} : { model: state2.model }, + thinkingLevel: state2?.thinkingLevel ?? "off", + extensions, + tools, + callable, + deferred, + sections: agentSections, + ...instructions === void 0 ? {} : { instructions }, + ...state2?.cwd === void 0 ? {} : { cwd: state2.cwd }, + ...state2?.maxTurns === void 0 ? {} : { maxTurns: state2.maxTurns } + }; + return agent; +} +function offeredTools(tools, filter) { + if (Array.isArray(filter)) + return filterTools(tools, filter); + const removed = new Set(filter?.remove ?? []); + const kept = tools.filter((tool) => tool.deferred !== true && !removed.has(tool.name)); + const byName = new Map(tools.map((tool) => [tool.name, tool])); + const loaded = [...new Set(filter?.add ?? [])].flatMap((name) => { + const tool = byName.get(name); + return tool?.deferred === true && !removed.has(name) ? [tool] : []; + }); + return [...kept, ...loaded]; +} +function filterTools(tools, filter) { + if (filter === void 0) + return tools; + if (Array.isArray(filter)) { + const byName = new Map(tools.map((tool) => [tool.name, tool])); + return [...new Set(filter)].flatMap((name) => { + const tool = byName.get(name); + return tool === void 0 ? [] : [tool]; + }); + } + const removed = new Set(filter.remove); + return tools.filter((tool) => !removed.has(tool.name)); +} +function selectExtensions(stored, snapshot, settings) { + let selected; + if (Array.isArray(stored)) + selected = stored; + else { + const base = settings.extensions?.map((extension) => extension.name) ?? snapshot.installed().map((e) => e.name); + const edit = stored; + const removed = new Set(edit?.remove ?? []); + selected = [...base, ...edit?.add ?? []].filter((name) => !removed.has(name)); + } + const extensions = []; + for (const name of new Set(selected)) { + const extension = snapshot.extension(name); + if (extension !== void 0) + extensions.push(extension); + } + return extensions; +} +function applyWrap(items, target, wrap, nameOf, report2) { + const item = items.get(target); + if (item === void 0) + return; + try { + const wrapped = wrap(item); + if (nameOf(wrapped) !== target) + throw new Error(`Wrapper renamed ${target} to ${nameOf(wrapped)}`); + items.set(target, wrapped); + } catch (error) { + items.delete(target); + report2(error); + } +} + +// node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +init_estimate(); + +// node_modules/@earendil-works/pi-ai/dist/utils/retry.js +function buildProviderErrorPattern(patterns) { + return new RegExp(patterns.join("|"), "i"); +} +var NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN = buildProviderErrorPattern([ + // OpenCode Go/free-tier limits returned as 429 JSON error types by OpenCode's + // Zen API. These are subscription/account limits, not transient throttles. + "GoUsageLimitError", + "FreeUsageLimitError", + // OpenCode Go subscription-limit text asks users to enable available-balance + // usage after rolling/weekly/monthly limits are reached. + "Monthly usage limit reached", + "available balance", + // Generic quota/budget/billing exhaustion. `insufficient_quota` is OpenAI's + // quota/billing error code; the other strings cover common gateway wording. + "insufficient_quota", + "out of budget", + "quota exceeded", + "billing", + // Sign in with ChatGPT: the subscription's shared usage limit, which resets + // after hours rather than seconds. + "subscription_sharing_usage_limit_exceeded", + // Sign in with ChatGPT on a ChatGPT Business plan: a usage limit set by the + // workspace admin. Only the admin can raise it. + "subscription_sharing_workplace_individual_usage_limit_exceeded", + // Zhipu/Z.ai (open.bigmodel.cn) error code 1308: the plan's usage limit is + // reached, sent as HTTP 429. It resets after hours, not seconds (#11537). + '"code"\\s*:\\s*"?1308(?![0-9])' +]); +var RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([ + // Generic provider load, HTTP status, and server-side transient failures. + "overloaded", + "server_busy", + "servers are currently busy", + "currently experiencing high demand", + "model is at capacity", + "rate.?limit", + "too many requests", + // Status codes must not be part of a longer word or number, e.g. a request id or byte count (#11057). + "(? captureContextBounds(session, line, conversationId, context, at, visible)); + if (bounds === void 0) + return { view: emptyView(), range: void 0 }; + freezeJson(bounds.head); + const current = at === void 0; + let range; + if (previous === void 0 || previous.bounds.head?.id !== bounds.head?.id) { + const entries2 = freezeJson(await scanRange(storage2, conversationId, rangeQuery(bounds), context)); + range = deriveRange(bounds, entries2, current); + } else if (bounds.tail === previous.bounds.tail) { + range = previous; + } else if (bounds.tail < previous.bounds.tail) { + range = deriveRange(bounds, previous.entries.filter((entry2) => entry2.id <= bounds.tail), false); + } else { + const minEntryId = idFromNumber(previous.bounds.tail + 1); + const added = await scanRange(storage2, conversationId, { minEntryId, maxEntryId: bounds.tail }, context); + range = extendRange(previous, bounds, freezeJson(added), current); + } + if (range.current && session.knownLatestEntryId(conversationId) !== range.bounds.tail) { + range = { ...range, current: false }; + } + const { view: view2 } = range; + return { + view: { + ...view2, + entries: [...view2.entries], + contributions: [...view2.contributions], + messages: [...view2.messages] + }, + range + }; +} +async function readContext(session, storage2, conversationId, context, at) { + const bounds = await session.readOnLine((line) => captureContextBounds(session, line, conversationId, context, at)); + return deriveContext(storage2, conversationId, bounds, context); +} +async function deriveContext(storage2, conversationId, bounds, context) { + if (bounds === void 0) + return emptyView(); + return deriveRange(bounds, await scanRange(storage2, conversationId, rangeQuery(bounds), context), false).view; +} +function emptyView() { + return { head: void 0, entries: [], contributions: [], messages: [] }; +} +function rangeEntry(range, id) { + const entries2 = range.entries; + let low = 0; + let high = entries2.length - 1; + while (low <= high) { + const middle = low + high >>> 1; + const entry2 = entries2[middle]; + if (entry2.id === id) + return entry2; + if (entry2.id < id) + low = middle + 1; + else + high = middle - 1; + } + return void 0; +} +function advanceRange(range, appended) { + if (!range.current || appended.length === 0) + return range; + const added = freezeJson(appended); + let head = range.bounds.head; + for (const entry2 of added) + if (entry2.head !== void 0) + head = entry2; + const bounds = { head, tail: added.at(-1).id }; + if (head?.id === range.bounds.head?.id) + return extendRange(range, bounds, added, true); + const start = head.head; + if (range.bounds.head !== void 0 && start < range.bounds.head.head) + return void 0; + const entries2 = [...range.entries, ...added].filter((entry2) => entry2.id >= start); + return deriveRange(bounds, entries2, true); +} +function deriveRange(bounds, entries2, current) { + const edits = /* @__PURE__ */ new Map(); + for (const entry2 of entries2) + for (const edit of entry2.edits ?? []) + edits.set(edit.target, edit); + const active = selectActive(bounds.head, entries2); + const contributions = active.map((entry2) => contribute(entry2, edits.get(entry2.id))); + const { settled, open } = settle([], contributions.flat()); + const baseline = findBaseline(bounds.head, active); + const messages = leadWithSystem([...settled, ...orderToolResults(open)], baseline); + const view2 = { head: bounds.head, entries: active, contributions, messages }; + return { bounds, entries: entries2, view: view2, edited: new Set(edits.keys()), settled, open, baseline, current }; +} +function extendRange(previous, bounds, added, current) { + const entries2 = [...previous.entries, ...added]; + if (added.some((entry2) => entry2.edits !== void 0 || entry2.head !== void 0 || previous.edited.has(entry2.id))) { + return deriveRange(bounds, entries2, current); + } + const contributions = added.map((entry2) => contribute(entry2, void 0)); + const { settled, open } = settle(previous.settled, [...previous.open, ...contributions.flat()]); + const baseline = previous.baseline !== void 0 ? previous.baseline : findBaseline(bounds.head, added); + const view2 = { + head: bounds.head, + entries: [...previous.view.entries, ...added], + contributions: [...previous.view.contributions, ...contributions], + messages: leadWithSystem([...settled, ...orderToolResults(open)], baseline) + }; + return { bounds, entries: entries2, view: view2, edited: previous.edited, settled, open, baseline, current }; +} +function findBaseline(head, entries2) { + for (const entry2 of entries2) { + if (head !== void 0 && entry2.id <= head.id) + continue; + if (SystemEntry.is(entry2)) + return entry2.model?.find((message) => message.role === "system") ?? null; + if (head === void 0 && carriesSystemMessage(entry2)) + return null; + } + return void 0; +} +function carriesSystemMessage(entry2) { + const isSystem = (message) => message.role === "system"; + return (entry2.model?.some(isSystem) ?? false) || (entry2.edits?.some((edit) => edit.action === "replace" && edit.messages.some(isSystem)) ?? false); +} +function leadWithSystem(messages, baseline) { + const index = messages.findIndex((message) => message.role === "system"); + if (index <= 0) + return messages; + const system = messages[index]; + if (system !== baseline && messages.slice(0, index).some((message) => message.role !== "user")) { + return messages; + } + return [system, ...messages.slice(0, index), ...messages.slice(index + 1)]; +} +function contribute(entry2, edit) { + if (edit?.action === "omit") + return Object.freeze([]); + const contributed = edit?.action === "replace" ? edit.messages : entry2.model ?? []; + return Object.freeze(contributed.filter((message) => message.role !== "assistant" || !EXCLUDED_STOP_REASONS.has(message.stopReason))); +} +var deeplyFrozen = /* @__PURE__ */ new WeakSet(); +function freezeJson(value2) { + if (value2 === null || typeof value2 !== "object" || deeplyFrozen.has(value2)) + return value2; + for (const child of Object.values(value2)) + freezeJson(child); + Object.freeze(value2); + deeplyFrozen.add(value2); + return value2; +} +function settle(settled, open) { + const last = open.findLastIndex((message) => message.role === "assistant"); + if (last <= 0) + return { settled, open }; + return { settled: [...settled, ...orderToolResults(open.slice(0, last))], open: open.slice(last) }; +} +function rangeQuery(bounds) { + const head = bounds.head; + return head === void 0 ? { maxEntryId: bounds.tail } : { minEntryId: head.head, maxEntryId: bounds.tail }; +} +async function scanRange(storage2, conversationId, range, context) { + const entries2 = []; + let cursor; + do { + const page2 = await storage2.scanEntries({ conversationId, ...range }, SCAN_PAGE_SIZE2, cursor, context); + entries2.push(...page2.items); + cursor = page2.next; + } while (cursor !== void 0); + return entries2.reverse(); +} +function selectActive(head, range) { + return head === void 0 ? range : [head, ...range.filter((entry2) => entry2.head === void 0)]; +} +function orderToolResults(messages) { + const ordered = []; + for (let index = 0; index < messages.length; index++) { + const message = messages[index]; + if (message.role === "toolResult") + continue; + ordered.push(message); + if (message.role !== "assistant") + continue; + const calls = message.content.filter((content) => content.type === "toolCall"); + if (calls.length === 0) + continue; + const results = /* @__PURE__ */ new Map(); + for (let next = index + 1; next < messages.length && messages[next].role !== "assistant"; next++) { + const candidate = messages[next]; + if (candidate.role === "toolResult" && !results.has(candidate.toolCallId)) { + results.set(candidate.toolCallId, next); + } + } + for (const call of calls) { + const resultIndex = results.get(call.id); + ordered.push(resultIndex === void 0 ? missingResult(call, message.timestamp) : messages[resultIndex]); + } + } + return ordered; +} +function missingResult(call, timestamp2) { + return freezeJson({ + role: "toolResult", + toolCallId: call.id, + toolName: call.name, + content: [{ type: "text", text: MISSING_RESULT_TEXT }], + isError: true, + details: { reason: "missing_result" }, + timestamp: timestamp2 + }); +} + +// node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +var OVERFLOW_PATTERNS = [ + /prompt (?:is )?too long/i, + // Anthropic and z.ai token overflow + /prompt exceeds max length/i, + // z.ai CN endpoint token overflow + /request_too_large/i, + // Anthropic request byte-size overflow (HTTP 413) + /input is too long for requested model/i, + // Amazon Bedrock + /exceeds the context window/i, + // OpenAI (Completions & Responses API) + /exceeds (?:the )?(?:model'?s )?maximum context length(?: of [\d,]+ tokens?|\s*\([\d,]+\))/i, + // OpenAI-compatible proxies (LiteLLM) + /context window exceeded/i, + // LiteLLM pre-call check (ContextWindowExceededError) + /input token count.*exceeds the maximum/i, + // Google (Gemini) + /maximum prompt length is \d+/i, + // xAI (Grok) + /reduce the length of the messages/i, + // Groq + /maximum context length is \d+ tokens/i, + // OpenRouter (most backends) + /exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i, + // OpenRouter/Poolside + /input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i, + // Together AI + /exceeds the limit of \d+/i, + // GitHub Copilot + /exceeds the available context size/i, + // llama.cpp server + /greater than the context length/i, + // LM Studio + /context window exceeds limit/i, + // MiniMax + /exceeded model token limit/i, + // Kimi For Coding + /too large for model with \d+ maximum context length/i, + // Mistral + /prompt has [\d,]+ tokens?, but the configured context size is [\d,]+ tokens?/i, + // DS4 server + /model_context_window_exceeded/i, + // z.ai non-standard finish_reason surfaced as error text + /prompt too long; exceeded (?:max )?context length/i, + // Ollama explicit overflow error + /range of input length should be/i, + // DashScope / Qwen Token Plan + /context[_ ]length[_ ]exceeded/i, + // Generic fallback + /too many tokens/i, + // Generic fallback + /token limit exceeded/i, + // Generic fallback + // HTTP 413 means request-size overflow regardless of provider or body text. + // Match raw SDK errors and formatProviderError's prefix, not a status mentioned in the body. + /^(?:[\w -]+ API error \(413\):|413(?:\s|:|$))/i +]; +var CEREBRAS_BODYLESS_OVERFLOW_PATTERN = /^4(?:00|13)\s*(?:status code)?\s*\(no body\)/i; +var NON_OVERFLOW_PATTERNS = [ + /^(Throttling error|Service unavailable):/i, + // AWS Bedrock non-overflow errors (human-readable prefixes from formatBedrockError) + /rate limit/i, + // Generic rate limiting + /too many requests/i + // Generic HTTP 429 style +]; +function isContextOverflow(message, contextWindow) { + if (message.stopReason === "error" && message.errorMessage) { + const isNonOverflow = NON_OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage)); + if (!isNonOverflow) { + if (OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage))) { + return true; + } + if (message.provider === "cerebras" && CEREBRAS_BODYLESS_OVERFLOW_PATTERN.test(message.errorMessage)) { + return true; + } + } + } + if (contextWindow && message.stopReason === "stop") { + const inputTokens = message.usage.input + message.usage.cacheRead; + if (inputTokens > contextWindow) { + return true; + } + } + if (contextWindow && message.stopReason === "length" && message.usage.output === 0) { + const inputTokens = message.usage.input + message.usage.cacheRead; + if (inputTokens >= contextWindow * 0.99) { + return true; + } + } + return false; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/generation.js +init_transcript(); + +// node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +var InboxDoc = defineDoc({ + kind: "pi.inbox", + version: 1, + scope: "conversation", + history: "latest", + fork: "initial", + initial: () => ({ items: [] }), + checkpointWhen: (value2) => value2.items.length === 0 +}); +async function prepareBoundary(tx, conversationId, modes, at, now, incoming) { + const head = (await tx.latestHeadMarker(conversationId))?.head; + const inbox = await tx.doc(InboxDoc, conversationId); + const first = inbox.items.find((item) => item.mode === "steer" || item.mode === "followUp"); + const input = first === void 0 ? incoming : inputDraft(first.content, first.entry, now); + const entries2 = input !== void 0 && (at === "final" || hasQueuedReset(inbox.items)) ? await tx.beforeInput(conversationId, input) : []; + return { + entries: entries2, + conversationId, + inbox, + steeringMode: modes.steeringMode, + followUpMode: modes.followUpMode, + head + }; +} +async function applyBoundary(tx, boundary, at, now) { + const { conversationId, inbox } = boundary; + const items = inbox.items; + const reset = hasQueuedReset(items); + const final = at === "final" || reset; + const pick = (mode, queueMode) => { + const indexes = items.flatMap((item, index) => item.mode === mode ? [index] : []); + return queueMode === "all" ? indexes : indexes.slice(0, 1); + }; + const writes = items.flatMap((item, index) => item.mode === "write" ? [index] : []); + const users = [...pick("steer", boundary.steeringMode), ...final ? pick("followUp", boundary.followUpMode) : []]; + users.sort((a, b) => a - b); + let first; + for (const index of writes) { + const item = items[index]; + const draft = item.entry; + if (isStale(boundary, draft)) { + tx.settleSubmission(item.id, { status: "unanswered", reason: "stale" }); + continue; + } + const entry2 = await tx.appendEntry(conversationId, draft); + if (draft.head !== void 0) + boundary.head = draft.head === "self" ? entry2.id : draft.head; + tx.placeSubmission(item.id, entry2.id); + first ??= entry2.id; + } + const placed = []; + for (const index of users) { + if (placed.length === 0) + for (const draft of boundary.entries) + await tx.appendEntry(conversationId, draft); + const item = items[index]; + const entry2 = await appendInput(tx, conversationId, item.content, item.entry, now); + tx.placeSubmission(item.id, entry2.id); + placed.push(item.id); + first ??= entry2.id; + } + const removed = [...writes, ...users].sort((a, b) => b - a); + for (const index of removed) + items.splice(index, 1); + return { users: placed, first, reset }; +} +function appendInput(tx, conversationId, content, entry2, now) { + return tx.appendEntry(conversationId, inputDraft(content, entry2, now)); +} +function inputDraft(content, entry2, now) { + const message = { role: "user", content, timestamp: now }; + return { ...entry2 === void 0 ? { kind: UserEntry.kind } : pickInputEntry(entry2), input: true, model: [message] }; +} +function pickInputEntry({ kind, data }) { + const picked = data === void 0 ? { kind } : { kind, data }; + return copyJson(picked, { omitUndefinedProperties: true }); +} +function isDisplayOnly(entry2) { + return entry2.model === void 0 && entry2.head === void 0 && entry2.edits === void 0; +} +function hasQueuedReset(items) { + return items.some((item) => item.mode === "write" && item.entry.head === "self"); +} +function isStale(boundary, entry2) { + return typeof entry2.head === "number" && boundary.head !== void 0 && entry2.head < boundary.head; +} +async function removeInboxItem(tx, conversationId, id) { + const items = (await tx.doc(InboxDoc, conversationId)).items; + const index = items.findIndex((item) => item.id === id); + if (index >= 0) + items.splice(index, 1); +} +async function withdrawQueuedInputs(tx, conversationId, reason = "aborted") { + const items = (await tx.doc(InboxDoc, conversationId)).items; + for (let index = items.length - 1; index >= 0; index--) { + const item = items[index]; + if (item.mode === "write") + continue; + tx.settleSubmission(item.id, { status: "unanswered", reason }); + items.splice(index, 1); + } +} + +// node_modules/@earendil-works/pi-durable/dist/harness/partial-changes.js +init_streaming_json(); + +// node_modules/@earendil-works/pi-durable/dist/harness/json.js +function assignJson(target, key, value2, plan) { + if (plan?.kind === "keep") + return; + const slots = target; + const current = key === "__proto__" && !Object.hasOwn(slots, key) ? void 0 : slots[key]; + const fields = plan?.kind === "fields" ? plan.fields : void 0; + if (isRecord(current) && isRecord(value2)) { + for (const name of Object.keys(current)) + if (!Object.hasOwn(value2, name)) + delete current[name]; + for (const [name, child] of Object.entries(value2)) + assignJson(current, name, child, fields?.get(name)); + return; + } + if (Array.isArray(current) && Array.isArray(value2) && current.length <= value2.length) { + const items = current; + for (let index = 0; index < value2.length; index++) { + if (index < items.length) + assignJson(items, index, value2[index], fields?.get(index)); + else + items.push(value2[index]); + } + return; + } + if (plan?.kind === "append" && typeof current === "string" && typeof value2 === "string" && !Array.isArray(target) && current.length + plan.text.length === value2.length) { + appendText(target, String(key), plan.text); + return; + } + if (current !== value2) + slots[key] = value2; +} +function isRecord(value2) { + return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); +} + +// node_modules/@earendil-works/pi-durable/dist/harness/partial-changes.js +var PartialChanges = class { + #text = /* @__PURE__ */ new Map(); + #toolCalls = /* @__PURE__ */ new Map(); + /** Record what `event` changed. */ + observe(event) { + switch (event.type) { + case "text_delta": + case "thinking_delta": { + const field = event.type === "text_delta" ? "text" : "thinking"; + const pending = this.#text.get(event.contentIndex); + if (pending?.field === field) + pending.text += event.delta; + else + this.#text.set(event.contentIndex, { field, text: event.delta }); + return; + } + case "toolcall_start": + this.#toolCalls.set(event.contentIndex, { + parser: new StreamingJsonParser(), + changes: [], + committed: false + }); + return; + case "toolcall_delta": { + const call = this.#toolCalls.get(event.contentIndex); + if (call === void 0) + return; + for (const change of call.parser.append(event.delta)) { + if (change.path.length === 0 && !isRecord2(change.kind === "set" ? value(change) : null)) { + this.#toolCalls.delete(event.contentIndex); + return; + } + call.changes.push(change); + } + return; + } + case "text_end": + case "thinking_end": + this.#text.delete(event.contentIndex); + return; + case "toolcall_end": + this.#toolCalls.delete(event.contentIndex); + return; + } + } + /** + * Take what changed since the last call, for a commit of `message`, a copy of the partial. Clears the arguments of + * tracked tool calls in `message`: the commit writes them from the changes. Call `restore()` if the commit fails. + */ + take(message) { + const blocks = /* @__PURE__ */ new Map(); + for (const [index, { field, text }] of this.#text) { + blocks.set(index, { kind: "fields", fields: /* @__PURE__ */ new Map([[field, { kind: "append", text }]]) }); + } + this.#text = /* @__PURE__ */ new Map(); + const toolCalls = /* @__PURE__ */ new Map(); + for (const [index, call] of this.#toolCalls) { + const block = message.content[index]; + if (block?.type !== "toolCall") + continue; + toolCalls.set(index, { changes: call.changes, snapshot: block.arguments }); + block.arguments = {}; + blocks.set(index, { kind: "fields", fields: /* @__PURE__ */ new Map([["arguments", { kind: "keep" }]]) }); + call.changes = []; + } + return { + plan: { kind: "fields", fields: /* @__PURE__ */ new Map([["content", { kind: "fields", fields: blocks }]]) }, + toolCalls + }; + } + /** + * Write `message` with what `commit` took into `generation.message`: the message leaf by leaf with the plan, then the + * argument changes. A tracked call whose block is new here gets its arguments from its changes, which then start at + * its first piece; when the committed message lost a call whose changes were already committed (another writer reset + * it), the call falls back to its snapshot from now on. + */ + commit(generation, message, commit) { + const committedBlocks = generation.message?.content.length ?? 0; + const apply2 = []; + for (const [index, { changes, snapshot }] of commit.toolCalls) { + const call = this.#toolCalls.get(index); + if (call === void 0) + continue; + const block = message.content[index]; + if (index >= committedBlocks && call.committed && block?.type === "toolCall") { + this.#toolCalls.delete(index); + block.arguments = snapshot; + continue; + } + call.committed = true; + apply2.push([index, changes]); + } + assignJson(generation, "message", message, commit.plan); + const content = generation.message?.content ?? []; + for (const [index, changes] of apply2) { + const block = content[index]; + if (block?.type !== "toolCall") + continue; + for (const change of changes) + applyChange2(block, change); + } + } + /** Put back what a failed commit took, so the next commit applies it first. */ + restore(commit) { + for (const [index, { changes }] of commit.toolCalls) { + const call = this.#toolCalls.get(index); + if (call !== void 0) + call.changes = [...changes, ...call.changes]; + } + } +}; +function applyChange2(block, change) { + const key = change.path.at(-1); + if (key === void 0) { + const root2 = change.kind === "set" ? value(change) : void 0; + if (isRecord2(root2)) + block.arguments = root2; + return; + } + let parent2 = block.arguments; + for (const segment of change.path.slice(0, -1)) { + parent2 = parent2[segment]; + } + const slots = parent2; + if (change.kind === "set") + slots[key] = value(change); + else if (Array.isArray(parent2)) + slots[key] = `${slots[key]}${change.text}`; + else + appendText(parent2, String(key), change.text); +} +function value(change) { + return change.value; +} +function isRecord2(value2) { + return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); +} + +// node_modules/@earendil-works/pi-durable/dist/harness/prompt.js +init_transcript(); +function replaySections(messages) { + const shown = /* @__PURE__ */ new Map(); + for (const message of messages) { + if (message.role !== "system" || message.sections === void 0) + continue; + for (const [key, value2] of Object.entries(message.sections)) { + if (value2 === null) + shown.delete(key); + else + shown.set(key, value2); + } + } + return shown; +} +async function renderSections(sections, input, shown, report2, context) { + const desired = /* @__PURE__ */ new Map(); + for (const section2 of sections) { + let text; + try { + text = await section2.render(input, context); + } catch (error) { + if (context.abortSignal?.aborted) + throw error; + report2(error, section2); + const kept = shown.get(section2.key); + if (kept !== void 0) + desired.set(section2.key, kept); + continue; + } + if (text === void 0) + continue; + desired.set(section2.key, section2.tag === false ? text : `<${section2.key}> +${text} +`); + } + return desired; +} +function planSystemEntries(view2, desired, tools, timestamp2) { + const head = view2.head; + if (head !== void 0 && !view2.entries.some((entry2) => SystemEntry.is(entry2) && entry2.id > head.id)) { + const edits = view2.entries.filter((entry2) => SystemEntry.is(entry2)).map((entry2) => ({ target: entry2.id, action: "omit" })); + const baseline = systemEntry(Object.fromEntries(desired), { toolsRemoved: [], toolsAdded: tools.map(toToolDeclaration) }, timestamp2); + return [edits.length === 0 ? baseline : { ...baseline, edits }]; + } + const sections = planSections(replaySections(view2.messages), desired); + const changes = planTools(getCurrentTools(view2.messages), tools); + if (changes.toolsRemoved.length === 0 && changes.toolsAdded.length === 0) { + return sections.map((patch) => systemEntry(patch, void 0, timestamp2)); + } + if (sections.length === 0) + return [systemEntry(void 0, changes, timestamp2)]; + return sections.map((patch, index) => systemEntry(patch, index === sections.length - 1 ? changes : void 0, timestamp2)); +} +function planTools(offered, desired) { + const wanted = new Map(desired.map((tool) => [tool.name, tool])); + const kept = offered.filter((tool) => { + const next = wanted.get(tool.name); + return next !== void 0 && declarationsEqual(tool, next); + }); + const keptNames = new Set(kept.map((tool) => tool.name)); + const added = desired.filter((tool) => !keptNames.has(tool.name)); + const replayed = [...kept, ...added]; + if (replayed.some((tool, index) => tool.name !== desired[index].name)) { + return { + toolsRemoved: offered.map((tool) => ({ name: tool.name })), + toolsAdded: desired.map(toToolDeclaration) + }; + } + return { + toolsRemoved: offered.filter((tool) => !keptNames.has(tool.name)).map((tool) => ({ name: tool.name })), + toolsAdded: added.map(toToolDeclaration) + }; +} +function planSections(shown, desired) { + const patchedOrder = [ + ...[...shown.keys()].filter((key) => desired.has(key)), + ...[...desired.keys()].filter((key) => !shown.has(key)) + ]; + const desiredOrder = [...desired.keys()]; + if (patchedOrder.some((key, index) => key !== desiredOrder[index])) { + return [Object.fromEntries([...shown.keys()].map((key) => [key, null])), Object.fromEntries(desired)]; + } + const patch = {}; + for (const [key, value2] of shown) { + const next = desired.get(key); + if (next !== value2) + patch[key] = next ?? null; + } + for (const [key, value2] of desired) + if (!shown.has(key)) + patch[key] = value2; + return Object.keys(patch).length === 0 ? [] : [patch]; +} +function systemEntry(sections, tools, timestamp2) { + const message = { + role: "system", + content: "", + ...sections === void 0 ? {} : { sections }, + ...tools === void 0 || tools.toolsRemoved.length === 0 ? {} : { toolsRemoved: tools.toolsRemoved }, + ...tools === void 0 || tools.toolsAdded.length === 0 ? {} : { toolsAdded: tools.toolsAdded }, + timestamp: timestamp2 + }; + return { model: [message] }; +} + +// node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +var MAX_UUID_V7_TIMESTAMP = 281474976710655; +var MAX_SEQUENCE = (1n << 41n) - 1n; +var lastOrdinaryTimestamp = -1; +var sequence; +function uuidv7(timestampMs) { + const requestedTimestamp = timestampMs ?? Date.now(); + if (!Number.isInteger(requestedTimestamp) || requestedTimestamp < 0 || requestedTimestamp > MAX_UUID_V7_TIMESTAMP) { + throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${MAX_UUID_V7_TIMESTAMP}`); + } + const effectiveTimestamp = timestampMs === void 0 ? Math.max(requestedTimestamp, lastOrdinaryTimestamp) : timestampMs; + if (timestampMs === void 0) + lastOrdinaryTimestamp = effectiveTimestamp; + const bytes2 = new Uint8Array(16); + globalThis.crypto.getRandomValues(bytes2); + if (sequence === void 0) { + sequence = BigInt(bytes2[1]) << 32n | BigInt(bytes2[2]) << 24n | BigInt(bytes2[3]) << 16n | BigInt(bytes2[4]) << 8n | BigInt(bytes2[5]); + } else { + if (sequence === MAX_SEQUENCE) + throw new RangeError("UUIDv7 generator sequence exhausted"); + sequence++; + } + const timestamp2 = BigInt(effectiveTimestamp); + for (let index = 5; index >= 0; index--) { + bytes2[index] = Number(timestamp2 >> BigInt((5 - index) * 8)) & 255; + } + bytes2[6] = 112 | Number(sequence >> 37n & 0x0fn); + bytes2[7] = Number(sequence >> 29n & 0xffn); + bytes2[8] = 128 | Number(sequence >> 23n & 0x3fn); + bytes2[9] = Number(sequence >> 15n & 0xffn); + bytes2[10] = Number(sequence >> 7n & 0xffn); + bytes2[11] = Number((sequence & 0x7fn) << 1n) | bytes2[11] & 1; + const hex = Array.from(bytes2, (byte) => byte.toString(16).padStart(2, "0")); + return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/provider.js +var ProviderDoc = defineDoc({ + kind: "pi.provider", + version: 1, + scope: "conversation", + history: "latest", + fork: "initial", + initial: () => ({ sessionId: uuidv7() }), + checkpointWhen: () => true +}); +async function ensureProviderSessionId(runtime, context) { + const existing = await runtime.snapshot(ProviderDoc, runtime.conversationId, context); + if (existing !== void 0) + return existing.sessionId; + let created; + await runtime.commit(async (tx) => { + created = (await tx.doc(ProviderDoc, runtime.conversationId)).sessionId; + return void 0; + }, context); + if (created === void 0) + throw new Error(`Conversation ${runtime.conversationId} has no provider session ID`); + return created; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +init_dist(); + +// node_modules/@earendil-works/pi-durable/dist/harness/telemetry.js +init_dist(); +var entry = { + description: "A transcript entry was committed; content remains in the transcript.", + attributes: { + "entry.id": { type: "number", required: true, description: "Transcript entry ID.", cardinality: "high" }, + "entry.kind": { type: "string", required: true, description: "Entry kind." } + } +}; +var reportAttributes = { + type: { + type: "string", + required: true, + description: "Report kind (`Report.kind`).", + values: [ + "storage_failed", + "task_faulted", + "task_interrupted", + "migration_failed", + "task_outdated", + "task_error", + "extension_error", + "host_error", + "listener_error" + ] + }, + reason: { + type: "string", + required: false, + description: "Fixed report reason, when present.", + values: ["threw", "restart_limit", "interrupted", "missing_task", "task_too_old", "migration_failed"] + }, + extension: { type: "string", required: false, description: "Registered extension name, when present." }, + "task.id": { type: "number", required: false, description: "Task ID, when present.", cardinality: "high" } +}; +var report = { + description: "A report was raised; no error payload is recorded.", + attributes: reportAttributes +}; +var submission = { + description: "A submission was settled.", + attributes: { + "submission.id": { type: "number", required: true, description: "Submission ID.", cardinality: "high" }, + status: { type: "string", required: true, values: ["done", "unanswered"], description: "Settlement." }, + "answer.entry_id": { type: "number", required: false, description: "Answer entry ID.", cardinality: "high" } + } +}; +var DURABLE_TELEMETRY_SCHEMA = defineTelemetrySchema({ + version: 1, + spans: { + "pi.durable.submit": { + description: "Public submission admission: with its commit for submit(draft, context); the admission only for submit(tx, draft), whose result is provisional (a later throw or storage failure of the caller's commit leaves no submission) and whose commit events go to the caller's commit context. Inputs and continues start root traces linked to their callers; writes are children. Internal admissions emit phase events only.", + parents: { kind: "any" }, + startAttributes: { + "submission.type": { + type: "string", + required: true, + values: ["input", "write", "continue"], + description: "Submission type." + }, + "conversation.id": { type: "number", required: true, description: "Conversation ID.", cardinality: "high" } + }, + endAttributes: { + "submission.id": { type: "number", description: "Admitted submission ID.", cardinality: "high" }, + result: { + type: "string", + values: ["queued", "placed", "done"], + description: "Admission result; stale writes report done." + } + }, + events: { "pi.durable.entry": entry, "pi.durable.submission": submission, "pi.durable.report": report }, + status: { default: "ok", errorWhen: "Admission failed." } + }, + "pi.durable.phase": { + description: "One task phase invocation, including its decision commit, never a wait or restart.", + parents: { kind: "any" }, + startAttributes: { + "task.id": { type: "number", required: true, description: "Task ID.", cardinality: "high" }, + "task.name": { type: "string", required: true, description: "Registered task name." }, + phase: { type: "string", required: true, description: "Invoked checkpoint phase." }, + kind: { type: "string", required: true, values: ["run", "abort"], description: "Invocation kind." }, + attempt: { type: "number", required: false, description: "Checkpoint attempt, when present." }, + resumed: { + type: "boolean", + required: true, + description: "First invocation of a task loaded in this process." + } + }, + endAttributes: { + outcome: { type: "string", description: "next=, waiting, sleeping, done, faulted, or aborted." }, + "tool.name": { type: "string", description: "Called tool name." }, + "tool.call_id": { type: "string", description: "Transcript tool call ID.", cardinality: "high" } + }, + events: { + "pi.durable.entry": entry, + "pi.durable.submission": submission, + "pi.durable.report": report, + "pi.durable.checkpoint": { + description: "The running checkpoint's phase changed while the invocation continued.", + attributes: { phase: { type: "string", required: true, description: "Committed checkpoint phase." } } + }, + "pi.durable.replay": { + description: "A nested tool call was answered from its stored result.", + attributes: { "tool.name": { type: "string", required: true, description: "Called tool name." } } + } + }, + status: { + default: "ok", + errorWhen: "Faulted, failed, and orphaned outcomes use task_faulted, task_failed, and task_orphaned with a diagnostic capped at 500 characters. Aborted outcomes keep status ok." + } + } + }, + metrics: { + "pi.durable.reports": { + kind: "counter", + description: "Reports raised, grouped by their fixed kind.", + attributes: { type: reportAttributes.type } + }, + "pi.durable.phase.duration": { + kind: "histogram", + unit: "ms", + description: "Duration of a phase invocation and its decision commit.", + attributes: { + task: { type: "string", required: true, description: "Registered task name." }, + phase: { type: "string", required: true, description: "Invoked checkpoint phase." }, + outcome: { type: "string", required: true, description: "Phase outcome." } + } + }, + "pi.durable.tasks.active": { + kind: "upDownCounter", + description: "Live tasks held by this Harness; decremented at terminal settlement or close.", + attributes: { task: { type: "string", required: true, description: "Registered task name." } } + } + } +}); + +// node_modules/@earendil-works/pi-durable/dist/harness/util.js +var Waiters = class { + #sets = /* @__PURE__ */ new Map(); + add(key, context) { + const signal = context.abortSignal; + if (signal?.aborted) + return Promise.reject(signal.reason); + const waiter = Promise.withResolvers(); + const set2 = this.#sets.get(key) ?? /* @__PURE__ */ new Set(); + this.#sets.set(key, set2.add(waiter)); + if (signal !== void 0) { + const onAbort = () => { + set2.delete(waiter); + if (set2.size === 0 && this.#sets.get(key) === set2) + this.#sets.delete(key); + waiter.reject(signal.reason); + }; + signal.addEventListener("abort", onAbort, { once: true }); + const detach = () => signal.removeEventListener("abort", onAbort); + waiter.promise.then(detach, detach); + } + return waiter.promise; + } + keys() { + return [...this.#sets.keys()]; + } + resolve(key, value2) { + const set2 = this.#sets.get(key); + this.#sets.delete(key); + for (const waiter of set2 ?? []) + waiter.resolve(value2); + } + rejectAll(error) { + const sets = [...this.#sets.values()]; + this.#sets.clear(); + for (const set2 of sets) + for (const waiter of set2) + waiter.reject(error); + } +}; +async function scanAll(scan) { + const items = []; + let cursor; + do { + const page2 = await scan(cursor); + items.push(...page2.items); + cursor = page2.next; + } while (cursor !== void 0); + return items; +} +function closedError(session) { + const failure2 = session.failure; + return failure2 === void 0 ? new Error("Harness is closed") : new SessionFailed(failure2.error); +} +function optionalExtension(extension) { + return extension === void 0 ? {} : { extension }; +} +function conversationEntries(conversationId, query) { + return { + conversationId, + ...query.minEntryId === void 0 ? {} : { minEntryId: query.minEntryId }, + ...query.maxEntryId === void 0 ? {} : { maxEntryId: query.maxEntryId }, + ...query.order === void 0 ? {} : { order: query.order } + }; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +var SCAN_PAGE_SIZE3 = 256; +var NO_KEYS2 = []; +var LIVE_STATUSES = ["pending", "running", "waiting", "sleeping", "completing"]; +function blockedSubject(record) { + return { + id: record.id, + kind: record.kind, + version: record.version, + abortRequested: record.abortRequested, + ...record.abortReason === void 0 ? {} : { abortReason: record.abortReason }, + status: record.state.status + }; +} +var CONTINUE = { kind: "continue" }; +var PROGRESS = { kind: "progress" }; +var END = { kind: "end" }; +var CASCADE = { kind: "cascade" }; +function conversationNode(id) { + return `c${id}`; +} +function conversationOf(node) { + return Number(node.slice(1)); +} +function parentNode(node) { + return node.owner ?? conversationNode(node.conversationId); +} +var TaskScheduler = class { + #telemetry; + #activeMetric; + #durationMetric; + #resumed = /* @__PURE__ */ new Set(); + #session; + #storage; + #registry; + #models; + #agent; + #settings; + #env; + #now; + #onWake; + #timers; + #writeAtClose; + #report; + #settleOutcome; + #limitsRestarts; + #withdrawInputs; + #conversation; + #context; + #live = /* @__PURE__ */ new Map(); + /** + * Context range last read through a task runtime, per conversation: a later read, by any of its tasks, scans only + * newer entries. `idleSince` is the Harness time it was first seen idle. Derived and never persisted; dropped at the + * first idle check after `settings.contextRetentionMs` of idleness, and at close. + */ + #contexts = /* @__PURE__ */ new Map(); + /** + * The idle kept contexts by `idleSince`, oldest first: the expiry order, so neither an expiry nor finding the next one + * scans `#contexts`. Kept sorted also when the Harness clock goes back (see `#markIdle`). + */ + #idleOrder = /* @__PURE__ */ new Map(); + /** At least the newest `idleSince` in `#idleOrder` (drops do not lower it): an older one added means the clock went back. */ + #idleNewest = Number.NEGATIVE_INFINITY; + /** + * A chain load resolved what `#idle()` treats as unknown for a live task whose chain is not loaded, which can make a + * scope idle without a task change below it; the next idle check then covers every scope. + */ + #unknownsChanged = false; + /** Idle checks that covered every scope (`idleState`, a test diagnostic). */ + #fullIdleChecks = 0; + /** Background timer for the earliest expiry of an idle context, unless the host declined it (see `#scheduleExpiry`). */ + #expiry; + #invocations = /* @__PURE__ */ new Map(); + #taskWaiters = new Waiters(); + /** Idle waiters by conversation; `undefined` waits for the whole Harness. */ + #idleWaiters = new Waiters(); + /** Definition whose migration failed per task; retried only once the registry resolves another definition. */ + #failedMigrations = /* @__PURE__ */ new Map(); + /** Owner task of each known conversation, `null` when ownerless. */ + #edges = /* @__PURE__ */ new Map(); + /** Ownership fields of the known terminal tasks, which walks pass through. */ + #settled = /* @__PURE__ */ new Map(); + /** + * Ended tasks and conversations found unneeded, dropped by `#sweep()` at the end of the commit's publication unless + * needed again by then: a chain load installs nodes before the work below them is listed. + */ + #dropQueue = /* @__PURE__ */ new Set(); + /** + * The tree downward around live work: each node's child nodes that are live tasks or have nodes listed below them. + * A conversation's parent is its owner task; ownerless ones with work are in `#roots`. + */ + #below = /* @__PURE__ */ new Map(); + #roots = /* @__PURE__ */ new Set(); + /** Known tasks whose chain may not be loaded; every other known task's chain is, and stays, loaded. */ + #unloaded = /* @__PURE__ */ new Set(); + /** Live tasks with cancellation intent, the sources of abort cascades (spec §5.4). */ + #intent = /* @__PURE__ */ new Set(); + /** Live tasks that are not `completing`, the candidates of a reservation pass; ones found waiting leave it. */ + #runnable = /* @__PURE__ */ new Set(); + /** `completing` tasks the next finalize pass checks: those that started holding, and holders of ended work. */ + #finalizeChecks = /* @__PURE__ */ new Set(); + /** Live waiting tasks by each task in their `on`. */ + #waiters = /* @__PURE__ */ new Map(); + /** + * `failFast` waiters the next reconcile checks for a failed task in `on`: at open, when they start waiting, and when + * one of their tasks fails. + */ + #failFastChecks = /* @__PURE__ */ new Set(); + /** + * Live tasks with `abandonOnRestart` found at open, from an earlier Harness. The first reservation pass abort-marks + * them with reason `restart`, so nothing of them or below them runs a phase again. + */ + #abandoned = /* @__PURE__ */ new Set(); + /** Sleeping live tasks, due or not: the candidates of `#wakeDue()`. */ + #sleeping = /* @__PURE__ */ new Set(); + /** Timer for the earliest sleep, without `onWake` while scheduling runs. */ + #timer; + /** Last value given to `onWake`, so an unchanged one is not repeated. */ + #lastWake; + #wakeScheduled = false; + #blockedListeners = /* @__PURE__ */ new Set(); + /** A registry snapshot that threw for the task graph was reported; it is read per record, so only once. */ + #snapshotReported = false; + #reconcileScheduled = false; + /** Reconcile passes underway with work (they may overlap): their commits finalize held outcomes and mark cascades. */ + #reconcilingWork = 0; + #sweepScheduled = false; + /** + * Nodes chain loads installed for jobs whose commits are not published yet, with how many such jobs: the sweep keeps + * them, as work a pending commit creates below them needs them. + */ + #pins = /* @__PURE__ */ new Map(); + /** Keys the decision region underway reads (`#region()`); set only while one runs. */ + #reading; + #cascadePending = false; + #unsubscribeRegistry = () => { + }; + #enabled = false; + #held = false; + #readOnly; + #closing = false; + #dirty = false; + #draining = false; + constructor(options) { + this.#telemetry = options.telemetry ?? NOOP_TELEMETRY_CONTEXT; + const metrics = createTypedMetrics(this.#telemetry.metrics ?? NOOP_TELEMETRY_METRICS, [DURABLE_TELEMETRY_SCHEMA]); + this.#activeMetric = metrics.upDownCounter("pi.durable.tasks.active"); + this.#durationMetric = metrics.histogram("pi.durable.phase.duration"); + this.#session = options.session; + this.#storage = options.storage; + this.#registry = options.registry; + this.#models = options.models; + this.#agent = options.agent; + this.#settings = options.settings; + this.#env = options.env; + this.#now = options.now; + this.#onWake = options.onWake; + this.#timers = options.timers; + this.#writeAtClose = options.writeAtClose; + this.#report = options.report; + this.#settleOutcome = options.settleOutcome; + this.#limitsRestarts = options.limitsRestarts; + this.#withdrawInputs = options.withdrawInputs; + this.#conversation = options.conversation; + this.#context = options.context; + this.#readOnly = options.readOnly === true; + } + /** Start no run invocation until `release()`; running invocations and abort handlers go on. Overrides `resume()`. */ + hold() { + this.#held = true; + } + release() { + this.#held = false; + this.#kick(); + } + /** + * Load live tasks and change surviving `running` tasks back to `pending`, counting the restart. Dispatches nothing; + * a task cut off `settings.restartLimit` times ends when it is next reserved. Read-only, it only loads them: a + * `running` task stays as committed, running in another process. + */ + async open(context) { + this.#session.followCommits((publication) => this.#observe(publication)); + this.#session.subscribeClose(() => this.#seal()); + this.#unsubscribeRegistry = this.#registry.subscribe(() => { + this.#notifyBlocked(); + this.#kick(); + }); + await this.#session.commitWith(async (tx) => { + await this.#published(); + const scans = []; + for (const status of LIVE_STATUSES) { + scans.push(await scanAll((cursor) => tx.scanTasks({ status }, SCAN_PAGE_SIZE3, cursor))); + } + for (const records of scans) { + for (const record of records) { + this.#track(void 0, record); + this.#resumed.add(record.id); + if (this.#readOnly) + continue; + if (record.abandonOnRestart === true) + this.#abandoned.add(record.id); + if (record.state.status === "running") { + const restarts = (record.restarts ?? 0) + 1; + const pending = withState(record, { status: "pending", checkpoint: record.state.checkpoint }); + tx.setTask({ ...pending, restarts }); + } + if (record.state.status === "waiting" && record.state.policy === "failFast") { + this.#failFastChecks.add(record.id); + } + } + } + }, context); + if (this.#readOnly) + return; + this.#cascadePending = true; + this.#scheduleReconcile(); + this.#scheduleWake(); + } + /** + * Enable scheduling, and make sleeping tasks that are due runnable: a host wakeup, such as an alarm, calls this. + * Idempotent; the kick does nothing once closing. + */ + resume() { + if (this.#readOnly) + throw new ReadOnlySession("running tasks"); + this.#enabled = true; + this.#wakeDue(); + this.#kick(); + } + /** + * Why a live task cannot run here, if it cannot: its definition is missing, too old, or failed to migrate. A running + * task, an abort-marked one, and one holding its outcome are never blocked. + */ + blockedReason(record) { + const status = record.status; + if (status === "running" || status === "completing" || status === "terminal") + return void 0; + if (record.abortRequested && record.abortReason === void 0) + return void 0; + let snapshot; + try { + snapshot = this.#registry.snapshot(); + } catch (error) { + if (!this.#snapshotReported) + this.#report(error, REGISTRY); + this.#snapshotReported = true; + return void 0; + } + const fit = this.#fit(record, snapshot.task(record.kind)); + if ("reason" in fit) + return fit.reason; + return fit.migrates && fit.task.definition.migrate === void 0 ? "migration_failed" : void 0; + } + /** Call `listener` when blocked reasons may have changed without a commit: a registry change or a failed migration. */ + subscribeBlocked(listener) { + this.#blockedListeners.add(listener); + return () => this.#blockedListeners.delete(listener); + } + /** + * When the Session next needs a process: `active` while some task can run now or is running, `at` for the earliest + * sleep not yet due. Synchronous, from memory; a task whose chain is not loaded yet counts as it would alone. + */ + wake() { + if (this.#readOnly) + return { active: false }; + const now = this.#now(); + const active = this.#invocations.size > 0 || this.#reconcilingWork > 0 || this.#reconcileWork() || this.#runsNow(now); + let at; + for (const id of this.#sleeping) { + const record = this.#live.get(id); + const state2 = record?.state; + if (state2?.status === "sleeping" && !record.abortRequested && state2.until > now) { + at = at === void 0 ? state2.until : Math.min(at, state2.until); + } + } + return at === void 0 ? { active } : { active, at }; + } + /** Whether a live task can run now: the scan `wake()` needs only while no invocation runs. */ + #runsNow(now) { + let snapshot; + let snapshotFailed = false; + for (const record of this.#live.values()) { + const state2 = record.state; + if (state2.status === "completing") + continue; + if (state2.status === "waiting" && !record.abortRequested && state2.on.some((id) => this.#live.has(id))) + continue; + if (state2.status === "sleeping" && !record.abortRequested && state2.until > now) + continue; + if (record.abortRequested && this.#waitingOn(record, true).length > 0) + continue; + if (!record.abortRequested || record.abortReason !== void 0) { + if (snapshot === void 0 && !snapshotFailed) { + try { + snapshot = this.#registry.snapshot(); + } catch (error) { + snapshotFailed = true; + this.#report(error, REGISTRY); + } + } + if (snapshot !== void 0 && "reason" in this.#fit(record, snapshot.task(record.kind))) + continue; + } + return true; + } + return false; + } + /** + * Signal every invocation and wait for them, then write the tasks they ran back as `pending` (`writeAtClose`), as a + * close is not a crash. Close calls this after every close listener has run, so waits, watches, and streams a task + * holds end with the Session's reason, not as cancelled by its signal. + */ + async join() { + const stopped = [...this.#invocations.values()]; + for (const invocation of stopped) + invocation.controller.abort(); + await Promise.allSettled(stopped.map((invocation) => invocation.done)); + if (stopped.length === 0) + return; + await this.#writeAtClose(() => stopped.flatMap((invocation) => { + const record = this.#live.get(invocation.taskId); + if (record?.state.status !== "running") + return []; + const value2 = withState(record, { status: "pending", checkpoint: record.state.checkpoint }); + return [{ type: "task", value: value2 }]; + })).catch(() => { + }); + } + /** + * Commit the abort mark, or settle a task that no registered definition can take as `orphaned` when nothing it owns + * is live, then join the run invocation seen on the line; the commit listener signalled it. The abort invocation + * starts once the task's ordinary owned work is gone. A `completing` task is only marked. A request replaces a + * `restart` mark, so a task abandoned after a restart that waits for its definition is orphaned; with `keepRestart`, + * as for an owner's own cleanup, such a task keeps its mark and waits on. + */ + async abort(id, context, keepRestart = false) { + const marked = await this.#session.commitWith(async (tx) => { + const current = await tx.task(id); + if (current === void 0) + throw new Error(`Task ${id} does not exist`); + if (current.state.status === "terminal") + return { result: "terminal" }; + const invocation = this.#invocations.get(id); + if (keepRestart && current.abortReason === "restart") + return { result: "marked" }; + if (invocation === void 0 && current.state.status !== "completing") { + await this.#loadScopes(false); + const owns = await this.#region(() => this.#hasOwnedLive(id), this.#reloadScopes); + const resolution = owns ? void 0 : this.#resolve(current, this.#registry.snapshot()); + if (resolution?.kind === "blocked") { + await this.#terminate(tx, current, { status: "orphaned", reason: resolution.reason }); + return { result: "marked" }; + } + } + if (!current.abortRequested || current.abortReason !== void 0) + tx.setTask(withAbortMark(current)); + return { result: "marked", run: invocation?.mode === "run" ? invocation : void 0 }; + }, context); + if (marked.run !== void 0) { + await awaitWithContext(Promise.race([marked.run.done, this.#session.failed]), context); + } + return marked.result; + } + async waitForTask(id, context) { + const found = await this.#session.readOnLine(async (storage2) => { + if (this.#closing) + throw closedError(this.#session); + if (await this.#region(() => this.#liveRecord(id) !== void 0)) { + return { promise: this.#taskWaiters.add(id, context) }; + } + const record = await storage2.task(id, context); + if (record === void 0) + throw new Error(`Task ${id} does not exist`); + return { promise: Promise.resolve(record) }; + }); + return found.promise; + } + /** + * Resolve when ordinary traversal from the conversation, or from every ownerless conversation, reaches no live + * non-background task. + */ + waitForIdle(conversationId, context) { + if (this.#closing) + return Promise.reject(closedError(this.#session)); + if (this.#idle(conversationId)) + return Promise.resolve(); + this.#scheduleReconcile(); + return this.#idleWaiters.add(conversationId, context); + } + /** + * `Conversation.abort()`: in one commit, withdraw the queued inputs and mark every live non-background task that + * ordinary traversal from the conversation reaches; resolves once the scope is idle. With `background`, traversal + * crosses background boundaries, and the wait also covers every task it reached. + */ + async abortConversation(conversationId, background, context) { + const reached = await this.#session.commitWith(async (tx) => { + await this.#published(); + const queued = await this.#loadScopes(true); + const scope = { conversation: conversationId }; + const reached2 = []; + const walk = this.#walkDown(conversationNode(conversationId), { crossBackground: background }); + for (const { node, live } of walk) { + if (live === void 0 || node.background && !background) + continue; + reached2.push(live.id); + if (!live.abortRequested || live.abortReason !== void 0) + tx.setTask(withAbortMark(live)); + } + for (const id of queued) { + if (this.#inScope({ conversation: id }, scope, background) === true) + await this.#withdrawInputs(tx, id); + } + return reached2; + }, context); + if (background) + for (const id of reached) + await this.waitForTask(id, context); + await this.waitForIdle(conversationId, context); + } + /** + * The ownership memberships a commit's task and conversation changes write (group commit §4.2), at its admission on + * the line: for each task created or made terminal, every node from its parent up to and including the nearest live + * task, or the root conversation, and then the roots too, conservatively, as a pending end may unlist the root a + * creation finds listed; for each conversation created under a task, that task; and the intent set when + * a change sets, upgrades, or clears a mark or a held or ended outcome other than `completed`. Loads the chains it + * walks; the nodes it installs stay until the commit is published. + */ + membershipKeys(tx) { + const tasks = tx.stagedTasks(); + const conversations = tx.stagedConversations(); + if (tasks.length === 0 && conversations.every((record) => record.owner === void 0)) + return NO_KEYS2; + return this.#membershipKeys(tx, tasks, conversations); + } + async #membershipKeys(tx, tasks, conversations) { + const keys = /* @__PURE__ */ new Set(); + const overlay = overlayOf(tx); + const created = new Set(tx.createdTaskIds()); + const reached = /* @__PURE__ */ new Map(); + for (const record of tasks) { + if (intentChanges(this.#live.get(record.id), record)) + keys.add(INTENT_KEY); + if (!created.has(record.id) && record.state.status !== "terminal") + continue; + await this.#loadChain(parentOf(record), overlay); + if (await this.#chainKeys(parentNode(record), overlay, keys, reached) !== void 0) + keys.add(ROOTS_KEY); + } + for (const conversation of conversations) { + const owner = conversation.owner?.taskId; + if (owner === void 0) + continue; + await this.#loadChain({ task: owner }, overlay); + await this.#chainKeys(owner, overlay, keys, reached); + } + return [...keys]; + } + /** + * Add the memberships from `start` up to and including the nearest live task, or the root conversation, which it + * returns. `reached` keeps, per node walked, where its walk ended, so a chain several tasks of a commit share is + * walked once. Whether an ancestor is live can change under a pending commit, so it is read after a touch of the + * ancestor's record: a pending end must not stop the chain early. Ownership fields are immutable, so not keyed. + */ + async #chainKeys(start, overlay, keys, reached) { + const walked = []; + let root2; + let node = start; + while (node !== void 0 && node !== null) { + const key = ownedKey(node); + if (reached.has(key)) { + root2 = reached.get(key); + break; + } + keys.add(key); + walked.push(key); + if (typeof node === "string") { + const conversation = conversationOf(node); + node = this.#edge(conversation, overlay); + if (node === null) + root2 = conversation; + continue; + } + let record = overlay.tasks.get(node); + if (record === void 0) { + const gate = this.#session.touch(taskKey(node)); + if (gate !== void 0) { + await gate; + await this.#loadChain({ task: node }, overlay); + } + record = this.#live.get(node); + } + if (record !== void 0 && record.state.status !== "terminal") + break; + const above = record ?? this.#settled.get(node); + node = above === void 0 ? void 0 : parentNode(above); + } + for (const key of walked) + reached.set(key, root2); + return root2; + } + // ─── Scheduling ──────────────────────────────────────────────────────── + #observe(publication) { + if (publication.kind === "memory") + return; + this.#advanceContexts(publication); + const updated = []; + const failed = []; + let changed = false; + let dirty = /* @__PURE__ */ new Set(); + for (const change of publication.changes) { + if (change.type === "conversation" && !this.#edges.has(change.value.id)) { + this.#setEdge(change.value.id, change.value.owner?.taskId ?? null); + } + } + for (const change of publication.changes) { + if (change.type !== "task") + continue; + changed = true; + const record = change.value; + const previous = this.#live.get(record.id); + if (failedOutcome(record) && (previous === void 0 || !failedOutcome(previous))) + failed.push(record.id); + this.#track(previous, record); + const liveness = previous === void 0 || record.state.status === "terminal"; + if (liveness && dirty !== void 0 && !this.#addScopesAbove(record, dirty)) + dirty = void 0; + if (record.state.status === "terminal") { + this.#failedMigrations.delete(record.id); + this.#failFastChecks.delete(record.id); + this.#taskWaiters.resolve(record.id, record); + this.#scheduleReconcile(); + continue; + } + if (record.abortRequested && previous?.abortRequested !== true) { + this.#cascadePending = true; + const invocation = this.#invocations.get(record.id); + if (invocation?.mode === "run") + queueMicrotask(() => invocation.controller.abort()); + } + if (previous?.abortReason !== void 0 && record.abortReason === void 0) + this.#cascadePending = true; + const status = record.state.status; + if (status === "completing" && previous?.state.status !== "completing") { + if (cancellationIntent(record)) + this.#cascadePending = true; + this.#scheduleReconcile(); + } + if (status === "waiting" && record.state.policy === "failFast" && previous?.state.status !== "waiting") { + this.#failFastChecks.add(record.id); + this.#scheduleReconcile(); + } + if (previous === void 0) + updated.push(record); + } + for (const id of failed) { + for (const waiter of this.#waiters.get(id) ?? []) { + const state2 = this.#live.get(waiter)?.state; + if (state2?.status === "waiting" && state2.policy === "failFast") { + this.#failFastChecks.add(waiter); + this.#scheduleReconcile(); + } + } + } + for (const change of publication.changes) { + if (change.type !== "submission" || change.value.status !== "queued" || change.value.type !== "input") + continue; + if (this.#intent.size === 0) + continue; + const conversation = change.value.conversationId; + if (!this.#known(conversationNode(conversation)) || this.#belowCancelled({ conversation })) { + this.#cascadePending = true; + } + } + for (const record of updated) { + if (this.#unloaded.has(record.id)) + this.#scheduleReconcile(); + else if (!record.background && !record.abortRequested && this.#belowCancelled(parentOf(record))) { + this.#cascadePending = true; + } + } + if (this.#cascadePending) + this.#scheduleReconcile(); + this.#sweep(); + if (!changed) + return; + this.#settleIdle(dirty); + this.#kick(); + } + /** + * Add the conversations above `record` to `scopes`: those whose idleness a change of it can change. False when a node + * on the way up is not known. A conversation already in `scopes` has everything above it there too. + */ + #addScopesAbove(record, scopes) { + for (const step of this.#above(parentOf(record))) { + if ("unknown" in step) + return false; + if (!("conversation" in step)) + continue; + if (scopes.has(step.conversation)) + return true; + scopes.add(step.conversation); + } + return true; + } + /** + * Extend each kept context range with the entries a stored commit appended to its conversation, so a later read + * needs no Storage scan. Entries are published in ID order. + */ + #advanceContexts(publication) { + if (this.#contexts.size === 0) + return; + let appended; + for (const change of publication.changes) { + if (change.type !== "entry" || !this.#contexts.has(change.value.conversationId)) + continue; + appended ??= /* @__PURE__ */ new Map(); + const entries2 = appended.get(change.value.conversationId); + if (entries2 === void 0) + appended.set(change.value.conversationId, [change.value]); + else + entries2.push(change.value); + } + if (appended === void 0) + return; + for (const [conversationId, entries2] of appended) { + const kept = this.#contexts.get(conversationId); + if (kept.idleSince !== void 0 && kept.expiresAt !== void 0 && kept.expiresAt <= this.#now()) { + this.#dropContext(conversationId); + continue; + } + const range = advanceRange(kept.range, entries2); + if (range === void 0) + this.#dropContext(conversationId); + else + kept.range = range; + } + } + /** + * `settings.contextRetentionMs`, or 0 when the host's settings throw. Kept contexts are only a cache, so dropping them + * is safe, while a throw here would escape commit listeners, reconciliation, and the expiry timer. + */ + #contextRetentionMs() { + try { + return this.#settings().contextRetentionMs; + } catch (error) { + this.#report(error, SETTINGS); + return 0; + } + } + /** + * After task changes below the conversations in `scopes` (every conversation when undefined): resolve their idle + * waiters and the Harness-wide ones, drop the kept contexts whose idle period passed the retention, then start or end + * the idle periods of the kept contexts in `scopes`. A task change can change the idleness only of the conversations + * above it, so no check visits every conversation. + */ + #settleIdle(scopes) { + const all = scopes === void 0 || this.#unknownsChanged; + this.#unknownsChanged = false; + if (all) + this.#fullIdleChecks++; + this.#resolveIdleWaiters(all ? void 0 : scopes); + const now = this.#now(); + const retention = this.#contextRetentionMs(); + this.#expireContexts(now, retention); + for (const conversationId of all ? [...this.#contexts.keys()] : scopes) { + const kept = this.#contexts.get(conversationId); + if (kept === void 0) + continue; + if (!this.#idle(conversationId)) { + if (kept.idleSince === void 0) + continue; + kept.idleSince = void 0; + this.#idleOrder.delete(conversationId); + } else if (retention <= 0) { + this.#dropContext(conversationId); + } else if (kept.idleSince === void 0) { + kept.idleSince = now; + kept.expiresAt = now + retention; + this.#markIdle(conversationId, now); + } + } + this.#scheduleExpiry(); + } + /** Resolve the idle waiters of the conversations in `scopes` (all when undefined) and the Harness-wide ones. */ + #resolveIdleWaiters(scopes) { + for (const conversationId of this.#idleWaiters.keys()) { + if (conversationId !== void 0 && scopes !== void 0 && !scopes.has(conversationId)) + continue; + if (this.#idle(conversationId)) + this.#idleWaiters.resolve(conversationId); + } + } + /** + * Drop the kept contexts idle for at least `retention`, oldest first, with the retention setting of now; with no + * retention, every idle one, also those whose idle period a clock that went back makes start after now. + */ + #expireContexts(now, retention) { + for (const [conversationId, idleSince] of this.#idleOrder) { + if (retention > 0 && now - idleSince < retention) + return; + this.#dropContext(conversationId); + } + } + /** + * Start the idle period of a kept context in the expiry order. An idle period older than the newest one kept, which + * a clock that went back starts, sorts the order again, and the newest is taken from what is kept then. + */ + #markIdle(conversationId, idleSince) { + this.#idleOrder.delete(conversationId); + this.#idleOrder.set(conversationId, idleSince); + if (this.#idleOrder.size === 1 || idleSince >= this.#idleNewest) { + this.#idleNewest = idleSince; + return; + } + const sorted = [...this.#idleOrder].sort((a, b) => a[1] - b[1]); + this.#idleOrder.clear(); + for (const [id, since] of sorted) + this.#idleOrder.set(id, since); + this.#idleNewest = sorted.at(-1)[1]; + } + /** Forget a kept context, idle or not, and its place in the expiry order. */ + #dropContext(conversationId) { + this.#contexts.delete(conversationId); + this.#idleOrder.delete(conversationId); + } + /** + * Drop the expired contexts when the earliest idle context expires, on a background timer, which never keeps the + * process alive. Where the host declines it, as the default does in Cloudflare Workers, none is kept: a pending timer + * could keep a Durable Object from being evicted, and eviction frees the contexts. There, task changes alone check + * expiry. + */ + #scheduleExpiry() { + const oldest = this.#idleOrder.values().next(); + const at = oldest.done === true ? void 0 : oldest.value + this.#contextRetentionMs(); + if (this.#expiry !== void 0 && this.#expiry.at === at) + return; + this.#expiry?.disarm(); + this.#expiry = void 0; + if (at === void 0 || this.#closing) + return; + const disarm = this.#timers.background(() => { + this.#expiry = void 0; + this.#expireContexts(this.#now(), this.#contextRetentionMs()); + this.#scheduleExpiry(); + }, at - this.#now()); + if (disarm !== void 0) + this.#expiry = { at, disarm }; + } + // ─── Ownership ─────────────────────────────────────────────────────────── + #scheduleReconcile() { + if (this.#reconcileScheduled || this.#closing || this.#readOnly) + return; + this.#reconcileScheduled = true; + queueMicrotask(() => void this.#reconcile()); + } + /** + * One commit that applies what committed records imply: abort marks below live owners with cancellation intent + * (spec §5.4), `failFast` marks (spec §5.5), withdrawn queued inputs below cancelled owners, and the final terminal + * record of every `completing` task whose ordinary owned work is gone. The durable records are the intent, so this + * also repairs whatever a crash left unapplied. Resolves idle waiters that the loaded edges decide. + */ + async #reconcile() { + this.#reconcileScheduled = false; + const work = this.#reconcileWork(); + if (work) + this.#reconcilingWork++; + try { + await this.#session.commitInternal(async (tx) => { + if (this.#closing) + return; + const cascade = this.#cascadePending; + const queued = await this.#loadScopes(cascade); + if (cascade) + this.#cascadePending = false; + const marks = await this.#marks(); + for (const { record, reason } of marks.values()) + tx.setTask(withAbortMark(record, reason)); + const withdrawn = await this.#region(() => queued.filter((id) => this.#belowCancelled({ conversation: id })), this.#reloadScopes); + for (const id of withdrawn) + await this.#withdrawInputs(tx, id); + await this.#finalize(tx); + }, this.#context); + } catch (error) { + this.#failSession(error); + } + if (work) + this.#reconcilingWork--; + this.#scheduleWake(); + if (this.#unknownsChanged) { + this.#settleIdle(void 0); + return; + } + this.#resolveIdleWaiters(void 0); + this.#expireContexts(this.#now(), this.#contextRetentionMs()); + this.#scheduleExpiry(); + } + /** + * The abort marks committed records imply (spec §5.4, §5.5): every live foreground task below a live owner with + * cancellation intent, which is its nearest one (a walk down from each owner with intent does not enter another, + * whose own walk covers what is below it), and every other live task in the `on` of a `failFast` waiter one of whose + * tasks failed. A cascade from an abandoned owner passes its `restart` reason on; any other intent marks, or upgrades + * a `restart` mark, as a request. Collected first, so a request wins over a `restart` mark of the same pass. Derived + * again on every pass, as loading edges can reveal a cancelled owner. Takes the `failFast` checks once its decision + * stands. + */ + async #marks() { + const ended = /* @__PURE__ */ new Map(); + for (; ; ) { + const plan = await this.#region(() => this.#planMarks(ended), this.#reloadScopes); + if ("missing" in plan) { + for (const id of plan.missing) + ended.set(id, await this.#session.lineStorage.task(id, this.#context) ?? null); + continue; + } + for (const id of plan.checked) + this.#failFastChecks.delete(id); + return plan.marks; + } + } + /** `#marks()`' decision region; the `failFast` members it needs from Storage first, when `ended` lacks them. */ + #planMarks(ended) { + const marks = /* @__PURE__ */ new Map(); + const mark = (found, reason) => { + const record = this.#liveRecord(found.id); + const staged = marks.get(record.id); + if (staged !== void 0 && staged.reason === void 0) + return; + if (record.abortRequested && (record.abortReason === void 0 || reason !== void 0)) + return; + marks.set(record.id, { record, reason }); + }; + this.#record(INTENT_KEY); + for (const id of this.#intent) { + const owner = this.#liveRecord(id); + const restart = owner.abortReason === "restart" && !failedOutcome(owner); + for (const { node, live } of this.#walkDown(id, { enter: (below) => !this.#intent.has(below) })) { + if (live !== void 0 && !node.background) + mark(live, restart ? "restart" : void 0); + } + } + const checked = [...this.#failFastChecks]; + const missing = []; + for (const id of checked) { + const waiter = this.#liveRecord(id); + if (waiter?.state.status !== "waiting") + continue; + let failed = false; + for (const member of waiter.state.on) { + const record = this.#liveRecord(member) ?? ended.get(member); + if (record === void 0) + missing.push(member); + else if (record !== null && failedOutcome(record)) + failed = true; + } + if (!failed) + continue; + for (const member of waiter.state.on) { + const record = this.#liveRecord(member); + if (record !== void 0 && !failedOutcome(record)) + mark(record, void 0); + } + } + return missing.length > 0 ? { missing } : { marks, checked }; + } + /** Whether a reconcile pass would have work: a cascade to derive, held outcomes to check, or `failFast` waits. */ + #reconcileWork() { + return this.#cascadePending || this.#finalizeChecks.size > 0 || this.#failFastChecks.size > 0; + } + /** + * Write the terminal record of every `completing` task without live ordinary owned work. Finalizing one can free its + * owner, so this repeats over the commit's candidates until nothing changes. A held scheduler outcome gets its + * Harness cleanup here. In rounds, one decision region each: the holders the tasks of one round free are checked once, + * in the next, so a holder of many tasks that end together is walked once, not once per task. The first round takes + * the `completing` tasks to check once its decision stands. + */ + async #finalize(tx) { + const done = /* @__PURE__ */ new Set(); + const overlay = overlayOf(tx); + let round; + for (; ; ) { + const ids = round; + const plan = await this.#region(() => this.#planRound(ids ?? [...this.#finalizeChecks], overlay, done), this.#reloadScopes); + if (ids === void 0) + this.#finalizeChecks.clear(); + for (const { record, terminal } of plan.finalized) { + tx.setTask(terminal); + overlay.tasks.set(record.id, terminal); + done.add(record.id); + const outcome = record.state.outcome; + if (outcome.status === "faulted" || outcome.status === "orphaned") { + await this.#settleOutcome(tx, record, outcome); + } + } + if (plan.next.length === 0) + return; + round = plan.next; + } + } + /** + * One finalize round's decision: which of `ids` are `completing` without live ordinary owned work below them, in the + * commit's candidates with the round's own finalizations applied in order, and the holders above them to check next. + * Tasks finalized have no live work below them, so walks down skip them. It applies the round's terminal records to + * `overlay` while it decides and takes them back before it returns, so a run again starts from the same candidates. + */ + #planRound(ids, overlay, finalized) { + const tasks = overlay.tasks; + const round = /* @__PURE__ */ new Set(); + const done = { has: (id) => round.has(id) || finalized.has(id) }; + const ended = []; + const next = /* @__PURE__ */ new Set(); + try { + for (const id of ids) { + const staged = tasks.get(id); + const record = staged ?? this.#liveRecord(id); + if (record?.state.status !== "completing" || done.has(id)) + continue; + if (this.#hasOwnedLive(id, overlay, done)) + continue; + const terminal = withState(record, { status: "terminal", outcome: record.state.outcome }); + tasks.set(id, terminal); + round.add(id); + ended.push({ record, terminal, staged: staged !== void 0 }); + const above = this.#nearestLiveAbove(record, overlay); + if (above?.state.status === "completing") + next.add(above.id); + } + } finally { + for (const { record, staged } of ended) { + if (staged) + tasks.set(record.id, record); + else + tasks.delete(record.id); + } + } + return { finalized: ended, next: [...next] }; + } + /** + * Load the owner chains of the tasks in `#unloaded` and, with `queued`, of every conversation with queued inputs, + * on the Session line; returns the latter. Reads through the line's Storage, so it may run inside a commit callback. + */ + async #loadScopes(queued) { + for (const id of [...this.#unloaded]) { + if (this.#unloaded.has(id)) + await this.#loadChain({ task: id }); + } + if (!queued) + return []; + const submissions = await scanAll((cursor) => this.#session.lineStorage.scanSubmissions({ status: "queued" }, SCAN_PAGE_SIZE3, cursor, this.#context)); + const inputs = submissions.filter((submission2) => submission2.type === "input"); + const conversations = [...new Set(inputs.map((submission2) => submission2.conversationId))]; + for (const id of conversations) + await this.#loadChain({ conversation: id }); + return conversations; + } + /** + * Load the owner edges and task nodes from `start` up to its ownerless root. A known task outside `#unloaded` ends the + * walk, as its chain is loaded; the `#unloaded` tasks passed have a loaded chain afterwards. Loading a node can reveal + * a cancelled owner, so it makes the next reconcile derive cascade marks. The nodes it installs stay until the job's + * commit is published (`#pin()`). + */ + async #loadChain(start, overlay) { + const passed = []; + let installed = false; + let at = start; + try { + while (at !== void 0) { + if ("task" in at) { + const id = at.task; + let node = this.#live.get(id) ?? this.#settled.get(id); + if (node === void 0 && overlay?.tasks.has(id) === true) + break; + if (node !== void 0 && !this.#unloaded.has(id)) + break; + if (node === void 0) { + const record = await this.#session.lineStorage.task(id, this.#context); + if (record === void 0) + return; + node = nodeOf(record); + if (record.state.status === "terminal") { + this.#settle(id, node); + this.#pin(id); + installed = true; + } + this.#scheduleReconcile(); + } + passed.push(id); + at = parentOf(node); + } else { + let edge = this.#edge(at.conversation, overlay); + if (edge === void 0) { + const record = await this.#session.lineStorage.conversation(at.conversation, this.#context); + edge = record?.owner?.taskId ?? null; + this.#setEdge(at.conversation, edge); + this.#pin(conversationNode(at.conversation)); + installed = true; + this.#scheduleReconcile(); + } + at = edge === null ? void 0 : { task: edge }; + } + } + } finally { + if (passed.some((id) => this.#live.has(id)) || installed && this.#liveUnloaded()) { + this.#unknownsChanged = true; + this.#scheduleReconcile(); + } + } + for (const id of passed) + this.#unloaded.delete(id); + } + /** Whether a live task's chain is not loaded yet: one `#idle()` counts as inside every scope it may be in. */ + #liveUnloaded() { + for (const id of this.#unloaded) + if (this.#live.has(id)) + return true; + return false; + } + #setEdge(conversationId, owner) { + this.#edges.set(conversationId, owner); + this.#relist(conversationNode(conversationId)); + this.#dropIfUnneeded(conversationNode(conversationId)); + } + /** Know a terminal task a chain load read, so walks pass through it; its own chain is not loaded yet. */ + #settle(id, node) { + this.#settled.set(id, node); + this.#unloaded.add(id); + this.#relist(id); + this.#dropIfUnneeded(id); + } + /** Queue an ended task or a conversation for the sweep when nothing is listed below it. */ + #dropIfUnneeded(node) { + if (typeof node !== "string" && this.#live.has(node)) + return; + if (this.#below.has(node)) + return; + this.#dropQueue.add(node); + this.#scheduleSweep(); + } + /** + * Sweep in a job of its own on the Session line, after the operation underway: a rejected commit, one with nothing to + * write, and a read publish nothing, so the sweep at the end of `#observe` would not run for what they loaded. + */ + #scheduleSweep() { + if (this.#sweepScheduled || this.#closing) + return; + this.#sweepScheduled = true; + this.#session.readOnLine(async () => { + this.#sweepScheduled = false; + this.#sweep(); + }).catch(() => { + }); + } + /** + * Drop the queued nodes that are still unneeded: not live, nothing listed below. Runs once a publication is fully + * tracked, and as a job of its own on the line, never inside an operation: work a commit creates below a chain its + * own callback loaded keeps that chain. A flat loop: unlisting already queued every node on the way up that lost its + * last listed node. + */ + #sweep() { + for (const node of this.#dropQueue) { + if (this.#below.has(node) || this.#pins.has(node)) + continue; + if (typeof node === "string") { + this.#edges.delete(conversationOf(node)); + this.#roots.delete(conversationOf(node)); + } else if (!this.#live.has(node)) { + this.#settled.delete(node); + this.#unloaded.delete(node); + } + } + this.#dropQueue.clear(); + } + /** + * Run `decide`, a decision region (group commit §6): synchronous, reading scheduler memory and recording the keys it + * reads, staging nothing and changing no scheduler state. When a key it read has an unpublished writer, its result, + * or its error, is dropped: once that writer is published, `refresh` reloads what the region needs and it runs + * again. A waiting job holds the line, so unpublished writes only shrink, and the runs converge. What a region read + * that had no unpublished writer gets none for the rest of the job, so its result stands while the job applies it. + */ + async #region(decide, refresh) { + for (; ; ) { + const keys = /* @__PURE__ */ new Set(); + this.#reading = keys; + let result; + try { + result = { value: decide() }; + } catch (error) { + result = { error }; + } finally { + this.#reading = void 0; + } + const gates = []; + for (const key of keys) { + const gate = this.#session.touch(key); + if (gate !== void 0) + gates.push(gate); + } + if (gates.length === 0) { + if ("error" in result) + throw result.error; + return result.value; + } + await Promise.all(gates); + await refresh?.(); + } + } + /** Load the chains a region walks, again after it waited: what was published meanwhile may list new work. */ + #reloadScopes = () => this.#loadScopes(false); + /** In a decision region, note that it reads `key`; anywhere else, nothing. */ + #record(key) { + this.#reading?.add(key); + } + /** A live task's committed record, read by a decision region. */ + #liveRecord(id) { + this.#record(taskKey(id)); + return this.#live.get(id); + } + /** + * Keep `node`, which a chain load of the job on the line installed, until that job's commit is published or fails: + * work it creates below the node needs it, and the sweep would drop it as unneeded before then. + */ + #pin(node) { + this.#pins.set(node, (this.#pins.get(node) ?? 0) + 1); + this.#session.onJobEnd(() => { + const count = this.#pins.get(node) - 1; + if (count > 0) { + this.#pins.set(node, count); + return; + } + this.#pins.delete(node); + this.#dropIfUnneeded(node); + }); + } + /** + * Bring the scheduler's sets in line with a task's committed record. A task that ended may free the nearest live task + * above it: one holding its outcome finalizes, an abort-marked one runs its abort handler; its waiters may run. + */ + #track(previous, record) { + const id = record.id; + const invocation = this.#invocations.get(id); + if (invocation !== void 0) + invocation.record = record; + if (record.state.status === "terminal") { + if (previous !== void 0 && !this.#closing) + this.#countActive(-1, record.kind); + this.#resumed.delete(id); + } else if (previous === void 0 && !this.#closing) { + this.#countActive(1, record.kind); + } + if (previous?.state.status === "waiting") + for (const on of previous.state.on) + deleteFrom(this.#waiters, on, id); + if (record.state.status === "terminal") { + const node = nodeOf(record); + this.#live.delete(id); + this.#sleeping.delete(id); + this.#intent.delete(id); + this.#runnable.delete(id); + this.#finalizeChecks.delete(id); + this.#settled.set(id, node); + this.#release(node); + for (const waiter of this.#waiters.get(id) ?? []) + this.#runnable.add(waiter); + this.#relist(id); + this.#dropIfUnneeded(id); + return; + } + this.#live.set(id, record); + if (previous === void 0) { + if (!this.#known(parentNode(record))) + this.#unloaded.add(id); + this.#relist(id); + } + if (cancellationIntent(record)) + this.#intent.add(id); + else + this.#intent.delete(id); + if (record.state.status === "completing") { + this.#runnable.delete(id); + this.#finalizeChecks.add(id); + } else { + this.#runnable.add(id); + } + if (record.state.status === "waiting") + for (const on of record.state.on) + addTo(this.#waiters, on, id); + if (record.state.status === "sleeping") + this.#sleeping.add(id); + else + this.#sleeping.delete(id); + } + /** The nearest live task above ended ordinary work may be free now: one holding its outcome, or an aborting one. */ + #release(node, overlay) { + const above = this.#nearestLiveAbove(node, overlay); + if (above?.state.status === "completing") + this.#finalizeChecks.add(above.id); + else if (above?.abortRequested === true) + this.#runnable.add(above.id); + return above; + } + /** + * List `start` under its parent node in `#below` while it is a live task or has nodes listed below it, and unlist it + * otherwise; then its parent, as far up as that changes. So `#below` holds exactly the tree around live work; a + * parent that loses its last listed node is queued for the sweep. A loop, as ownership chains can be deeper than the + * call stack. + */ + #relist(start) { + let node = start; + for (; ; ) { + const needed = typeof node !== "string" && this.#live.has(node) || this.#below.has(node); + let parent2; + if (typeof node === "string") { + parent2 = this.#edges.get(conversationOf(node)); + } else { + const known = this.#live.get(node) ?? this.#settled.get(node); + if (known === void 0) + return; + parent2 = parentNode(known); + } + if (parent2 === void 0) + return; + if (parent2 === null) { + const root2 = conversationOf(node); + if (needed) + this.#roots.add(root2); + else + this.#roots.delete(root2); + return; + } + if (this.#below.get(parent2)?.has(node) === true === needed) + return; + if (needed) { + const first = !this.#below.has(parent2); + addTo(this.#below, parent2, node); + if (!first) + return; + } else { + deleteFrom(this.#below, parent2, node); + if (this.#below.has(parent2)) + return; + this.#dropIfUnneeded(parent2); + } + node = parent2; + } + } + /** + * The nearest live task above ended ordinary work `node`, in the overlay's view: the one that work held, if any. Work + * at or below a background task holds nothing above it. + */ + #nearestLiveAbove(node, overlay) { + this.#record(INTENT_KEY); + for (let current = node; !current.background; ) { + const owner = current.owner ?? this.#edge(current.conversationId, overlay); + if (owner === void 0 || owner === null) + return void 0; + const record = overlay?.tasks.get(owner) ?? this.#liveRecord(owner); + if (record !== void 0 && record.state.status !== "terminal") + return record; + const above = record ?? this.#settled.get(owner); + if (above === void 0) + return void 0; + current = above; + } + return void 0; + } + /** Whether the chain above `node` is loaded, without walking: known tasks outside `#unloaded` have a loaded chain. */ + #known(node) { + if (typeof node !== "string") { + return (this.#live.has(node) || this.#settled.has(node)) && !this.#unloaded.has(node); + } + const owner = this.#edges.get(conversationOf(node)); + return owner === null || owner !== void 0 && this.#known(owner); + } + /** Owner task of a conversation, `null` when ownerless, `undefined` while not loaded. */ + #edge(id, overlay) { + if (overlay?.edges.has(id) === true) + return overlay.edges.get(id); + this.#record(conversationKey(id)); + return this.#edges.get(id); + } + #node(id, overlay) { + return overlay?.tasks.get(id) ?? this.#live.get(id) ?? this.#settled.get(id); + } + /** Walk up from `start`: owner tasks and conversations, ending at an ownerless root or an edge not loaded yet. */ + *#above(start, overlay) { + let at = start; + while (at !== void 0) { + if ("task" in at) { + const node = this.#node(at.task, overlay); + if (node === void 0) { + yield { unknown: true }; + return; + } + yield { task: at.task, node }; + at = parentOf(node); + } else { + yield { conversation: at.conversation }; + const edge = this.#edge(at.conversation, overlay); + if (edge === void 0) { + yield { unknown: true }; + return; + } + at = edge === null ? void 0 : { task: edge }; + } + } + } + /** + * The tasks below `start` that a walk down reaches: those `#below` lists and, under an overlay, the commit's new tasks, + * with its candidates in place of committed records. Background tasks are reached but not entered, unless + * `crossBackground`, and neither are the tasks `enter` rejects. A loop, as chains can be deeper than the call stack. + */ + *#walkDown(start, options = {}) { + const { overlay, crossBackground = false, enter } = options; + const links = overlay === void 0 ? void 0 : this.#links(overlay); + const pending = [start]; + for (let at = pending.pop(); at !== void 0; at = pending.pop()) { + this.#record(ownedKey(at)); + for (const children of [this.#below.get(at), links?.get(at)]) { + for (const child of children ?? []) { + if (typeof child === "string") { + pending.push(child); + continue; + } + const record = overlay?.tasks.get(child) ?? this.#live.get(child); + const node = record ?? this.#settled.get(child); + if (node === void 0) + continue; + const live = record !== void 0 && record.state.status !== "terminal" ? record : void 0; + yield { id: child, node, live }; + if ((crossBackground || !node.background) && (enter === void 0 || enter(child))) + pending.push(child); + } + } + } + } + /** + * The links walks down need for the commit's new tasks: each one under its parent node, then each node above it that + * `#below` does not list yet, until one it lists, a live task (always listed), or the chain's end. + */ + #links(overlay) { + if (overlay.links !== void 0) + return overlay.links; + const links = /* @__PURE__ */ new Map(); + for (const record of overlay.tasks.values()) { + if (this.#live.has(record.id) || this.#settled.has(record.id)) + continue; + let child = record.id; + let parent2 = parentNode(record); + while (parent2 !== void 0 && parent2 !== null && links.get(parent2)?.has(child) !== true) { + addTo(links, parent2, child); + if (typeof parent2 !== "string" && (this.#live.has(parent2) || overlay.tasks.has(parent2))) + break; + let above; + if (typeof parent2 === "string") { + above = this.#edge(conversationOf(parent2), overlay); + } else { + const fields = this.#settled.get(parent2); + above = fields === void 0 ? void 0 : parentNode(fields); + } + if (above !== void 0 && above !== null && this.#below.get(above)?.has(parent2) === true) + break; + child = parent2; + parent2 = above; + } + } + overlay.links = links; + return links; + } + /** + * The live ordinary owned work of `owner` (spec §5.5): the live non-background tasks below it that a walk down reaches + * without entering a background task; with `first`, only the first. Candidates in `overlay` replace committed records; + * the walk does not enter tasks in `done`, which have none. Owner chains must be loaded. + */ + #ownedLive(owner, options = {}) { + const { overlay, first = false, done } = options; + const found = []; + const walk = this.#walkDown(owner, { + ...overlay === void 0 ? {} : { overlay }, + ...done === void 0 ? {} : { enter: (id) => !done.has(id) } + }); + for (const { id, node, live } of walk) { + if (live === void 0 || node.background) + continue; + found.push(id); + if (first) + break; + } + return found; + } + #hasOwnedLive(owner, overlay, done) { + const options = { + first: true, + ...overlay === void 0 ? {} : { overlay }, + ...done === void 0 ? {} : { done } + }; + return this.#ownedLive(owner, options).length > 0; + } + /** + * Whether ordinary traversal from `scope` reaches `start`: walking up reaches the scope's conversation, or an + * ownerless one for `roots`, without crossing a background owner, unless `crossBackground`. `undefined` while an + * edge is not loaded. + */ + #inScope(start, scope, crossBackground = false) { + this.#record(INTENT_KEY); + for (const step of this.#above(start)) { + if ("unknown" in step) + return void 0; + if ("conversation" in step) { + if ("conversation" in scope && step.conversation === scope.conversation) + return true; + } else if (step.node.background && !crossBackground) { + return false; + } + } + return "roots" in scope; + } + /** + * Whether a live owner's cancellation intent reaches `start`: walking up finds an owner with intent before a + * background owner without it. Terminal owners never cascade (spec §5.4). + */ + #belowCancelled(start) { + return this.#cancellingOwner(start) !== void 0; + } + /** The nearest live owner above `start` whose cancellation intent reaches it, if any; see `#belowCancelled`. */ + #cancellingOwner(start) { + this.#record(INTENT_KEY); + if (this.#intent.size === 0) + return void 0; + for (const step of this.#above(start)) { + if ("unknown" in step) + return void 0; + if (!("task" in step)) + continue; + const live = this.#live.get(step.task); + if (live !== void 0 && cancellationIntent(live)) + return live; + if (step.node.background) + return void 0; + } + return void 0; + } + /** + * Count a task in or out of `pi.durable.tasks.active`. Commit observers count at a commit's publication, which must not + * throw, so a throwing adapter is reported. + */ + #countActive(delta, kind) { + try { + this.#activeMetric.add(delta, { task: kind }); + } catch (error) { + this.#report(error, TELEMETRY2); + } + } + /** Fail the Session, which reports it, for a throw in one of the scheduler's own commits; ignored once closing. */ + #failSession(error, context) { + if (!this.#closing) + this.#session.fail(error, context); + } + /** Close listener: runs synchronously once admission is sealed, before `join()`, or when the Session fails. */ + #seal() { + for (const record of this.#live.values()) + this.#countActive(-1, record.kind); + this.#resumed.clear(); + this.#closing = true; + try { + this.#unsubscribeRegistry(); + } catch (error2) { + this.#report(error2, REGISTRY); + } + const error = closedError(this.#session); + this.#taskWaiters.rejectAll(error); + this.#idleWaiters.rejectAll(error); + this.#contexts.clear(); + this.#idleOrder.clear(); + this.#expiry?.disarm(); + this.#expiry = void 0; + this.#timer?.disarm(); + this.#timer = void 0; + } + /** + * Recompute the wake in a microtask the line never waits for, with no order relative to host commit listeners (one + * already queued serves later changes too): arm the built-in timer, or tell `onWake` of a change. + */ + #scheduleWake() { + if (this.#wakeScheduled || this.#closing || this.#readOnly) + return; + this.#wakeScheduled = true; + queueMicrotask(() => { + this.#wakeScheduled = false; + if (this.#closing) + return; + const wake = this.wake(); + if (this.#onWake === void 0) { + this.#armTimer(this.#enabled ? wake.at : void 0); + return; + } + const last = this.#lastWake; + if (last !== void 0 && last.active === wake.active && last.at === wake.at) + return; + try { + this.#onWake(wake); + this.#lastWake = wake; + } catch (error) { + this.#report(error, ON_WAKE); + } + }); + } + /** + * Keep the timer for the earliest sleep. It keeps the process alive, unlike the context expiry timer: a process with a + * sleeping task has work left, such as a retry backoff. Rechecks the clock when it fires, so a wake before `until` + * only arms it again. + */ + #armTimer(at) { + if (this.#timer !== void 0 && this.#timer.at === at) + return; + this.#timer?.disarm(); + this.#timer = void 0; + if (at === void 0 || this.#closing) + return; + const disarm = this.#timers.foreground(() => { + this.#timer = void 0; + this.#wakeDue(); + this.#kick(); + }, at - this.#now()); + this.#timer = { at, disarm }; + } + /** Make every sleeping task whose time has come a reservation candidate. */ + #wakeDue() { + for (const id of this.#sleeping) { + const record = this.#live.get(id); + if (record !== void 0 && !this.#notDue(record)) + this.#runnable.add(id); + } + } + /** + * The report info of a task's failure, with the extension that installed its definition: the code that failed is + * that extension's. Built-in tasks have none. + */ + /** What a report about `task`'s own code says of it: the task, and the extension that installed its definition. */ + #aboutTask(task) { + let extension; + if ("extension" in task) + extension = task.extension; + else { + try { + const snapshot = this.#registry.snapshot(); + extension = installerOf(snapshot, snapshot.task(task.kind)); + } catch { + } + } + return { task: reportTask(task), ...optionalExtension(extension) }; + } + /** `settings.restartLimit`, or the default when the host's settings throw. */ + #restartLimit() { + try { + return this.#settings().restartLimit; + } catch (error) { + this.#report(error, SETTINGS); + return DEFAULT_RESTART_LIMIT; + } + } + #notifyBlocked() { + for (const listener of [...this.#blockedListeners]) { + try { + listener(); + } catch (error) { + this.#report(error, { kind: "listener_error" }); + } + } + } + /** A sleep whose `until` the clock has not reached; an abort mark ends a sleep. */ + #notDue(record) { + const state2 = record.state; + return state2.status === "sleeping" && !record.abortRequested && state2.until > this.#now(); + } + #kick() { + this.#scheduleWake(); + this.#dirty = true; + if (this.#draining || !this.#enabled || this.#closing) + return; + this.#draining = true; + queueMicrotask(() => void this.#drain()); + } + async #drain() { + try { + while (this.#dirty && this.#enabled && !this.#closing) { + this.#dirty = false; + for (const reservation of await this.#reserve()) + this.#start(reservation); + } + } catch (error) { + this.#failSession(error); + } finally { + this.#draining = false; + if (this.#dirty) + this.#kick(); + } + } + /** + * Reserve every eligible task in one commit; orphan abort-marked tasks no definition can take, unless abandoned after + * a restart. The first pass after open only abort-marks the abandoned tasks, so later passes see the marks. + */ + async #reserve() { + const reservations = []; + const faulted = []; + let abandoned = []; + try { + await this.#session.commitInternal(async (tx) => { + if (!this.#enabled || this.#closing) + return; + if (this.#abandoned.size > 0) { + const ids = [...this.#abandoned]; + const unmarked = await this.#region(() => ids.map((id) => this.#liveRecord(id)).filter((record) => record !== void 0 && !record.abortRequested)); + for (const record of unmarked) + tx.setTask(withAbortMark(record, "restart")); + abandoned = ids; + return; + } + await this.#loadScopes(false); + this.#wakeDue(); + const plan = await this.#region(() => this.#planReservation(), this.#reloadScopes); + for (const id of plan.dropped) + this.#runnable.delete(id); + if (plan.cascade) { + this.#cascadePending = true; + this.#scheduleReconcile(); + } + let snapshot; + for (const record of plan.ready) { + const id = record.id; + const mode = record.abortRequested ? "abort" : "run"; + if (mode === "run" && this.#held) + continue; + const cutOff = record.restarts !== void 0 && record.restarts >= this.#restartLimit(); + if (cutOff && (mode === "abort" || !this.#limitsRestarts(record.kind))) { + const message = mode === "abort" ? `Abort handler of task ${id} (${record.kind}) was cut off ${record.restarts} times` : `Task ${id} (${record.kind}) was cut off ${record.restarts} times without progress`; + await this.#terminate(tx, record, { + status: "faulted", + error: { message, detail: { reason: "restart_limit" } } + }); + faulted.push({ record, message }); + continue; + } + snapshot ??= this.#registry.snapshot(); + const resolution = this.#resolve(record, snapshot); + if (resolution.kind === "blocked") { + if (mode === "abort" && record.abortReason === void 0) { + await this.#terminate(tx, record, { status: "orphaned", reason: resolution.reason }); + } + continue; + } + if (resolution.record !== record || record.state.status !== "running") { + tx.setTask(withState(resolution.record, { + status: "running", + checkpoint: resolution.record.state.checkpoint + })); + } + this.#runnable.delete(id); + const invocation = this.#createInvocation(record, mode, installerOf(snapshot, resolution.task)); + reservations.push({ invocation, task: resolution.task, snapshot }); + } + }, this.#context); + } catch (error) { + for (const { invocation } of reservations) { + this.#invocations.delete(invocation.taskId); + this.#runnable.add(invocation.taskId); + invocation.finish(); + } + throw error; + } + for (const { record, message } of faulted) { + this.#report(new Error(message), { + kind: "task_faulted", + ...this.#aboutTask(recordTask(record)), + reason: "restart_limit" + }); + } + for (const id of abandoned) + this.#abandoned.delete(id); + if (abandoned.length > 0) + this.#dirty = true; + return reservations; + } + /** + * A reservation pass's decision region: the candidates it drops (gone, holding, waiting, asleep, or with an + * invocation), whether one waits for a cascade, and the runnable records to resolve. Iterating the candidates is not + * keyed: a pass that misses a task a pending commit makes runnable only delays it, as does skipping one with an + * invocation without reading its record, or a waiter's check whether what it waits on is still live. + */ + #planReservation() { + const dropped = []; + const ready = []; + let cascade = false; + for (const id of this.#runnable) { + if (this.#invocations.has(id)) { + dropped.push(id); + continue; + } + const record = this.#liveRecord(id); + if (record === void 0 || record.state.status === "completing" || this.#waitingOn(record, true).length > 0 || this.#notDue(record)) { + dropped.push(id); + continue; + } + if (!record.abortRequested && !record.background && this.#belowCancelled(parentOf(record))) { + cascade = true; + continue; + } + ready.push(record); + } + return { dropped, cascade, ready }; + } + /** + * Live tasks a task waits for before its next invocation: its live ordinary owned work when abort-marked, since + * abort runs bottom-up, otherwise the live part of the `on` of a wait. + */ + #waitingOn(record, first = false) { + if (record.abortRequested) + return this.#ownedLive(record.id, { first }); + if (record.state.status !== "waiting") + return []; + if (!first) + return record.state.on.filter((id) => this.#live.has(id)); + const live = record.state.on.find((id) => this.#live.has(id)); + return live === void 0 ? [] : [live]; + } + /** Resolve the record's definition by kind, migrating an older stored version. */ + #resolve(record, snapshot) { + const fit = this.#fit(record, snapshot.task(record.kind)); + if ("reason" in fit) + return { kind: "blocked", reason: fit.reason }; + if (!fit.migrates) + return { kind: "ready", task: fit.task, record }; + const definition = erased(fit.task); + try { + if (definition.migrate === void 0) + throw missingMigration(record, definition); + const migrated = definition.migrate(record.input, record.state.checkpoint, record.version); + const state2 = { ...record.state, checkpoint: copyJson(migrated.checkpoint) }; + const migratedRecord = { ...record, version: definition.version, input: copyJson(migrated.input), state: state2 }; + return { kind: "ready", task: fit.task, record: migratedRecord }; + } catch (error) { + this.#failedMigrations.set(record.id, { task: fit.task, error }); + queueMicrotask(() => this.#notifyBlocked()); + this.#scheduleWake(); + const extension = installerOf(snapshot, fit.task); + this.#report(error, { kind: "migration_failed", ...this.#aboutTask({ ...recordTask(record), extension }) }); + return { kind: "blocked", reason: "migration_failed" }; + } + } + #fit(record, task) { + if (task === void 0) + return { reason: "missing_task" }; + const version = task.definition.version; + if (version === record.version) + return { task, migrates: false }; + if (version < record.version) + return { reason: "task_too_old" }; + const failed = this.#failedMigrations.get(record.id); + if (failed?.task === task) + return { reason: "migration_failed", error: failed.error }; + return { task, migrates: true }; + } + /** Sizes of the ownership indexes, for tests that bound the scheduler's memory. */ + get indexSizes() { + let below = 0; + for (const children of this.#below.values()) + below += children.size; + return { + live: this.#live.size, + settled: this.#settled.size, + edges: this.#edges.size, + below, + roots: this.#roots.size, + unloaded: this.#unloaded.size, + dropQueue: this.#dropQueue.size, + pins: this.#pins.size + }; + } + /** + * The kept contexts' idle state, for tests (a diagnostic, computed on demand): how many are kept and how many are + * idle, how many disagree with a full recompute (an idle period without `#idle()`, or `#idle()` without one; an + * expiry order that differs from the idle periods, or is not sorted), and how many idle checks covered every scope. + */ + get idleState() { + let mismatches = 0; + let idle = 0; + for (const [conversationId, kept] of this.#contexts) { + if (kept.idleSince !== void 0) + idle++; + if (kept.idleSince !== void 0 !== this.#idle(conversationId)) + mismatches++; + if (this.#idleOrder.get(conversationId) !== kept.idleSince) + mismatches++; + } + let previous = Number.NEGATIVE_INFINITY; + for (const [conversationId, idleSince] of this.#idleOrder) { + if (idleSince < previous || this.#contexts.get(conversationId)?.idleSince !== idleSince) + mismatches++; + previous = idleSince; + } + return { + contexts: this.#contexts.size, + idleContexts: idle, + idleMismatches: mismatches, + fullIdleChecks: this.#fullIdleChecks + }; + } + /** + * Scheduling state and every live task with its derived state, read on the Session line. Runs no task code: a + * pending migration shows as `ready` with `migrates`, and only a migration the scheduler already tried, or one that + * cannot exist, shows as failed. + */ + async inspect(snapshot) { + await this.#published(); + await this.#loadScopes(false); + const tasks = []; + for (const record of this.#live.values()) + tasks.push({ record, state: this.#inspectTask(record, snapshot) }); + const scheduling = this.#closing ? "closing" : this.#enabled && !this.#held ? "running" : "paused"; + return { scheduling, tasks }; + } + #inspectTask(record, snapshot) { + if (this.#invocations.has(record.id)) + return { kind: "running" }; + if (record.state.status === "completing") + return { kind: "completing" }; + const on = this.#waitingOn(record); + if (on.length > 0) + return { kind: "waiting", on }; + if (this.#notDue(record)) + return { kind: "sleeping", until: record.state.until }; + const fit = this.#fit(record, snapshot.task(record.kind)); + if ("reason" in fit) + return { kind: "blocked", ...fit }; + if (fit.migrates && fit.task.definition.migrate === void 0) { + return { kind: "blocked", reason: "migration_failed", error: missingMigration(record, erased(fit.task)) }; + } + return { kind: "pending", migrates: fit.migrates }; + } + #createInvocation(record, mode, extension) { + const controller = new AbortController(); + const { promise: done, resolve: finish } = Promise.withResolvers(); + const invocation = { + taskId: record.id, + kind: record.kind, + extension, + conversationId: record.conversationId, + mode, + controller, + links: record.startedAt === void 0 ? record.links : void 0, + context: withAbortSignal(controller.signal, this.#context), + record, + watches: /* @__PURE__ */ new Set(), + timers: /* @__PURE__ */ new Set(), + ended: false, + done, + finish: () => finish() + }; + this.#invocations.set(record.id, invocation); + return invocation; + } + #start(reservation) { + const invocation = reservation.invocation; + void (async () => { + try { + if (invocation.mode === "run") + await this.#run(reservation); + else + await this.#runAbort(reservation); + } catch (error) { + this.#report(error, { kind: "task_error", ...this.#aboutTask(invocation) }, invocation.context); + } finally { + this.#end(invocation); + invocation.record = void 0; + invocation.links = void 0; + invocation.fault = void 0; + invocation.finish(); + this.#kick(); + } + })(); + } + /** Run phase handlers, each preceded by a step that decides on the line whether the invocation continues. */ + async #run(reservation) { + const invocation = reservation.invocation; + const state2 = { task: reservation.task, snapshot: reservation.snapshot, reported: void 0 }; + const phase = { snapshot: () => state2.snapshot, task: () => state2.task, agent: void 0 }; + const runtime = this.#runtime(invocation, phase); + const progress = (tx, current2) => this.#progress(tx, current2, state2, invocation.extension, invocation.context); + let current = await this.#step(invocation, (task) => this.#rules(task, void 0), progress); + while (current !== void 0 && !this.#closing) { + const task = current; + current = await this.#phase(invocation, task, async () => { + const checkpoint = task.state.checkpoint; + phase.agent = void 0; + let previous; + try { + await erased(state2.task).phases[checkpoint.phase](task, runtime, invocation.context); + previous = { checkpoint }; + } catch (error) { + previous = { checkpoint, failure: { error } }; + } + return this.#step(invocation, (next) => this.#rules(next, previous), progress); + }); + } + } + /** A phase owns its decision commit, not the next handler, a durable wait, or recovery. */ + #phase(invocation, task, run2) { + const parent2 = task.trace === void 0 ? this.#telemetry : this.#telemetry.propagation?.extract(task.trace) ?? this.#telemetry; + const checkpoint = task.state.checkpoint; + const attempt = checkpoint.attempt; + const resumed = this.#resumed.delete(task.id); + return createTypedSpanStarter(parent2, [DURABLE_TELEMETRY_SCHEMA])("pi.durable.phase", { + "task.id": task.id, + "task.name": task.kind, + phase: checkpoint.phase, + kind: invocation.mode, + resumed, + ...attempt === void 0 ? {} : { attempt } + }, async (span) => { + if (span.propagation !== void 0 && invocation.links !== void 0) { + for (const carrier of invocation.links) + span.addLink({ context: span.propagation.extract(carrier) }); + } + const previous = invocation.context; + invocation.context = withTelemetry(span, previous); + const started = performance.now(); + try { + return await run2(); + } finally { + invocation.context = previous; + const state2 = invocation.record.state; + const terminal = invocation.fault ?? (state2.status === "terminal" || state2.status === "completing" ? state2.outcome : void 0); + const outcome = terminal !== void 0 ? terminal.status === "completed" ? "done" : terminal.status === "aborted" ? "aborted" : "faulted" : state2.status === "waiting" || state2.status === "sleeping" ? state2.status : invocation.ended || this.#closing ? "aborted" : `next=${state2.checkpoint.phase}`; + span.setAttributes({ outcome }); + if (terminal?.status === "faulted" || terminal?.status === "failed" || terminal?.status === "orphaned") { + const message = terminal.status === "orphaned" ? terminal.reason : terminal.error.message; + span.setStatus({ + status: "error", + error: { name: `task_${terminal.status}`, message: ownedSlice2(message, 0, 500) } + }); + } else if (outcome === "aborted") { + span.setStatus({ status: "ok" }); + } + this.#durationMetric.record(performance.now() - started, { task: task.kind, phase: checkpoint.phase, outcome }, span); + } + }); + } + /** + * Precedence rules for a run invocation, a decision region of its step. Rules 1 (terminal, `completing`, `waiting`, or + * `sleeping`) and 2 (closing) are applied by `#step`. Progress (rule 5) is decided by `#progress()` once the decision + * stands, as it takes a registry snapshot. + */ + #rules(current, previous) { + if (current.abortRequested) + return END; + if (!current.background && this.#belowCancelled(parentOf(current))) + return CASCADE; + if (previous === void 0) + return CONTINUE; + if (previous.failure !== void 0) + return { kind: "fault", error: previous.failure.error }; + if (jsonEqual(current.state.checkpoint, previous.checkpoint)) { + const message = `Task ${current.kind} phase ${previous.checkpoint.phase} returned without durable progress`; + return { kind: "fault", error: new Error(message) }; + } + return PROGRESS; + } + /** + * Rule 5, progress: refresh the snapshot; hand over to a replacement definition that can take the task, writing it + * back as `pending`, or keep running under the old one, reported once per resolved definition. Returns whether the + * invocation continues. + */ + #progress(tx, current, state2, extension, context) { + if (this.#held) { + tx.setTask(withState(current, { status: "pending", checkpoint: current.state.checkpoint })); + return false; + } + state2.snapshot = this.#registry.snapshot(); + const next = state2.snapshot.task(current.kind); + if (next === state2.task) + return true; + if (next !== void 0 && canReserve(next, current)) { + tx.setTask(withState(current, { status: "pending", checkpoint: current.state.checkpoint })); + return false; + } + if (state2.reported === void 0 || state2.reported.task !== next) { + state2.reported = { task: next }; + this.#report(new Error(`Task ${current.id} keeps running under its old ${current.kind} definition`), { + kind: "task_outdated", + ...this.#aboutTask({ ...recordTask(current), extension }), + reason: outdatedReason(next, current) + }, context); + } + return true; + } + /** Run the abort handler once; rules 1, 2, and 4 apply, and returning without an outcome faults. */ + async #runAbort(reservation) { + const invocation = reservation.invocation; + const current = this.#live.get(invocation.taskId); + if (current === void 0 || this.#closing) + return; + await this.#phase(invocation, current, async () => { + let failure2; + try { + const phase = { + snapshot: () => reservation.snapshot, + task: () => reservation.task, + agent: void 0 + }; + const runtime = this.#runtime(invocation, phase); + await erased(reservation.task).abort(current, runtime, invocation.context); + } catch (error) { + failure2 = { error }; + } + const message = `Abort handler of task ${invocation.taskId} returned without a terminal outcome`; + await this.#step(invocation, () => ({ kind: "fault", error: failure2?.error ?? new Error(message) })); + }); + } + /** + * One decision on the Session line, before a phase: a decision region (`#region()`) that reads the task's record. A + * task that is no longer running (rule 1: terminal, `completing`, `waiting`, or `sleeping`) or a closing Harness (rule + * 2) ends the invocation without a write; otherwise `plan` decides, and a decision that stands is applied: the + * invocation continues, with `progress` for rule 5, or ends, with a fault written. Ending happens inside the callback, + * before a fault's Harness cleanup. A rejected step, such as admission after close, also ends the invocation. Its + * outcome goes to the invocation only, so it is a scheduler commit (`commitInternal()`). + */ + async #step(invocation, plan, progress) { + let fault; + try { + const continued = await this.#session.commitInternal(async (tx) => { + const decided = await this.#region(() => { + const found = this.#liveRecord(invocation.taskId); + if (found?.state.status !== "running" || this.#closing) + return { plan: END }; + const current2 = found; + return { current: current2, plan: plan(current2) }; + }); + const { current } = decided; + const step = decided.plan; + if (step.kind === "continue") + return current; + if (step.kind === "progress" && progress(tx, current)) + return current; + this.#end(invocation); + if (step.kind === "cascade") { + this.#cascadePending = true; + this.#scheduleReconcile(); + } + if (step.kind === "fault") { + fault = { error: step.error }; + const message = errorMessage(step.error); + invocation.fault = { status: "faulted", error: { message } }; + await this.#terminate(tx, current, invocation.fault); + } + return void 0; + }, withoutAbortSignal(invocation.context)); + if (fault !== void 0) + this.#report(fault.error, { kind: "task_faulted", ...this.#aboutTask(invocation), reason: "threw" }, invocation.context); + return continued; + } catch (error) { + this.#end(invocation); + this.#failSession(error, invocation.context); + return void 0; + } + } + /** + * Write an outcome the scheduler decided. While the task's ordinary owned work is live it holds as `completing` and + * its Harness cleanup waits for the final commit (spec §5.5, rule 4); otherwise it is terminal with its cleanup. + */ + async #terminate(tx, record, outcome) { + await this.#loadScopes(false); + if (await this.#region(() => this.#hasOwnedLive(record.id, overlayOf(tx)), this.#reloadScopes)) { + tx.setTask(withState(record, { status: "completing", outcome })); + return; + } + tx.setTask(withState(record, { status: "terminal", outcome })); + await this.#settleOutcome(tx, record, outcome); + } + /** + * Replace a running task's state with what it committed. A terminal state holds as `completing` while ordinary owned + * work is live, judged on the commit's candidates, so work the same commit creates below the task counts. A wait is + * validated first. + */ + async #commitState(tx, invocation, current, next) { + if (next.status === "waiting") + await this.#validateWait(tx, invocation, current, next.on, next.policy); + if (next.status === "sleeping") + validateSleep(invocation, current.id, next.until); + if (next.status === "terminal") { + const overlay = overlayOf(tx); + await this.#loadScopes(false); + for (const record of overlay.tasks.values()) + await this.#loadChain(parentOf(record), overlay); + if (await this.#region(() => this.#hasOwnedLive(current.id, overlayOf(tx)), this.#reloadScopes)) { + tx.setTask(withState(progressed(current), { status: "completing", outcome: next.outcome })); + return; + } + } + const same = jsonEqual(current.state, next); + tx.setTask(withState(same ? current : progressed(current), next)); + } + /** + * A wait names existing tasks, and `failFast` only tasks the waiter owns. It may not close a cycle in the wait-for + * graph, whose edges run from each task to what it waits on and to its live ordinary owned work (spec §5.5); waiting + * on itself or on an owner holding it are the shortest such cycles. An abort handler cannot wait. + * + * Invariant: the wait-for graph is acyclic. Only a wait adds an edge between existing tasks, as a new task has only + * incoming edges, so checking each wait maintains it. + */ + async #validateWait(tx, invocation, current, on, policy) { + if (invocation.mode === "abort") + throw new Error(`Abort handler of task ${current.id} cannot wait`); + await this.#loadScopes(false); + const ended = /* @__PURE__ */ new Map(); + for (; ; ) { + const checked = await this.#region(() => this.#checkWait(current, on, policy, overlayOf(tx), ended), this.#reloadScopes); + if (checked === void 0) + return; + if ("missing" in checked) { + for (const id of checked.missing) + ended.set(id, await this.#session.lineStorage.task(id, this.#context) ?? null); + continue; + } + throw checked.error; + } + } + /** + * `#validateWait()`'s decision region: why the wait is refused, `undefined` when it may be stored, or the tasks in + * `on` it needs from Storage first, when `ended` lacks them. + */ + #checkWait(current, on, policy, overlay, ended) { + const targets = []; + const missing = []; + for (const id of on) { + const member = overlay.tasks.get(id) ?? this.#liveRecord(id) ?? ended.get(id); + if (member === void 0) { + missing.push(id); + continue; + } + if (member === null) + return { error: new Error(`Task ${id} does not exist`) }; + if (policy === "failFast" && member.owner !== current.id) { + return { error: new Error(`Task ${current.id} can wait failFast only on tasks it owns; ${id} is not one`) }; + } + if (member.state.status !== "terminal" && member.owner !== current.id) + targets.push(id); + } + if (missing.length > 0) + return { missing }; + if (targets.length === 0) + return void 0; + const cycle = this.#waitCycle(current.id, targets, overlay); + if (cycle === void 0) + return void 0; + return { + error: new Error(`Task ${current.id} cannot wait on ${cycle[0]}: ${[current.id, ...cycle].join(" -> ")} is a wait cycle`) + }; + } + /** + * The path from a member of `on` back to `task` in the wait-for graph, if the wait would close a cycle (spec §5.1). + * An edge X -> Y means X cannot settle before Y: Y is in the `on` of waiting X that is not abort-marked, or Y is live + * ordinary owned work of X, which holds X as `completing`. Each task is visited once and each subtree walked once, + * so a check is bounded by the live work it reaches. Part of a decision region: it records every record it reads. + * Owned work is found by walks down, which need the chains of every live task loaded. + */ + #waitCycle(task, on, overlay) { + const from = /* @__PURE__ */ new Map(); + const walked = /* @__PURE__ */ new Set(); + const pending = []; + const reach = (id, via) => { + if (from.has(id)) + return; + from.set(id, via); + pending.push(id); + }; + const path5 = (end) => { + const steps = []; + for (let at = end; at !== void 0; at = from.get(at)) + steps.unshift(at); + return steps; + }; + for (const id of on) + reach(id, void 0); + for (let id = pending.pop(); id !== void 0; id = pending.pop()) { + if (id === task) + return path5(id); + const record = overlay.tasks.get(id) ?? this.#liveRecord(id); + if (record === void 0 || record.state.status === "terminal") + continue; + if (record.state.status === "waiting" && !record.abortRequested) { + for (const member of record.state.on) + reach(member, id); + } + if (walked.has(id)) + continue; + walked.add(id); + const found = []; + const walk = this.#walkDown(id, { overlay, enter: (below) => !walked.has(below) }); + for (const { id: below, node, live } of walk) { + if (live === void 0 || node.background) + continue; + found.push(below); + reach(below, id); + } + for (const below of found) + walked.add(below); + } + return void 0; + } + /** End an invocation: its runtime operations reject from now on, its signal aborts, its watches stop, and its task is free. */ + #end(invocation) { + if (invocation.ended) + return; + invocation.ended = true; + if (this.#invocations.get(invocation.taskId) === invocation) { + this.#invocations.delete(invocation.taskId); + if (this.#live.has(invocation.taskId)) + this.#runnable.add(invocation.taskId); + } + for (const watch of invocation.watches) + void watch.stop(); + for (const disarm of invocation.timers) + disarm(); + invocation.timers.clear(); + invocation.controller.abort(endedError(invocation)); + } + /** No live non-background task in the scope; a task whose owner edges are not loaded yet counts as inside. */ + #idle(conversationId) { + const scope = conversationId === void 0 ? { roots: true } : { conversation: conversationId }; + if (conversationId === void 0) + this.#record(ROOTS_KEY); + for (const id of this.#unloaded) { + const record = this.#live.get(id); + if (record !== void 0 && !record.background && this.#inScope(parentOf(record), scope) !== false) + return false; + } + const starts = conversationId === void 0 ? this.#roots : [conversationId]; + for (const start of starts) { + for (const { node, live } of this.#walkDown(conversationNode(start))) { + if (live !== void 0 && !node.background) + return false; + } + } + return true; + } + // ─── Invocation runtime ────────────────────────────────────────────────── + #runtime(invocation, phase) { + const agent = () => { + if (invocation.ended) + return Promise.reject(endedError(invocation)); + if (phase.agent === void 0) { + phase.agent = this.#agent(invocation.conversationId, phase.snapshot(), invocation.context); + phase.agent.catch(() => { + }); + } + return phase.agent; + }; + const hooks = { + each: async (name, invoke) => { + for (const { extension, handlers } of agentHooks(await agent(), phase.task().definition.name)) { + const handler = handlers[name]; + if (typeof handler !== "function") + continue; + try { + await invoke(handler.bind(handlers)); + } catch (error) { + if (invocation.controller.signal.aborted) + throw error; + this.#report(error, { kind: "extension_error", extension, task: reportTask(invocation) }, invocation.context); + } + } + } + }; + const settings = this.#settings; + const models3 = this.#models; + return { + taskId: invocation.taskId, + conversationId: invocation.conversationId, + signal: invocation.controller.signal, + get models() { + return models3(); + }, + agent: (context) => invocation.ended ? Promise.reject(endedError(invocation)) : awaitWithContext(agent(), context), + get settings() { + return settings(); + }, + env: (context) => this.#read(invocation, () => this.#env(invocation.conversationId, context)), + hooks, + get registry() { + return phase.snapshot(); + }, + commit: async (change, context, options) => { + let checkpoint; + let interrupted2; + await this.#gated(invocation, async (tx, current) => { + const next = await change(tx, current); + if (next !== void 0) + await this.#commitState(tx, invocation, current, next); + if (next?.status === "running" && current.state.checkpoint.phase !== next.checkpoint.phase) { + checkpoint = next.checkpoint.phase; + } + if (next?.status === "terminal") { + const restarts = current.restarts ?? 0; + const reason = next.outcome.status === "failed" ? interruptionOf(next.outcome.error) : void 0; + if (reason !== void 0 && next.outcome.status === "failed") { + interrupted2 = { message: next.outcome.error.message, reason, restarts }; + } else { + const message = endedByCrashesStates.get(next); + if (message !== void 0) + interrupted2 = { message, reason: "restart_limit", restarts }; + } + } + }, context, options); + if (interrupted2 !== void 0) { + this.#report(new Error(interrupted2.message), { + kind: "task_interrupted", + ...this.#aboutTask(invocation), + reason: interrupted2.reason, + restarts: interrupted2.restarts + }, invocation.context); + } + if (checkpoint !== void 0) { + invocation.context.telemetry.addEvent("pi.durable.checkpoint", { + phase: checkpoint + }); + } + }, + memo: ((name, ...rest) => { + if (rest.length === 1) { + return this.#read(invocation, async () => memoOf(this.#live.get(invocation.taskId), name)); + } + const candidate = rest[0]; + return this.#gated(invocation, (tx, current) => { + const winner = memoOf(current, name); + if (winner !== void 0) + return winner; + tx.setTask({ ...current, memos: { ...current.memos, [name]: candidate } }); + return candidate; + }, rest[1]); + }), + sleepUntil: (until, checkpoint, context) => this.#gated(invocation, (tx, current) => this.#commitState(tx, invocation, current, { status: "sleeping", checkpoint, until }), context), + watchDoc: ((...args) => this.#watchDoc(invocation, args)), + snapshot: ((...args) => this.#read(invocation, () => sessionMethod(this.#session, "snapshot")(...args))), + snapshotAsOf: ((...args) => this.#read(invocation, () => sessionMethod(this.#session, "snapshotAsOf")(...args))), + getTask: ((id, context) => this.#read(invocation, () => this.#session.readOnLine((storage2) => storage2.task(id, context)))), + waitForTask: ((id, context) => this.#read(invocation, () => this.waitForTask(id, withAbortSignal(invocation.controller.signal, context)))), + ownedTasks: (context) => this.#read(invocation, () => this.#session.readOnLine(async () => { + if (invocation.ended) + throw endedError(invocation); + context.abortSignal?.throwIfAborted(); + const owned = await this.#region(() => { + this.#record(ownedKey(invocation.taskId)); + const records = []; + for (const node of this.#below.get(invocation.taskId) ?? []) { + const record = typeof node === "string" ? void 0 : this.#liveRecord(node); + if (record?.owner === invocation.taskId) + records.push(record); + } + return records; + }); + return owned.sort((a, b) => a.id - b.id).map((record) => copyJson(record)); + })), + abortOwned: (id, context) => this.#read(invocation, async () => { + const bound = withAbortSignal(invocation.controller.signal, context); + const record = await this.#session.readOnLine((storage2) => storage2.task(id, bound)); + if (record?.owner !== invocation.taskId) { + throw new Error(`Task ${id} is not owned by task ${invocation.taskId}`); + } + if (record.state.status === "terminal") + return; + await this.abort(id, bound, true); + await this.waitForTask(id, bound); + }), + outcomes: ((ids, context) => this.#read(invocation, () => this.#session.readOnLine(async (storage2) => { + const outcomes = []; + for (const id of ids) { + const state2 = (await storage2.task(id, context))?.state; + if (state2?.status !== "terminal") + throw new Error(`Task ${id} is not terminal`); + outcomes.push(state2.outcome); + } + return outcomes; + }))), + conversation: (id, context) => this.#read(invocation, () => this.#conversation(id, { + signal: invocation.controller.signal, + check: () => { + if (invocation.ended) + throw endedError(invocation); + } + }, context)), + entry: ((...args) => { + const [token, id, context] = args.length === 2 ? [void 0, args[0], args[1]] : [args[0], args[1], args[2]]; + return this.#read(invocation, async () => { + const kept = this.#contexts.get(invocation.conversationId); + const entry2 = (kept === void 0 ? void 0 : rangeEntry(kept.range, id)) ?? (await this.#session.readOnLine((storage2) => storage2.entry(invocation.conversationId, id, context)))?.entry; + return token === void 0 || entry2?.kind === token.kind ? entry2 : void 0; + }); + }), + entries: (query, limit3, cursor, context) => this.#read(invocation, () => this.#session.readOnLine((storage2) => storage2.scanEntries(conversationEntries(invocation.conversationId, query), limit3, cursor, context))), + context: (conversationId, context, options) => this.#read(invocation, async () => { + const read2 = await readContextFrom(this.#session, this.#storage, conversationId, context, options?.at, this.#contexts.get(conversationId)?.range); + const { view: view2 } = read2; + const range = read2.range?.current === true && this.#session.knownLatestEntryId(conversationId) !== read2.range.bounds.tail ? { ...read2.range, current: false } : read2.range; + const kept = this.#contexts.get(conversationId); + if (range !== void 0 && !this.#closing && !invocation.ended && (kept === void 0 || kept.range.bounds.tail <= range.bounds.tail)) { + if (!this.#idle(conversationId)) { + this.#contexts.set(conversationId, { range, idleSince: void 0 }); + this.#idleOrder.delete(conversationId); + } else if (this.#contextRetentionMs() > 0) { + const idleSince = kept?.idleSince ?? this.#now(); + const expiresAt = kept?.idleSince !== void 0 && kept.expiresAt !== void 0 ? kept.expiresAt : idleSince + this.#contextRetentionMs(); + this.#contexts.set(conversationId, { range, idleSince, expiresAt }); + if (kept?.idleSince === void 0) + this.#markIdle(conversationId, idleSince); + this.#scheduleExpiry(); + } + } + return view2; + }), + now: () => { + if (invocation.ended) + throw endedError(invocation); + return this.#now(); + }, + setTimer: (callback, delayMs) => { + if (invocation.ended) + return () => { + }; + const disarm = this.#timers.foreground(() => { + invocation.timers.delete(disarm); + if (!invocation.ended) + callback(); + }, delayMs); + invocation.timers.add(disarm); + return () => { + invocation.timers.delete(disarm); + disarm(); + }; + }, + report: (error, from) => { + if (invocation.ended) + throw endedError(invocation); + const task = reportTask(invocation); + this.#report(error, from === void 0 ? { kind: "task_error", ...this.#aboutTask(invocation) } : from.kind === "extension" ? { kind: "extension_error", task, ...optionalExtension(from.extension) } : { kind: "host_error", callback: from.callback, task }, invocation.context); + } + }; + } + /** + * On the line: wait until every commit admitted before is published, for a decision that reads what cannot be keyed, + * every live task (open, inspection) or every task a conversation abort reaches. + */ + async #published() { + const gate = this.#session.touch(ALL_KEYS); + if (gate !== void 0) + await gate; + } + /** Run a committed-state read unless the invocation has ended. */ + async #read(invocation, read2) { + if (invocation.ended) + throw endedError(invocation); + return read2(); + } + /** Commit after rereading the task on the line and gating the invocation. */ + #gated(invocation, change, context, options) { + if (invocation.ended) + return Promise.reject(endedError(invocation)); + return this.#session.commitWith(async (tx) => { + if (invocation.ended) + throw endedError(invocation); + if (this.#closing) + throw closedError(this.#session); + const current = await this.#region(() => { + const found = this.#liveRecord(invocation.taskId); + if (found === void 0) + throw new Error(`Task ${invocation.taskId} is terminal`); + if (found.state.status !== "running") + throw new Error(`Task ${invocation.taskId} is ${found.state.status}`); + if (invocation.mode === "run" && found.abortRequested) { + throw new Error(`Task ${invocation.taskId} has a durable abort mark`); + } + return found; + }); + if (invocation.ended) + throw endedError(invocation); + return change(tx, current); + }, context, { conversationId: invocation.conversationId, taskId: invocation.taskId }, options); + } + async #watchDoc(invocation, args) { + if (invocation.ended) + throw endedError(invocation); + const watch = await sessionMethod(this.#session, "watchDoc")(...args); + if (watch === void 0) + return void 0; + if (invocation.ended) { + void watch.stop(); + throw endedError(invocation); + } + invocation.watches.add(watch); + void watch.closed.then(() => invocation.watches.delete(watch)); + return watch; + } +}; +var REGISTRY = { kind: "host_error", callback: "registry" }; +var SETTINGS = { kind: "host_error", callback: "settings" }; +var ON_WAKE = { kind: "host_error", callback: "onWake" }; +var TELEMETRY2 = { kind: "host_error", callback: "telemetry" }; +function installerOf(snapshot, task) { + if (task === void 0) + return void 0; + return snapshot.installed().findLast((installed) => installed.tasks?.includes(task) === true)?.name; +} +function reportTask(task) { + return { id: task.taskId, kind: task.kind, conversationId: task.conversationId }; +} +function recordTask(record) { + return { taskId: record.id, kind: record.kind, conversationId: record.conversationId }; +} +var endedByCrashesStates = /* @__PURE__ */ new WeakMap(); +function endedByCrashes(state2, message) { + endedByCrashesStates.set(state2, message); + return state2; +} +function interruptionOf(error) { + const detail = error.detail; + if (typeof detail !== "object" || detail === null || !("reason" in detail)) + return void 0; + return detail.reason === "restart_limit" || detail.reason === "interrupted" ? detail.reason : void 0; +} +function withAbortMark(record, reason) { + const { abortReason: _reason, restarts: _restarts, ...rest } = record; + return { ...rest, abortRequested: true, ...reason === void 0 ? {} : { abortReason: reason } }; +} +function cancellationIntent(record) { + return record.state.status !== "terminal" && (record.abortRequested || failedOutcome(record)); +} +function intentChanges(previous, next) { + return (previous?.abortRequested ?? false) !== next.abortRequested || previous?.abortReason !== next.abortReason || (previous !== void 0 && failedOutcome(previous)) !== failedOutcome(next) || (previous !== void 0 && cancellationIntent(previous)) !== cancellationIntent(next); +} +function failedOutcome(record) { + const state2 = record.state; + return (state2.status === "completing" || state2.status === "terminal") && state2.outcome.status !== "completed"; +} +function parentOf(node) { + return node.owner !== void 0 ? { task: node.owner } : { conversation: node.conversationId }; +} +function nodeOf(record) { + return { + conversationId: record.conversationId, + ...record.owner === void 0 ? {} : { owner: record.owner }, + background: record.background + }; +} +function overlayOf(tx) { + const tasks = new Map(tx.stagedTasks().map((record) => [record.id, record])); + const edges = new Map(tx.stagedConversations().map((record) => [record.id, record.owner?.taskId ?? null])); + return { tasks, edges }; +} +function addTo(map3, key, value2) { + const values = map3.get(key); + if (values === void 0) + map3.set(key, /* @__PURE__ */ new Set([value2])); + else + values.add(value2); +} +function deleteFrom(map3, key, value2) { + const values = map3.get(key); + if (values === void 0) + return; + values.delete(value2); + if (values.size === 0) + map3.delete(key); +} +function memoOf(record, name) { + const memos = record?.memos; + return memos !== void 0 && Object.hasOwn(memos, name) ? memos[name] : void 0; +} +function sessionMethod(session, name) { + return session[name].bind(session); +} +function missingMigration(record, definition) { + return new Error(`Task ${record.kind} version ${definition.version} has no migration from ${record.version}`); +} +function erased(task) { + return task.definition; +} +function endedError(invocation) { + return new Error(`Task ${invocation.taskId} invocation has ended`); +} +function progressed(record) { + if (record.restarts === void 0) + return record; + const { restarts: _restarts, ...rest } = record; + return rest; +} +function withState(record, state2) { + if (state2.status !== "terminal" && state2.status !== "completing") + return { ...record, state: state2 }; + const { memos: _memos, restarts: _restarts, ...rest } = record; + return { ...rest, state: state2 }; +} +function outdatedReason(task, record) { + if (task === void 0) + return "missing_task"; + return task.definition.version < record.version ? "task_too_old" : "migration_failed"; +} +function canReserve(task, record) { + const definition = task.definition; + return definition.version === record.version || definition.version > record.version && definition.migrate !== void 0; +} +function validateSleep(invocation, task, until) { + if (invocation.mode === "abort") + throw new Error(`Abort handler of task ${task} cannot sleep`); + if (typeof until !== "number" || !Number.isFinite(until) || until < 0) { + throw new Error(`Task ${task} cannot sleep until ${until}: not a time in milliseconds`); + } +} +function jsonEqual(left, right) { + if (left === right) + return true; + if (typeof left !== "object" || typeof right !== "object" || left === null || right === null) + return false; + if (Array.isArray(left) || Array.isArray(right)) { + if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) + return false; + return left.every((value2, index) => jsonEqual(value2, right[index])); + } + const keys = Object.keys(left); + if (keys.length !== Object.keys(right).length) + return false; + return keys.every((key) => Object.hasOwn(right, key) && jsonEqual(left[key], right[key])); +} // node_modules/@earendil-works/chord/dist/output.js +var NEWLINE = 10; +var INVALID_OUTPUT = /[\x00-\x08\x0b-\x1f\ufff9-\ufffb]/g; +var ESCAPE_SEQUENCE = /\x1b[\]PX^_][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\x20-\x2f]*[\x30-\x7e]/g; var encoder = new TextEncoder(); var decoder = new TextDecoder("utf-8", { ignoreBOM: true }); +function sanitizeOutput(text) { + return text.replace(ESCAPE_SEQUENCE, "").replace(INVALID_OUTPUT, ""); +} +function boundOutput(text, limits) { + const bytes2 = encoder.encode(text); + const [from, to] = limits.retain === "head" ? headRange(bytes2, limits) : tailRange(bytes2, limits); + const kept = bytes2.subarray(from, to); + return { + text: kept.length === bytes2.length ? text : decoder.decode(kept), + bytes: kept.length, + droppedBytes: bytes2.length - kept.length, + droppedLines: lineCount(bytes2) - lineCount(kept) + }; +} +function headRange(bytes2, limits) { + if (limits.maxLines === 0 || limits.maxBytes === 0) + return [0, 0]; + let end = bytes2.length; + let lines2 = 0; + for (let index = bytes2.indexOf(NEWLINE); index !== -1; index = bytes2.indexOf(NEWLINE, index + 1)) { + if (++lines2 === limits.maxLines) { + end = index + 1; + break; + } + } + if (end > limits.maxBytes) { + const newline = bytes2.lastIndexOf(NEWLINE, limits.maxBytes - 1); + end = newline === -1 ? characterEnd(bytes2, limits.maxBytes) : newline + 1; + } + return [0, end]; +} +function tailRange(bytes2, limits) { + if (limits.maxLines === 0 || limits.maxBytes === 0) + return [bytes2.length, bytes2.length]; + const last = bytes2[bytes2.length - 1] === NEWLINE ? bytes2.length - 2 : bytes2.length - 1; + let start = 0; + let lines2 = 1; + for (let index = last < 0 ? -1 : bytes2.lastIndexOf(NEWLINE, last); index !== -1; ) { + if (lines2 === limits.maxLines) { + start = index + 1; + break; + } + lines2++; + index = index === 0 ? -1 : bytes2.lastIndexOf(NEWLINE, index - 1); + } + if (bytes2.length - start > limits.maxBytes) { + const from = bytes2.length - limits.maxBytes; + const newline = bytes2.indexOf(NEWLINE, from - 1); + start = newline !== -1 && newline + 1 < bytes2.length ? newline + 1 : characterStart(bytes2, from); + } + return [start, bytes2.length]; +} function characterEnd(bytes2, index) { let end = index; while (end > 0 && ((bytes2[end] ?? 0) & 192) === 128) end--; return end; } +function characterStart(bytes2, index) { + let start = index; + while (start < bytes2.length && ((bytes2[start] ?? 0) & 192) === 128) + start++; + return start; +} +function lineCount(bytes2) { + if (bytes2.length === 0) + return 0; + let newlines = 0; + for (let index = bytes2.indexOf(NEWLINE); index !== -1; index = bytes2.indexOf(NEWLINE, index + 1)) + newlines++; + return newlines + (bytes2[bytes2.length - 1] === NEWLINE ? 0 : 1); +} +var OutputBuffer = class { + #limits; + /** + * Decoder of byte chunks. A string chunk or a skip ends an incomplete character of earlier bytes (it becomes U+FFFD); + * the next byte chunk then starts a new character. As in `StreamDecoder`, only a byte-order mark at the very start of + * the output is dropped, never a U+FEFF later in it. + */ + #decoder = new TextDecoder("utf-8", { ignoreBOM: true }); + #started = false; + /** Stored chunks: for head the start of the stream, for tail a suffix that still contains the next window. */ + #chunks = []; + #storedBytes = 0; + #storedNewlines = 0; + #full = false; + #totalBytes = 0; + #totalNewlines = 0; + #endsWithNewline = true; + constructor(limits) { + this.#limits = limits; + } + /** Bytes currently held; bounded by the limits plus one chunk. */ + get storedBytes() { + return this.#storedBytes; + } + /** + * Accept a chunk; returns whether anything was accepted. `skipped` is output omitted right before the chunk, which + * must be more than the tail window by at least one byte or line; only tail retention accepts it. + */ + push(chunk, skipped) { + const pending = typeof chunk === "string" || skipped !== void 0 ? this.#decoder.decode() : ""; + let text = typeof chunk === "string" ? chunk : this.#decoder.decode(chunk, { stream: true }); + const first = !this.#started && pending === "" && skipped === void 0; + if (pending !== "" || text !== "" || skipped !== void 0) + this.#started = true; + if (first && typeof chunk !== "string" && text.startsWith("\uFEFF")) + text = text.slice(1); + if (skipped === void 0) + return this.#accept(pending + text); + if (this.#limits.retain !== "tail") + throw new Error("Skipped output requires tail retention"); + this.#accept(pending); + this.#skip(skipped); + this.#accept(text); + return true; + } + /** Count omitted output; nothing stored before it can be in the window once the text after it arrives. */ + #skip(skipped) { + if (skipped.bytes === 0) + return; + this.#totalBytes += skipped.bytes; + this.#totalNewlines += skipped.newlines; + this.#endsWithNewline = skipped.endsWithNewline; + this.#chunks = []; + this.#storedBytes = 0; + this.#storedNewlines = 0; + } + /** Flush an incomplete trailing character as a replacement character; call when the stream ends. */ + end() { + this.#accept(this.#decoder.decode()); + } + #accept(text) { + if (text.length === 0) + return false; + const bytes2 = utf8ByteLength(text); + const newlines = countNewlines(text); + this.#totalBytes += bytes2; + this.#totalNewlines += newlines; + this.#endsWithNewline = text.endsWith("\n"); + if (this.#full) + return true; + this.#chunks.push({ text, bytes: bytes2, newlines }); + this.#storedBytes += bytes2; + this.#storedNewlines += newlines; + if (this.#limits.retain === "head") { + this.#full = this.#storedBytes > this.#limits.maxBytes || this.#storedNewlines >= this.#limits.maxLines; + return true; + } + while (this.#chunks.length > 1) { + const first = this.#chunks[0]; + const bytesAfter = this.#storedBytes - first.bytes; + const newlinesAfter = this.#storedNewlines - first.newlines; + if (bytesAfter <= this.#limits.maxBytes + 1 && newlinesAfter <= this.#limits.maxLines + 1) + break; + this.#chunks.shift(); + this.#storedBytes = bytesAfter; + this.#storedNewlines = newlinesAfter; + } + return true; + } + /** Retained, sanitized output and what the limits dropped from the whole stream. */ + snapshot() { + const stored = this.#chunks.length === 1 ? this.#chunks[0].text : this.#chunks.map((chunk) => chunk.text).join(""); + const kept = boundOutput(stored, this.#limits); + const storedLines = lines(this.#storedNewlines, stored === "" || stored.endsWith("\n")); + const keptLines = storedLines - kept.droppedLines; + if (this.#limits.retain === "tail" || this.#chunks.length > 1) { + const text = this.#limits.retain === "tail" ? tailMargin(stored, this.#limits) : stored; + const bytes2 = this.#limits.retain === "tail" ? utf8ByteLength(text) : this.#storedBytes; + this.#chunks = text === "" ? [] : [{ text, bytes: bytes2, newlines: countNewlines(text) }]; + this.#storedBytes = bytes2; + this.#storedNewlines = this.#chunks[0]?.newlines ?? 0; + } + return { + text: sanitizeOutput(kept.text), + droppedBytes: this.#totalBytes - kept.bytes, + droppedLines: lines(this.#totalNewlines, this.#endsWithNewline) - keptLines + }; + } +}; +function tailMargin(text, limits) { + const bytes2 = encoder.encode(text); + const byteStart = bytes2.length > limits.maxBytes ? characterEnd(bytes2, bytes2.length - limits.maxBytes - 1) : 0; + let lineStart = 0; + let newlines = 0; + for (let index = bytes2.lastIndexOf(NEWLINE); index !== -1; index = bytes2.lastIndexOf(NEWLINE, index - 1)) { + if (++newlines > limits.maxLines) { + lineStart = index; + break; + } + if (index === 0) + break; + } + const start = Math.max(byteStart, lineStart); + return start === 0 ? text : decoder.decode(bytes2.subarray(start)); +} +function lines(newlines, terminated) { + return newlines + (terminated ? 0 : 1); +} var runtimeBuffer = globalThis.Buffer; var nonAsciiPattern = /[^\x00-\x7f]/; function utf8ByteLength(content) { @@ -41479,7 +55086,649 @@ function utf8ByteLength(content) { } return bytes2; } +function countNewlines(text) { + let count = 0; + for (let index = text.indexOf("\n"); index !== -1; index = text.indexOf("\n", index + 1)) + count++; + return count; +} var PROGRESS_BYTES_PER_SECOND = 100 * 1024; +var SYSTEM_CLOCK = { + now: () => Date.now(), + setTimer: (callback, delayMs) => { + const timer = setTimeout(callback, delayMs); + return () => clearTimeout(timer); + } +}; +var Progress = class { + #write; + #onError; + #minIntervalMs; + #clock; + #waiters = []; + #timer; + #inFlight; + #nextAt = 0; + #dirty = false; + #stopped = false; + constructor(write, onError, minIntervalMs, clock = SYSTEM_CLOCK) { + this.#write = write; + this.#onError = onError; + this.#minIntervalMs = minIntervalMs; + this.#clock = clock; + } + /** Schedule a commit. */ + mark() { + this.#dirty = true; + this.#schedule(); + } + /** Schedule a commit; the promise settles with the commit that includes this change. */ + markAndWait() { + const waiter = Promise.withResolvers(); + this.#waiters.push(waiter); + this.mark(); + return waiter.promise; + } + /** Stop committing and wait for the commit in flight; returns the waiters the final commit must settle. */ + async stop() { + this.#stopped = true; + this.#timer?.(); + this.#timer = void 0; + await this.#inFlight; + return this.#waiters.splice(0); + } + #schedule() { + if (this.#stopped || this.#timer !== void 0 || this.#inFlight !== void 0) + return; + const wait = this.#nextAt - this.#clock.now(); + if (wait <= 0) + this.#flush(); + else + this.#timer = this.#clock.setTimer(() => { + this.#timer = void 0; + this.#schedule(); + }, wait); + } + #flush() { + if (this.#stopped || !this.#dirty) + return; + this.#dirty = false; + const waiters = this.#waiters.splice(0); + const started = this.#clock.now(); + this.#inFlight = this.#write().then((bytes2) => { + this.#nextAt = started + Math.max(this.#minIntervalMs, bytes2 * 1e3 / PROGRESS_BYTES_PER_SECOND); + for (const waiter of waiters) + waiter.resolve(); + }, (error) => { + this.#nextAt = started + this.#minIntervalMs; + for (const waiter of waiters) + waiter.reject(error); + this.#onError(error); + }).finally(() => { + this.#inFlight = void 0; + if (this.#dirty) + this.#schedule(); + }); + } +}; + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/date.js +var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; +function IsLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} +function IsDate(value2) { + const matches = DATE.exec(value2); + if (!matches) + return false; + const year = +matches[1]; + const month = +matches[2]; + const day = +matches[3]; + return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/time.js +var TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/; +function IsTime(value2, strictTimeZone = true) { + const matches = TIME.exec(value2); + if (!matches) + return false; + if (strictTimeZone && !matches[4] && !matches[5]) + return false; + const hr = +matches[1]; + const min = +matches[2]; + const sec = +matches[3]; + if (hr > 23 || min > 59 || sec > 60) + return false; + if (matches[5]) { + const tzH2 = +matches[6]; + const tzM2 = +matches[7]; + if (tzH2 > 23 || tzM2 > 59) + return false; + } + if (sec < 60) + return true; + const tzSign = matches[5] === "-" ? -1 : 1; + const tzH = +(matches[6] || 0); + const tzM = +(matches[7] || 0); + const totalUtcMin = hr * 60 + min - tzSign * (tzH * 60 + tzM); + return (totalUtcMin % 1440 + 1440) % 1440 === 1439; +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/date_time.js +function IsDateTime(value2) { + const dateTime = value2.split(/T/i); + return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/duration.js +var Duration = /^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/; +function IsDuration(value2) { + return Duration.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/email.js +var Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i; +function IsEmail(value2) { + return Email.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/pattern/pattern.js +var RE_RULE_HYPHEN_PLACEMENT = /^(?!-).*(? regexp.source).join("|"), "u"); +var RE_PERMITTED_CATEGORY = new RegExp([ + RE_LETTER, + RE_EUROPEAN_SEPARATOR, + RE_COMMON_SEPARATOR, + RE_NUMBER_DECIMAL, + RE_MARK_NONSPACING, + RE_MARK_SPACING_COMBINING, + RE_CONTEXTO_EXCEPTIONS, + RE_PVALID_EXCEPTIONS +].map((regexp) => regexp.source).join("|"), "u"); + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/ascii.js +function IsAsciiLabel(value2) { + return RE_RULE_HYPHEN_PLACEMENT.test(value2) && RE_RULE_NOT_RESERVED_ACE.test(value2) && RE_ASCII_LDH.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/puny.js +var PUNYCODE_BASE = 36; +var PUNYCODE_TMIN = 1; +var PUNYCODE_TMAX = 26; +var PUNYCODE_SKEW = 38; +var PUNYCODE_DAMP = 700; +var PUNYCODE_INITIAL_BIAS = 72; +var PUNYCODE_INITIAL_N = 128; +function ThrowDontCare() { + throw null; +} +function IsAcePrefixed(value2) { + return value2.toLowerCase().startsWith("xn--"); +} +function Adapt(delta, numPoints, firstTime) { + delta = firstTime ? Math.floor(delta / PUNYCODE_DAMP) : delta >> 1; + delta += Math.floor(delta / numPoints); + let k = 0; + while (delta > (PUNYCODE_BASE - PUNYCODE_TMIN) * PUNYCODE_TMAX >> 1) { + delta = Math.floor(delta / (PUNYCODE_BASE - PUNYCODE_TMIN)); + k += PUNYCODE_BASE; + } + return k + Math.floor((PUNYCODE_BASE - PUNYCODE_TMIN + 1) * delta / (delta + PUNYCODE_SKEW)); +} +function Decode(value2) { + const output = []; + let n = PUNYCODE_INITIAL_N; + let i = 0; + let bias = PUNYCODE_INITIAL_BIAS; + const delimIdx = value2.lastIndexOf("-"); + if (delimIdx > 0) { + for (let j = 0; j < delimIdx; j++) { + const cp = value2.charCodeAt(j); + if (cp >= 128) + ThrowDontCare(); + output.push(cp); + } + } + let inIdx = delimIdx < 0 ? 0 : delimIdx + 1; + while (inIdx < value2.length) { + const oldi = i; + let w = 1; + let k = PUNYCODE_BASE; + while (true) { + if (inIdx >= value2.length) + ThrowDontCare(); + const ch = value2.charCodeAt(inIdx++); + let digit; + if (ch >= 97 && ch <= 122) + digit = ch - 97; + else if (ch >= 48 && ch <= 57) + digit = ch - 48 + 26; + else + ThrowDontCare(); + i += digit * w; + const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias; + if (digit < t) + break; + w *= PUNYCODE_BASE - t; + k += PUNYCODE_BASE; + } + const outLen = output.length + 1; + bias = Adapt(i - oldi, outLen, oldi === 0); + n += Math.floor(i / outLen); + i %= outLen; + output.splice(i, 0, n); + i++; + } + return String.fromCodePoint(...output); +} +function DigitToChar(digit) { + return digit < 26 ? String.fromCharCode(digit + 97) : String.fromCharCode(digit - 26 + 48); +} +var RE_REPLACE_NON_ASCII = new RegExp(RE_NON_ASCII.source, "gu"); +function Encode(input) { + const basic = input.replace(RE_REPLACE_NON_ASCII, ""); + const basicLength = basic.length; + const result = basicLength > 0 ? [basic, "-"] : []; + const codePoints2 = Array.from(input, (char) => char.codePointAt(0)); + let n = PUNYCODE_INITIAL_N; + let delta = 0; + let bias = PUNYCODE_INITIAL_BIAS; + let handledCPCount = basicLength; + while (handledCPCount < codePoints2.length) { + let m = Infinity; + for (const cp of codePoints2) { + if (cp >= n && cp < m) + m = cp; + } + delta += (m - n) * (handledCPCount + 1); + n = m; + for (const cp of codePoints2) { + if (cp < n) + delta++; + if (cp === n) { + let q = delta; + for (let k = PUNYCODE_BASE; ; k += PUNYCODE_BASE) { + const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias; + if (q < t) + break; + const digit = t + (q - t) % (PUNYCODE_BASE - t); + result.push(DigitToChar(digit)); + q = Math.floor((q - t) / (PUNYCODE_BASE - t)); + } + result.push(DigitToChar(q)); + bias = Adapt(delta, handledCPCount + 1, handledCPCount === basicLength); + delta = 0; + handledCPCount++; + } + } + delta++; + n++; + } + return result.join(""); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/bidi.js +var RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/; +var RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/; +var RE_RTL_CLASSES = /^(?:R|AL|AN)$/; +function HasBidiChars(value2) { + if (IsAcePrefixed(value2)) { + try { + return HasRightToLeftCharacters(Decode(value2.slice(4).toLowerCase())); + } catch { + return false; + } + } + return HasRightToLeftCharacters(value2); +} +function GetBidiClass(codePoint) { + const char = String.fromCodePoint(codePoint); + return RE_EUROPEAN_NUMBER.test(char) ? "EN" : RE_ARABIC_INDIC_DIGIT.test(char) ? "AN" : ( + // Pattern.RE_EUROPEAN_SEPARATOR.test(char) ? 'ES' : // (no-spec-coverage) + // Pattern.RE_COMMON_SEPARATOR.test(char) ? 'CS' : // (no-spec-coverage) + RE_MARK_NONSPACING.test(char) ? "NSM" : RE_SCRIPT_HEBREW.test(char) ? "R" : RE_SCRIPT_ARABIC_LETTER.test(char) ? "AL" : RE_LETTER.test(char) ? "L" : "ON" + ); +} +function HasRightToLeftCharacters(value2) { + for (const ch of value2) + if (RE_RTL_CLASSES.test(GetBidiClass(ch.codePointAt(0)))) + return true; + return false; +} +function SatisfiesBidiRule(value2) { + let isRtl = false; + let allowed = RE_LTR_ALLOWED; + let sawEN = false; + let sawAN = false; + let isFirst = true; + for (const ch of value2) { + const bidiClass = GetBidiClass(ch.codePointAt(0)); + if (isFirst) { + if (bidiClass !== "L" && bidiClass !== "R" && bidiClass !== "AL") + return false; + isRtl = bidiClass === "R" || bidiClass === "AL"; + allowed = isRtl ? RE_RTL_ALLOWED : RE_LTR_ALLOWED; + isFirst = false; + } + if (!allowed.test(bidiClass)) + return false; + if (bidiClass === "EN") + sawEN = true; + else if (bidiClass === "AN") + sawAN = true; + } + if (isRtl && sawEN && sawAN) + return false; + return true; +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/unicode.js +function ExceedsMaxALabelLength(value2) { + return RE_NON_ASCII.test(value2) && Encode(value2).length + 4 > 63; +} +function HasInvalidHyphens(chars) { + if (chars[0] === "-" || chars[chars.length - 1] === "-") + return true; + return chars.slice(2).join("").startsWith("--"); +} +function IsUnicodeLabel(value2) { + if (ExceedsMaxALabelLength(value2)) + return false; + if (HasRightToLeftCharacters(value2) && !SatisfiesBidiRule(value2)) + return false; + const chars = [...value2]; + const codePoints2 = chars.map((c) => c.codePointAt(0)); + const length = codePoints2.length; + if (HasInvalidHyphens(chars)) + return false; + if (RE_COMBINING_MARK.test(chars[0])) + return false; + let hasJapanese = false; + for (let i = 0; i < length; i++) { + const codePoint = codePoints2[i]; + const char = chars[i]; + if (RE_RFC5892_DISALLOWED.test(char)) + return false; + if (!RE_PERMITTED_CATEGORY.test(char)) + return false; + if (RE_SCRIPT_JAPANESE.test(char)) + hasJapanese = true; + const prev = codePoints2[i - 1], next = codePoints2[i + 1]; + switch (codePoint) { + case 183: + if (prev !== 108 || next !== 108) + return false; + break; + // MIDDLE DOT (Catalan) + case 885: + if (!next || !RE_SCRIPT_GREEK.test(chars[i + 1])) + return false; + break; + // Greek KERAIA + case 1523: + case 1524: + if (!prev || !RE_SCRIPT_HEBREW.test(chars[i - 1])) + return false; + break; + // Hebrew GERESH + case 8204: + if (!prev || prev < 128 && !RE_VIRAMA.test(chars[i - 1])) + return false; + break; + case 8205: + if (!prev || !RE_VIRAMA.test(chars[i - 1])) + return false; + break; + case 12539: + break; + } + } + if (value2.includes("\u30FB") && !hasJapanese) + return false; + return true; +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/puny.js +function IsPunyLabel(value2) { + if (!IsAcePrefixed(value2)) + return false; + try { + const body = value2.slice(4).toLowerCase(); + if (body.lastIndexOf("-") === 0) + return false; + const decoded = Decode(body); + if (!RE_NON_ASCII.test(decoded)) + return false; + return IsUnicodeLabel(decoded); + } catch { + return false; + } +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/hostname.js +function IsValidLabelLength(value2) { + return value2.length > 0 && value2.length <= 63; +} +function IsLabel(value2) { + return IsValidLabelLength(value2) && (IsPunyLabel(value2) || IsAsciiLabel(value2)); +} +function IsHostname(value2) { + if (value2.length === 0 || value2.length > 253) + return false; + if (value2.charCodeAt(value2.length - 1) === 46) + return false; + return value2.split(".").every((label) => IsLabel(label)); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/idn-hostname.js +function IsValidLabelLength2(value2) { + return value2.length > 0 && value2.length <= 63; +} +function IsLabel2(value2) { + return IsValidLabelLength2(value2) && (IsPunyLabel(value2) || IsUnicodeLabel(value2)); +} +function NormalizeHostname(value2) { + return value2.replace(/[\uff01-\uff5e]/g, (char) => String.fromCharCode(char.charCodeAt(0) - 65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu, "").replace(/[\u002E\u3002\uFF0E\uFF61]/g, "."); +} +function IsIdnHostname(value2) { + if (value2.length === 0 || value2.includes(" ")) + return false; + const normalized = NormalizeHostname(value2); + if (normalized.length > 253) + return false; + const labels = normalized.split("."); + const hasBidiChars = labels.some((label) => HasBidiChars(label)); + return labels.every((label) => IsLabel2(label) && (!hasBidiChars || SatisfiesBidiRule(label))); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/hostname.js +function IsHostname2(value2) { + return IsHostname(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idn_email.js +var IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?^`{|}\\]/; +var InvalidPercentEncoding = /%(?![0-9a-fA-F]{2})/; +function NarrowIpvFuture(value2) { + return value2.length < IpvFutureMatchMaxLength ? value2.replace(IpvFutureMatch, "[::1]") : value2; +} +function IsIri(value2) { + if (InvalidIriChars.test(value2)) + return false; + if (InvalidPercentEncoding.test(value2)) + return false; + return URL.canParse(NarrowIpvFuture(value2)); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/iri_reference.js +var InvalidIriChars2 = /[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/; +var MalformedScheme = /^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//; +function IsIriReference(value2) { + return !InvalidIriChars2.test(value2) && !MalformedScheme.test(value2) && URL.canParse(value2, "http://example.com"); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer.js +var JsonPointer = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +function IsJsonPointer(value2) { + return JsonPointer.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer_uri_fragment.js +var JsonPointerUriFragment = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +function IsJsonPointerUriFragment(value2) { + return JsonPointerUriFragment.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/regex.js +function IsRegex(value2) { + try { + new RegExp(value2, "u"); + return true; + } catch { + return false; + } +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/relative_json_pointer.js +var RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; +function IsRelativeJsonPointer(value2) { + return RelativeJsonPointer.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri.js +var Uri = /^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; +function IsUri(value2) { + return Uri.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_reference.js +var UriReference = /^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; +function IsUriReference(value2) { + return UriReference.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_template.js +var UriTemplate = /^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i; +function IsUriTemplate(value2) { + return UriTemplate.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/url.js +function IsUrl(value2) { + return URL.canParse(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uuid.js +var Uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +function IsUuid(value2) { + return Uuid.test(value2); +} + +// node_modules/@earendil-works/pi-schema/dist/formats/index.js +var formats = Object.freeze({ + date: IsDate, + "date-time": IsDateTime, + duration: IsDuration, + email: IsEmail, + hostname: IsHostname2, + "idn-email": IsIdnEmail, + "idn-hostname": IsIdnHostname2, + ipv4: IsIPv4, + ipv6: IsIPv6, + iri: IsIri, + "iri-reference": IsIriReference, + "json-pointer": IsJsonPointer, + "json-pointer-uri-fragment": IsJsonPointerUriFragment, + regex: IsRegex, + "relative-json-pointer": IsRelativeJsonPointer, + time: IsTime, + uri: IsUri, + "uri-reference": IsUriReference, + "uri-template": IsUriTemplate, + url: IsUrl, + uuid: IsUuid +}); + +// node_modules/@earendil-works/pi-ai/dist/utils/validation.js +var validatorCache = /* @__PURE__ */ new WeakMap(); +function getValidator(schema4) { + const cached = validatorCache.get(schema4); + if (cached) { + return cached; + } + const validator = compile(schema4, { formats, coerce: true, unresolvedRefs: "reject" }); + validatorCache.set(schema4, validator); + return validator; +} +function formatValidationPath(pointer2) { + if (pointer2 === "") + return "root"; + return pointer2.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join("."); +} +function validateToolArguments(tool, toolCall) { + if (toolCall.argumentsError) { + throw new Error(`Invalid arguments for tool "${toolCall.name}": ${toolCall.argumentsError}`); + } + const result = getValidator(tool.parameters).parse(structuredClone(toolCall.arguments)); + if (result.ok) { + return result.value; + } + const errors = result.errors.map((error) => ` - ${formatValidationPath(error.path)}: ${error.message}`).join("\n"); + const errorMessage2 = `Validation failed for tool "${toolCall.name}": +${errors} + +Received arguments: +${JSON.stringify(toolCall.arguments, null, 2)}`; + throw new Error(errorMessage2); +} // node_modules/@earendil-works/pi-durable/dist/truncate.js var DEFAULT_MAX_LINES = 2e3; @@ -41487,10 +55736,10 @@ var DEFAULT_MAX_BYTES = 50 * 1024; function splitLinesForCounting(content) { if (content.length === 0) return []; - const lines = content.split("\n"); + const lines2 = content.split("\n"); if (content.endsWith("\n")) - lines.pop(); - return lines; + lines2.pop(); + return lines2; } function formatSize(bytes2) { if (bytes2 < 1024) { @@ -41505,7 +55754,7 @@ function truncateHeadOf(prefix, totals, options = {}) { const maxLines = options.maxLines ?? DEFAULT_MAX_LINES; const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES; const totalBytes = totals.bytes; - const lines = splitLinesForCounting(prefix); + const lines2 = splitLinesForCounting(prefix); const totalLines = totals.lines; if (totalLines <= maxLines && totalBytes <= maxBytes) { return { @@ -41522,7 +55771,7 @@ function truncateHeadOf(prefix, totals, options = {}) { maxBytes }; } - const firstLineBytes = utf8ByteLength(lines[0]); + const firstLineBytes = utf8ByteLength(lines2[0]); if (firstLineBytes > maxBytes) { return { content: "", @@ -41541,8 +55790,8 @@ function truncateHeadOf(prefix, totals, options = {}) { const outputLinesArr = []; let outputBytesCount = 0; let truncatedBy = "lines"; - for (let i = 0; i < lines.length && i < maxLines; i++) { - const line = lines[i]; + for (let i = 0; i < lines2.length && i < maxLines; i++) { + const line = lines2[i]; const lineBytes = utf8ByteLength(line) + (i > 0 ? 1 : 0); if (outputBytesCount + lineBytes > maxBytes) { truncatedBy = "bytes"; @@ -41570,6 +55819,2262 @@ function truncateHeadOf(prefix, totals, options = {}) { }; } +// node_modules/@earendil-works/pi-durable/dist/harness/usage.js +var UsageDoc = defineDoc({ + kind: "pi.usage", + version: 1, + scope: "conversation", + history: "latest", + fork: "initial", + initial: () => ({ models: {}, tools: {} }), + checkpointWhen: () => true +}); +async function recordUsage(tx, conversationId, bucket, key, usage) { + const totals = (await tx.doc(UsageDoc, conversationId))[bucket]; + const total = Object.hasOwn(totals, key) ? totals[key] : void 0; + if (total === void 0) + totals[key] = copyJson(usage, { omitUndefinedProperties: true }); + else + addUsage(total, usage); +} +function addUsage(total, usage) { + total.input += usage.input; + total.output += usage.output; + total.cacheRead += usage.cacheRead; + total.cacheWrite += usage.cacheWrite; + total.totalTokens += usage.totalTokens; + if (usage.cacheWrite1h !== void 0) + total.cacheWrite1h = (total.cacheWrite1h ?? 0) + usage.cacheWrite1h; + if (usage.reasoning !== void 0) + total.reasoning = (total.reasoning ?? 0) + usage.reasoning; + total.cost.input += usage.cost.input; + total.cost.output += usage.cost.output; + total.cost.cacheRead += usage.cost.cacheRead; + total.cost.cacheWrite += usage.cost.cacheWrite; + total.cost.total += usage.cost.total; +} +function addUsageState(sum, state2) { + for (const bucket of ["models", "tools"]) { + for (const [key, usage] of Object.entries(state2[bucket])) { + const total = Object.hasOwn(sum[bucket], key) ? sum[bucket][key] : void 0; + if (total !== void 0) + addUsage(total, usage); + else + Object.defineProperty(sum[bucket], key, { + value: structuredClone(usage), + enumerable: true, + writable: true + }); + } + } +} + +// node_modules/@earendil-works/pi-durable/dist/harness/tool.js +var MADE_NESTED_CALLS = "pi.tool.madeNestedCalls"; +var NestedCallDoc = defineDocFamily({ + kind: "pi.tool.nested-call", + version: 1, + scope: "task", + family: true, + initial: () => ({}), + // The document retires with its task. + checkpointWhen: () => false +}); +var ToolTask = defineTask({ + name: "pi.tool", + version: 3, + initial: () => ({ phase: "call" }), + // Version 1 had only model-issued calls, without `kind`; version 3 added `unoffered`, absent in version 2 inputs. + migrate: (input, checkpoint, fromVersion) => ({ + input: fromVersion === 1 ? { kind: "model", ...input } : input, + checkpoint + }), + phases: { + call: async (task, runtime, context) => { + const call = await readCall(runtime, task.input, context); + if (cutOffTooOften(task, runtime)) + return endCutOff(runtime, task, call, context); + const tool = isUnoffered(task.input) ? void 0 : await resolveTool(runtime, task.input, call.name, context); + if (tool === void 0) { + const error = harnessError("tool_unavailable", `Tool ${call.name} is not available`); + return reject(runtime, task.input, call, void 0, error, context); + } + const prepared = prepare(tool, call.arguments); + const checked = "error" in prepared ? prepared : validate(tool, call, prepared.args); + if ("error" in checked) + return reject(runtime, task.input, call, tool, invalid(checked.error), context); + let args = checked.args; + let block; + await runtime.hooks.each("beforeTool", async (hook2) => { + if (block !== void 0) + return; + try { + const decision = await hook2({ ...call, arguments: args }, runtime, context); + if (decision?.block !== void 0) + block = decision.block; + else if (decision?.arguments !== void 0) + args = decision.arguments; + } catch (error) { + if (runtime.signal.aborted) + throw error; + block = errorMessage(error); + } + }); + if (block !== void 0) { + const blocked = harnessError("blocked", `Tool call blocked: ${block}`); + return reject(runtime, task.input, call, tool, blocked, context); + } + const validated = validate(tool, call, args); + if ("error" in validated) + return reject(runtime, task.input, call, tool, invalid(validated.error), context); + const final = copyJson(validated.args, { omitUndefinedProperties: true }); + await runtime.commit(async (tx) => { + const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + if (slot !== void 0) + slot.status = "running"; + if (slot !== void 0 && "parentTaskId" in slot) + slot.arguments = final; + return void 0; + }, context, PROGRESS_COMMIT); + await runtime.commit(() => { + const intent = { phase: "execute", arguments: final, replay: tool.replay ?? "unsafe" }; + return { status: "running", checkpoint: intent }; + }, context); + await run(runtime, task.input, call, tool, final, context); + }, + /** Recovery after intent: rerun only when the stored and the current policy both say `safe`. */ + execute: async (task, runtime, context) => { + const { arguments: args, replay } = task.state.checkpoint; + const call = await readCall(runtime, task.input, context); + if (cutOffTooOften(task, runtime)) + return endCutOff(runtime, task, call, context); + const tool = await resolveTool(runtime, task.input, call.name, context); + if (replay === "safe" && tool?.replay === "safe") { + await runtime.commit(async (tx) => { + const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + if (slot !== void 0) { + clearProgress(slot); + slot.status = "running"; + if ("parentTaskId" in slot) + slot.arguments = args; + } + return void 0; + }, context); + return run(runtime, task.input, call, tool, args, context); + } + const message = `Tool ${call.name} was interrupted and may have partially run`; + const ending = { status: "failed", message }; + await settleFromSlot(runtime, task.input, call, { tool }, ending, "interrupted", message, context); + } + }, + abort: async (task, runtime, context) => { + const call = await readCall(runtime, task.input, context); + const [code, message] = isUnoffered(task.input) ? ["tool_unavailable", `Tool ${call.name} is not available`] : task.abortReason !== "restart" ? ["aborted", `Tool ${call.name} was aborted`] : task.state.checkpoint.phase === "execute" ? ["interrupted", `Tool ${call.name} was interrupted by a restart and may have partially run`] : ["abandoned", `Tool ${call.name} was not started: its caller ended with a restart`]; + const hooks = (task.restarts ?? 0) < runtime.settings.restartLimit - 1 ? { tool: await toolForLimits(runtime, task.input, call.name, context) } : void 0; + await settleFromSlot(runtime, task.input, call, hooks, { status: "aborted" }, code, message, context); + } +}); +async function endCutOff(runtime, task, call, context) { + const message = `Tool ${call.name} was interrupted ${cutOffCount(task)}; it is not run again`; + const ending = { status: "failed", message, reason: "restart_limit" }; + const hooks = salvageable(task, runtime) ? { tool: await toolForLimits(runtime, task.input, call.name, context) } : void 0; + await settleFromSlot(runtime, task.input, call, hooks, ending, "restart_limit", message, context); +} +async function reject(runtime, input, call, tool, result, context) { + const settled = await afterHarnessResult(runtime, input, call, tool, result, void 0, context); + await settle2(runtime, input, call, COMPLETED, settled, context); +} +async function settleFromSlot(runtime, input, call, hooks, ending, code, message, context) { + const live = await runtime.snapshot(LiveDoc, runtime.conversationId, context); + const { result, truncation } = fromSlot(live === void 0 ? void 0 : toolSlot(live, runtime.taskId), code, message); + const settled = hooks !== void 0 ? await afterHarnessResult(runtime, input, call, hooks.tool, result, truncation, context) : truncation === void 0 ? result : { ...result, diagnostics: [...result.diagnostics ?? [], truncation] }; + await settle2(runtime, input, call, ending, settled, context); +} +async function toolForLimits(runtime, input, name, context) { + if (isUnoffered(input)) + return void 0; + return resolveTool(runtime, input, name, context).catch(() => void 0); +} +function isUnoffered(input) { + return input.kind === "model" && input.unoffered === true; +} +async function resolveTool(runtime, input, name, context) { + const agent = await runtime.agent(context); + return (input.kind === "model" ? agent.tools : agent.callable).find((tool) => tool.name === name); +} +function outputLimits(tool) { + return { + maxBytes: tool?.outputLimits?.maxBytes ?? DEFAULT_MAX_BYTES, + maxLines: tool?.outputLimits?.maxLines ?? DEFAULT_MAX_LINES, + retain: tool?.outputLimits?.retain ?? "head" + }; +} +async function readCall(runtime, input, context) { + if (input.kind === "nested") { + context.telemetry.setAttributes({ + "tool.name": input.call.name, + "tool.call_id": input.call.id + }); + return { ...input.call, parent: { taskId: input.parent, callId: input.parentCallId } }; + } + const entry2 = await runtime.entry(AssistantEntry, input.assistant, context); + const message = entry2?.model?.[0]; + const call = message?.role === "assistant" ? message.content.find((content) => content.type === "toolCall" && content.id === input.callId) : void 0; + if (call === void 0) + throw new Error(`Entry ${input.assistant} has no tool call ${input.callId}`); + context.telemetry.setAttributes({ + "tool.name": call.name, + "tool.call_id": call.id + }); + return call; +} +function prepare(tool, args) { + if (tool.prepareArguments === void 0) + return { args }; + try { + return { args: tool.prepareArguments(args) }; + } catch (error) { + return { error: errorMessage(error) }; + } +} +function validate(tool, call, args) { + try { + return { args: validateToolArguments(tool, { ...call, arguments: args }) }; + } catch (error) { + return { error: errorMessage(error) }; + } +} +function invalid(message) { + return harnessError("invalid_arguments", message); +} +async function run(runtime, input, call, tool, args, context) { + const limits = outputLimits(tool); + const reported = { output: new OutputBuffer(limits), limits, diagnostics: [], details: void 0 }; + const streams = input.kind === "model" || input.progress !== false; + const progress = publishProgress(runtime, reported, streams, context); + const admissions = []; + const resumes = tool.replay === "safe"; + let sequence2 = 0; + let madeNestedMemo; + let ended = false; + const assertLive = () => { + if (ended) + throw new Error(`Tool call ${call.id} has settled`); + }; + let env; + const api = { + taskId: runtime.taskId, + conversationId: runtime.conversationId, + callId: call.id, + registry: runtime.registry, + agent: runtime.agent, + get models() { + return runtime.models; + }, + get env() { + return env; + }, + now: () => runtime.now(), + output: (chunk, skipped) => { + assertLive(); + if (reported.output.push(chunk, skipped)) + progress.mark(); + }, + outputWindow: limits.retain === "tail" ? { + maxBytes: limits.maxBytes, + maxLines: limits.maxLines, + minIntervalMs: runtime.settings.progress.outputIntervalMs, + bytesPerSecond: PROGRESS_BYTES_PER_SECOND + } : void 0, + retainedOutput: () => { + assertLive(); + const retained = reported.output.snapshot(); + return { text: retained.text, truncated: retained.droppedBytes > 0 }; + }, + diagnostic: (diagnostic) => { + assertLive(); + reported.diagnostics.push(copyJson(diagnostic, { omitUndefinedProperties: true })); + progress.mark(); + }, + details: async (value2, detailsContext) => { + assertLive(); + detailsContext.abortSignal?.throwIfAborted(); + reported.details = copyJson(value2, { omitUndefinedProperties: true }); + const committed = progress.markAndWait(); + committed.catch(() => { + }); + return awaitWithContext(committed, detailsContext); + }, + commit: async (change, commitContext, options) => { + let result2; + await runtime.commit(async (tx) => { + result2 = await change(tx); + return void 0; + }, commitContext, options); + return result2; + }, + memo: runtime.memo, + createTask: async (task, input2, options, taskContext) => { + const child = options.ownership.kind === "task" && !resumes ? { abandonOnRestart: true, ...options } : options; + let id; + await runtime.commit(async (tx) => { + id = await tx.createTask(task, input2, child); + return void 0; + }, taskContext); + return id; + }, + getTask: runtime.getTask, + waitForTask: runtime.waitForTask, + conversation: runtime.conversation, + snapshot: runtime.snapshot, + snapshotAsOf: runtime.snapshotAsOf, + watchDoc: runtime.watchDoc, + executeTool: async (name, toolArgs, callContext, options = {}) => { + assertLive(); + const key = options.key ?? String(++sequence2); + if (options.key !== void 0) + checkKey(options.key); + madeNestedMemo ??= runtime.memo(MADE_NESTED_CALLS, true, callContext).catch((error) => { + madeNestedMemo = void 0; + throw error; + }); + const admission = madeNestedMemo.then(() => startNestedCall(runtime, call.id, name, toolArgs, { key, progress: options.progress, abandonOnRestart: !resumes }, callContext)); + admissions.push(admission); + const id = await admission; + const settled = await runtime.waitForTask(id, callContext); + const stored = (await runtime.snapshot(NestedCallDoc, runtime.taskId, key, callContext))?.result; + return stored === void 0 ? fallbackResult(id, name, settled.state.outcome) : copyJson(stored); + } + }; + let result; + let ending = COMPLETED; + let durationMs; + try { + env = await runtime.env(context); + const startedAt = performance.now(); + try { + result = await tool.execute(args, api, context); + } finally { + durationMs = Math.round(performance.now() - startedAt); + } + } catch (error) { + if (runtime.signal.aborted) { + ended = true; + for (const waiter of await progress.stop()) + waiter.reject(error); + throw error; + } + result = { isError: true, diagnostics: [toolDiagnostic("tool_error", errorMessage(error))] }; + ending = { status: "failed", message: `Tool ${call.name} threw` }; + } + ended = true; + await Promise.allSettled(admissions); + reported.output.end(); + const pending = await progress.stop(); + try { + const settled = await finalResult(runtime, input, call, tool, result, reported, context); + await settle2(runtime, input, call, ending, settled, context, durationMs); + } catch (error) { + for (const waiter of pending) + waiter.reject(error); + throw error; + } + for (const waiter of pending) + waiter.resolve(); +} +function progressClock(runtime) { + let last = 0; + return { + now: () => { + try { + last = runtime.now(); + } catch { + } + return last; + }, + setTimer: (callback, delayMs) => runtime.setTimer(callback, delayMs) + }; +} +function publishProgress(runtime, reported, enabled, context) { + let written = { text: "", details: void 0, diagnostics: 0 }; + return new Progress(async () => { + if (!enabled) + return 0; + const snapshot = reported.output.snapshot(); + const current = { text: snapshot.text, details: reported.details, diagnostics: reported.diagnostics.length }; + const added = reported.diagnostics.slice(written.diagnostics, current.diagnostics); + const detailsChanged = current.details !== written.details; + let bytes2 = 0; + if (snapshot.text !== written.text) { + const shared = snapshot.text.startsWith(written.text) ? written.text.length : overlap(written.text, snapshot.text, 65536); + bytes2 += utf8ByteLength(snapshot.text.slice(shared)); + } + if (detailsChanged) + bytes2 += utf8ByteLength(JSON.stringify(current.details ?? null)); + if (added.length > 0) + bytes2 += utf8ByteLength(JSON.stringify(added)); + await runtime.commit(async (tx) => { + const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + if (slot === void 0) + return void 0; + if ((slot.output ?? "") !== snapshot.text) + slot.output = snapshot.text; + if (snapshot.droppedBytes > 0) + slot.droppedBytes = snapshot.droppedBytes; + if (snapshot.droppedLines > 0) + slot.droppedLines = snapshot.droppedLines; + if (detailsChanged && current.details !== void 0) { + assignJson(slot, "details", current.details); + } + if (added.length > 0) { + if (slot.diagnostics === void 0) + slot.diagnostics = []; + for (const diagnostic of added) + slot.diagnostics.push(diagnostic); + } + return void 0; + }, context, PROGRESS_COMMIT); + written = current; + return bytes2; + }, (error) => { + if (!runtime.signal.aborted) + runtime.report(error); + }, runtime.settings.progress.outputIntervalMs, progressClock(runtime)); +} +async function finalResult(runtime, input, call, tool, result, reported, context) { + const harness2 = []; + const retained = result.output === void 0 ? reported.output.snapshot() : void 0; + const output = retained === void 0 ? result.output : retained.text === "" ? [] : [{ type: "text", text: retained.text }]; + let final = { + ...result, + output, + details: result.details === void 0 ? reported.details : result.details, + diagnostics: [...reported.diagnostics, ...result.diagnostics ?? []] + }; + await runtime.hooks.each("afterTool", async (hook2) => { + final = await hook2(call, final, runtime, context) ?? final; + }); + if (retained !== void 0 && retained.droppedBytes > 0 && final.output === output) { + harness2.push(truncated(retained, reported.limits.retain)); + } + const bounded = boundContent(final.output ?? [], reported.limits); + if (bounded.droppedBytes > 0) + harness2.push(truncated(bounded, reported.limits.retain)); + const broken = structuredOutputError(tool, final); + if (broken !== void 0) { + const { structuredOutput: _dropped, ...rest } = final; + if (input.kind === "nested") { + final = { ...rest, isError: true }; + harness2.push(toolDiagnostic("invalid_structured_output", broken)); + } else { + final = rest; + const extension = await runtime.agent(context).then((agent) => toolExtension(agent, tool.name), () => void 0); + runtime.report(new Error(broken), { kind: "extension", ...optionalExtension(extension) }); + } + } + if (input.kind === "nested" && tool.structuredOutputSchema === void 0) { + final = { ...final, structuredOutput: outputValue(bounded.content) }; + } + if (input.kind === "nested" && tool.structuredOutputSchema !== void 0 && final.isError === true && final.structuredOutput === void 0 && ![...final.diagnostics ?? [], ...harness2].some((diagnostic) => diagnostic.severity === "error")) { + const text = bounded.content.flatMap((item) => item.type === "text" ? [item.text] : []).join("\n"); + if (text !== "") + harness2.push(toolDiagnostic("tool_error", text)); + } + return { ...final, output: bounded.content, diagnostics: [...final.diagnostics ?? [], ...harness2] }; +} +async function afterHarnessResult(runtime, input, call, tool, result, truncation, context) { + let final = result; + await runtime.hooks.each("afterTool", async (hook2) => { + final = await hook2(call, final, runtime, context) ?? final; + }); + const harness2 = []; + if (truncation !== void 0 && final.output === result.output) + harness2.push(truncation); + const limits = outputLimits(tool); + const bounded = boundContent(final.output ?? [], limits); + if (bounded.droppedBytes > 0) + harness2.push(truncated(bounded, limits.retain)); + const { structuredOutput: _dropped, ...rest } = final; + const value2 = input.kind === "nested" && final.isError !== true && tool?.structuredOutputSchema === void 0 ? { structuredOutput: outputValue(bounded.content) } : {}; + return { ...rest, ...value2, output: bounded.content, diagnostics: [...rest.diagnostics ?? [], ...harness2] }; +} +var structuredValidators = /* @__PURE__ */ new WeakMap(); +function structuredOutputError(tool, result) { + const schema4 = tool.structuredOutputSchema; + const value2 = result.structuredOutput; + if (schema4 === void 0) { + return value2 === void 0 ? void 0 : `Tool ${tool.name} returned structuredOutput but declares no structuredOutputSchema`; + } + if (value2 === void 0) { + return result.isError === true ? void 0 : `Tool ${tool.name} returned no structuredOutput`; + } + let validator = structuredValidators.get(schema4); + if (validator === void 0) { + validator = compile(schema4, { formats, unresolvedRefs: "reject" }); + structuredValidators.set(schema4, validator); + } + if (validator.check(value2)) + return void 0; + const [first] = validator.errors(value2); + const path5 = first?.path.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") || "root"; + return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path5}: ${first?.message ?? "invalid"}`; +} +async function settle2(runtime, input, call, ending, result, context, durationMs) { + const nestedIds = (await runtime.ownedTasks(context)).filter((record) => record.kind === ToolTask.definition.name && record.input.kind === "nested").map((record) => record.id); + const madeNested = await runtime.memo(MADE_NESTED_CALLS, context) === true; + await Promise.all(nestedIds.map((id) => runtime.abortOwned(id, context))); + await runtime.commit(async (tx) => { + const conversationId = runtime.conversationId; + const live = await tx.doc(LiveDoc, conversationId); + const slot = toolSlot(live, runtime.taskId); + let settled; + if (input.kind === "nested") { + const nested = nestedResult(runtime.taskId, result, durationMs); + if (nested.usage !== void 0) + await recordUsage(tx, conversationId, "tools", call.name, nested.usage); + const state2 = await tx.doc(NestedCallDoc, input.parent, input.key, null); + if (state2.taskId !== runtime.taskId) + throw new Error(`Nested call ${call.id} is not in its caller's index`); + state2.result = nested; + if (slot !== void 0 && "parentTaskId" in slot) { + finishSlot(slot); + slot.summary = summaryOf(nested, result.output ?? []); + } + settled = { kind: "nested" }; + } else { + const timing = { timestamp: runtime.now(), durationMs }; + const entry2 = await appendToolResult(tx, conversationId, call, result, timing); + if (slot !== void 0 && !("parentTaskId" in slot)) { + finishSlot(slot); + slot.entry = entry2.id; + } + const control = result.control === void 0 || ending.status !== "completed" ? {} : { control: copyJson(result.control, { omitUndefinedProperties: true }) }; + settled = { kind: "model", entryId: entry2.id, ...control }; + } + if (madeNested) + removeNestedSlots(live, runtime.taskId); + if (ending.status === "aborted") + return { status: "terminal", outcome: { status: "aborted", result: settled } }; + if (ending.status === "failed") { + const error = { + message: ending.message, + ...ending.reason === void 0 ? {} : { detail: { reason: ending.reason } } + }; + return { status: "terminal", outcome: { status: "failed", error, result: settled } }; + } + return { status: "terminal", outcome: { status: "completed", result: settled } }; + }, context); +} +function nestedResult(taskId, result, durationMs) { + const nested = { + taskId, + structuredOutput: result.structuredOutput, + isError: result.isError ?? false, + details: result.details, + diagnostics: result.diagnostics ?? [], + usage: result.usage, + durationMs + }; + return copyJson(nested, { + omitUndefinedProperties: true + }); +} +async function startNestedCall(runtime, parentCallId, name, args, options, context) { + const key = options.key; + const call = { + type: "toolCall", + id: `${parentCallId}/${key}`, + name, + arguments: copyJson(args, { omitUndefinedProperties: true }) + }; + let id; + let replayed = false; + await runtime.commit(async (tx) => { + const state2 = await tx.doc(NestedCallDoc, runtime.taskId, key, null); + const existing = state2.taskId; + if (existing !== void 0) { + const input2 = (await tx.task(existing))?.input; + const same = input2?.kind === "nested" && input2.call.name === name && jsonEqual2(input2.call.arguments, call.arguments); + if (!same) + throw new Error(`Nested call ${call.id} was already made with another tool or other arguments`); + id = existing; + replayed = state2.result !== void 0; + return void 0; + } + const input = { + kind: "nested", + parent: runtime.taskId, + parentCallId, + key, + call, + ...options.progress === false ? { progress: false } : {} + }; + const created = await tx.createTask(ToolTask, input, { + ownership: { kind: "task", taskId: runtime.taskId }, + abandonOnRestart: options.abandonOnRestart + }); + state2.taskId = created; + const live = await tx.doc(LiveDoc, runtime.conversationId); + live.nestedTools ??= []; + const slot = { + callId: call.id, + parentCallId, + parentTaskId: runtime.taskId, + name, + taskId: created, + arguments: call.arguments, + status: "pending" + }; + live.nestedTools.push(slot); + id = created; + return void 0; + }, context); + if (replayed) { + context.telemetry.addEvent("pi.durable.replay", { "tool.name": name }); + } + return id; +} +function outputValue(output) { + if (output.length === 0) + return ""; + if (output.length > 1) + return output; + const [only] = output; + return only.type === "text" ? only.text : only; +} +function fallbackResult(taskId, name, outcome) { + const message = outcome.status === "faulted" ? `Tool ${name} failed: ${outcome.error.message}` : outcome.status === "orphaned" ? `Tool ${name} could not resume: ${outcome.reason}` : `Tool ${name} ended without a result`; + const error = harnessError(outcome.status, message); + return { taskId, isError: true, diagnostics: error.diagnostics ?? [] }; +} +var COMPLETED = { status: "completed" }; +function fromSlot(slot, code, message) { + const droppedBytes = slot?.droppedBytes ?? 0; + const result = { + output: slot?.output === void 0 || slot.output === "" ? [] : [{ type: "text", text: slot.output }], + isError: true, + ...slot?.details === void 0 ? {} : { details: slot.details }, + diagnostics: [...slot?.diagnostics ?? [], toolDiagnostic(code, message)] + }; + if (droppedBytes === 0) + return { result }; + return { result, truncation: truncated({ droppedBytes, droppedLines: slot?.droppedLines ?? 0 }) }; +} +function harnessError(code, message) { + return { output: [], isError: true, diagnostics: [toolDiagnostic(code, message)] }; +} +function toolDiagnostic(code, message) { + return { severity: "error", code, message }; +} +function truncated(dropped, retain) { + const kept = retain === void 0 ? "" : ` to its ${retain === "head" ? "beginning" : "end"}`; + return { + severity: "warn", + code: "truncated", + message: `Output truncated${kept}: ${dropped.droppedLines} lines, ${dropped.droppedBytes} bytes dropped` + }; +} +var MAX_SUMMARY_ERROR_CHARS = 500; +function summaryOf(result, output) { + const error = result.isError ? ownedSlice2(errorTextOf(result, output), 0, MAX_SUMMARY_ERROR_CHARS) : ""; + return { + isError: result.isError, + ...result.durationMs === void 0 ? {} : { durationMs: result.durationMs }, + ...result.usage === void 0 ? {} : { usage: result.usage }, + ...error === "" ? {} : { error } + }; +} +function errorTextOf(result, output) { + const errors = result.diagnostics.filter((diagnostic) => diagnostic.severity === "error"); + if (errors.length > 0) + return errors.map((diagnostic) => diagnostic.message).join("\n"); + return output.flatMap((item) => item.type === "text" ? [item.text] : []).join("\n"); +} +async function appendToolResult(tx, conversationId, call, result, meta) { + const { timestamp: timestamp2, durationMs } = meta; + const diagnostics = [...result.diagnostics ?? []]; + const content = [...result.output ?? []]; + if (diagnostics.length > 0) + content.push({ type: "text", text: renderDiagnostics(diagnostics) }); + const message = { + role: "toolResult", + toolCallId: call.id, + toolName: call.name, + content, + ...result.details === void 0 ? {} : { details: result.details }, + ...result.usage === void 0 ? {} : { usage: result.usage }, + isError: result.isError ?? false, + ...durationMs === void 0 ? {} : { durationMs }, + timestamp: timestamp2 + }; + if (result.usage !== void 0) + await recordUsage(tx, conversationId, "tools", call.name, result.usage); + return tx.appendEntry(ToolResultEntry, conversationId, { model: [message], data: { diagnostics } }); +} +function renderDiagnostics(diagnostics) { + return ` +${diagnostics.map((diagnostic) => `[${diagnostic.severity}] ${diagnostic.message}`).join("\n")} +`; +} +function boundContent(content, limits) { + const texts = content.filter((item) => item.type === "text"); + const bounded = boundOutput(texts.map((item) => item.text).join(""), limits); + if (bounded.droppedBytes === 0) + return { content, droppedBytes: 0, droppedLines: 0 }; + const keep = limits.retain === "head" ? texts[0] : texts.at(-1); + const result = []; + for (const item of content) { + if (item.type !== "text") + result.push(item); + else if (item === keep) + result.push({ ...item, text: bounded.text }); + } + return { content: result, droppedBytes: bounded.droppedBytes, droppedLines: bounded.droppedLines }; +} +function checkKey(key) { + if (key === "" || key.includes("/") || key === "__proto__" || /^[1-9][0-9]*$/.test(key)) { + throw new Error(`Nested call key ${JSON.stringify(key)} must be non-empty, without "/", not "__proto__", and not a positive integer`); + } +} +function jsonEqual2(a, b) { + if (a === b) + return true; + if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) + return false; + if (Array.isArray(a) || Array.isArray(b)) { + return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => jsonEqual2(item, b[i])); + } + const keys = Object.keys(a); + return keys.length === Object.keys(b).length && keys.every((key) => Object.hasOwn(b, key) && jsonEqual2(a[key], b[key])); +} + +// node_modules/@earendil-works/pi-durable/dist/harness/generation.js +var DEFAULT_POLL_AFTER_MS = 5e3; +var GenerationTask = defineTask({ + name: "pi.generation", + version: 2, + initial: () => ({ phase: "prepare", attempt: 1 }), + // Version 2 leaves calls to tools not offered in a sequential round's `pending`, flagged `unoffered` in their slots. + // A version 1 Harness would start their tool tasks unflagged, resolving the name, so it leaves version 2 blocked + // instead. A version 1 checkpoint has no such calls and is kept as it is. + migrate: (input, checkpoint) => ({ + input, + checkpoint + }), + phases: { + /** + * Render the system prompt and tool loadout and append the positional `pi.system` entries they need, then move to + * `request`. The agent and settings resolved here are fixed for this request. Only the Harness writes model + * context to a busy conversation, so the context read here is still current at the commit; display-only entries + * may land meanwhile. + */ + prepare: async (task, runtime, context) => { + if (cutOffTooOften(task, runtime)) + return endCutOff2(runtime, task, context); + const { conversationId } = runtime; + const agent = await runtime.agent(context); + const settings = runtime.settings; + const { model: model2, thinkingLevel } = agent; + const resolved = model2 === void 0 ? void 0 : runtime.models.getModel(model2.provider, model2.modelId); + if (model2 === void 0 || resolved === void 0) + return failNoModel(runtime, model2, context); + const { attempt, compacted, overflow, threshold: blocked } = task.state.checkpoint; + if (compacted !== void 0 && overflow !== void 0) { + const [outcome] = await runtime.outcomes([compacted], context); + if (outcome?.status !== "completed" || outcome.result.entryId === void 0) { + return failModelError(runtime, overflow, context); + } + } + if (compacted !== void 0 && blocked === true) { + const [outcome] = await runtime.outcomes([compacted], context); + if (outcome !== void 0 && outcome.status !== "completed") { + return failModelError(runtime, compactionFailure(outcome), context); + } + } + const view2 = await runtime.context(conversationId, context); + const last = view2.messages.findLast((message) => message.role !== "system"); + if (last?.role !== "user" && last?.role !== "toolResult") + return failNothingToAnswer(runtime, context); + const shown = replaySections(view2.messages); + let env; + try { + env = await runtime.env(context); + } catch (error) { + if (context.abortSignal?.aborted) + throw error; + runtime.report(error, { kind: "host", callback: "env" }); + } + const input = { conversationId, agent, env, shown: Object.fromEntries(shown), read: runtime }; + const desired = await renderSections(agent.sections, input, shown, (error, section2) => runtime.report(error, { + kind: "extension", + ...optionalExtension(sectionExtension(agent, section2.key)) + }), context); + const entries2 = planSystemEntries(view2, desired, agent.tools, runtime.now()); + const threshold = compacted === void 0 ? thresholdCompaction(view2, entries2, resolved.contextWindow, compactionPolicy(settings, model2)) : void 0; + if (threshold === "blocking") { + await runtime.commit(async (tx) => { + const child = await createCompaction(tx, conversationId, { reason: "threshold" }, runtime.taskId); + const checkpoint = { phase: "prepare", attempt, compacted: child, threshold: true }; + return { status: "waiting", checkpoint, on: [child], policy: "allSettled" }; + }, context); + return; + } + await runtime.commit(async (tx) => { + let cutoff = await tx.latestEntryId(conversationId); + for (const entry2 of entries2) + cutoff = (await tx.appendEntry(SystemEntry, conversationId, entry2)).id; + if (threshold === "background" && (await tx.doc(LiveDoc, conversationId)).compactions === void 0) { + await createCompaction(tx, conversationId, { reason: "threshold" }); + } + const request2 = { + attempt, + ...compacted === void 0 ? {} : { compacted }, + model: model2, + thinkingLevel, + streamOptions: settings.stream, + cutoff + }; + return { status: "running", checkpoint: { phase: "request", ...request2 } }; + }, context); + }, + request: async (task, runtime, context) => { + if (cutOffTooOften(task, runtime)) + return endCutOff2(runtime, task, context); + if (task.restarts !== void 0) + return interrupted(runtime, task.state.checkpoint, context); + const { attempt, compacted, model: ref, thinkingLevel, streamOptions, cutoff } = task.state.checkpoint; + const conversationId = runtime.conversationId; + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, conversationId); + await convertPartial(tx, live, conversationId); + live.generation = { attempt }; + return void 0; + }, context, PROGRESS_COMMIT); + const model2 = runtime.models.getModel(ref.provider, ref.modelId); + if (model2 === void 0) + return failNoModel(runtime, ref, context); + const view2 = await runtime.context(conversationId, context, { at: cutoff }); + let messages = view2.messages; + await runtime.hooks.each("beforeRequest", async (hook2) => { + const replaced = await hook2({ messages }, runtime, context); + if (replaced !== void 0) + messages = replaced.messages; + }); + const options = { + ...streamOptions, + signal: runtime.signal, + telemetry: context.telemetry, + sessionId: await ensureProviderSessionId(runtime, context), + ...thinkingLevel === "off" ? {} : { reasoning: thinkingLevel }, + onPayload: (payload) => providerPayload(runtime, model2, payload, context) + }; + const message = await streamResponse(runtime, model2, messages, options, attempt, context); + const request2 = { attempt, compacted, model: ref, thinkingLevel, cutoff, messages: view2.messages }; + await classify(runtime, request2, message, context); + }, + /** After the backoff's sleep; a run before `until` (an early wake, or a record of an earlier version) sleeps again. */ + retry: async (task, runtime, context) => { + const { attempt, compacted, until, poll } = task.state.checkpoint; + if (cutOffTooOften(task, runtime)) + return endCutOff2(runtime, task, context); + if (until > runtime.now()) + return runtime.sleepUntil(until, task.state.checkpoint, context); + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, runtime.conversationId); + const kept = compacted === void 0 ? {} : { compacted }; + if (poll !== void 0) { + const pollAt = runtime.now(); + live.generation = { attempt: attempt + 1, deferred: { pollAt } }; + return { + status: "running", + checkpoint: { phase: "poll", attempt: attempt + 1, ...kept, ...poll, pollAt } + }; + } + live.generation = { attempt: attempt + 1 }; + return { status: "running", checkpoint: { phase: "prepare", attempt: attempt + 1, ...kept } }; + }, context); + }, + /** After the sleep until `pollAt`; a run before it (an early wake, or a record of an earlier version) sleeps again. */ + poll: async (task, runtime, context) => { + const { attempt, compacted, model: ref, thinkingLevel, cutoff, handle, pollAt } = task.state.checkpoint; + if (cutOffTooOften(task, runtime)) + return endCutOff2(runtime, task, context); + if (task.restarts !== void 0) + return interrupted(runtime, task.state.checkpoint, context); + if (pollAt > runtime.now()) + return runtime.sleepUntil(pollAt, task.state.checkpoint, context); + const model2 = runtime.models.getModel(ref.provider, ref.modelId); + if (model2 === void 0) + return failNoModel(runtime, ref, context); + const message = await runtime.models.fetchDeferred(model2, handle, { + signal: runtime.signal, + telemetry: context.telemetry + }); + const request2 = { attempt, compacted, model: ref, thinkingLevel, cutoff, pollAt }; + await classify(runtime, request2, message, context); + }, + tools: async (task, runtime, context) => { + if (cutOffTooOften(task, runtime)) + return endCutOff2(runtime, task, context); + const { assistant, tools, pending } = task.state.checkpoint; + const [next, ...rest] = pending; + if (next === void 0) + return finishToolRound(runtime, assistant, tools, context); + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, runtime.conversationId); + const slot = live.tools?.find((slot2) => slot2.callId === next && slot2.taskId === void 0); + const taskId = await createToolTask(tx, runtime, assistant, next, slot?.unoffered); + if (slot !== void 0) + slot.taskId = taskId; + const checkpoint = { + phase: "tools", + assistant, + tools: [...tools, taskId], + pending: rest + }; + return { status: "waiting", checkpoint, on: [taskId], policy: "allSettled" }; + }, context); + }, + /** + * Ask the `afterRun` hooks for tasks and create them, as the generation's children, in the commit that moves to + * `drain`; without any, end the run now. + */ + finish: async (task, runtime, context) => { + const { run: run2 } = task.state.checkpoint; + if (cutOffTooOften(task, runtime)) + return endAnsweredCutOff(runtime, task, run2.answer, context); + const prepared = []; + await runtime.hooks.each("afterRun", async (hook2) => { + const asked = await hook2(run2, runtime, context); + if (asked !== void 0) + prepareRunEndTasks(runtime, asked.tasks, prepared); + }); + if (prepared.length === 0) + return endAnsweredRun(runtime, run2.answer, context); + await runtime.commit(async (tx) => { + const tasks = []; + for (const { task: task2, input } of prepared) { + tasks.push(await tx.createTask(task2, input, { ownership: { kind: "task", taskId: runtime.taskId } })); + } + const live = await tx.doc(LiveDoc, runtime.conversationId); + if (live.run?.taskId === runtime.taskId && live.run.afterRun !== void 0) + live.run.afterRun.tasks = tasks; + const checkpoint = { phase: "drain", answer: run2.answer, tasks }; + return { status: "waiting", checkpoint, on: tasks, policy: "allSettled" }; + }, context); + }, + /** The after-run tasks are terminal, whatever their outcomes: end the run. */ + drain: async (task, runtime, context) => { + const { answer: answer2 } = task.state.checkpoint; + if (cutOffTooOften(task, runtime)) + return endAnsweredCutOff(runtime, task, answer2, context); + return endAnsweredRun(runtime, answer2, context); + } + }, + abort: async (task, runtime, context) => { + const checkpoint = task.state.checkpoint; + const polled = deferredOf(checkpoint); + if (polled !== void 0) + await cancelDeferred(runtime, polled, context); + const conversationId = runtime.conversationId; + const unstarted = checkpoint.phase === "tools" ? await readCalls(runtime, checkpoint.assistant, checkpoint.pending, context) : []; + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, conversationId); + await convertPartial(tx, live, conversationId); + for (const call of unstarted) { + const unoffered = live.tools?.find((slot) => slot.callId === call.id)?.unoffered === true; + const result = unoffered ? harnessError("tool_unavailable", `Tool ${call.name} is not available`) : harnessError("aborted", `Tool ${call.name} was aborted`); + await appendToolResult(tx, conversationId, call, result, { timestamp: runtime.now() }); + } + endRun(tx, live, runtime.taskId, { status: "unanswered", reason: "aborted" }); + return { status: "terminal", outcome: { status: "aborted" } }; + }, context); + } +}); +async function readCalls(runtime, assistant, callIds, context) { + const message = (await runtime.entry(AssistantEntry, assistant, context))?.model?.[0]; + const calls = message?.role === "assistant" ? message.content.filter((content) => content.type === "toolCall") : []; + return callIds.flatMap((id) => calls.filter((call) => call.id === id).slice(0, 1)); +} +function createToolTask(tx, runtime, assistant, callId, unoffered) { + return tx.createTask(ToolTask, { kind: "model", assistant, callId, ...unoffered === void 0 ? {} : { unoffered } }, { ownership: { kind: "task", taskId: runtime.taskId } }); +} +function thresholdCompaction(view2, planned, contextWindow, policy) { + if (!policy.enabled || contextWindow <= 0) + return void 0; + const tokens = estimateContext(view2, planned.flatMap((entry2) => entry2.model ?? [])); + const blocking = contextWindow - policy.reserveTokens; + const background = blocking - policy.backgroundTokens; + const over = tokens > blocking ? "blocking" : policy.backgroundTokens > 0 && tokens > background ? "background" : void 0; + if (over === void 0 || selectCut(view2, policy.keepRecentTokens) === void 0) + return void 0; + return over; +} +function compactionFailure(outcome) { + switch (outcome.status) { + case "failed": + case "faulted": + return `Compaction failed: ${outcome.error.message}`; + case "orphaned": + return `Compaction failed: ${outcome.reason}`; + case "aborted": + return "Compaction was aborted"; + } +} +async function failModelError(runtime, text, context) { + await runtime.commit(async (tx) => { + const failure2 = await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, runtime.conversationId); + await endFailedRun(tx, runtime, live, failure2, { status: "unanswered", reason: "model_error", detail: text }); + return { + status: "terminal", + outcome: { status: "failed", error: { message: text, detail: { reason: "model_error" } } } + }; + }, context); +} +async function interrupted(runtime, checkpoint, context) { + const { attempt, compacted } = checkpoint; + const policy = runtime.settings.retry; + const retry = policy.enabled && attempt <= policy.maxRetries; + const until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0; + const polled = checkpoint.phase === "poll" ? checkpoint : void 0; + const text = polled === void 0 ? `The host stopped while the model was answering, on attempt ${attempt}` : `The host stopped while the deferred answer was fetched, on attempt ${attempt}`; + if (!retry && polled !== void 0) + await cancelDeferred(runtime, polled, context); + await runtime.commit(async (tx) => { + const failure2 = retry ? void 0 : await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, runtime.conversationId); + await convertPartial(tx, live, runtime.conversationId); + if (failure2 === void 0) { + live.generation = { attempt, retry: { at: until, error: text } }; + const poll = polled === void 0 ? {} : { + poll: { + model: polled.model, + ...polled.thinkingLevel === void 0 ? {} : { thinkingLevel: polled.thinkingLevel }, + cutoff: polled.cutoff, + handle: polled.handle + } + }; + const next = { phase: "retry", attempt, ...compacted === void 0 ? {} : { compacted }, until, ...poll }; + return { status: "sleeping", checkpoint: next, until }; + } + await endFailedRun(tx, runtime, live, failure2, { status: "unanswered", reason: "interrupted", detail: text }); + return { + status: "terminal", + outcome: { status: "failed", error: { message: text, detail: { reason: "interrupted" } } } + }; + }, context); +} +async function endCutOff2(runtime, task, context) { + const checkpoint = task.state.checkpoint; + const text = `The generation was interrupted ${cutOffCount(task)} in its ${checkpoint.phase} phase`; + const salvage = salvageable(task, runtime); + const polled = deferredOf(checkpoint); + if (salvage && polled !== void 0) + await cancelDeferred(runtime, polled, context); + await runtime.commit(async (tx) => { + const failure2 = await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, runtime.conversationId); + if (salvage) + await convertPartial(tx, live, runtime.conversationId); + await endFailedRun(tx, runtime, live, failure2, { status: "unanswered", reason: "restart_limit", detail: text }); + return { + status: "terminal", + outcome: { status: "failed", error: { message: text, detail: { reason: "restart_limit" } } } + }; + }, context); +} +function deferredOf(checkpoint) { + if (checkpoint.phase === "poll") + return checkpoint; + return checkpoint.phase === "retry" ? checkpoint.poll : void 0; +} +async function cancelDeferred(runtime, checkpoint, context) { + const model2 = runtime.models.getModel(checkpoint.model.provider, checkpoint.model.modelId); + if (model2 === void 0) + return; + try { + await runtime.models.cancelDeferred(model2, checkpoint.handle, { + signal: runtime.signal, + telemetry: context.telemetry + }); + } catch (error) { + runtime.report(error, { kind: "host", callback: "models" }); + } +} +async function failNoModel(runtime, ref, context) { + const message = ref === void 0 ? "No model is configured" : `Model ${ref.provider}/${ref.modelId} is not available`; + await runtime.commit(async (tx) => { + const failure2 = await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, runtime.conversationId); + await endFailedRun(tx, runtime, live, failure2, { + status: "unanswered", + reason: "no_model", + detail: message, + settlement: { status: "unanswered", reason: "no_model" } + }); + return { status: "terminal", outcome: { status: "failed", error: { message, detail: { reason: "no_model" } } } }; + }, context); +} +async function failNothingToAnswer(runtime, context) { + const message = "The conversation has nothing to answer"; + await runtime.commit(async (tx) => { + const failure2 = await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, runtime.conversationId); + await endFailedRun(tx, runtime, live, failure2, { status: "unanswered", reason: "nothing_to_answer" }); + const error = { message, detail: { reason: "nothing_to_answer" } }; + return { status: "terminal", outcome: { status: "failed", error } }; + }, context); +} +async function prepareFailure(tx, runtime) { + const settings = runtime.settings; + const policy = settings.afterFailedRun; + if (policy !== "continue") + return { policy }; + return { policy, boundary: await prepareBoundary(tx, runtime.conversationId, settings, "final", runtime.now()) }; +} +async function endFailedRun(tx, runtime, live, failure2, end) { + const conversationId = runtime.conversationId; + endRun(tx, live, runtime.taskId, end); + if (failure2.policy === "withdraw") + await withdrawQueuedInputs(tx, conversationId, "run_failed"); + if (failure2.boundary === void 0) + return; + const { users, first } = await applyBoundary(tx, failure2.boundary, "final", runtime.now()); + if (users.length > 0) + await startRun(tx, conversationId, live, { inputs: users, first }, { keepFailure: true }); +} +async function convertPartial(tx, live, conversationId) { + const partial = live.generation?.message; + if (partial === void 0) + return; + const message = copyJson(partial); + await appendAssistant(tx, conversationId, { ...message, stopReason: "aborted" }); +} +async function providerPayload(runtime, model2, payload, context) { + let current = payload; + await runtime.hooks.each("beforeProviderRequest", async (hook2) => { + const replaced = await hook2({ model: model2, payload: current }, runtime, context); + if (replaced !== void 0) + current = replaced.payload; + }); + return current; +} +async function streamResponse(runtime, model2, messages, options, attempt, context) { + const interval = runtime.settings.progress.partialIntervalMs; + let pending; + let timer; + let inFlight; + let stopped = false; + const changes = new PartialChanges(); + const flush = () => { + timer = void 0; + const partial = pending; + pending = void 0; + if (partial === void 0 || stopped) + return; + inFlight = (async () => { + const message = copyJson(partial, { omitUndefinedProperties: true }); + const taken = changes.take(message); + try { + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, runtime.conversationId); + live.generation ??= { attempt }; + changes.commit(live.generation, message, taken); + return void 0; + }, context, PROGRESS_COMMIT); + } catch (error) { + changes.restore(taken); + throw error; + } + })().catch((error) => { + if (!runtime.signal.aborted) + runtime.report(error); + }).finally(() => { + inFlight = void 0; + if (pending !== void 0 && !stopped) + timer = runtime.setTimer(flush, interval); + }); + }; + try { + const events = runtime.models.streamSimple(model2, { messages: [...messages] }, options); + for await (const event of events) { + if (event.type === "done" || event.type === "error" || event.partial.content.length === 0) + continue; + changes.observe(event); + pending = event.partial; + if (timer === void 0 && inFlight === void 0) + timer = runtime.setTimer(flush, interval); + } + return await events.result(); + } finally { + stopped = true; + timer?.(); + await inFlight; + } +} +async function classify(runtime, request2, message, context) { + runtime.signal.throwIfAborted(); + const conversationId = runtime.conversationId; + const { attempt, compacted, model: ref, thinkingLevel, cutoff } = request2; + if (thinkingLevel !== void 0) + message.thinkingLevel = thinkingLevel; + if (message.stopReason === "deferred" && message.deferred !== void 0) { + const handle = message.deferred; + const pollAt = Math.max(runtime.now() + (handle.pollAfterMs ?? DEFAULT_POLL_AFTER_MS), request2.pollAt === void 0 ? Number.NEGATIVE_INFINITY : request2.pollAt + 1); + await runtime.commit(async (tx) => { + (await tx.doc(LiveDoc, conversationId)).generation = { attempt, deferred: { pollAt } }; + const checkpoint = { + phase: "poll", + attempt, + ...compacted === void 0 ? {} : { compacted }, + model: ref, + ...thinkingLevel === void 0 ? {} : { thinkingLevel }, + cutoff, + handle, + pollAt + }; + return { status: "sleeping", checkpoint, until: pollAt }; + }, context); + return; + } + await runtime.hooks.each("afterResponse", (hook2) => hook2(message, runtime, context)); + const calls = message.content.filter((content) => content.type === "toolCall"); + if (message.stopReason === "toolUse" && calls.length > 0) { + return startToolRound(runtime, request2, message, calls, context); + } + if (message.stopReason === "stop" || message.stopReason === "length" || message.stopReason === "toolUse") { + return answer(runtime, message, context); + } + const settings = runtime.settings; + const overflow = message.stopReason === "error" && isContextOverflow(message); + const compaction = compactionPolicy(settings, ref); + if (overflow && compacted === void 0 && compaction.enabled) { + const view2 = await runtime.context(conversationId, context, { at: cutoff }); + if (selectCut(view2, compaction.keepRecentTokens) !== void 0) { + const text = message.errorMessage ?? "Context overflow"; + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, conversationId); + await appendAssistant(tx, conversationId, message); + delete live.generation; + const child = await createCompaction(tx, conversationId, { reason: "overflow" }, runtime.taskId); + const checkpoint = { phase: "prepare", attempt, compacted: child, overflow: text }; + return { status: "waiting", checkpoint, on: [child], policy: "allSettled" }; + }, context); + return; + } + } + const policy = settings.retry; + const retry = message.stopReason === "error" && !overflow && isRetryableAssistantError(message) && policy.enabled && attempt <= policy.maxRetries; + const until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0; + await runtime.commit(async (tx) => { + const failure2 = retry ? void 0 : await prepareFailure(tx, runtime); + const live = await tx.doc(LiveDoc, conversationId); + await appendAssistant(tx, conversationId, message); + if (failure2 === void 0) { + live.generation = { attempt, retry: { at: until, error: message.errorMessage ?? "" } }; + const checkpoint = { + phase: "retry", + attempt, + ...compacted === void 0 ? {} : { compacted }, + until + }; + return { status: "sleeping", checkpoint, until }; + } + const text = message.errorMessage ?? `Model response ended with stop reason ${message.stopReason}`; + await endFailedRun(tx, runtime, live, failure2, { status: "unanswered", reason: "model_error", detail: text }); + return { + status: "terminal", + outcome: { status: "failed", error: { message: text, detail: { reason: "model_error" } } } + }; + }, context); +} +async function answer(runtime, message, context) { + let continuation; + await runtime.hooks.each("onYield", async (hook2) => { + if (continuation !== void 0) + return; + continuation = (await hook2(message, runtime, context))?.continue; + }); + const afterRun = await asksAfterRun(runtime, context); + const conversationId = runtime.conversationId; + await runtime.commit(async (tx) => { + const boundary = await prepareBoundary(tx, conversationId, runtime.settings, "final", runtime.now()); + const live = await tx.doc(LiveDoc, conversationId); + const entry2 = await appendAssistant(tx, conversationId, message); + const result = { status: "terminal", outcome: { status: "completed", result: { entryId: entry2.id } } }; + const continues = takesContinuation(continuation, boundary) ? continuation : void 0; + if (continues === void 0 && afterRun) { + const held = holdRun(tx, live, runtime, { reason: "answer", answer: entry2.id, last: entry2.id }); + if (held !== void 0) + return held; + } + const { users, first } = await applyBoundary(tx, boundary, "final", runtime.now()); + if (continues !== void 0) { + const user = { role: "user", content: continues, timestamp: runtime.now() }; + await tx.appendEntry(UserEntry, conversationId, { model: [user] }); + if (live.run?.taskId === runtime.taskId) + live.run.turns = 0; + handOver(live, runtime.taskId, await createGeneration(tx, conversationId)); + delete live.generation; + return result; + } + endRun(tx, live, runtime.taskId, { status: "done", answer: entry2.id }); + if (users.length > 0) + await startRun(tx, conversationId, live, { inputs: users, first }); + return result; + }, context); +} +async function asksAfterRun(runtime, context) { + const hooks = agentHooks(await runtime.agent(context), GenerationTask.definition.name); + return hooks.some(({ handlers }) => typeof handlers.afterRun === "function"); +} +function holdRun(tx, live, runtime, end) { + const run2 = live.run; + if (run2?.taskId !== runtime.taskId) + return void 0; + for (const id of run2.inputs) + tx.settleSubmission(id, { status: "done", answer: end.answer }); + run2.inputs = []; + run2.afterRun = {}; + delete live.generation; + delete live.tools; + delete live.nestedTools; + const summary = { ...end, first: run2.first ?? end.answer }; + return { status: "running", checkpoint: { phase: "finish", run: summary } }; +} +function prepareRunEndTasks(runtime, requests, prepared) { + const rejected = []; + for (const request2 of requests) { + try { + const name = request2.task.definition.name; + if (name.startsWith("pi.")) + throw new Error(`An afterRun hook cannot start the built-in task ${name}`); + const installed = runtime.registry.task(name); + if (installed === void 0) + throw new Error(`Task ${name} is not installed`); + const input = copyJson(request2.input, { omitUndefinedProperties: true }); + const definition = installed.definition; + const checkpoint = copyJson(definition.initial(input), { omitUndefinedProperties: true }); + if (!Object.hasOwn(definition.phases, checkpoint.phase)) { + throw new Error(`Task ${name} starts at the unknown phase ${String(checkpoint.phase)}`); + } + prepared.push({ task: { definition: { ...definition, initial: () => checkpoint } }, input }); + } catch (error) { + rejected.push(error); + } + } + if (rejected.length === 1) + throw rejected[0]; + if (rejected.length > 1) + throw new AggregateError(rejected, `${rejected.length} afterRun task requests were rejected`); +} +async function endAnsweredRun(runtime, answer2, context) { + const conversationId = runtime.conversationId; + await runtime.commit(async (tx) => { + const boundary = await prepareBoundary(tx, conversationId, runtime.settings, "final", runtime.now()); + const live = await tx.doc(LiveDoc, conversationId); + const { users, first } = await applyBoundary(tx, boundary, "final", runtime.now()); + endRun(tx, live, runtime.taskId, { status: "done", answer: answer2 }); + if (users.length > 0) + await startRun(tx, conversationId, live, { inputs: users, first }); + return { status: "terminal", outcome: { status: "completed", result: { entryId: answer2 } } }; + }, context); +} +async function endAnsweredCutOff(runtime, task, answer2, context) { + const text = `The generation was interrupted ${cutOffCount(task)} in its ${task.state.checkpoint.phase} phase`; + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, runtime.conversationId); + endRun(tx, live, runtime.taskId, { status: "done", answer: answer2 }); + const completed = { status: "terminal", outcome: { status: "completed", result: { entryId: answer2 } } }; + return endedByCrashes(completed, text); + }, context); +} +function takesContinuation(continuation, boundary) { + const items = boundary.inbox.items; + return continuation !== void 0 && !items.some((item) => item.mode === "steer" || item.mode === "followUp") && !hasQueuedReset(items); +} +async function startToolRound(runtime, request2, message, calls, context) { + const conversationId = runtime.conversationId; + const messages = request2.messages ?? (await runtime.context(conversationId, context, { at: request2.cutoff })).messages; + const offered = new Set(getCurrentTools(messages).map((tool) => tool.name)); + const tools = (await runtime.agent(context)).tools; + const sequential = runtime.settings.toolExecution === "sequential" || calls.some((call) => offered.has(call.name) && tools.find((tool) => tool.name === call.name)?.executionMode === "sequential"); + await runtime.commit(async (tx) => { + const live = await tx.doc(LiveDoc, conversationId); + const entry2 = await appendAssistant(tx, conversationId, message); + const slots = []; + const tools2 = []; + const pending = []; + for (const call of calls) { + const unoffered = offered.has(call.name) ? {} : { unoffered: true }; + if (sequential && tools2.length > 0) { + pending.push(call.id); + slots.push({ callId: call.id, name: call.name, status: "pending", ...unoffered }); + continue; + } + const taskId = await createToolTask(tx, runtime, entry2.id, call.id, unoffered.unoffered); + tools2.push(taskId); + slots.push({ callId: call.id, name: call.name, taskId, status: "pending", ...unoffered }); + } + delete live.generation; + live.tools = slots; + if (live.run?.taskId === runtime.taskId) { + live.run.turns += 1; + live.run.first ??= entry2.id; + } + const checkpoint = { phase: "tools", assistant: entry2.id, tools: tools2, pending }; + return { status: "waiting", checkpoint, on: tools2, policy: "allSettled" }; + }, context); +} +async function finishToolRound(runtime, assistant, tools, context) { + const conversationId = runtime.conversationId; + const controls = /* @__PURE__ */ new Map(); + const outcomes = await runtime.outcomes(tools, context); + tools.forEach((id, index) => { + const outcome = outcomes[index]; + controls.set(id, outcome.status === "completed" && outcome.result.kind !== "nested" ? outcome.result.control : void 0); + }); + const slots = (await runtime.snapshot(LiveDoc, conversationId, context))?.tools ?? []; + const results = slots.flatMap((slot) => slot.entry === void 0 ? [] : [slot.entry]); + await runtime.hooks.each("afterTools", (hook2) => hook2(assistant, results, runtime, context)); + const ordered = slots.map((slot) => slot.taskId === void 0 ? void 0 : controls.get(slot.taskId)); + const terminate = slots.length > 0 && ordered.every((control) => control?.terminate === true); + const added = ordered.flatMap((control) => control?.addTools ?? []); + const handoff = ordered.findLast((control) => control?.handoff !== void 0)?.handoff; + const maxTurns = (await runtime.agent(context)).maxTurns; + const afterRun = terminate && await asksAfterRun(runtime, context); + await runtime.commit(async (tx) => { + const boundary = await prepareBoundary(tx, conversationId, runtime.settings, terminate || handoff !== void 0 ? "final" : "postTools", runtime.now()); + if (added.length > 0) + await addTools(tx, conversationId, added); + const live = await tx.doc(LiveDoc, conversationId); + const now = runtime.now(); + let last = results.reduce((newest, id) => id > newest ? id : newest, assistant); + if (handoff !== void 0) { + const message = { role: "user", content: handoff, timestamp: now }; + const entry2 = await tx.appendEntry(ResetEntry, conversationId, { head: "self", model: [message] }); + boundary.head = entry2.id; + last = entry2.id; + } + const turns = live.run?.taskId === runtime.taskId ? live.run.turns : 0; + const held = afterRun ? holdRun(tx, live, runtime, { reason: "terminate", answer: assistant, last }) : void 0; + if (held !== void 0) + return held; + if (terminate) { + const { users, first } = await applyBoundary(tx, boundary, "final", now); + endRun(tx, live, runtime.taskId, { status: "done", answer: assistant }); + if (users.length > 0) + await startRun(tx, conversationId, live, { inputs: users, first }); + } else if (maxTurns !== void 0 && turns >= maxTurns) { + const policy = runtime.settings.afterFailedRun; + const failure2 = { policy, ...policy === "continue" ? { boundary } : {} }; + await endFailedRun(tx, runtime, live, failure2, { + status: "unanswered", + reason: "turn_limit", + detail: turns === 1 ? "1 turn" : `${turns} turns` + }); + } else { + const { users, first, reset } = await applyBoundary(tx, boundary, "postTools", now); + if (reset) { + endRun(tx, live, runtime.taskId, { status: "unanswered", reason: "reset" }); + if (users.length > 0) { + await startRun(tx, conversationId, live, { inputs: users, first }, { keepFailure: true }); + } + } else { + delete live.tools; + delete live.nestedTools; + if (live.run?.taskId === runtime.taskId) + live.run.inputs.push(...users); + handOver(live, runtime.taskId, await createGeneration(tx, conversationId)); + } + } + return { status: "terminal", outcome: { status: "completed", result: { entryId: assistant } } }; + }, context); +} +async function appendAssistant(tx, conversationId, message) { + await recordUsage(tx, conversationId, "models", `${message.provider}/${message.model}`, message.usage); + return tx.appendEntry(AssistantEntry, conversationId, { model: [message] }); +} +async function startRun(tx, conversationId, live, run2, options) { + const { inputs, first } = run2; + const taskId = await createGeneration(tx, conversationId, { submissionIds: inputs }); + live.run = { taskId, inputs, turns: 0, ...first === void 0 ? {} : { first } }; + if (options?.keepFailure !== true) + delete live.runFailure; +} +function createGeneration(tx, conversationId, telemetry = {}) { + return tx.createTask(GenerationTask, {}, { ownership: { kind: "conversation" }, conversationId, ...telemetry }); +} +function handOver(live, from, to) { + if (live.run?.taskId === from) + live.run.taskId = to; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/live.js +var LiveDoc = defineDoc({ + kind: "pi.live", + version: 3, + scope: "conversation", + history: "latest", + fork: "initial", + initial: () => ({}), + // Version 1 named a compaction's trigger `reason`, in `compactions` and `compactionFailure`. Versions 1 and 2 (as + // builds before `run.turns` stored it) may lack `run.turns`: a run in flight across the upgrade counts its turns + // from 0. Version 2 already names the trigger `trigger`, so renaming leaves it alone. + migrate: (value2) => { + const live = value2; + const { run: run2, compactions, compactionFailure: compactionFailure2 } = live; + return { + ...value2, + ...run2 === void 0 ? {} : { run: { ...run2, turns: typeof run2.turns === "number" ? run2.turns : 0 } }, + ...compactions === void 0 ? {} : { compactions: compactions.map(renameReason) }, + ...compactionFailure2 === void 0 ? {} : { compactionFailure: renameReason(compactionFailure2) } + }; + }, + // REMINDER: a complete base whenever nothing runs (spec §8.2): no generation and no running tool slot. That holds + // while idle, in the commit handing a generation over to its tool round, and between tools, so the delta chain + // spans at most one generation or the overlapping execution of one round's tools. A slot holds output only while + // running, so every base is small; a nested call's result lives in its caller's task documents, never here. Do not + // add a delta-count bound; the tool output benchmark checks this rule. + checkpointWhen: (value2) => value2.generation === void 0 && !(value2.tools ?? []).some((slot) => slot.status === "running") && !(value2.nestedTools ?? []).some((slot) => slot.status === "running") +}); +function renameReason(value2) { + return Object.fromEntries(Object.entries(value2).map(([key, field]) => [key === "reason" ? "trigger" : key, field])); +} +var PROGRESS_COMMIT = { persistence: { kind: "deferred" } }; +var RUN_TASK_KINDS = /* @__PURE__ */ new Set(["pi.generation"]); +var TOOL_TASK_KIND = "pi.tool"; +var COMPACTION_TASK_KIND = "pi.compaction"; +var LIMITS_RESTARTS = /* @__PURE__ */ new Set([...RUN_TASK_KINDS, TOOL_TASK_KIND, COMPACTION_TASK_KIND]); +function cutOffTooOften(task, runtime) { + return task.restarts !== void 0 && task.restarts >= runtime.settings.restartLimit; +} +function salvageable(task, runtime) { + return (task.restarts ?? 0) <= runtime.settings.restartLimit; +} +function cutOffCount(task) { + const restarts = task.restarts ?? 0; + return restarts === 1 ? "once" : `${restarts} times in a row`; +} +function endRun(tx, live, taskId, end) { + if (live.run?.taskId === taskId) { + const inputs = [...live.run.inputs]; + const { first } = live.run; + if (end.status === "done") { + for (const id of inputs) + tx.settleSubmission(id, { status: "done", answer: end.answer }); + } else if (live.run.afterRun === void 0) { + const { reason, detail } = end; + const settlement = end.settlement ?? { + status: "unanswered", + reason, + ...detail === void 0 ? {} : { detail } + }; + for (const id of inputs) + tx.settleSubmission(id, settlement); + live.runFailure = { + taskId, + inputs, + reason, + ...detail === void 0 ? {} : { detail }, + ...first === void 0 ? {} : { first } + }; + } + delete live.run; + } + delete live.generation; + delete live.tools; + delete live.nestedTools; +} +function addCompactionStatus(live, status) { + live.compactions ??= []; + live.compactions.push(status); +} +function compactionStatus(live, taskId) { + return live.compactions?.find((status) => status.taskId === taskId); +} +function removeCompactionStatus(live, taskId) { + const statuses = live.compactions; + if (statuses === void 0) + return; + const index = statuses.findIndex((status) => status.taskId === taskId); + if (index >= 0) + statuses.splice(index, 1); + if (statuses.length === 0) + delete live.compactions; +} +function failCompactionStatus(live, taskId, error) { + const status = compactionStatus(live, taskId); + if (status !== void 0) + live.compactionFailure = { taskId: status.taskId, trigger: status.trigger, error }; + removeCompactionStatus(live, taskId); +} +function toolSlot(live, taskId) { + const slot = live.tools?.find((each) => each.taskId === taskId); + if (slot !== void 0 || live.nestedTools === void 0) + return slot; + const nested = live.nestedTools; + let low = 0; + let high = nested.length - 1; + while (low <= high) { + const middle = low + high >>> 1; + const candidate = nested[middle]; + if (candidate.taskId === taskId) + return candidate; + if (candidate.taskId < taskId) + low = middle + 1; + else + high = middle - 1; + } + return void 0; +} +function finishSlot(slot) { + slot.status = "done"; + clearProgress(slot); +} +function removeNestedSlots(live, taskId) { + const nested = live.nestedTools; + if (nested === void 0) + return; + const removed = /* @__PURE__ */ new Set([taskId]); + for (const slot of nested) + if (removed.has(slot.parentTaskId)) + removed.add(slot.taskId); + for (let index = nested.length - 1; index >= 0; index--) { + if (removed.has(nested[index].parentTaskId)) + nested.splice(index, 1); + } + if (nested.length === 0) + delete live.nestedTools; +} +function clearProgress(slot) { + delete slot.output; + delete slot.droppedBytes; + delete slot.droppedLines; + delete slot.details; + delete slot.diagnostics; +} +async function settleSchedulerOutcome(tx, record, outcome) { + if (record.kind === TOOL_TASK_KIND) { + const live2 = await tx.doc(LiveDoc, record.conversationId); + const slot = toolSlot(live2, record.id); + if (slot !== void 0) + finishSlot(slot); + removeNestedSlots(live2, record.id); + return; + } + const detail = outcome.status === "faulted" ? outcome.error.detail : void 0; + const cutOff = typeof detail === "object" && detail !== null && "reason" in detail && detail.reason === "restart_limit"; + if (record.kind === COMPACTION_TASK_KIND) { + const live2 = await tx.doc(LiveDoc, record.conversationId); + if (cutOff) + removeCompactionStatus(live2, record.id); + else + failCompactionStatus(live2, record.id, outcome.status === "faulted" ? outcome.error.message : outcome.reason); + return; + } + if (!RUN_TASK_KINDS.has(record.kind)) + return; + const live = await tx.doc(LiveDoc, record.conversationId); + if (live.run?.taskId !== record.id) + return; + if (!cutOff) + await convertPartial(tx, live, record.conversationId); + endRun(tx, live, record.id, outcome.status === "faulted" ? { status: "unanswered", reason: cutOff ? "aborted" : "faulted", detail: outcome.error.message } : { + status: "unanswered", + reason: "orphaned", + detail: outcome.reason, + settlement: { status: "unanswered", reason: outcome.reason } + }); +} + +// node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +init_dist(); +var Submissions = class { + #telemetry; + #session; + #now; + /** Read at each admission, on the Session line. */ + #queueModes; + /** Enable task scheduling; submitting or waiting asks for progress. */ + #resume; + #waiters = new Waiters(); + #closed = false; + constructor(session, now, queueModes, resume, telemetry = NOOP_TELEMETRY_CONTEXT) { + this.#telemetry = telemetry; + this.#session = session; + this.#now = now; + this.#queueModes = queueModes; + this.#resume = resume; + session.followCommits((publication) => this.#observe(publication)); + session.subscribeClose(() => { + this.#closed = true; + this.#waiters.rejectAll(closedError(this.#session)); + }); + } + /** Admit a submission in one commit; see `admitSubmission()`. */ + async submit(conversationId, draft, context) { + const { id } = await this.#traced(conversationId, draft, context, (span) => this.#session.commitWith((tx) => admitSubmission(tx, conversationId, draft, this.#now(), this.#queueModes(), span), withTelemetry(span, context))); + return new SubmissionHandle(id, this); + } + /** + * Admit a submission inside the caller's commit `tx`, with the rules of `submit()`. The admission is stored or lost + * with that commit. It must come before the commit's first table write, another admission's included. + */ + async admit(tx, conversationId, draft) { + if (!this.#session.ownsTransaction(tx)) + throw new Error("The transaction belongs to another Session"); + if (tx.hasTableWrite) + throw new ReadAfterWrite("submit(tx, draft)"); + const admission = await this.#traced(conversationId, draft, tx.context, (span) => admitSubmission(tx, conversationId, draft, this.#now(), this.#queueModes(), span)); + return admission.id; + } + /** Run one admission in its `pi.durable.submit` span, asking for progress first, as the run it starts needs it. */ + #traced(conversationId, draft, context, admit) { + this.#resume(); + const startsRun = draft.type !== "write"; + const parent2 = startsRun ? this.#telemetry : context.telemetry; + return createTypedSpanStarter(parent2, [DURABLE_TELEMETRY_SCHEMA])("pi.durable.submit", { + "submission.type": draft.type, + "conversation.id": conversationId + }, async (span) => { + if (startsRun) + span.addLink({ context: context.telemetry }); + try { + const admission = await admit(span); + span.setAttributes({ "submission.id": admission.id, result: admission.status }); + return admission; + } catch (error) { + span.setStatus({ status: "error" }); + throw error; + } + }); + } + /** Handle for an existing submission, or `undefined`. */ + async get(id, context) { + const record = await this.#session.readOnLine((storage2) => storage2.submission(id, context)); + return record === void 0 ? void 0 : new SubmissionHandle(record.id, this); + } + async status(id, context) { + const record = await this.#session.readOnLine((storage2) => storage2.submission(id, context)); + if (record === void 0) + throw new Error(`Submission ${id} does not exist`); + return record; + } + async wait(id, context) { + this.#resume(); + const found = await this.#session.readOnLine(async (storage2) => { + const record = await storage2.submission(id, context); + if (record === void 0) + throw new Error(`Submission ${id} does not exist`); + if (isSettled(record)) + return { promise: Promise.resolve(record) }; + if (this.#closed) + throw closedError(this.#session); + return { promise: this.#waiters.add(id, context) }; + }); + return found.promise; + } + /** Withdraw a queued submission and remove its inbox item; placed inputs and settled submissions are reported. */ + abort(id, context, conversationId) { + return this.#session.commitWith(async (tx) => { + const record = await tx.submission(id); + if (record === void 0 || conversationId !== void 0 && record.conversationId !== conversationId) { + return "not_found"; + } + if (record.status === "queued") { + tx.settleSubmission(id, { status: "unanswered", reason: "aborted" }); + await removeInboxItem(tx, record.conversationId, id); + return "aborted"; + } + return record.status === "placed" ? "already_placed" : "settled"; + }, context); + } + #observe(publication) { + if (publication.kind === "memory") + return; + for (const change of publication.changes) { + if (change.type !== "submission" || !isSettled(change.value)) + continue; + this.#waiters.resolve(change.value.id, change.value); + } + } +}; +var SubmissionHandle = class { + id; + #submissions; + constructor(id, submissions) { + this.id = id; + this.#submissions = submissions; + } + status(context) { + return this.#submissions.status(this.id, context); + } + wait(context) { + return this.#submissions.wait(this.id, context); + } + async abort(context) { + const result = await this.#submissions.abort(this.id, context); + if (result === "not_found") + throw new Error(`Submission ${this.id} does not exist`); + return result; + } +}; +function isSettled(record) { + return record.status === "done" || record.status === "unanswered"; +} +function checkInputEntry(entry2) { + const { kind } = entry2; + if (typeof kind !== "string" || kind.length === 0 || kind.startsWith("pi.")) { + throw new TypeError(`An input entry's kind must be a non-empty string not starting with "pi.", got ${String(kind)}`); + } +} +async function admitSubmission(tx, conversationId, draft, now, queueModes, span) { + if (draft.type === "input" && draft.entry !== void 0) + checkInputEntry(draft.entry); + if (draft.requestId !== void 0) { + const existing = await tx.submissionByRequest(conversationId, draft.requestId); + if (existing !== void 0) { + if (existing.type !== draft.type) { + throw new Error(`Request ${draft.requestId} already identifies a submission of type ${existing.type}`); + } + return { id: existing.id, status: existing.status === "unanswered" ? "done" : existing.status }; + } + } + const fields = { conversationId, requestId: draft.requestId, trace: span?.propagation?.inject(span) }; + if (draft.type === "write" && isDisplayOnly(draft.entry) && !hasQueuedReset((await tx.doc(InboxDoc, conversationId)).items)) { + const entry3 = await tx.appendEntry(conversationId, draft.entry); + const write = { ...fields, type: "write", status: "done", entry: entry3.id }; + return { id: (await tx.createSubmission(write)).id, status: "done" }; + } + const live = await tx.doc(LiveDoc, conversationId); + const busy = live.run !== void 0; + if (draft.type === "input" && draft.whenBusy === "steer" && live.run !== void 0 && span?.propagation !== void 0) { + const run2 = await tx.task(live.run.taskId); + if (run2?.trace !== void 0) + span.addLink({ context: span.propagation.extract(run2.trace) }); + } + if (busy && draft.type === "input" && draft.whenBusy === "reject") + throw new ConversationBusy(conversationId); + if (!busy && draft.type === "input" && draft.whenIdle === "reject") + throw new ConversationIdle(conversationId); + if (draft.type === "continue") { + if (busy) + throw new ConversationBusy(conversationId); + const boundary2 = await prepareBoundary(tx, conversationId, queueModes, "final", now); + const { id: id2 } = await tx.createSubmission({ ...fields, type: "continue", status: "placed" }); + const { users, first } = await applyBoundary(tx, boundary2, "final", now); + await startRun(tx, conversationId, live, { inputs: [...users, id2], first: live.runFailure?.first ?? first }); + return { id: id2, status: "placed" }; + } + const boundary = busy ? void 0 : await prepareBoundary(tx, conversationId, queueModes, "final", now, draft.type === "input" ? inputDraft(draft.content, draft.entry, now) : void 0); + if (boundary === void 0 || boundary.inbox.items.length > 0) { + const { id: id2 } = await tx.createSubmission({ + ...fields, + type: draft.type, + status: "queued" + }); + const value2 = copyJson(draft.type === "write" ? draft.entry : draft.content, { + omitUndefinedProperties: true + }); + const items = (boundary?.inbox ?? await tx.doc(InboxDoc, conversationId)).items; + if (draft.type === "write") + items.push({ id: id2, mode: "write", entry: value2 }); + else { + const mode = draft.whenBusy === "steer" ? "steer" : "followUp"; + const content = value2; + const entry3 = draft.entry === void 0 ? {} : { entry: pickInputEntry(draft.entry) }; + items.push({ id: id2, mode, content, ...entry3 }); + } + if (boundary === void 0) + return { id: id2, status: "queued" }; + const { users, first } = await applyBoundary(tx, boundary, "final", now); + if (users.length > 0) + await startRun(tx, conversationId, live, { inputs: users, first }); + return { id: id2, status: draft.type === "write" ? "done" : users.at(-1) === id2 ? "placed" : "queued" }; + } + if (draft.type === "write") { + if (isStale(boundary, draft.entry)) { + const stale = { status: "unanswered", reason: "stale" }; + return { + id: (await tx.createSubmission({ ...fields, type: "write", ...stale })).id, + status: "done" + }; + } + const entry3 = await tx.appendEntry(conversationId, draft.entry); + const write = { ...fields, type: "write", status: "done", entry: entry3.id }; + return { id: (await tx.createSubmission(write)).id, status: "done" }; + } + for (const before of boundary.entries) + await tx.appendEntry(conversationId, before); + const entry2 = await appendInput(tx, conversationId, draft.content, draft.entry, now); + const input = { ...fields, type: "input", status: "placed", entry: entry2.id }; + const { id } = await tx.createSubmission(input); + await startRun(tx, conversationId, live, { inputs: [id], first: entry2.id }); + return { id, status: "placed" }; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +var TOOL_RESULT_MAX_CHARS = 2e3; +var SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n\n"; +var SUMMARY_SUFFIX = "\n"; +var SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified. + +Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`; +var SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work. If the conversation starts with an earlier summary, preserve its information and fold the newer messages into it. + +Use this EXACT format: + +## Goal +[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.] + +## Constraints & Preferences +- [Any constraints, preferences, or requirements mentioned by user] +- [Or "(none)" if none were mentioned] + +## Progress +### Done +- [x] [Completed tasks/changes] + +### In Progress +- [ ] [Current work] + +### Blocked +- [Issues preventing progress, if any] + +## Key Decisions +- **[Decision]**: [Brief rationale] + +## Next Steps +1. [Ordered list of what should happen next] + +## Critical Context +- [Any data, examples, or references needed to continue] +- [Or "(none)" if not applicable] + +Keep each section concise. Preserve exact file paths, function names, and error messages.`; +var CompactionTask = defineTask({ + name: "pi.compaction", + version: 1, + initial: () => ({ phase: "select" }), + phases: { + select: async (task, runtime, context) => { + if (cutOffTooOften(task, runtime)) + return failCutOff(runtime, task, context); + const { conversationId } = runtime; + const agent = await runtime.agent(context); + const settings = runtime.settings; + const ref = agent.model; + const model2 = ref === void 0 ? void 0 : runtime.models.getModel(ref.provider, ref.modelId); + if (ref === void 0 || model2 === void 0) + return failNoModel2(runtime, ref, context); + const policy = compactionPolicy(settings, ref); + const view2 = await runtime.context(conversationId, context); + const cut = selectCut(view2, policy.keepRecentTokens); + if (cut === void 0) + return complete(runtime, context); + const firstKept = view2.entries[cut].id; + const { reason, instructions } = task.input; + const compaction = { + reason, + entries: view2.entries.slice(0, cut), + messages: summarizedMessages(view2, cut), + firstKept, + ...instructions === void 0 ? {} : { instructions } + }; + let decision; + await runtime.hooks.each("beforeCompact", async (hook2) => { + if (decision === void 0) + decision = await hook2(compaction, runtime, context); + }); + if (decision !== void 0 && "decline" in decision) + return complete(runtime, context); + if (decision !== void 0) + return place(runtime, firstKept, decision.summary, context); + const request2 = { + attempt: 1, + model: ref, + thinkingLevel: agent.thinkingLevel, + streamOptions: settings.stream, + maxTokens: Math.min(Math.floor(0.8 * policy.reserveTokens), model2.maxTokens > 0 ? model2.maxTokens : Number.POSITIVE_INFINITY), + tail: view2.entries.reduce((tail, entry2) => entry2.id > tail ? entry2.id : tail, firstKept), + firstKept + }; + await runtime.commit(() => ({ status: "running", checkpoint: { phase: "summarize", ...request2 } }), context); + }, + summarize: async (task, runtime, context) => { + if (cutOffTooOften(task, runtime)) + return failCutOff(runtime, task, context); + const { phase: _, ...request2 } = task.state.checkpoint; + const { model: ref, thinkingLevel, streamOptions, maxTokens, tail, firstKept, attempt } = request2; + const model2 = runtime.models.getModel(ref.provider, ref.modelId); + if (model2 === void 0) + return failNoModel2(runtime, ref, context); + const view2 = await runtime.context(runtime.conversationId, context, { at: tail }); + const cut = view2.entries.findIndex((entry2) => entry2.id === firstKept); + const now = runtime.now(); + const messages = [ + { role: "system", content: SUMMARIZATION_SYSTEM_PROMPT, timestamp: now }, + { + role: "user", + content: [{ type: "text", text: summaryPrompt(summarizedMessages(view2, cut), task.input.instructions) }], + timestamp: now + } + ]; + const { deferred: _deferred, ...forwarded } = streamOptions; + const options = { + ...forwarded, + cacheRetention: "none", + maxTokens, + signal: runtime.signal, + telemetry: context.telemetry, + sessionId: await ensureProviderSessionId(runtime, context), + ...thinkingLevel === "off" ? {} : { reasoning: thinkingLevel } + }; + const message = await runtime.models.completeSimple(model2, { messages }, options); + runtime.signal.throwIfAborted(); + const summary = summaryText(message); + const policy = runtime.settings.retry; + const retry = message.stopReason === "error" && isRetryableAssistantError(message) && policy.enabled && attempt <= policy.maxRetries; + const until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0; + await runtime.commit(async (tx, current) => { + await recordUsage(tx, runtime.conversationId, "models", `${message.provider}/${message.model}`, message.usage); + const live = await tx.doc(LiveDoc, runtime.conversationId); + if (summary !== void 0) + return placeSummary(tx, runtime, current, live, firstKept, summary); + if (retry) { + const status = compactionStatus(live, runtime.taskId); + if (status !== void 0) + status.retry = { at: until, error: message.errorMessage ?? "" }; + const checkpoint = { phase: "retry", ...request2, until }; + return { status: "sleeping", checkpoint, until }; + } + const text = summaryFailure(message); + failCompactionStatus(live, runtime.taskId, text); + return { + status: "terminal", + outcome: { status: "failed", error: { message: text, detail: { reason: "model_error" } } } + }; + }, context); + }, + /** After the backoff's sleep; a run before `until` (an early wake, or a record of an earlier version) sleeps again. */ + retry: async (task, runtime, context) => { + const { phase: _, until, ...request2 } = task.state.checkpoint; + if (cutOffTooOften(task, runtime)) + return failCutOff(runtime, task, context); + if (until > runtime.now()) + return runtime.sleepUntil(until, task.state.checkpoint, context); + const attempt = request2.attempt + 1; + await runtime.commit(async (tx) => { + const status = compactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + if (status !== void 0) { + status.attempt = attempt; + delete status.retry; + } + return { status: "running", checkpoint: { phase: "summarize", ...request2, attempt } }; + }, context); + } + }, + abort: async (_task, runtime, context) => { + await runtime.commit(async (tx) => { + removeCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + return { status: "terminal", outcome: { status: "aborted" } }; + }, context); + } +}); +async function createCompaction(tx, conversationId, input, owner) { + const ownership = owner === void 0 ? { kind: "conversation" } : { kind: "task", taskId: owner }; + const background = owner === void 0 && input.reason !== "manual"; + const taskId = await tx.createTask(CompactionTask, input, { ownership, conversationId, background }); + const status = { taskId, trigger: input.reason, blocking: owner !== void 0, attempt: 1 }; + addCompactionStatus(await tx.doc(LiveDoc, conversationId), status); + return taskId; +} +function compactionPolicy(settings, model2) { + const { modelOverrides, ...policy } = settings.compaction; + const override2 = modelOverrides?.[`${model2.provider}/${model2.modelId}`]; + return { + enabled: override2?.enabled ?? policy.enabled, + reserveTokens: override2?.reserveTokens ?? policy.reserveTokens, + keepRecentTokens: override2?.keepRecentTokens ?? policy.keepRecentTokens, + backgroundTokens: override2?.backgroundTokens ?? policy.backgroundTokens + }; +} +function selectCut(view2, keepRecentTokens) { + const { contributions } = view2; + const start = view2.head === void 0 ? 0 : 1; + const candidates = []; + for (let index = start; index < contributions.length; index++) { + if (isCandidate(contributions, index)) + candidates.push(index); + } + let kept = 0; + let cut; + for (let index = contributions.length - 1; index >= start; index--) { + for (const message of contributions[index]) + kept += estimateMessageTokens(message); + if (kept < keepRecentTokens) + continue; + cut = candidates.find((candidate) => candidate >= index) ?? candidates.at(-1); + break; + } + if (cut === void 0) + return void 0; + for (let index = start; index < cut; index++) + if (contributions[index].length > 0) + return cut; + return void 0; +} +function isCandidate(contributions, index) { + const first = contributions[index][0]; + if (first?.role === "assistant") + return true; + if (first?.role !== "user") + return false; + let calls = /* @__PURE__ */ new Set(); + for (let before = index - 1; before >= 0; before--) { + const assistant = contributions[before].findLast((message) => message.role === "assistant"); + if (assistant === void 0) + continue; + calls = new Set(assistant.content.flatMap((content) => content.type === "toolCall" ? [content.id] : [])); + break; + } + if (calls.size === 0) + return true; + for (let after = index; after < contributions.length; after++) { + for (const [position, message] of contributions[after].entries()) { + if (message.role === "assistant" && (after > index || position > 0)) + return true; + if (message.role === "toolResult" && calls.has(message.toolCallId)) + return false; + } + } + return true; +} +function summarizedMessages(view2, cut) { + return orderToolResults(view2.contributions.slice(0, cut).flat()); +} +function estimateContext(view2, extra) { + let measured; + const after = view2.head?.id ?? Number.NEGATIVE_INFINITY; + for (let index = view2.entries.length - 1; index >= 0 && measured === void 0; index--) { + if (view2.entries[index].id <= after) + continue; + measured = view2.contributions[index].findLast((message) => message.role === "assistant" && calculateContextTokens(message.usage) > 0); + } + const from = measured === void 0 ? 0 : view2.messages.lastIndexOf(measured) + 1; + let tokens = measured === void 0 ? 0 : calculateContextTokens(measured.usage); + for (const message of view2.messages.slice(from)) + tokens += estimateMessageTokens(message); + for (const message of extra) + tokens += estimateMessageTokens(message); + return tokens; +} +function summaryText(message) { + if (message.stopReason !== "stop" || message.content.some((content) => content.type === "toolCall")) + return void 0; + const text = message.content.flatMap((content) => content.type === "text" ? [content.text] : []).join("\n").trim(); + return text.length === 0 ? void 0 : text; +} +function summaryFailure(message) { + if (message.stopReason === "error" || message.stopReason === "aborted") { + return `Summarization failed: ${message.errorMessage ?? message.stopReason}`; + } + if (message.stopReason === "length") + return "Summarization hit the token limit; the summary is incomplete"; + if (message.content.some((content) => content.type === "toolCall")) + return "Summarization attempted to call a tool"; + return "Summarization produced no text"; +} +function summaryPrompt(messages, instructions) { + const focus = instructions === void 0 ? "" : ` + +Additional focus: ${instructions}`; + return ` +${serializeConversation(messages)} + + +${SUMMARIZATION_PROMPT}${focus}`; +} +function serializeConversation(messages) { + const parts = []; + for (const message of messages) { + if (message.role === "user") { + const text = contentText2(message.content); + if (text.length > 0) + parts.push(`[User]: ${text}`); + } else if (message.role === "assistant") { + const text = message.content.flatMap((content) => content.type === "text" ? [content.text] : []); + const calls = message.content.flatMap((content) => content.type === "toolCall" ? [ + `${content.name}(${Object.entries(content.arguments).map(([key, value2]) => `${key}=${JSON.stringify(value2)}`).join(", ")})` + ] : []); + if (text.length > 0) + parts.push(`[Assistant]: ${text.join("\n")}`); + if (calls.length > 0) + parts.push(`[Assistant tool calls]: ${calls.join("; ")}`); + } else if (message.role === "toolResult") { + const text = contentText2(message.content); + if (text.length > 0) + parts.push(`[Tool result]: ${truncate(text, TOOL_RESULT_MAX_CHARS)}`); + } + } + return parts.join("\n\n"); +} +function contentText2(content) { + if (typeof content === "string") + return content; + return content.flatMap((block) => block.type === "text" && block.text !== void 0 ? [block.text] : []).join("\n"); +} +function truncate(text, maxChars) { + if (text.length <= maxChars) + return text; + return `${text.slice(0, maxChars)} + +[... ${text.length - maxChars} more characters truncated]`; +} +async function place(runtime, firstKept, summary, context) { + await runtime.commit(async (tx, current) => placeSummary(tx, runtime, current, await tx.doc(LiveDoc, runtime.conversationId), firstKept, summary), context); +} +async function placeSummary(tx, runtime, current, live, firstKept, summary) { + removeCompactionStatus(live, runtime.taskId); + delete live.compactionFailure; + const text = `${SUMMARY_PREFIX}${summary}${SUMMARY_SUFFIX}`; + const entry2 = { + kind: CompactionEntry.kind, + head: firstKept, + model: [{ role: "user", content: [{ type: "text", text }], timestamp: runtime.now() }], + data: { reason: current.input.reason } + }; + const result = current.owner === void 0 ? { + submissionId: (await admitSubmission(tx, runtime.conversationId, { type: "write", requestId: `compaction:${runtime.taskId}`, entry: entry2 }, runtime.now(), runtime.settings)).id + } : { entryId: (await tx.appendEntry(runtime.conversationId, entry2)).id }; + return { status: "terminal", outcome: { status: "completed", result } }; +} +async function complete(runtime, context) { + await runtime.commit(async (tx) => { + removeCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId); + return { status: "terminal", outcome: { status: "completed", result: {} } }; + }, context); +} +async function failCutOff(runtime, task, context) { + const message = `Compaction was interrupted ${cutOffCount(task)}`; + await runtime.commit(async (tx) => { + failCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId, message); + return { + status: "terminal", + outcome: { status: "failed", error: { message, detail: { reason: "restart_limit" } } } + }; + }, context); +} +async function failNoModel2(runtime, ref, context) { + const message = ref === void 0 ? "No model is configured" : `Model ${ref.provider}/${ref.modelId} is not available`; + await runtime.commit(async (tx) => { + failCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId, message); + return { status: "terminal", outcome: { status: "failed", error: { message, detail: { reason: "no_model" } } } }; + }, context); +} + // node_modules/@earendil-works/pi-durable/dist/harness/define.js function defineExtension(extension) { return extension; @@ -41577,6 +58082,931 @@ function defineExtension(extension) { function defineTool(tool) { return tool; } +function hook(task, handlers) { + return { task: task.definition.name, handlers }; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/harness.js +init_identity(); +init_dist(); + +// node_modules/@earendil-works/pi-durable/dist/harness/registry.js +var SECTION_KEY = /^[a-z][a-z0-9_-]*$/; +var BUILTIN_TASKS = [GenerationTask, ToolTask, CompactionTask]; +var RegistryState = class { + #extensions; + #byName; + #tasks; + constructor(extensions) { + this.#extensions = extensions; + this.#byName = new Map(extensions.map((extension) => [extension.name, extension])); + const tasks = /* @__PURE__ */ new Map(); + for (const task of BUILTIN_TASKS) + tasks.set(task.definition.name, task); + for (const extension of extensions) { + for (const task of extension.tasks ?? []) { + const name = task.definition.name; + if (tasks.has(name)) + throw new Error(`Task ${name} of extension ${extension.name} is already installed`); + tasks.set(name, task); + } + } + this.#tasks = tasks; + } + installed() { + return this.#extensions; + } + extension(name) { + return this.#byName.get(name); + } + tools() { + return this.#extensions.flatMap((extension) => (extension.tools ?? []).map((tool) => ({ extension, tool }))); + } + sections() { + return this.#extensions.flatMap((extension) => (extension.sections ?? []).map((section2) => ({ extension, section: section2 }))); + } + tasks() { + return [...this.#tasks.values()]; + } + task(name) { + return this.#tasks.get(name); + } +}; +var RegistryImpl = class { + #current = new RegistryState([]); + #listeners = /* @__PURE__ */ new Set(); + snapshot() { + return this.#current; + } + subscribe(listener) { + this.#listeners.add(listener); + return () => this.#listeners.delete(listener); + } + install(extension) { + validateExtension(extension); + const current = this.#current.installed(); + const index = current.findIndex((installed) => installed.name === extension.name); + const next = index < 0 ? [...current, extension] : current.map((installed, at) => at === index ? extension : installed); + this.#publish(next); + } + uninstall(extension) { + const current = this.#current.installed(); + if (!current.some((installed) => installed.name === extension.name)) + return; + this.#publish(current.filter((installed) => installed.name !== extension.name)); + } + /** Build and validate the next state, which throws on a task name collision, then publish it synchronously. */ + #publish(extensions) { + this.#current = new RegistryState(extensions); + for (const listener of [...this.#listeners]) + listener(); + } +}; +function validateExtension(extension) { + const tools = /* @__PURE__ */ new Set(); + for (const tool of extension.tools ?? []) { + if (tools.has(tool.name)) + throw new Error(`Extension ${extension.name} has two tools named ${tool.name}`); + tools.add(tool.name); + } + const sections = /* @__PURE__ */ new Set(); + for (const { key } of extension.sections ?? []) { + if (!SECTION_KEY.test(key)) + throw new TypeError(`Section key ${JSON.stringify(key)} must match ${SECTION_KEY}`); + if (key === INSTRUCTIONS_KEY) + throw new Error(`Section key ${key} is reserved for the agent's instructions`); + if (sections.has(key)) + throw new Error(`Extension ${extension.name} has two sections with key ${key}`); + sections.add(key); + } +} +function createRegistry() { + return new RegistryImpl(); +} + +// node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +var LIVE_STATUSES2 = ["pending", "running", "waiting", "sleeping", "completing"]; +var SCAN_PAGE_SIZE4 = 256; +var TaskGraphView = class { + #session; + #blocking; + #mount; + #closed = false; + constructor(session, blocking) { + this.#session = session; + this.#blocking = blocking; + session.followCommits((publication, context) => { + if (this.#mount === void 0 || publication.kind === "memory") + return; + advance(this.#mount, publication, context, blocking.blocked, (error) => session.report(error)); + }); + blocking.subscribeBlocked(() => this.#refreshBlocked()); + session.subscribeClose(() => { + this.#closed = true; + const ends = closeEnds(this.#session.failure); + for (const observer of [...this.#mount?.observers ?? []]) { + contained(() => observer.end(closeEndOf(observer, ends)), (error) => session.report(error)); + } + this.#mount = void 0; + }); + } + /** + * Attach a synchronous observer of the graph (`Harness.observeTaskGraph()`), behind `guardObserver()`; `context` + * governs only the attachment. + */ + async observe(observer, context) { + let value2; + const attached = await this.#attach((current, release) => { + value2 = current; + return guardObserver(observer, release, (error) => this.#session.report(error)); + }, context); + const signal = context.abortSignal; + if (signal?.aborted) { + attached.detach(); + throw signal.reason; + } + return observation(value2, attached.observer); + } + /** A serialized watch of the graph, an observer of its mount; aborting `context` ends it `aborted`. */ + async watch(context) { + const { observer } = await this.#attach((value2, release) => new Watch(value2, release, (error) => this.#session.report(error)), context); + const signal = context.abortSignal; + if (signal?.aborted) { + observer.abort(); + throw signal.reason; + } + if (signal !== void 0) + observer.observeAbort(signal); + return observer; + } + /** Register an observer created from the current revision, atomically on the Session line. */ + #attach(create, context) { + return this.#session.readOnLine(async (storage2) => { + const mount = this.#mount ?? { + ...await this.#build(storage2, context), + observers: /* @__PURE__ */ new Set() + }; + const detach = () => { + mount.observers.delete(observer); + if (mount.observers.size === 0 && this.#mount === mount) + this.#mount = void 0; + }; + const observer = create(mount.value, detach); + if (this.#closed) + throw closedError(this.#session); + context.abortSignal?.throwIfAborted(); + this.#mount = mount; + mount.observers.add(observer); + return { observer, detach }; + }); + } + /** On the Session line: derive every node's blocked reason again, and publish the ones that changed. */ + #refreshBlocked() { + if (this.#mount === void 0 || this.#closed) + return; + this.#session.readOnLine(async () => { + const mount = this.#mount; + if (mount === void 0) + return; + const ops3 = []; + for (const [key, record] of mount.records) { + const blocked = this.#blocking.blocked(record); + if (blocked === mount.value.tasks[key]?.blocked) + continue; + ops3.push(blocked === void 0 ? ["d", ["tasks", key, "blocked"]] : ["s", ["tasks", key, "blocked"], blocked]); + } + publish(mount, ops3, BACKGROUND_CONTEXT, (error) => this.#session.report(error)); + }).catch(() => { + }); + } + /** Read the graph on the line, through the line's `storage`. */ + async #build(storage2, context) { + const tasks = {}; + const live = /* @__PURE__ */ new Map(); + const records = []; + for (const status of LIVE_STATUSES2) { + records.push(...await scanAll((cursor) => storage2.scanTasks({ status }, SCAN_PAGE_SIZE4, cursor, context))); + } + records.sort((a, b) => a.id - b.id); + for (const record of records) { + const owned = await scanAll((cursor) => storage2.scanConversations({ ownerTaskId: record.id }, SCAN_PAGE_SIZE4, cursor, context)); + const conversations = owned.map((conversation) => conversation.id).sort((a, b) => a - b); + const subject = blockedSubject(record); + tasks[String(record.id)] = nodeOf2(record, conversations, this.#blocking.blocked(subject)); + live.set(String(record.id), subject); + } + return { value: { tasks }, records: live }; + } +}; +function advance(mount, publication, context, blocked, report2) { + const ops3 = []; + const changed = /* @__PURE__ */ new Map(); + const node = (key) => changed.has(key) ? changed.get(key) : mount.value.tasks[key]; + for (const change of publication.changes) { + if (change.type !== "task") + continue; + const record = change.value; + const key = String(record.id); + const previous = node(key); + if (record.state.status === "terminal") { + mount.records.delete(key); + if (previous === void 0) + continue; + ops3.push(["d", ["tasks", key]]); + changed.set(key, void 0); + continue; + } + const subject = blockedSubject(record); + mount.records.set(key, subject); + const next = nodeOf2(record, previous?.conversations ?? [], blocked(subject)); + if (previous !== void 0 && JSON.stringify(next) === JSON.stringify(previous)) + continue; + ops3.push(["s", ["tasks", key], next]); + changed.set(key, next); + } + const created = /* @__PURE__ */ new Map(); + for (const change of publication.changes) { + if (change.type !== "conversation" || change.value.owner === void 0) + continue; + const key = String(change.value.owner.taskId); + if (node(key) !== void 0) + created.set(key, [...created.get(key) ?? [], change.value.id]); + } + for (const [key, ids] of created) { + const conversations = [...node(key).conversations, ...ids].sort((a, b) => a - b); + ops3.push(["s", ["tasks", key, "conversations"], conversations]); + } + publish(mount, ops3, context, report2); +} +function publish(mount, ops3, context, report2) { + if (ops3.length === 0) + return; + mount.value = applyImmutable(mount.value, ops3); + const frameContext = withoutAbortSignal(context); + const call = { kind: "value", value: mount.value, ops: ops3, retired: false }; + for (const observer of [...mount.observers]) + contained(() => observer.advance(call, frameContext), report2); +} +function nodeOf2(record, conversations, blocked) { + return { + id: record.id, + kind: record.kind, + conversationId: record.conversationId, + ...record.owner === void 0 ? {} : { owner: record.owner }, + background: record.background, + abortRequested: record.abortRequested, + state: stateOf(record), + conversations, + ...blocked === void 0 ? {} : { blocked } + }; +} +function stateOf(record) { + const state2 = record.state; + switch (state2.status) { + case "pending": + case "running": + return { status: state2.status, phase: phaseOf(state2.checkpoint) }; + case "waiting": + return { status: "waiting", phase: phaseOf(state2.checkpoint), on: [...state2.on], policy: state2.policy }; + case "sleeping": + return { status: "sleeping", phase: phaseOf(state2.checkpoint), until: state2.until }; + // Terminal records never reach here: they leave the graph. + case "completing": + case "terminal": + return { status: "completing", outcome: state2.outcome.status }; + } +} +function phaseOf(checkpoint) { + return checkpoint.phase; +} + +// node_modules/@earendil-works/pi-durable/dist/harness/view.js +var DEFAULT_WINDOW_MIN = 50; +var MOUNTED = [ + AgentDoc, + LiveDoc, + InboxDoc, + ProviderDoc, + UsageDoc +]; +var MOUNTED_KINDS = new Set(MOUNTED.map((token) => token.definition.kind)); +var SCAN_PAGE_SIZE5 = 256; +var VIEWS = /* @__PURE__ */ new WeakMap(); +function resolveWindow(window2) { + const min = window2?.min ?? DEFAULT_WINDOW_MIN; + if (!Number.isSafeInteger(min) || min < 1) + throw new RangeError(`Window min must be an integer >= 1, got ${min}`); + const max = window2?.max ?? 2 * min; + if (!Number.isSafeInteger(max) || max < min) { + throw new RangeError(`Window max must be an integer >= min (${min}), got ${max}`); + } + const from = window2?.from; + if (from !== void 0 && !Number.isSafeInteger(from)) { + throw new RangeError(`Window from must be an entry ID, got ${from}`); + } + return { from, min, max }; +} +var ConversationViews = class { + #session; + #mounts = /* @__PURE__ */ new Map(); + #closed = false; + constructor(session) { + this.#session = session; + VIEWS.set(session, this); + session.followCommits((publication, context) => { + for (const [id, mount] of this.#mounts) + advance2(id, mount, publication, context, (error) => this.report(error)); + }); + session.subscribeClose(() => { + this.#closed = true; + const ends = closeEnds(this.#session.failure); + for (const mount of this.#mounts.values()) + for (const windowed of [...mount.observers]) { + contained(() => windowed.observer.end(closeEndOf(windowed.observer, ends)), (error) => this.report(error)); + } + this.#mounts.clear(); + }); + } + /** Report an observer's listener error through the Harness. */ + report(error) { + this.#session.report(error); + } + /** + * Attach a synchronous observer of the view (`Harness.observeConversation()`), behind `guardObserver()`; `context` + * governs only the attachment. + */ + async observe(id, observer, context, window2) { + let value2; + const attached = await this.attach(id, window2, (current, release) => { + value2 = current; + return guardObserver(observer, release, (error) => this.report(error)); + }, context); + const signal = context.abortSignal; + if (signal?.aborted) { + attached.detach(); + throw signal.reason; + } + return observation(value2, attached.observer); + } + /** A serialized watch of the view, an observer of its mount; aborting `context` ends it `aborted`. */ + async watch(id, context, window2) { + const { observer } = await this.attach(id, window2, (value2, release) => new Watch(value2, release, (error) => this.#session.report(error)), context); + const signal = context.abortSignal; + if (signal?.aborted) { + observer.abort(); + throw signal.reason; + } + if (signal !== void 0) + observer.observeAbort(signal); + return observer; + } + /** + * Register an observer created from its window's first revision, atomically on the Session line: it sees every later + * publication and nothing earlier. `release` drops it, and the mount with its last observer. + */ + async attach(id, window2, create, context) { + const bounds = resolveWindow(window2); + return this.#session.readOnLine(async (storage2) => { + const mount = this.#mounts.get(id) ?? await this.#build(storage2, id, context); + const { entries: entries2, before } = await loadWindow(storage2, id, bounds, context); + const value2 = view(mount.conversation, entries2, before, mount.docs); + let windowed; + const detach = () => { + if (windowed !== void 0) + mount.observers.delete(windowed); + if (mount.observers.size === 0 && this.#mounts.get(id) === mount) + this.#mounts.delete(id); + }; + const observer = create(value2, detach); + if (this.#closed) + throw closedError(this.#session); + context.abortSignal?.throwIfAborted(); + windowed = { min: bounds.min, max: bounds.max, value: value2, observer }; + this.#mounts.set(id, mount); + mount.observers.add(windowed); + return { observer, detach }; + }); + } + /** Hydrate a mount on the line, through the line's `storage`. */ + async #build(storage2, id, context) { + const conversation = await storage2.conversation(id, context); + if (conversation === void 0) + throw new Error(`Conversation ${id} does not exist`); + const docs = {}; + const incarnations = /* @__PURE__ */ new Map(); + for (const token of MOUNTED) { + const loaded = await this.#session.conversationDocumentOnLine(token, id, context); + if (loaded === void 0) + continue; + docs[token.definition.kind] = loaded.value; + incarnations.set(token.definition.kind, { id: loaded.record.id, version: loaded.version }); + } + return { conversation, docs, incarnations, observers: /* @__PURE__ */ new Set() }; + } +}; +function view(conversation, entries2, before, docs) { + return before === void 0 ? { conversation, entries: entries2, docs } : { conversation, entries: entries2, before, docs }; +} +async function loadWindow(storage2, conversationId, bounds, context) { + const { from, min, max } = bounds; + if (from !== void 0) { + const since = await scanUpTo(storage2, { conversationId, minEntryId: from, order: "ascending" }, max + 1, context); + if (since.length <= max) { + const query = { conversationId, maxEntryId: idFromNumber(from - 1) }; + const previous = (await storage2.scanEntries(query, 1, void 0, context)).items[0]; + return { entries: since, before: previous?.id }; + } + } + const newest = await scanUpTo(storage2, { conversationId }, min + 1, context); + const before = newest.length > min ? newest.pop().id : void 0; + return { entries: newest.reverse(), before }; +} +async function scanUpTo(storage2, query, limit3, context) { + const entries2 = []; + let cursor; + do { + const page2 = await storage2.scanEntries(query, Math.min(SCAN_PAGE_SIZE5, limit3 - entries2.length), cursor, context); + entries2.push(...page2.items); + cursor = page2.next; + } while (cursor !== void 0 && entries2.length < limit3); + return entries2; +} +function advance2(id, mount, publication, context, report2) { + const docOps = []; + const appended = []; + for (const change of publication.changes) { + if (change.type === "entry" && change.value.conversationId === id) { + appended.push(change.value); + continue; + } + if (change.type !== "document" || change.conversationId !== id) + continue; + const kind = change.record.kind; + if (!MOUNTED_KINDS.has(kind) || change.record.key !== void 0) + continue; + const path5 = ["docs", kind]; + const mounted = mount.incarnations.get(kind); + if (change.kind === "retire") { + if (mounted?.id !== change.record.id) + continue; + mount.incarnations.delete(kind); + docOps.push(["d", path5]); + } else if (mounted?.id === change.record.id && mounted.version === change.version) { + for (const op2 of change.ops) + docOps.push(prefixed(op2, path5)); + } else { + mount.incarnations.set(kind, { id: change.record.id, version: change.version }); + docOps.push(["s", path5, change.value]); + } + } + if (docOps.length === 0 && appended.length === 0) + return; + if (docOps.length > 0) + mount.docs = applyImmutable({ docs: mount.docs }, docOps).docs; + const frameContext = withoutAbortSignal(context); + const inserted = appended; + for (const windowed of [...mount.observers]) { + const previous = windowed.value; + let entries2 = previous.entries; + let before = previous.before; + let ops3 = docOps; + if (appended.length > 0) { + ops3 = [...docOps, ["p", ["entries"], entries2.length, 0, inserted]]; + entries2 = entries2.concat(appended); + if (entries2.length > windowed.max) { + const drop = entries2.length - windowed.min; + before = entries2[drop - 1].id; + entries2 = entries2.slice(drop); + ops3.push(["p", ["entries"], 0, drop, []], ["s", ["before"], before]); + } + } + windowed.value = view(mount.conversation, entries2, before, mount.docs); + const call = { kind: "value", value: windowed.value, ops: ops3, retired: false }; + contained(() => windowed.observer.advance(call, frameContext), report2); + } +} +function prefixed(op2, prefix) { + const at = (path5) => [...prefix, ...path5]; + switch (op2[0]) { + case "r": + return ["s", prefix, op2[1]]; + case "p": + return ["p", at(op2[1]), op2[2], op2[3], op2[4]]; + case "m": + return ["m", at(op2[1]), op2[2]]; + case "s": + return ["s", at(op2[1]), op2[2]]; + case "d": + return ["d", at(op2[1])]; + case "a": + return ["a", at(op2[1]), op2[2]]; + case "t": + return ["t", at(op2[1]), op2[2]]; + } +} + +// node_modules/@earendil-works/pi-durable/dist/harness/harness.js +var SCAN_PAGE_SIZE6 = 256; +var SCHEDULER_INDEX_SIZES = /* @__PURE__ */ Symbol.for("pi-durable.schedulerIndexSizes"); +var SCHEDULER_IDLE_STATE = /* @__PURE__ */ Symbol.for("pi-durable.schedulerIdleState"); +var ConversationImpl = class { + id; + #host; + constructor(id, host) { + this.id = id; + this.#host = host; + } + agent(context) { + return this.#host.harness.resolveAgent(this.id, void 0, context); + } + configure(change, context) { + return this.#host.harness.commitWith((tx) => configure(tx, this.id, change), context); + } + submit(first, second) { + if ("type" in first) + return this.#host.submissions.submit(this.id, first, second); + return this.#host.submissions.admit(first, this.id, second); + } + async compact(instructions, context) { + this.#host.tasks.resume(); + const input = { reason: "manual", ...instructions === void 0 ? {} : { instructions } }; + return this.#host.harness.commitWith((tx) => createCompaction(tx, this.id, input), context); + } + async reset(handoff, context) { + const model2 = handoff === void 0 ? {} : { model: [{ role: "user", content: handoff, timestamp: this.#host.now() }] }; + const entry2 = { kind: ResetEntry.kind, head: "self", ...model2 }; + await this.#host.submissions.submit(this.id, { type: "write", entry: entry2 }, context); + } + commit(change, context, options) { + return this.#host.harness.commitWith(change, context, { conversationId: this.id }, options); + } + context(context, options) { + return readContext(this.#host.harness, this.#host.storage, this.id, context, options?.at); + } + entries(query, limit3, cursor, context) { + const scan = conversationEntries(this.id, query); + return this.#host.harness.readOnLine((storage2) => storage2.scanEntries(scan, limit3, cursor, context)); + } + fork(at, options, context) { + return this.#host.create({ kind: "fork", parentId: this.id, at, ownership: options.ownership }, options, context); + } + async abort(context, options) { + this.#host.tasks.resume(); + return this.#host.tasks.abortConversation(this.id, options?.background === true, context); + } + async waitForIdle(context) { + this.#host.tasks.resume(); + return this.#host.tasks.waitForIdle(this.id, context); + } + watch(context, window2) { + return this.#host.views.watch(this.id, context, window2); + } +}; +var DEFAULT_HARNESS_IDENTITY = { attribution: PI_ATTRIBUTION }; +function currentModels(models3, identity) { + const merged = mergeClientIdentity(DEFAULT_HARNESS_IDENTITY, identity) ?? DEFAULT_HARNESS_IDENTITY; + if (typeof models3 === "function") + return () => withClientIdentity(models3(), merged); + const wrapped = withClientIdentity(models3, merged); + return () => wrapped; +} +function currentSettings(settings) { + return typeof settings === "function" ? settings : () => settings; +} +var HarnessImpl = class extends SessionImpl { + #options; + #hostSettings; + #report; + #host; + #tasks; + #submissions; + #taskGraph; + constructor(rawStorage, options, context) { + const report2 = safeReport(options.onReport, options.telemetry ?? NOOP_TELEMETRY_CONTEXT); + const now = safeNow(options.now, report2); + const hostSettings = currentSettings(options.settings); + super(rawStorage, now, () => hostSettings()?.documentRetentionMs, options.setTimer, options.readOnly === true, () => hostSettings()?.progress?.persistWithinMs); + const storage2 = this.storage; + this.#options = options; + this.#report = report2; + this.#hostSettings = hostSettings; + const settings = () => resolveSettings(hostSettings()); + this.#tasks = new TaskScheduler({ + telemetry: options.telemetry, + session: this, + storage: storage2, + registry: options.registry, + models: currentModels(options.models, options.identity), + agent: (id, snapshot, callContext) => this.resolveAgent(id, snapshot, callContext), + settings, + env: (id, callContext) => this.buildEnv(id, callContext), + now, + onWake: options.onWake, + timers: hostTimers(options.setTimer, (error) => report2(error, { kind: "host_error", callback: "setTimer" })), + writeAtClose: (writes) => this.writeAtClose(writes), + report: this.#report, + limitsRestarts: (kind) => LIMITS_RESTARTS.has(kind), + settleOutcome: settleSchedulerOutcome, + withdrawInputs: withdrawQueuedInputs, + conversation: async (id, binding, callContext) => { + const record = await this.readOnLine((line) => line.conversation(id, callContext)); + return record === void 0 ? void 0 : boundConversation(id, binding, this.#submissions, this.#tasks); + }, + context: withoutAbortSignal(context), + readOnly: options.readOnly === true + }); + this.#submissions = new Submissions(this, now, settings, () => this.#tasks.resume(), options.telemetry); + this.#taskGraph = new TaskGraphView(this, { + blocked: (record) => this.#tasks.blockedReason(record), + subscribeBlocked: (listener) => this.#tasks.subscribeBlocked(listener) + }); + this.#host = { + harness: this, + storage: storage2, + tasks: this.#tasks, + submissions: this.#submissions, + views: new ConversationViews(this), + now, + create: (target, createOptions, context2) => this.#create(target, createOptions, context2) + }; + } + async beforeInput(tx, conversationId, input, context) { + const agent = resolveAgent(await tx.doc(AgentDoc, conversationId), this.#options.registry.snapshot(), resolveSettings(this.#hostSettings()), (error, extension) => this.#report(error, { kind: "extension_error", conversationId, extension }, context)); + const entries2 = []; + for (const { handlers } of agentHooks(agent, "pi.generation")) { + const result = await handlers.beforeInput?.(input, { conversationId, tx }, context); + entries2.push(...result?.entries ?? []); + } + return entries2; + } + /** Resolve a conversation's committed `pi.agent` against `snapshot`, or the current one, and the current settings. */ + async resolveAgent(id, snapshot, context) { + const registry3 = snapshot ?? this.#options.registry.snapshot(); + const state2 = await this.snapshot(AgentDoc, id, context); + return resolveAgent(state2, registry3, resolveSettings(this.#hostSettings()), (error, extension) => this.#report(error, { kind: "extension_error", conversationId: id, extension }, context)); + } + /** Build a conversation's environment from its current `cwd`; `undefined` without an `env` option. */ + async buildEnv(id, context) { + const build = this.#options.env; + if (build === void 0) + return void 0; + const cwd = (await this.snapshot(AgentDoc, id, context))?.cwd; + return build({ conversationId: id, ...cwd === void 0 ? {} : { cwd }, read: this }, context); + } + /** Reconcile surviving `running` tasks to `pending`; part of open. */ + openTasks(context) { + return this.#tasks.open(context); + } + resume() { + this.assertUsable(); + this.#tasks.resume(); + } + hold() { + this.#tasks.hold(); + } + release() { + this.#tasks.release(); + } + wake() { + this.assertUsable(); + return this.#tasks.wake(); + } + getTask(id, context) { + return this.readOnLine((storage2) => storage2.task(id, context)); + } + /** Internal, for tests: sizes of the scheduler's ownership indexes. */ + get [SCHEDULER_INDEX_SIZES]() { + return this.#tasks.indexSizes; + } + /** Internal, for tests: the kept contexts' idle state and its disagreements with a full recompute. */ + get [SCHEDULER_IDLE_STATE]() { + return this.#tasks.idleState; + } + inspect(context) { + return this.readOnLine(async (storage2) => { + const { scheduling, tasks } = await this.#tasks.inspect(this.#options.registry.snapshot()); + const scan = (status) => scanAll((cursor) => storage2.scanSubmissions({ status }, SCAN_PAGE_SIZE6, cursor, context)); + const submissions = [...await scan("queued"), ...await scan("placed")].sort((a, b) => a.id - b.id); + return { scheduling, tasks, submissions }; + }); + } + submission(id, context) { + return this.#submissions.get(id, context); + } + abortSubmission(id, context, conversationId) { + return this.#submissions.abort(id, context, conversationId); + } + abortTask(id, context) { + return this.#tasks.abort(id, context); + } + async waitForTask(id, context) { + this.#tasks.resume(); + return this.#tasks.waitForTask(id, context); + } + async waitForIdle(context) { + this.#tasks.resume(); + return this.#tasks.waitForIdle(void 0, context); + } + /** Sum every conversation's committed `pi.usage`. Each document is read at its own point; totals only grow. */ + async usage(context) { + const conversations = await this.readOnLine((storage2) => scanAll((cursor) => storage2.scanConversations({}, SCAN_PAGE_SIZE6, cursor, context))); + const total = UsageDoc.definition.initial(); + for (const { id } of conversations) { + const state2 = await this.snapshot(UsageDoc, id, context); + if (state2 !== void 0) + addUsageState(total, state2); + } + return total; + } + watchTaskGraph(context) { + return this.#taskGraph.watch(context); + } + async observeTaskGraph(observer, context) { + this.assertUsable(); + return this.#taskGraph.observe(observer, context); + } + async observeConversation(id, observer, context, window2) { + this.assertUsable(); + return this.#host.views.observe(id, observer, context, window2); + } + root(context, options) { + return this.#create({ kind: "root" }, options ?? {}, context); + } + async conversation(id, context) { + this.assertUsable(); + const record = await this.readOnLine((storage2) => storage2.conversation(id, context)); + return record === void 0 ? void 0 : new ConversationImpl(record.id, this.#host); + } + createConversation(options, context) { + return this.#create({ kind: "independent", ownership: options.ownership }, options, context); + } + report(error, info = { kind: "listener_error" }, context) { + this.#report(error, info, context); + } + /** The ownership memberships a commit's task changes write, from the scheduler's index. */ + membershipKeys(tx) { + return this.#tasks.membershipKeys(tx); + } + /** Signal and join task invocations after the close listeners and before Storage closes; writes no task outcome. */ + beforeClose() { + return this.#tasks.join(); + } + async #create(target, options, context) { + this.assertUsable(); + const id = await this.commitWith(async (tx) => { + if (target.kind === "root" && await tx.conversation(ROOT_CONVERSATION_ID) !== void 0) { + return ROOT_CONVERSATION_ID; + } + const record = target.kind === "root" ? await tx.createRootConversation() : target.kind === "fork" ? await tx.forkConversation(target.parentId, target.at, { ownership: target.ownership }) : await tx.createConversation({ ownership: target.ownership }); + if (options.agent !== void 0) + await configure(tx, record.id, options.agent); + if (options.init !== void 0) + await options.init(tx, record.id); + return record.id; + }, context); + return new ConversationImpl(id, this.#host); + } + /** + * The built-in creation hook, in every commit that creates or forks a conversation: empty `pi.live`, `pi.inbox`, and + * `pi.usage`, a fresh `pi.provider`, the conversation's `pi.agent` (see `createAgent()`), then + * `HarnessOptions.conversationCreated`. + */ + async conversationCreated(tx, record) { + await tx.doc(LiveDoc, record.id); + await tx.doc(InboxDoc, record.id); + await tx.doc(UsageDoc, record.id); + await tx.doc(ProviderDoc, record.id); + await createAgent(tx, record); + await this.#options.conversationCreated?.(tx, record); + } +}; +function safeReport(onReport, telemetry) { + const reports = createTypedMetrics(telemetry.metrics ?? NOOP_TELEMETRY_METRICS, [DURABLE_TELEMETRY_SCHEMA]).counter("pi.durable.reports"); + return (error, info, context) => { + if (onReport !== void 0) { + contained(() => onReport({ ...info, error }), () => { + }); + } + const attributes = { + type: info.kind + }; + switch (info.kind) { + case "task_faulted": + case "task_interrupted": + case "task_outdated": + attributes.reason = info.reason; + attributes.extension = info.extension; + attributes["task.id"] = info.task.id; + break; + case "migration_failed": + case "task_error": + case "extension_error": + attributes.extension = info.extension; + attributes["task.id"] = info.task?.id; + break; + case "host_error": + attributes["task.id"] = info.task?.id; + break; + } + try { + reports.add(1, { type: info.kind }); + context?.telemetry.addEvent("pi.durable.report", attributes); + } catch { + } + }; +} +function safeNow(now, report2) { + if (now === void 0) + return Date.now; + let reported = false; + return () => { + try { + return now(); + } catch (error) { + if (!reported) { + reported = true; + report2(error, { kind: "host_error", callback: "now" }); + } + return Date.now(); + } + }; +} +function boundConversation(id, binding, submissions, tasks) { + const bind = (context) => withAbortSignal(binding.signal, context); + const bound = (operation) => { + return async (context) => { + binding.check(); + return operation(bind(context)); + }; + }; + async function submit(first, second) { + binding.check(); + if (!("type" in first)) { + binding.signal.throwIfAborted(); + return submissions.admit(first, id, second); + } + const submission2 = await submissions.submit(id, first, bind(second)); + return { + id: submission2.id, + status: bound((callContext) => submission2.status(callContext)), + wait: bound((callContext) => submission2.wait(callContext)), + abort: bound((callContext) => submission2.abort(callContext)) + }; + } + return { + id, + submit, + abort: async (context, options) => { + binding.check(); + return tasks.abortConversation(id, options?.background === true, bind(context)); + }, + waitForIdle: bound((callContext) => tasks.waitForIdle(id, callContext)) + }; +} +var Harness = { + /** Open a Harness over storage. The registry may keep changing while the Harness runs. */ + async open(storage2, options, context) { + context.abortSignal?.throwIfAborted(); + const snapshot = options.registry.snapshot(); + const missing = BUILTIN_TASKS.filter((task) => snapshot.task(task.definition.name) === void 0); + if (missing.length > 0) { + const names2 = missing.map((task) => task.definition.name).join(", "); + throw new Error(`Registry lacks built-in tasks ${names2}; create it with createRegistry()`); + } + const harness2 = new HarnessImpl(storage2, options, context); + try { + await harness2.openTasks(context); + } catch (error) { + await harness2.close(withoutAbortSignal(context)).catch(() => { + }); + throw error; + } + return harness2; + } +}; + +// node_modules/@earendil-works/pi-durable/dist/storage/scan.js +function scanStart(requested, cursor, fallback) { + if (requested !== void 0 && requested !== "ascending" && requested !== "descending") { + throw new StorageRequestError(`Invalid scan order: ${String(requested)}`); + } + if (cursor === void 0) + return { order: requested ?? fallback, after: void 0 }; + const { after, order: stored } = cursor; + if (typeof after !== "number" || !Number.isSafeInteger(after)) + throw new StorageRequestError("Invalid storage cursor"); + if (stored !== void 0 && stored !== "ascending" && stored !== "descending") { + throw new StorageRequestError("Invalid storage cursor"); + } + const order = stored ?? fallback; + if (requested !== void 0 && requested !== order) { + throw new StorageRequestError(`The cursor continues a ${order} scan; the query asks for ${requested}`); + } + return { order, after }; +} +function nextCursor(id, order) { + return { after: id, order }; +} // node_modules/yaml/browser/dist/nodes/identity.js var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias"); @@ -41630,17 +59060,17 @@ function visit(node, visitor) { visit.BREAK = BREAK; visit.SKIP = SKIP; visit.REMOVE = REMOVE; -function visit_(key, node, visitor, path4) { - const ctrl = callVisitor(key, node, visitor, path4); +function visit_(key, node, visitor, path5) { + const ctrl = callVisitor(key, node, visitor, path5); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path4, ctrl); - return visit_(key, ctrl, visitor, path4); + replaceNode(key, path5, ctrl); + return visit_(key, ctrl, visitor, path5); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path4 = Object.freeze(path4.concat(node)); + path5 = Object.freeze(path5.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = visit_(i, node.items[i], visitor, path4); + const ci = visit_(i, node.items[i], visitor, path5); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -41651,13 +59081,13 @@ function visit_(key, node, visitor, path4) { } } } else if (isPair(node)) { - path4 = Object.freeze(path4.concat(node)); - const ck = visit_("key", node.key, visitor, path4); + path5 = Object.freeze(path5.concat(node)); + const ck = visit_("key", node.key, visitor, path5); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = visit_("value", node.value, visitor, path4); + const cv = visit_("value", node.value, visitor, path5); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -41678,17 +59108,17 @@ async function visitAsync(node, visitor) { visitAsync.BREAK = BREAK; visitAsync.SKIP = SKIP; visitAsync.REMOVE = REMOVE; -async function visitAsync_(key, node, visitor, path4) { - const ctrl = await callVisitor(key, node, visitor, path4); +async function visitAsync_(key, node, visitor, path5) { + const ctrl = await callVisitor(key, node, visitor, path5); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path4, ctrl); - return visitAsync_(key, ctrl, visitor, path4); + replaceNode(key, path5, ctrl); + return visitAsync_(key, ctrl, visitor, path5); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path4 = Object.freeze(path4.concat(node)); + path5 = Object.freeze(path5.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = await visitAsync_(i, node.items[i], visitor, path4); + const ci = await visitAsync_(i, node.items[i], visitor, path5); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -41699,13 +59129,13 @@ async function visitAsync_(key, node, visitor, path4) { } } } else if (isPair(node)) { - path4 = Object.freeze(path4.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path4); + path5 = Object.freeze(path5.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path5); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path4); + const cv = await visitAsync_("value", node.value, visitor, path5); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -41732,34 +59162,34 @@ function initVisitor(visitor) { } return visitor; } -function callVisitor(key, node, visitor, path4) { +function callVisitor(key, node, visitor, path5) { if (typeof visitor === "function") - return visitor(key, node, path4); + return visitor(key, node, path5); if (isMap(node)) - return visitor.Map?.(key, node, path4); + return visitor.Map?.(key, node, path5); if (isSeq(node)) - return visitor.Seq?.(key, node, path4); + return visitor.Seq?.(key, node, path5); if (isPair(node)) - return visitor.Pair?.(key, node, path4); + return visitor.Pair?.(key, node, path5); if (isScalar(node)) - return visitor.Scalar?.(key, node, path4); + return visitor.Scalar?.(key, node, path5); if (isAlias(node)) - return visitor.Alias?.(key, node, path4); + return visitor.Alias?.(key, node, path5); return void 0; } -function replaceNode(key, path4, node) { - const parent = path4[path4.length - 1]; - if (isCollection(parent)) { - parent.items[key] = node; - } else if (isPair(parent)) { +function replaceNode(key, path5, node) { + const parent2 = path5[path5.length - 1]; + if (isCollection(parent2)) { + parent2.items[key] = node; + } else if (isPair(parent2)) { if (key === "key") - parent.key = node; + parent2.key = node; else - parent.value = node; - } else if (isDocument(parent)) { - parent.contents = node; + parent2.value = node; + } else if (isDocument(parent2)) { + parent2.contents = node; } else { - const pt = isAlias(parent) ? "alias" : "scalar"; + const pt = isAlias(parent2) ? "alias" : "scalar"; throw new Error(`Cannot replace node with ${pt} parent`); } } @@ -41782,9 +59212,9 @@ var Directives = class _Directives { this.tags = Object.assign({}, _Directives.defaultTags, tags); } clone() { - const copy = new _Directives(this.yaml, this.tags); - copy.docStart = this.docStart; - return copy; + const copy2 = new _Directives(this.yaml, this.tags); + copy2.docStart = this.docStart; + return copy2; } /** * During parsing, get a Directives instance for the current document and @@ -41903,7 +59333,7 @@ var Directives = class _Directives { return tag[0] === "!" ? tag : `!<${tag}>`; } toString(doc) { - const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; + const lines2 = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; const tagEntries = Object.entries(this.tags); let tagNames; if (doc && tagEntries.length > 0 && isNode(doc.contents)) { @@ -41919,9 +59349,9 @@ var Directives = class _Directives { if (handle === "!!" && prefix === "tag:yaml.org,2002:") continue; if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) - lines.push(`%TAG ${handle} ${prefix}`); + lines2.push(`%TAG ${handle} ${prefix}`); } - return lines.join("\n"); + return lines2.join("\n"); } }; Directives.defaultYaml = { explicit: false, version: "1.2" }; @@ -41936,6 +59366,55 @@ function anchorIsValid(anchor) { } return true; } +function anchorNames(root2) { + const anchors = /* @__PURE__ */ new Set(); + visit(root2, { + Value(_key, node) { + if (node.anchor) + anchors.add(node.anchor); + } + }); + return anchors; +} +function findNewAnchor(prefix, exclude) { + for (let i = 1; true; ++i) { + const name = `${prefix}${i}`; + if (!exclude.has(name)) + return name; + } +} +function createNodeAnchors(doc, prefix) { + const aliasObjects = []; + const sourceObjects = /* @__PURE__ */ new Map(); + let prevAnchors = null; + return { + onAnchor: (source) => { + aliasObjects.push(source); + prevAnchors ?? (prevAnchors = anchorNames(doc)); + const anchor = findNewAnchor(prefix, prevAnchors); + prevAnchors.add(anchor); + return anchor; + }, + /** + * With circular references, the source node is only resolved after all + * of its child nodes are. This is why anchors are set only after all of + * the nodes have been created. + */ + setAnchors: () => { + for (const source of aliasObjects) { + const ref = sourceObjects.get(source); + if (typeof ref === "object" && ref.anchor && (isScalar(ref.node) || isCollection(ref.node))) { + ref.node.anchor = ref.anchor; + } else { + const error = new Error("Failed to resolve repeated object (this should not happen)"); + error.source = source; + throw error; + } + } + }, + sourceObjects + }; +} // node_modules/yaml/browser/dist/doc/applyReviver.js function applyReviver(reviver, obj2, key, val) { @@ -41982,26 +59461,26 @@ function applyReviver(reviver, obj2, key, val) { } // node_modules/yaml/browser/dist/nodes/toJS.js -function toJS(value, arg, ctx) { - if (Array.isArray(value)) - return value.map((v, i) => toJS(v, String(i), ctx)); - if (value && typeof value.toJSON === "function") { - if (!ctx || !hasAnchor(value)) - return value.toJSON(arg, ctx); +function toJS(value2, arg, ctx) { + if (Array.isArray(value2)) + return value2.map((v, i) => toJS(v, String(i), ctx)); + if (value2 && typeof value2.toJSON === "function") { + if (!ctx || !hasAnchor(value2)) + return value2.toJSON(arg, ctx); const data = { aliasCount: 0, count: 1, res: void 0 }; - ctx.anchors.set(value, data); + ctx.anchors.set(value2, data); ctx.onCreate = (res2) => { data.res = res2; delete ctx.onCreate; }; - const res = value.toJSON(arg, ctx); + const res = value2.toJSON(arg, ctx); if (ctx.onCreate) ctx.onCreate(res); return res; } - if (typeof value === "bigint" && !ctx?.keep) - return Number(value); - return value; + if (typeof value2 === "bigint" && !ctx?.keep) + return Number(value2); + return value2; } // node_modules/yaml/browser/dist/nodes/Node.js @@ -42011,10 +59490,10 @@ var NodeBase = class { } /** Create a copy of this node. */ clone() { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + const copy2 = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); if (this.range) - copy.range = this.range.slice(); - return copy; + copy2.range = this.range.slice(); + return copy2; } /** A plain JavaScript representation of this node. */ toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { @@ -42144,11 +59623,11 @@ function getAliasCount(doc, node, anchors) { } // node_modules/yaml/browser/dist/nodes/Scalar.js -var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; +var isScalarValue = (value2) => !value2 || typeof value2 !== "function" && typeof value2 !== "object"; var Scalar = class extends NodeBase { - constructor(value) { + constructor(value2) { super(SCALAR); - this.value = value; + this.value = value2; } toJSON(arg, ctx) { return ctx?.keep ? this.value : toJS(this.value, arg, ctx); @@ -42165,7 +59644,7 @@ Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; // node_modules/yaml/browser/dist/doc/createNode.js var defaultTagPrefix = "tag:yaml.org,2002:"; -function findTagObject(value, tagName, tags) { +function findTagObject(value2, tagName, tags) { if (tagName) { const match = tags.filter((t) => t.tag === tagName); const tagObj = match.find((t) => !t.format) ?? match[0]; @@ -42173,53 +59652,53 @@ function findTagObject(value, tagName, tags) { throw new Error(`Tag ${tagName} not found`); return tagObj; } - return tags.find((t) => t.identify?.(value) && !t.format); + return tags.find((t) => t.identify?.(value2) && !t.format); } -function createNode(value, tagName, ctx) { - if (isDocument(value)) - value = value.contents; - if (isNode(value)) - return value; - if (isPair(value)) { +function createNode2(value2, tagName, ctx) { + if (isDocument(value2)) + value2 = value2.contents; + if (isNode(value2)) + return value2; + if (isPair(value2)) { const map3 = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx); - map3.items.push(value); + map3.items.push(value2); return map3; } - if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) { - value = value.valueOf(); + if (value2 instanceof String || value2 instanceof Number || value2 instanceof Boolean || typeof BigInt !== "undefined" && value2 instanceof BigInt) { + value2 = value2.valueOf(); } const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema4, sourceObjects } = ctx; let ref = void 0; - if (aliasDuplicateObjects && value && typeof value === "object") { - ref = sourceObjects.get(value); + if (aliasDuplicateObjects && value2 && typeof value2 === "object") { + ref = sourceObjects.get(value2); if (ref) { - ref.anchor ?? (ref.anchor = onAnchor(value)); + ref.anchor ?? (ref.anchor = onAnchor(value2)); return new Alias(ref.anchor); } else { ref = { anchor: null, node: null }; - sourceObjects.set(value, ref); + sourceObjects.set(value2, ref); } } if (tagName?.startsWith("!!")) tagName = defaultTagPrefix + tagName.slice(2); - let tagObj = findTagObject(value, tagName, schema4.tags); + let tagObj = findTagObject(value2, tagName, schema4.tags); if (!tagObj) { - if (value && typeof value.toJSON === "function") { - value = value.toJSON(); + if (value2 && typeof value2.toJSON === "function") { + value2 = value2.toJSON(); } - if (!value || typeof value !== "object") { - const node2 = new Scalar(value); + if (!value2 || typeof value2 !== "object") { + const node2 = new Scalar(value2); if (ref) ref.node = node2; return node2; } - tagObj = value instanceof Map ? schema4[MAP] : Symbol.iterator in Object(value) ? schema4[SEQ] : schema4[MAP]; + tagObj = value2 instanceof Map ? schema4[MAP] : Symbol.iterator in Object(value2) ? schema4[SEQ] : schema4[MAP]; } if (onTagObj) { onTagObj(tagObj); delete ctx.onTagObj; } - const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar(value); + const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value2, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value2, ctx) : new Scalar(value2); if (tagName) node.tag = tagName; else if (!tagObj.default) @@ -42230,10 +59709,10 @@ function createNode(value, tagName, ctx) { } // node_modules/yaml/browser/dist/nodes/Collection.js -function collectionFromPath(schema4, path4, value) { - let v = value; - for (let i = path4.length - 1; i >= 0; --i) { - const k = path4[i]; +function collectionFromPath(schema4, path5, value2) { + let v = value2; + for (let i = path5.length - 1; i >= 0; --i) { + const k = path5[i]; if (typeof k === "number" && Number.isInteger(k) && k >= 0) { const a = []; a[k] = v; @@ -42242,7 +59721,7 @@ function collectionFromPath(schema4, path4, value) { v = /* @__PURE__ */ new Map([[k, v]]); } } - return createNode(v, void 0, { + return createNode2(v, void 0, { aliasDuplicateObjects: false, keepUndefined: false, onAnchor: () => { @@ -42252,7 +59731,7 @@ function collectionFromPath(schema4, path4, value) { sourceObjects: /* @__PURE__ */ new Map() }); } -var isEmptyPath = (path4) => path4 == null || typeof path4 === "object" && !!path4[Symbol.iterator]().next().done; +var isEmptyPath = (path5) => path5 == null || typeof path5 === "object" && !!path5[Symbol.iterator]().next().done; var Collection = class extends NodeBase { constructor(type, schema4) { super(type); @@ -42269,29 +59748,29 @@ var Collection = class extends NodeBase { * @param schema - If defined, overwrites the original's schema */ clone(schema4) { - const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + const copy2 = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); if (schema4) - copy.schema = schema4; - copy.items = copy.items.map((it) => isNode(it) || isPair(it) ? it.clone(schema4) : it); + copy2.schema = schema4; + copy2.items = copy2.items.map((it) => isNode(it) || isPair(it) ? it.clone(schema4) : it); if (this.range) - copy.range = this.range.slice(); - return copy; + copy2.range = this.range.slice(); + return copy2; } /** * Adds a value to the collection. For `!!map` and `!!omap` the value must * be a Pair instance or a `{ key, value }` object, which may not have a key * that already exists in the map. */ - addIn(path4, value) { - if (isEmptyPath(path4)) - this.add(value); + addIn(path5, value2) { + if (isEmptyPath(path5)) + this.add(value2); else { - const [key, ...rest] = path4; + const [key, ...rest] = path5; const node = this.get(key, true); if (isCollection(node)) - node.addIn(rest, value); + node.addIn(rest, value2); else if (node === void 0 && this.schema) - this.set(key, collectionFromPath(this.schema, rest, value)); + this.set(key, collectionFromPath(this.schema, rest, value2)); else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); } @@ -42300,8 +59779,8 @@ var Collection = class extends NodeBase { * Removes a value from the collection. * @returns `true` if the item was found and removed. */ - deleteIn(path4) { - const [key, ...rest] = path4; + deleteIn(path5) { + const [key, ...rest] = path5; if (rest.length === 0) return this.delete(key); const node = this.get(key, true); @@ -42315,8 +59794,8 @@ var Collection = class extends NodeBase { * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ - getIn(path4, keepScalar) { - const [key, ...rest] = path4; + getIn(path5, keepScalar) { + const [key, ...rest] = path5; const node = this.get(key, true); if (rest.length === 0) return !keepScalar && isScalar(node) ? node.value : node; @@ -42334,8 +59813,8 @@ var Collection = class extends NodeBase { /** * Checks if the collection includes a value with the key `key`. */ - hasIn(path4) { - const [key, ...rest] = path4; + hasIn(path5) { + const [key, ...rest] = path5; if (rest.length === 0) return this.has(key); const node = this.get(key, true); @@ -42345,16 +59824,16 @@ var Collection = class extends NodeBase { * Sets a value in this collection. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ - setIn(path4, value) { - const [key, ...rest] = path4; + setIn(path5, value2) { + const [key, ...rest] = path5; if (rest.length === 0) { - this.set(key, value); + this.set(key, value2); } else { const node = this.get(key, true); if (isCollection(node)) - node.setIn(rest, value); + node.setIn(rest, value2); else if (node === void 0 && this.schema) - this.set(key, collectionFromPath(this.schema, rest, value)); + this.set(key, collectionFromPath(this.schema, rest, value2)); else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); } @@ -42498,8 +59977,8 @@ function consumeMoreIndentedLines(text, i, indent) { } // node_modules/yaml/browser/dist/stringify/stringifyString.js -var getFoldOptions = (ctx, isBlock) => ({ - indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, +var getFoldOptions = (ctx, isBlock2) => ({ + indentAtStart: isBlock2 ? ctx.indent.length : ctx.indentAtStart, lineWidth: ctx.options.lineWidth, minContentWidth: ctx.options.minContentWidth }); @@ -42522,13 +60001,13 @@ function lineLengthOverLimit(str2, lineWidth, indentLength) { } return true; } -function doubleQuotedString(value, ctx) { - const json = JSON.stringify(value); +function doubleQuotedString(value2, ctx) { + const json = JSON.stringify(value2); if (ctx.options.doubleQuotedAsJSON) return json; const { implicitKey } = ctx; const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); + const indent = ctx.indent || (containsDocumentMarker(value2) ? " " : ""); let str2 = ""; let start = 0; for (let i = 0, ch = json[i]; ch; ch = json[++i]) { @@ -42602,22 +60081,22 @@ function doubleQuotedString(value, ctx) { str2 = start ? str2 + json.slice(start) : json; return implicitKey ? str2 : foldFlowLines(str2, indent, FOLD_QUOTED, getFoldOptions(ctx, false)); } -function singleQuotedString(value, ctx) { - if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) - return doubleQuotedString(value, ctx); - const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); - const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$& +function singleQuotedString(value2, ctx) { + if (ctx.options.singleQuote === false || ctx.implicitKey && value2.includes("\n") || /[ \t]\n|\n[ \t]/.test(value2)) + return doubleQuotedString(value2, ctx); + const indent = ctx.indent || (containsDocumentMarker(value2) ? " " : ""); + const res = "'" + value2.replace(/'/g, "''").replace(/\n+/g, `$& ${indent}`) + "'"; return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false)); } -function quotedString(value, ctx) { +function quotedString(value2, ctx) { const { singleQuote } = ctx.options; let qs; if (singleQuote === false) qs = doubleQuotedString; else { - const hasDouble = value.includes('"'); - const hasSingle = value.includes("'"); + const hasDouble = value2.includes('"'); + const hasSingle = value2.includes("'"); if (hasDouble && !hasSingle) qs = singleQuotedString; else if (hasSingle && !hasDouble) @@ -42625,7 +60104,7 @@ function quotedString(value, ctx) { else qs = singleQuote ? singleQuotedString : doubleQuotedString; } - return qs(value, ctx); + return qs(value2, ctx); } var blockEndNewlines; try { @@ -42633,27 +60112,27 @@ try { } catch { blockEndNewlines = /\n+(?!\n|$)/g; } -function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { +function blockString({ comment, type, value: value2 }, ctx, onComment, onChompKeep) { const { blockQuote, commentString, lineWidth } = ctx.options; - if (!blockQuote || /\n[\t ]+$/.test(value)) { - return quotedString(value, ctx); + if (!blockQuote || /\n[\t ]+$/.test(value2)) { + return quotedString(value2, ctx); } - const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : ""); - const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.BLOCK_FOLDED ? false : type === Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length); - if (!value) + const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value2) ? " " : ""); + const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.BLOCK_FOLDED ? false : type === Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value2, lineWidth, indent.length); + if (!value2) return literal ? "|\n" : ">\n"; let chomp; let endStart; - for (endStart = value.length; endStart > 0; --endStart) { - const ch = value[endStart - 1]; + for (endStart = value2.length; endStart > 0; --endStart) { + const ch = value2[endStart - 1]; if (ch !== "\n" && ch !== " " && ch !== " ") break; } - let end = value.substring(endStart); + let end = value2.substring(endStart); const endNlPos = end.indexOf("\n"); if (endNlPos === -1) { chomp = "-"; - } else if (value === end || endNlPos !== end.length - 1) { + } else if (value2 === end || endNlPos !== end.length - 1) { chomp = "+"; if (onChompKeep) onChompKeep(); @@ -42661,7 +60140,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { chomp = ""; } if (end) { - value = value.slice(0, -end.length); + value2 = value2.slice(0, -end.length); if (end[end.length - 1] === "\n") end = end.slice(0, -1); end = end.replace(blockEndNewlines, `$&${indent}`); @@ -42669,8 +60148,8 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { let startWithSpace = false; let startEnd; let startNlPos = -1; - for (startEnd = 0; startEnd < value.length; ++startEnd) { - const ch = value[startEnd]; + for (startEnd = 0; startEnd < value2.length; ++startEnd) { + const ch = value2[startEnd]; if (ch === " ") startWithSpace = true; else if (ch === "\n") @@ -42678,9 +60157,9 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { else break; } - let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); + let start = value2.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); if (start) { - value = value.substring(start.length); + value2 = value2.substring(start.length); start = start.replace(/\n+/g, `$&${indent}`); } const indentSize = indent ? "2" : "1"; @@ -42691,7 +60170,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { onComment(); } if (!literal) { - const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); + const foldedValue = value2.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); let literalFallback = false; const foldOptions = getFoldOptions(ctx, true); if (blockQuote !== "folded" && type !== Scalar.BLOCK_FOLDED) { @@ -42704,37 +60183,37 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { return `>${header} ${indent}${body}`; } - value = value.replace(/\n+/g, `$&${indent}`); + value2 = value2.replace(/\n+/g, `$&${indent}`); return `|${header} -${indent}${start}${value}${end}`; +${indent}${start}${value2}${end}`; } function plainString(item, ctx, onComment, onChompKeep) { - const { type, value } = item; + const { type, value: value2 } = item; const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; - if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) { - return quotedString(value, ctx); + if (implicitKey && value2.includes("\n") || inFlow && /[[\]{},]/.test(value2)) { + return quotedString(value2, ctx); } - if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { - return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); + if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value2)) { + return implicitKey || inFlow || !value2.includes("\n") ? quotedString(value2, ctx) : blockString(item, ctx, onComment, onChompKeep); } - if (!implicitKey && !inFlow && type !== Scalar.PLAIN && value.includes("\n")) { + if (!implicitKey && !inFlow && type !== Scalar.PLAIN && value2.includes("\n")) { return blockString(item, ctx, onComment, onChompKeep); } - if (containsDocumentMarker(value)) { + if (containsDocumentMarker(value2)) { if (indent === "") { ctx.forceBlockIndent = true; return blockString(item, ctx, onComment, onChompKeep); } else if (implicitKey && indent === indentStep) { - return quotedString(value, ctx); + return quotedString(value2, ctx); } } - const str2 = value.replace(/\n+/g, `$& + const str2 = value2.replace(/\n+/g, `$& ${indent}`); if (actualString) { const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str2); const { compat, tags } = ctx.doc.schema; if (tags.some(test) || compat?.some(test)) - return quotedString(value, ctx); + return quotedString(value2, ctx); } return implicitKey ? str2 : foldFlowLines(str2, indent, FOLD_FLOW, getFoldOptions(ctx, false)); } @@ -42886,7 +60365,7 @@ ${ctx.indent}${str2}`; } // node_modules/yaml/browser/dist/stringify/stringifyPair.js -function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { +function stringifyPair({ key, value: value2 }, ctx, onComment, onChompKeep) { const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; let keyComment = isNode(key) && key.comment || null; if (simpleKeys) { @@ -42898,7 +60377,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { throw new Error(msg); } } - let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === "object")); + let explicitKey = !simpleKeys && (!key || keyComment && value2 == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === "object")); ctx = Object.assign({}, ctx, { allNullValues: false, implicitKey: !explicitKey && (simpleKeys || !allNullValues), @@ -42913,12 +60392,12 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { explicitKey = true; } if (ctx.inFlow) { - if (allNullValues || value == null) { + if (allNullValues || value2 == null) { if (keyCommentDone && onComment) onComment(); return str2 === "" ? "?" : explicitKey ? `? ${str2}` : str2; } - } else if (allNullValues && !simpleKeys || value == null && explicitKey) { + } else if (allNullValues && !simpleKeys || value2 == null && explicitKey) { str2 = `? ${str2}`; if (keyComment && !keyCommentDone) { str2 += lineComment(str2, ctx.indent, commentString(keyComment)); @@ -42939,26 +60418,26 @@ ${indent}:`; str2 += lineComment(str2, ctx.indent, commentString(keyComment)); } let vsb, vcb, valueComment; - if (isNode(value)) { - vsb = !!value.spaceBefore; - vcb = value.commentBefore; - valueComment = value.comment; + if (isNode(value2)) { + vsb = !!value2.spaceBefore; + vcb = value2.commentBefore; + valueComment = value2.comment; } else { vsb = false; vcb = null; valueComment = null; - if (value && typeof value === "object") - value = doc.createNode(value); + if (value2 && typeof value2 === "object") + value2 = doc.createNode(value2); } ctx.implicitKey = false; - if (!explicitKey && !keyComment && isScalar(value)) + if (!explicitKey && !keyComment && isScalar(value2)) ctx.indentAtStart = str2.length + 1; chompKeep = false; - if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value) && !value.flow && !value.tag && !value.anchor) { + if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value2) && !value2.flow && !value2.tag && !value2.anchor) { ctx.indent = ctx.indent.substring(2); } let valueCommentDone = false; - const valueStr = stringify3(value, ctx, () => valueCommentDone = true, () => chompKeep = true); + const valueStr = stringify3(value2, ctx, () => valueCommentDone = true, () => chompKeep = true); let ws = " "; if (keyComment || vsb || vcb) { ws = vsb ? "\n" : ""; @@ -42974,11 +60453,11 @@ ${indentComment(cs, ctx.indent)}`; ws += ` ${ctx.indent}`; } - } else if (!explicitKey && isCollection(value)) { + } else if (!explicitKey && isCollection(value2)) { const vs0 = valueStr[0]; const nl0 = valueStr.indexOf("\n"); const hasNewline = nl0 !== -1; - const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; + const flow = ctx.inFlow ?? value2.flow ?? value2.items.length === 0; if (hasNewline || !flow) { let hasPropsLine = false; if (hasNewline && (vs0 === "&" || vs0 === "!")) { @@ -43017,8 +60496,8 @@ function warn(logLevel, warning) { // node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js var MERGE_KEY = "<<"; -var merge = { - identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, +var merge3 = { + identify: (value2) => value2 === MERGE_KEY || typeof value2 === "symbol" && value2.description === MERGE_KEY, default: "key", tag: "tag:yaml.org,2002:merge", test: /^<<$/, @@ -43027,9 +60506,9 @@ var merge = { }), stringify: () => MERGE_KEY }; -var isMergeKey = (ctx, key) => (merge.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default); -function addMergeToJSMap(ctx, map3, value) { - const source = resolveAliasValue(ctx, value); +var isMergeKey = (ctx, key) => (merge3.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge3.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default); +function addMergeToJSMap(ctx, map3, value2) { + const source = resolveAliasValue(ctx, value2); if (isSeq(source)) for (const it of source.items) mergeValue(ctx, map3, it); @@ -43039,20 +60518,20 @@ function addMergeToJSMap(ctx, map3, value) { else mergeValue(ctx, map3, source); } -function mergeValue(ctx, map3, value) { - const source = resolveAliasValue(ctx, value); +function mergeValue(ctx, map3, value2) { + const source = resolveAliasValue(ctx, value2); if (!isMap(source)) throw new Error("Merge sources must be maps or map aliases"); const srcMap = source.toJSON(null, ctx, Map); - for (const [key, value2] of srcMap) { + for (const [key, value3] of srcMap) { if (map3 instanceof Map) { if (!map3.has(key)) - map3.set(key, value2); + map3.set(key, value3); } else if (map3 instanceof Set) { map3.add(key); } else if (!Object.prototype.hasOwnProperty.call(map3, key)) { Object.defineProperty(map3, key, { - value: value2, + value: value3, writable: true, enumerable: true, configurable: true @@ -43061,25 +60540,25 @@ function mergeValue(ctx, map3, value) { } return map3; } -function resolveAliasValue(ctx, value) { - return ctx && isAlias(value) ? value.resolve(ctx.doc, ctx) : value; +function resolveAliasValue(ctx, value2) { + return ctx && isAlias(value2) ? value2.resolve(ctx.doc, ctx) : value2; } // node_modules/yaml/browser/dist/nodes/addPairToJSMap.js -function addPairToJSMap(ctx, map3, { key, value }) { +function addPairToJSMap(ctx, map3, { key, value: value2 }) { if (isNode(key) && key.addToJSMap) - key.addToJSMap(ctx, map3, value); + key.addToJSMap(ctx, map3, value2); else if (isMergeKey(ctx, key)) - addMergeToJSMap(ctx, map3, value); + addMergeToJSMap(ctx, map3, value2); else { const jsKey = toJS(key, "", ctx); if (map3 instanceof Map) { - map3.set(jsKey, toJS(value, jsKey, ctx)); + map3.set(jsKey, toJS(value2, jsKey, ctx)); } else if (map3 instanceof Set) { map3.add(jsKey); } else { const stringKey = stringifyKey(key, jsKey, ctx); - const jsValue = toJS(value, stringKey, ctx); + const jsValue = toJS(value2, stringKey, ctx); if (stringKey in map3) Object.defineProperty(map3, stringKey, { value: jsValue, @@ -43119,24 +60598,24 @@ function stringifyKey(key, jsKey, ctx) { } // node_modules/yaml/browser/dist/nodes/Pair.js -function createPair(key, value, ctx) { - const k = createNode(key, void 0, ctx); - const v = createNode(value, void 0, ctx); +function createPair(key, value2, ctx) { + const k = createNode2(key, void 0, ctx); + const v = createNode2(value2, void 0, ctx); return new Pair(k, v); } var Pair = class _Pair { - constructor(key, value = null) { + constructor(key, value2 = null) { Object.defineProperty(this, NODE_TYPE, { value: PAIR }); this.key = key; - this.value = value; + this.value = value2; } clone(schema4) { - let { key, value } = this; + let { key, value: value2 } = this; if (isNode(key)) key = key.clone(schema4); - if (isNode(value)) - value = value.clone(schema4); - return new _Pair(key, value); + if (isNode(value2)) + value2 = value2.clone(schema4); + return new _Pair(key, value2); } toJSON(_, ctx) { const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; @@ -43157,22 +60636,22 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl const { indent, options: { commentString } } = ctx; const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null }); let chompKeep = false; - const lines = []; + const lines2 = []; for (let i = 0; i < items.length; ++i) { const item = items[i]; let comment2 = null; if (isNode(item)) { if (!chompKeep && item.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, chompKeep); + lines2.push(""); + addCommentBefore(ctx, lines2, item.commentBefore, chompKeep); if (item.comment) comment2 = item.comment; } else if (isPair(item)) { const ik = isNode(item.key) ? item.key : null; if (ik) { if (!chompKeep && ik.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); + lines2.push(""); + addCommentBefore(ctx, lines2, ik.commentBefore, chompKeep); } } chompKeep = false; @@ -43181,15 +60660,15 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl str3 += lineComment(str3, itemIndent, commentString(comment2)); if (chompKeep && comment2) chompKeep = false; - lines.push(blockItemPrefix + str3); + lines2.push(blockItemPrefix + str3); } let str2; - if (lines.length === 0) { + if (lines2.length === 0) { str2 = flowChars.start + flowChars.end; } else { - str2 = lines[0]; - for (let i = 1; i < lines.length; ++i) { - const line = lines[i]; + str2 = lines2[0]; + for (let i = 1; i < lines2.length; ++i) { + const line = lines2[i]; str2 += line ? ` ${indent}${line}` : "\n"; } @@ -43212,22 +60691,22 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { }); let reqNewline = false; let linesAtValue = 0; - const lines = []; + const lines2 = []; for (let i = 0; i < items.length; ++i) { const item = items[i]; let comment = null; if (isNode(item)) { if (item.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, item.commentBefore, false); + lines2.push(""); + addCommentBefore(ctx, lines2, item.commentBefore, false); if (item.comment) comment = item.comment; } else if (isPair(item)) { const ik = isNode(item.key) ? item.key : null; if (ik) { if (ik.spaceBefore) - lines.push(""); - addCommentBefore(ctx, lines, ik.commentBefore, false); + lines2.push(""); + addCommentBefore(ctx, lines2, ik.commentBefore, false); if (ik.comment) reqNewline = true; } @@ -43244,12 +60723,12 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { if (comment) reqNewline = true; let str2 = stringify3(item, itemCtx, () => comment = null); - reqNewline || (reqNewline = lines.length > linesAtValue || str2.includes("\n")); + reqNewline || (reqNewline = lines2.length > linesAtValue || str2.includes("\n")); if (i < items.length - 1) { str2 += ","; } else if (ctx.options.trailingComma) { if (ctx.options.lineWidth > 0) { - reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str2.length + 2) > ctx.options.lineWidth); + reqNewline || (reqNewline = lines2.reduce((sum, line) => sum + line.length + 2, 2) + (str2.length + 2) > ctx.options.lineWidth); } if (reqNewline) { str2 += ","; @@ -43257,35 +60736,35 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { } if (comment) str2 += lineComment(str2, itemIndent, commentString(comment)); - lines.push(str2); - linesAtValue = lines.length; + lines2.push(str2); + linesAtValue = lines2.length; } const { start, end } = flowChars; - if (lines.length === 0) { + if (lines2.length === 0) { return start + end; } else { if (!reqNewline) { - const len = lines.reduce((sum, line) => sum + line.length + 2, 2); + const len = lines2.reduce((sum, line) => sum + line.length + 2, 2); reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; } if (reqNewline) { let str2 = start; - for (const line of lines) + for (const line of lines2) str2 += line ? ` ${indentStep}${indent}${line}` : "\n"; return `${str2} ${indent}${end}`; } else { - return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; + return `${start}${fcPadding}${lines2.join(" ")}${fcPadding}${end}`; } } } -function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { +function addCommentBefore({ indent, options: { commentString } }, lines2, comment, chompKeep) { if (comment && chompKeep) comment = comment.replace(/^\n+/, ""); if (comment) { const ic = indentComment(commentString(comment), indent); - lines.push(ic.trimStart()); + lines2.push(ic.trimStart()); } } @@ -43317,17 +60796,17 @@ var YAMLMap = class extends Collection { static from(schema4, obj2, ctx) { const { keepUndefined, replacer } = ctx; const map3 = new this(schema4); - const add = (key, value) => { + const add = (key, value2) => { if (typeof replacer === "function") - value = replacer.call(obj2, key, value); + value2 = replacer.call(obj2, key, value2); else if (Array.isArray(replacer) && !replacer.includes(key)) return; - if (value !== void 0 || keepUndefined) - map3.items.push(createPair(key, value, ctx)); + if (value2 !== void 0 || keepUndefined) + map3.items.push(createPair(key, value2, ctx)); }; if (obj2 instanceof Map) { - for (const [key, value] of obj2) - add(key, value); + for (const [key, value2] of obj2) + add(key, value2); } else if (obj2 && typeof obj2 === "object") { for (const key of Object.keys(obj2)) add(key, obj2[key]); @@ -43385,8 +60864,8 @@ var YAMLMap = class extends Collection { has(key) { return !!findPair(this.items, key); } - set(key, value) { - this.add(new Pair(key, value), true); + set(key, value2) { + this.add(new Pair(key, value2), true); } /** * @param ctx - Conversion context, originally set in Document#toJS() @@ -43443,8 +60922,8 @@ var YAMLSeq = class extends Collection { super(SEQ, schema4); this.items = []; } - add(value) { - this.items.push(value); + add(value2) { + this.items.push(value2); } /** * Removes a value from the collection. @@ -43485,15 +60964,15 @@ var YAMLSeq = class extends Collection { * If `key` does not contain a representation of an integer, this will throw. * It may be wrapped in a `Scalar`. */ - set(key, value) { + set(key, value2) { const idx = asItemIndex(key); if (typeof idx !== "number") throw new Error(`Expected a valid index, not ${key}.`); const prev = this.items[idx]; - if (isScalar(prev) && isScalarValue(value)) - prev.value = value; + if (isScalar(prev) && isScalarValue(value2)) + prev.value = value2; else - this.items[idx] = value; + this.items[idx] = value2; } toJSON(_, ctx) { const seq2 = []; @@ -43525,7 +61004,7 @@ var YAMLSeq = class extends Collection { const key = obj2 instanceof Set ? it : String(i++); it = replacer.call(obj2, key, it); } - seq2.items.push(createNode(it, void 0, ctx)); + seq2.items.push(createNode2(it, void 0, ctx)); } } return seq2; @@ -43552,21 +61031,169 @@ var seq = { createNode: (schema4, obj2, ctx) => YAMLSeq.from(schema4, obj2, ctx) }; -// node_modules/yaml/browser/dist/schema/json/schema.js -function intIdentify(value) { - return typeof value === "bigint" || Number.isInteger(value); +// node_modules/yaml/browser/dist/schema/common/string.js +var string = { + identify: (value2) => typeof value2 === "string", + default: true, + tag: "tag:yaml.org,2002:str", + resolve: (str2) => str2, + stringify(item, ctx, onComment, onChompKeep) { + ctx = Object.assign({ actualString: true }, ctx); + return stringifyString(item, ctx, onComment, onChompKeep); + } +}; + +// node_modules/yaml/browser/dist/schema/common/null.js +var nullTag = { + identify: (value2) => value2 == null, + createNode: () => new Scalar(null), + default: true, + tag: "tag:yaml.org,2002:null", + test: /^(?:~|[Nn]ull|NULL)?$/, + resolve: () => new Scalar(null), + stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr +}; + +// node_modules/yaml/browser/dist/schema/core/bool.js +var boolTag = { + identify: (value2) => typeof value2 === "boolean", + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, + resolve: (str2) => new Scalar(str2[0] === "t" || str2[0] === "T"), + stringify({ source, value: value2 }, ctx) { + if (source && boolTag.test.test(source)) { + const sv = source[0] === "t" || source[0] === "T"; + if (value2 === sv) + return source; + } + return value2 ? ctx.options.trueStr : ctx.options.falseStr; + } +}; + +// node_modules/yaml/browser/dist/stringify/stringifyNumber.js +function stringifyNumber({ format, minFractionDigits, tag, value: value2 }) { + if (typeof value2 === "bigint") + return String(value2); + const num2 = typeof value2 === "number" ? value2 : Number(value2); + if (!isFinite(num2)) + return isNaN(num2) ? ".nan" : num2 < 0 ? "-.inf" : ".inf"; + let n = Object.is(value2, -0) ? "-0" : JSON.stringify(value2); + if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) { + let i = n.indexOf("."); + if (i < 0) { + i = n.length; + n += "."; + } + let d = minFractionDigits - (n.length - i - 1); + while (d-- > 0) + n += "0"; + } + return n; } -var stringifyJSON = ({ value }) => JSON.stringify(value); + +// node_modules/yaml/browser/dist/schema/core/float.js +var floatNaN = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber +}; +var floatExp = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, + resolve: (str2) => parseFloat(str2), + stringify(node) { + const num2 = Number(node.value); + return isFinite(num2) ? num2.toExponential() : stringifyNumber(node); + } +}; +var float = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, + resolve(str2) { + const node = new Scalar(parseFloat(str2)); + const dot = str2.indexOf("."); + if (dot !== -1 && str2[str2.length - 1] === "0") + node.minFractionDigits = str2.length - dot - 1; + return node; + }, + stringify: stringifyNumber +}; + +// node_modules/yaml/browser/dist/schema/core/int.js +var intIdentify = (value2) => typeof value2 === "bigint" || Number.isInteger(value2); +var intResolve = (str2, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2.substring(offset), radix); +function intStringify(node, radix, prefix) { + const { value: value2 } = node; + if (intIdentify(value2) && value2 >= 0) + return prefix + value2.toString(radix); + return stringifyNumber(node); +} +var intOct = { + identify: (value2) => intIdentify(value2) && value2 >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^0o[0-7]+$/, + resolve: (str2, _onError, opt2) => intResolve(str2, 2, 8, opt2), + stringify: (node) => intStringify(node, 8, "0o") +}; +var int2 = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9]+$/, + resolve: (str2, _onError, opt2) => intResolve(str2, 0, 10, opt2), + stringify: stringifyNumber +}; +var intHex = { + identify: (value2) => intIdentify(value2) && value2 >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^0x[0-9a-fA-F]+$/, + resolve: (str2, _onError, opt2) => intResolve(str2, 2, 16, opt2), + stringify: (node) => intStringify(node, 16, "0x") +}; + +// node_modules/yaml/browser/dist/schema/core/schema.js +var schema = [ + map2, + seq, + string, + nullTag, + boolTag, + intOct, + int2, + intHex, + floatNaN, + floatExp, + float +]; + +// node_modules/yaml/browser/dist/schema/json/schema.js +function intIdentify2(value2) { + return typeof value2 === "bigint" || Number.isInteger(value2); +} +var stringifyJSON = ({ value: value2 }) => JSON.stringify(value2); var jsonScalars = [ { - identify: (value) => typeof value === "string", + identify: (value2) => typeof value2 === "string", default: true, tag: "tag:yaml.org,2002:str", resolve: (str2) => str2, stringify: stringifyJSON }, { - identify: (value) => value == null, + identify: (value2) => value2 == null, createNode: () => new Scalar(null), default: true, tag: "tag:yaml.org,2002:null", @@ -43575,7 +61202,7 @@ var jsonScalars = [ stringify: stringifyJSON }, { - identify: (value) => typeof value === "boolean", + identify: (value2) => typeof value2 === "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^true$|^false$/, @@ -43583,15 +61210,15 @@ var jsonScalars = [ stringify: stringifyJSON }, { - identify: intIdentify, + identify: intIdentify2, default: true, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (str2, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2, 10), - stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value) + stringify: ({ value: value2 }) => intIdentify2(value2) ? value2.toString() : JSON.stringify(value2) }, { - identify: (value) => typeof value === "number", + identify: (value2) => typeof value2 === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, @@ -43608,9 +61235,88 @@ var jsonError = { return str2; } }; -var schema = [map2, seq].concat(jsonScalars, jsonError); +var schema2 = [map2, seq].concat(jsonScalars, jsonError); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +var binary = { + identify: (value2) => value2 instanceof Uint8Array, + // Buffer inherits from Uint8Array + default: false, + tag: "tag:yaml.org,2002:binary", + /** + * Returns a Buffer in node and an Uint8Array in browsers + * + * To use the resulting buffer as an image, you'll want to do something like: + * + * const blob = new Blob([buffer], { type: 'image/jpeg' }) + * document.querySelector('#photo').src = URL.createObjectURL(blob) + */ + resolve(src, onError) { + if (typeof atob === "function") { + const str2 = atob(src.replace(/[\n\r]/g, "")); + const buffer = new Uint8Array(str2.length); + for (let i = 0; i < str2.length; ++i) + buffer[i] = str2.charCodeAt(i); + return buffer; + } else { + onError("This environment does not support reading binary tags; either Buffer or atob is required"); + return src; + } + }, + stringify({ comment, type, value: value2 }, ctx, onComment, onChompKeep) { + if (!value2) + return ""; + const buf = value2; + let str2; + if (typeof btoa === "function") { + let s = ""; + for (let i = 0; i < buf.length; ++i) + s += String.fromCharCode(buf[i]); + str2 = btoa(s); + } else { + throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); + } + type ?? (type = Scalar.BLOCK_LITERAL); + if (type !== Scalar.QUOTE_DOUBLE) { + const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); + const n = Math.ceil(str2.length / lineWidth); + const lines2 = new Array(n); + for (let i = 0, o = 0; i < n; ++i, o += lineWidth) { + lines2[i] = str2.substr(o, lineWidth); + } + str2 = lines2.join(type === Scalar.BLOCK_LITERAL ? "\n" : " "); + } + return stringifyString({ comment, type, value: str2 }, ctx, onComment, onChompKeep); + } +}; // node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +function resolvePairs(seq2, onError) { + if (isSeq(seq2)) { + for (let i = 0; i < seq2.items.length; ++i) { + let item = seq2.items[i]; + if (isPair(item)) + continue; + else if (isMap(item)) { + if (item.items.length > 1) + onError("Each pair must have its own sequence indicator"); + const pair = item.items[0] || new Pair(new Scalar(null)); + if (item.commentBefore) + pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore} +${pair.key.commentBefore}` : item.commentBefore; + if (item.comment) { + const cn = pair.value ?? pair.key; + cn.comment = cn.comment ? `${item.comment} +${cn.comment}` : item.comment; + } + item = pair; + } + seq2.items[i] = isPair(item) ? item : new Pair(item); + } + } else + onError("Expected a sequence for this tag"); + return seq2; +} function createPairs(schema4, iterable, ctx) { const { replacer } = ctx; const pairs2 = new YAMLSeq(schema4); @@ -43620,28 +61326,35 @@ function createPairs(schema4, iterable, ctx) { for (let it of iterable) { if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it); - let key, value; + let key, value2; if (Array.isArray(it)) { if (it.length === 2) { key = it[0]; - value = it[1]; + value2 = it[1]; } else throw new TypeError(`Expected [key, value] tuple: ${it}`); } else if (it && it instanceof Object) { const keys = Object.keys(it); if (keys.length === 1) { key = keys[0]; - value = it[key]; + value2 = it[key]; } else { throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); } } else { key = it; } - pairs2.items.push(createPair(key, value, ctx)); + pairs2.items.push(createPair(key, value2, ctx)); } return pairs2; } +var pairs = { + collection: "seq", + default: false, + tag: "tag:yaml.org,2002:pairs", + resolve: resolvePairs, + createNode: createPairs +}; // node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js var YAMLOMap = class _YAMLOMap extends YAMLSeq { @@ -43665,16 +61378,16 @@ var YAMLOMap = class _YAMLOMap extends YAMLSeq { if (ctx?.onCreate) ctx.onCreate(map3); for (const pair of this.items) { - let key, value; + let key, value2; if (isPair(pair)) { key = toJS(pair.key, "", ctx); - value = toJS(pair.value, key, ctx); + value2 = toJS(pair.value, key, ctx); } else { key = toJS(pair, "", ctx); } if (map3.has(key)) throw new Error("Ordered maps must not include duplicate keys"); - map3.set(key, value); + map3.set(key, value2); } return map3; } @@ -43686,6 +61399,160 @@ var YAMLOMap = class _YAMLOMap extends YAMLSeq { } }; YAMLOMap.tag = "tag:yaml.org,2002:omap"; +var omap = { + collection: "seq", + identify: (value2) => value2 instanceof Map, + nodeClass: YAMLOMap, + default: false, + tag: "tag:yaml.org,2002:omap", + resolve(seq2, onError) { + const pairs2 = resolvePairs(seq2, onError); + const seenKeys = []; + for (const { key } of pairs2.items) { + if (isScalar(key)) { + if (seenKeys.includes(key.value)) { + onError(`Ordered maps must not include duplicate keys: ${key.value}`); + } else { + seenKeys.push(key.value); + } + } + } + return Object.assign(new YAMLOMap(), pairs2); + }, + createNode: (schema4, iterable, ctx) => YAMLOMap.from(schema4, iterable, ctx) +}; + +// node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +function boolStringify({ value: value2, source }, ctx) { + const boolObj = value2 ? trueTag : falseTag; + if (source && boolObj.test.test(source)) + return source; + return value2 ? ctx.options.trueStr : ctx.options.falseStr; +} +var trueTag = { + identify: (value2) => value2 === true, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, + resolve: () => new Scalar(true), + stringify: boolStringify +}; +var falseTag = { + identify: (value2) => value2 === false, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, + resolve: () => new Scalar(false), + stringify: boolStringify +}; + +// node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +var floatNaN2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber +}; +var floatExp2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, + resolve: (str2) => parseFloat(str2.replace(/_/g, "")), + stringify(node) { + const num2 = Number(node.value); + return isFinite(num2) ? num2.toExponential() : stringifyNumber(node); + } +}; +var float2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, + resolve(str2) { + const node = new Scalar(parseFloat(str2.replace(/_/g, ""))); + const dot = str2.indexOf("."); + if (dot !== -1) { + const f = str2.substring(dot + 1).replace(/_/g, ""); + if (f[f.length - 1] === "0") + node.minFractionDigits = f.length; + } + return node; + }, + stringify: stringifyNumber +}; + +// node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +var intIdentify3 = (value2) => typeof value2 === "bigint" || Number.isInteger(value2); +function intResolve2(str2, offset, radix, { intAsBigInt }) { + const sign = str2[0]; + if (sign === "-" || sign === "+") + offset += 1; + str2 = str2.substring(offset).replace(/_/g, ""); + if (intAsBigInt) { + switch (radix) { + case 2: + str2 = `0b${str2}`; + break; + case 8: + str2 = `0o${str2}`; + break; + case 16: + str2 = `0x${str2}`; + break; + } + const n2 = BigInt(str2); + return sign === "-" ? BigInt(-1) * n2 : n2; + } + const n = parseInt(str2, radix); + return sign === "-" ? -1 * n : n; +} +function intStringify2(node, radix, prefix) { + const { value: value2 } = node; + if (intIdentify3(value2)) { + const str2 = value2.toString(radix); + return value2 < 0 ? "-" + prefix + str2.substr(1) : prefix + str2; + } + return stringifyNumber(node); +} +var intBin = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "BIN", + test: /^[-+]?0b[0-1_]+$/, + resolve: (str2, _onError, opt2) => intResolve2(str2, 2, 2, opt2), + stringify: (node) => intStringify2(node, 2, "0b") +}; +var intOct2 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^[-+]?0[0-7_]+$/, + resolve: (str2, _onError, opt2) => intResolve2(str2, 1, 8, opt2), + stringify: (node) => intStringify2(node, 8, "0") +}; +var int3 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9][0-9_]*$/, + resolve: (str2, _onError, opt2) => intResolve2(str2, 0, 10, opt2), + stringify: stringifyNumber +}; +var intHex2 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^[-+]?0x[0-9a-fA-F_]+$/, + resolve: (str2, _onError, opt2) => intResolve2(str2, 2, 16, opt2), + stringify: (node) => intStringify2(node, 16, "0x") +}; // node_modules/yaml/browser/dist/schema/yaml-1.1/set.js var YAMLSet = class _YAMLSet extends YAMLMap { @@ -43713,13 +61580,13 @@ var YAMLSet = class _YAMLSet extends YAMLMap { const pair = findPair(this.items, key); return !keepPair && isPair(pair) ? isScalar(pair.key) ? pair.key.value : pair.key : pair; } - set(key, value) { - if (typeof value !== "boolean") - throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); + set(key, value2) { + if (typeof value2 !== "boolean") + throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value2}`); const prev = findPair(this.items, key); - if (prev && !value) { + if (prev && !value2) { this.items.splice(this.items.indexOf(prev), 1); - } else if (!prev && value) { + } else if (!prev && value2) { this.items.push(new Pair(key)); } } @@ -43738,15 +61605,33 @@ var YAMLSet = class _YAMLSet extends YAMLMap { const { replacer } = ctx; const set2 = new this(schema4); if (iterable && Symbol.iterator in Object(iterable)) - for (let value of iterable) { + for (let value2 of iterable) { if (typeof replacer === "function") - value = replacer.call(iterable, value, value); - set2.items.push(createPair(value, null, ctx)); + value2 = replacer.call(iterable, value2, value2); + set2.items.push(createPair(value2, null, ctx)); } return set2; } }; YAMLSet.tag = "tag:yaml.org,2002:set"; +var set = { + collection: "map", + identify: (value2) => value2 instanceof Set, + nodeClass: YAMLSet, + default: false, + tag: "tag:yaml.org,2002:set", + createNode: (schema4, iterable, ctx) => YAMLSet.from(schema4, iterable, ctx), + resolve(map3, onError) { + if (isMap(map3)) { + if (map3.hasAllNullValues(true)) + return Object.assign(new YAMLSet(), map3); + else + onError("Set items must all have null values"); + } else + onError("Expected a mapping for this tag"); + return map3; + } +}; // node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js function parseSexagesimal(str2, asBigInt) { @@ -43756,8 +61641,52 @@ function parseSexagesimal(str2, asBigInt) { const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num2(60) + num2(p), num2(0)); return sign === "-" ? num2(-1) * res : res; } +function stringifySexagesimal(node) { + let { value: value2 } = node; + let num2 = (n) => n; + if (typeof value2 === "bigint") + num2 = (n) => BigInt(n); + else if (isNaN(value2) || !isFinite(value2)) + return stringifyNumber(node); + let sign = ""; + if (value2 < 0) { + sign = "-"; + value2 *= num2(-1); + } + const _60 = num2(60); + const parts = [value2 % _60]; + if (value2 < 60) { + parts.unshift(0); + } else { + value2 = (value2 - parts[0]) / _60; + parts.unshift(value2 % _60); + if (value2 >= 60) { + value2 = (value2 - parts[0]) / _60; + parts.unshift(value2); + } + } + return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); +} +var intTime = { + identify: (value2) => typeof value2 === "bigint" || Number.isInteger(value2), + default: true, + tag: "tag:yaml.org,2002:int", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, + resolve: (str2, _onError, { intAsBigInt }) => parseSexagesimal(str2, intAsBigInt), + stringify: stringifySexagesimal +}; +var floatTime = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, + resolve: (str2) => parseSexagesimal(str2, false), + stringify: stringifySexagesimal +}; var timestamp = { - identify: (value) => value instanceof Date, + identify: (value2) => value2 instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part @@ -43780,7 +61709,1937 @@ var timestamp = { } return new Date(date); }, - stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" + stringify: ({ value: value2 }) => value2?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" +}; + +// node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +var schema3 = [ + map2, + seq, + string, + nullTag, + trueTag, + falseTag, + intBin, + intOct2, + int3, + intHex2, + floatNaN2, + floatExp2, + float2, + binary, + merge3, + omap, + pairs, + set, + intTime, + floatTime, + timestamp +]; + +// node_modules/yaml/browser/dist/schema/tags.js +var schemas = /* @__PURE__ */ new Map([ + ["core", schema], + ["failsafe", [map2, seq, string]], + ["json", schema2], + ["yaml11", schema3], + ["yaml-1.1", schema3] +]); +var tagsByName = { + binary, + bool: boolTag, + float, + floatExp, + floatNaN, + floatTime, + int: int2, + intHex, + intOct, + intTime, + map: map2, + merge: merge3, + null: nullTag, + omap, + pairs, + seq, + set, + timestamp +}; +var coreKnownTags = { + "tag:yaml.org,2002:binary": binary, + "tag:yaml.org,2002:merge": merge3, + "tag:yaml.org,2002:omap": omap, + "tag:yaml.org,2002:pairs": pairs, + "tag:yaml.org,2002:set": set, + "tag:yaml.org,2002:timestamp": timestamp +}; +function getTags(customTags, schemaName, addMergeTag) { + const schemaTags = schemas.get(schemaName); + if (schemaTags && !customTags) { + return addMergeTag && !schemaTags.includes(merge3) ? schemaTags.concat(merge3) : schemaTags.slice(); + } + let tags = schemaTags; + if (!tags) { + if (Array.isArray(customTags)) + tags = []; + else { + const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); + } + } + if (Array.isArray(customTags)) { + for (const tag of customTags) + tags = tags.concat(tag); + } else if (typeof customTags === "function") { + tags = customTags(tags.slice()); + } + if (addMergeTag) + tags = tags.concat(merge3); + return tags.reduce((tags2, tag) => { + const tagObj = typeof tag === "string" ? tagsByName[tag] : tag; + if (!tagObj) { + const tagName = JSON.stringify(tag); + const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`); + } + if (!tags2.includes(tagObj)) + tags2.push(tagObj); + return tags2; + }, []); +} + +// node_modules/yaml/browser/dist/schema/Schema.js +var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; +var Schema = class _Schema { + constructor({ compat, customTags, merge: merge4, resolveKnownTags, schema: schema4, sortMapEntries, toStringDefaults }) { + this.compat = Array.isArray(compat) ? getTags(compat, "compat") : compat ? getTags(null, compat) : null; + this.name = typeof schema4 === "string" && schema4 || "core"; + this.knownTags = resolveKnownTags ? coreKnownTags : {}; + this.tags = getTags(customTags, this.name, merge4); + this.toStringOptions = toStringDefaults ?? null; + Object.defineProperty(this, MAP, { value: map2 }); + Object.defineProperty(this, SCALAR, { value: string }); + Object.defineProperty(this, SEQ, { value: seq }); + this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; + } + clone() { + const copy2 = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this)); + copy2.tags = this.tags.slice(); + return copy2; + } +}; + +// node_modules/yaml/browser/dist/stringify/stringifyDocument.js +function stringifyDocument(doc, options) { + const lines2 = []; + let hasDirectives = options.directives === true; + if (options.directives !== false && doc.directives) { + const dir = doc.directives.toString(doc); + if (dir) { + lines2.push(dir); + hasDirectives = true; + } else if (doc.directives.docStart) + hasDirectives = true; + } + if (hasDirectives) + lines2.push("---"); + const ctx = createStringifyContext(doc, options); + const { commentString } = ctx.options; + if (doc.commentBefore) { + if (lines2.length !== 1) + lines2.unshift(""); + const cs = commentString(doc.commentBefore); + lines2.unshift(indentComment(cs, "")); + } + let chompKeep = false; + let contentComment = null; + if (doc.contents) { + if (isNode(doc.contents)) { + if (doc.contents.spaceBefore && hasDirectives) + lines2.push(""); + if (doc.contents.commentBefore) { + const cs = commentString(doc.contents.commentBefore); + lines2.push(indentComment(cs, "")); + } + ctx.forceBlockIndent = !!doc.comment; + contentComment = doc.contents.comment; + } + const onChompKeep = contentComment ? void 0 : () => chompKeep = true; + let body = stringify3(doc.contents, ctx, () => contentComment = null, onChompKeep); + if (contentComment) + body += lineComment(body, "", commentString(contentComment)); + if ((body[0] === "|" || body[0] === ">") && lines2[lines2.length - 1] === "---") { + lines2[lines2.length - 1] = `--- ${body}`; + } else + lines2.push(body); + } else { + lines2.push(stringify3(doc.contents, ctx)); + } + if (doc.directives?.docEnd) { + if (doc.comment) { + const cs = commentString(doc.comment); + if (cs.includes("\n")) { + lines2.push("..."); + lines2.push(indentComment(cs, "")); + } else { + lines2.push(`... ${cs}`); + } + } else { + lines2.push("..."); + } + } else { + let dc = doc.comment; + if (dc && chompKeep) + dc = dc.replace(/^\n+/, ""); + if (dc) { + if ((!chompKeep || contentComment) && lines2[lines2.length - 1] !== "") + lines2.push(""); + lines2.push(indentComment(commentString(dc), "")); + } + } + return lines2.join("\n") + "\n"; +} + +// node_modules/yaml/browser/dist/doc/Document.js +var Document = class _Document { + constructor(value2, replacer, options) { + this.commentBefore = null; + this.comment = null; + this.errors = []; + this.warnings = []; + Object.defineProperty(this, NODE_TYPE, { value: DOC }); + let _replacer = null; + if (typeof replacer === "function" || Array.isArray(replacer)) { + _replacer = replacer; + } else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const opt2 = Object.assign({ + intAsBigInt: false, + keepSourceTokens: false, + logLevel: "warn", + prettyErrors: true, + strict: true, + stringKeys: false, + uniqueKeys: true, + version: "1.2" + }, options); + this.options = opt2; + let { version } = opt2; + if (options?._directives) { + this.directives = options._directives.atDocument(); + if (this.directives.yaml.explicit) + version = this.directives.yaml.version; + } else + this.directives = new Directives({ version }); + this.setSchema(version, options); + this.contents = value2 === void 0 ? null : this.createNode(value2, _replacer, options); + } + /** + * Create a deep copy of this Document and its contents. + * + * Custom Node values that inherit from `Object` still refer to their original instances. + */ + clone() { + const copy2 = Object.create(_Document.prototype, { + [NODE_TYPE]: { value: DOC } + }); + copy2.commentBefore = this.commentBefore; + copy2.comment = this.comment; + copy2.errors = this.errors.slice(); + copy2.warnings = this.warnings.slice(); + copy2.options = Object.assign({}, this.options); + if (this.directives) + copy2.directives = this.directives.clone(); + copy2.schema = this.schema.clone(); + copy2.contents = isNode(this.contents) ? this.contents.clone(copy2.schema) : this.contents; + if (this.range) + copy2.range = this.range.slice(); + return copy2; + } + /** Adds a value to the document. */ + add(value2) { + if (assertCollection(this.contents)) + this.contents.add(value2); + } + /** Adds a value to the document. */ + addIn(path5, value2) { + if (assertCollection(this.contents)) + this.contents.addIn(path5, value2); + } + /** + * Create a new `Alias` node, ensuring that the target `node` has the required anchor. + * + * If `node` already has an anchor, `name` is ignored. + * Otherwise, the `node.anchor` value will be set to `name`, + * or if an anchor with that name is already present in the document, + * `name` will be used as a prefix for a new unique anchor. + * If `name` is undefined, the generated anchor will use 'a' as a prefix. + */ + createAlias(node, name) { + if (!node.anchor) { + const prev = anchorNames(this); + node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + !name || prev.has(name) ? findNewAnchor(name || "a", prev) : name; + } + return new Alias(node.anchor); + } + createNode(value2, replacer, options) { + let _replacer = void 0; + if (typeof replacer === "function") { + value2 = replacer.call({ "": value2 }, "", value2); + _replacer = replacer; + } else if (Array.isArray(replacer)) { + const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number; + const asStr = replacer.filter(keyToStr).map(String); + if (asStr.length > 0) + replacer = replacer.concat(asStr); + _replacer = replacer; + } else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; + const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors( + this, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + anchorPrefix || "a" + ); + const ctx = { + aliasDuplicateObjects: aliasDuplicateObjects ?? true, + keepUndefined: keepUndefined ?? false, + onAnchor, + onTagObj, + replacer: _replacer, + schema: this.schema, + sourceObjects + }; + const node = createNode2(value2, tag, ctx); + if (flow && isCollection(node)) + node.flow = true; + setAnchors(); + return node; + } + /** + * Convert a key and a value into a `Pair` using the current schema, + * recursively wrapping all values as `Scalar` or `Collection` nodes. + */ + createPair(key, value2, options = {}) { + const k = this.createNode(key, null, options); + const v = this.createNode(value2, null, options); + return new Pair(k, v); + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + delete(key) { + return assertCollection(this.contents) ? this.contents.delete(key) : false; + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + deleteIn(path5) { + if (isEmptyPath(path5)) { + if (this.contents == null) + return false; + this.contents = null; + return true; + } + return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false; + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + get(key, keepScalar) { + return isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; + } + /** + * Returns item at `path`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path5, keepScalar) { + if (isEmptyPath(path5)) + return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents; + return isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : void 0; + } + /** + * Checks if the document includes a value with the key `key`. + */ + has(key) { + return isCollection(this.contents) ? this.contents.has(key) : false; + } + /** + * Checks if the document includes a value at `path`. + */ + hasIn(path5) { + if (isEmptyPath(path5)) + return this.contents !== void 0; + return isCollection(this.contents) ? this.contents.hasIn(path5) : false; + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + set(key, value2) { + if (this.contents == null) { + this.contents = collectionFromPath(this.schema, [key], value2); + } else if (assertCollection(this.contents)) { + this.contents.set(key, value2); + } + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path5, value2) { + if (isEmptyPath(path5)) { + this.contents = value2; + } else if (this.contents == null) { + this.contents = collectionFromPath(this.schema, Array.from(path5), value2); + } else if (assertCollection(this.contents)) { + this.contents.setIn(path5, value2); + } + } + /** + * Change the YAML version and schema used by the document. + * A `null` version disables support for directives, explicit tags, anchors, and aliases. + * It also requires the `schema` option to be given as a `Schema` instance value. + * + * Overrides all previously set schema options. + */ + setSchema(version, options = {}) { + if (typeof version === "number") + version = String(version); + let opt2; + switch (version) { + case "1.1": + if (this.directives) + this.directives.yaml.version = "1.1"; + else + this.directives = new Directives({ version: "1.1" }); + opt2 = { resolveKnownTags: false, schema: "yaml-1.1" }; + break; + case "1.2": + case "next": + if (this.directives) + this.directives.yaml.version = version; + else + this.directives = new Directives({ version }); + opt2 = { resolveKnownTags: true, schema: "core" }; + break; + case null: + if (this.directives) + delete this.directives; + opt2 = null; + break; + default: { + const sv = JSON.stringify(version); + throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); + } + } + if (options.schema instanceof Object) + this.schema = options.schema; + else if (opt2) + this.schema = new Schema(Object.assign(opt2, options)); + else + throw new Error(`With a null YAML version, the { schema: Schema } option is required`); + } + // json & jsonArg are only used from toJSON() + toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + const ctx = { + anchors: /* @__PURE__ */ new Map(), + doc: this, + keep: !json, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 + }; + const res = toJS(this.contents, jsonArg ?? "", ctx); + if (typeof onAnchor === "function") + for (const { count, res: res2 } of ctx.anchors.values()) + onAnchor(res2, count); + return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res; + } + /** + * A JSON representation of the document `contents`. + * + * @param jsonArg Used by `JSON.stringify` to indicate the array index or + * property name. + */ + toJSON(jsonArg, onAnchor) { + return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor }); + } + /** A YAML representation of the document. */ + toString(options = {}) { + if (this.errors.length > 0) + throw new Error("Document with errors cannot be stringified"); + if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { + const s = JSON.stringify(options.indent); + throw new Error(`"indent" option must be a positive integer, not ${s}`); + } + return stringifyDocument(this, options); + } +}; +function assertCollection(contents) { + if (isCollection(contents)) + return true; + throw new Error("Expected a YAML collection as document contents"); +} + +// node_modules/yaml/browser/dist/errors.js +var YAMLError = class extends Error { + constructor(name, pos, code, message) { + super(); + this.name = name; + this.code = code; + this.message = message; + this.pos = pos; + } +}; +var YAMLParseError = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLParseError", pos, code, message); + } +}; +var YAMLWarning = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLWarning", pos, code, message); + } +}; +var prettifyError = (src, lc) => (error) => { + if (error.pos[0] === -1) + return; + error.linePos = error.pos.map((pos) => lc.linePos(pos)); + const { line, col } = error.linePos[0]; + error.message += ` at line ${line}, column ${col}`; + let ci = col - 1; + let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); + if (ci >= 60 && lineStr.length > 80) { + const trimStart = Math.min(ci - 39, lineStr.length - 79); + lineStr = "\u2026" + lineStr.substring(trimStart); + ci -= trimStart - 1; + } + if (lineStr.length > 80) + lineStr = lineStr.substring(0, 79) + "\u2026"; + if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { + let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); + if (prev.length > 80) + prev = prev.substring(0, 79) + "\u2026\n"; + lineStr = prev + lineStr; + } + if (/[^ ]/.test(lineStr)) { + let count = 1; + const end = error.linePos[1]; + if (end?.line === line && end.col > col) { + count = Math.max(1, Math.min(end.col - col, 80 - ci)); + } + const pointer2 = " ".repeat(ci) + "^".repeat(count); + error.message += `: + +${lineStr} +${pointer2} +`; + } +}; + +// node_modules/yaml/browser/dist/compose/resolve-props.js +function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { + let spaceBefore = false; + let atNewline = startOnNewline; + let hasSpace = startOnNewline; + let comment = ""; + let commentSep = ""; + let hasNewline = false; + let reqSpace = false; + let tab = null; + let anchor = null; + let tag = null; + let newlineAfterProp = null; + let comma = null; + let found = null; + let start = null; + for (const token of tokens) { + if (reqSpace) { + if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") + onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + reqSpace = false; + } + if (tab) { + if (atNewline && token.type !== "comment" && token.type !== "newline") { + onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + } + tab = null; + } + switch (token.type) { + case "space": + if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) { + tab = token; + } + hasSpace = true; + break; + case "comment": { + if (!hasSpace) + onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = token.source.substring(1) || " "; + if (!comment) + comment = cb; + else + comment += commentSep + cb; + commentSep = ""; + atNewline = false; + break; + } + case "newline": + if (atNewline) { + if (comment) + comment += token.source; + else if (!found || indicator !== "seq-item-ind") + spaceBefore = true; + } else + commentSep += token.source; + atNewline = true; + hasNewline = true; + if (anchor || tag) + newlineAfterProp = token; + hasSpace = true; + break; + case "anchor": + if (anchor) + onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); + if (token.source.endsWith(":")) + onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); + anchor = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + case "tag": { + if (tag) + onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); + tag = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + } + case indicator: + if (anchor || tag) + onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); + if (found) + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`); + found = token; + atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind"; + hasSpace = false; + break; + case "comma": + if (flow) { + if (comma) + onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`); + comma = token; + atNewline = false; + hasSpace = false; + break; + } + // else fallthrough + default: + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); + atNewline = false; + hasSpace = false; + } + } + const last = tokens[tokens.length - 1]; + const end = last ? last.offset + last.source.length : offset; + if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) { + onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + } + if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq")) + onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + return { + comma, + found, + spaceBefore, + comment, + hasNewline, + anchor, + tag, + newlineAfterProp, + end, + start: start ?? end + }; +} + +// node_modules/yaml/browser/dist/compose/util-contains-newline.js +function containsNewline(key) { + if (!key) + return null; + switch (key.type) { + case "alias": + case "scalar": + case "double-quoted-scalar": + case "single-quoted-scalar": + if (key.source.includes("\n")) + return true; + if (key.end) { + for (const st of key.end) + if (st.type === "newline") + return true; + } + return false; + case "flow-collection": + for (const it of key.items) { + for (const st of it.start) + if (st.type === "newline") + return true; + if (it.sep) { + for (const st of it.sep) + if (st.type === "newline") + return true; + } + if (containsNewline(it.key) || containsNewline(it.value)) + return true; + } + return false; + default: + return true; + } +} + +// node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +function flowIndentCheck(indent, fc, onError) { + if (fc?.type === "flow-collection") { + const end = fc.end[0]; + if (end.indent === indent && (end.source === "]" || end.source === "}") && containsNewline(fc)) { + const msg = "Flow end indicator should be more indented than parent"; + onError(end, "BAD_INDENT", msg, true); + } + } +} + +// node_modules/yaml/browser/dist/compose/util-map-includes.js +function mapIncludes(ctx, items, search) { + const { uniqueKeys } = ctx.options; + if (uniqueKeys === false) + return false; + const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || isScalar(a) && isScalar(b) && a.value === b.value; + return items.some((pair) => isEqual(pair.key, search)); +} + +// node_modules/yaml/browser/dist/compose/resolve-block-map.js +var startColMsg = "All mapping items must start at the same column"; +function resolveBlockMap({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bm, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLMap; + const map3 = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + let offset = bm.offset; + let commentEnd = null; + for (const collItem of bm.items) { + const { start, key, sep, value: value2 } = collItem; + const keyProps = resolveProps(start, { + indicator: "explicit-key-ind", + next: key ?? sep?.[0], + offset, + onError, + parentIndent: bm.indent, + startOnNewline: true + }); + const implicitKey = !keyProps.found; + if (implicitKey) { + if (key) { + if (key.type === "block-seq") + onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); + else if ("indent" in key && key.indent !== bm.indent) + onError(offset, "BAD_INDENT", startColMsg); + } + if (!keyProps.anchor && !keyProps.tag && !sep) { + commentEnd = keyProps.end; + if (keyProps.comment) { + if (map3.comment) + map3.comment += "\n" + keyProps.comment; + else + map3.comment = keyProps.comment; + } + continue; + } + if (keyProps.newlineAfterProp || containsNewline(key)) { + onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); + } + } else if (keyProps.found?.indent !== bm.indent) { + onError(offset, "BAD_INDENT", startColMsg); + } + ctx.atKey = true; + const keyStart = keyProps.end; + const keyNode = key ? composeNode2(ctx, key, keyProps, onError) : composeEmptyNode2(ctx, keyStart, start, null, keyProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, key, onError); + ctx.atKey = false; + if (mapIncludes(ctx, map3.items, keyNode)) + onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + const valueProps = resolveProps(sep ?? [], { + indicator: "map-value-ind", + next: value2, + offset: keyNode.range[2], + onError, + parentIndent: bm.indent, + startOnNewline: !key || key.type === "block-scalar" + }); + offset = valueProps.end; + if (valueProps.found) { + if (implicitKey) { + if (value2?.type === "block-map" && !valueProps.hasNewline) + onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); + if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) + onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); + } + const valueNode = value2 ? composeNode2(ctx, value2, valueProps, onError) : composeEmptyNode2(ctx, offset, sep, null, valueProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, value2, onError); + offset = valueNode.range[2]; + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map3.items.push(pair); + } else { + if (implicitKey) + onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); + if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += "\n" + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map3.items.push(pair); + } + } + if (commentEnd && commentEnd < offset) + onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); + map3.range = [bm.offset, offset, commentEnd ?? offset]; + return map3; +} + +// node_modules/yaml/browser/dist/compose/resolve-block-seq.js +function resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bs, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLSeq; + const seq2 = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + if (ctx.atKey) + ctx.atKey = false; + let offset = bs.offset; + let commentEnd = null; + for (const { start, value: value2 } of bs.items) { + const props = resolveProps(start, { + indicator: "seq-item-ind", + next: value2, + offset, + onError, + parentIndent: bs.indent, + startOnNewline: true + }); + if (!props.found) { + if (props.anchor || props.tag || value2) { + if (value2?.type === "block-seq") + onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); + else + onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); + } else { + commentEnd = props.end; + if (props.comment) + seq2.comment = props.comment; + continue; + } + } + const node = value2 ? composeNode2(ctx, value2, props, onError) : composeEmptyNode2(ctx, props.end, start, null, props, onError); + if (ctx.schema.compat) + flowIndentCheck(bs.indent, value2, onError); + offset = node.range[2]; + seq2.items.push(node); + } + seq2.range = [bs.offset, offset, commentEnd ?? offset]; + return seq2; +} + +// node_modules/yaml/browser/dist/compose/resolve-end.js +function resolveEnd(end, offset, reqSpace, onError) { + let comment = ""; + if (end) { + let hasSpace = false; + let sep = ""; + for (const token of end) { + const { source, type } = token; + switch (type) { + case "space": + hasSpace = true; + break; + case "comment": { + if (reqSpace && !hasSpace) + onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = source.substring(1) || " "; + if (!comment) + comment = cb; + else + comment += sep + cb; + sep = ""; + break; + } + case "newline": + if (comment) + sep += source; + hasSpace = true; + break; + default: + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`); + } + offset += source.length; + } + } + return { comment, offset }; +} + +// node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +var blockMsg = "Block collections are not allowed within flow collections"; +var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); +function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) { + const isMap2 = fc.start.source === "{"; + const fcName = isMap2 ? "flow map" : "flow sequence"; + const NodeClass = tag?.nodeClass ?? (isMap2 ? YAMLMap : YAMLSeq); + const coll = new NodeClass(ctx.schema); + coll.flow = true; + const atRoot = ctx.atRoot; + if (atRoot) + ctx.atRoot = false; + if (ctx.atKey) + ctx.atKey = false; + let offset = fc.offset + fc.start.source.length; + for (let i = 0; i < fc.items.length; ++i) { + const collItem = fc.items[i]; + const { start, key, sep, value: value2 } = collItem; + const props = resolveProps(start, { + flow: fcName, + indicator: "explicit-key-ind", + next: key ?? sep?.[0], + offset, + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (!props.found) { + if (!props.anchor && !props.tag && !sep && !value2) { + if (i === 0 && props.comma) + onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + else if (i < fc.items.length - 1) + onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); + if (props.comment) { + if (coll.comment) + coll.comment += "\n" + props.comment; + else + coll.comment = props.comment; + } + offset = props.end; + continue; + } + if (!isMap2 && ctx.options.strict && containsNewline(key)) + onError( + key, + // checked by containsNewline() + "MULTILINE_IMPLICIT_KEY", + "Implicit keys of flow sequence pairs need to be on a single line" + ); + } + if (i === 0) { + if (props.comma) + onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + } else { + if (!props.comma) + onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); + if (props.comment) { + let prevItemComment = ""; + loop: for (const st of start) { + switch (st.type) { + case "comma": + case "space": + break; + case "comment": + prevItemComment = st.source.substring(1); + break loop; + default: + break loop; + } + } + if (prevItemComment) { + let prev = coll.items[coll.items.length - 1]; + if (isPair(prev)) + prev = prev.value ?? prev.key; + if (prev.comment) + prev.comment += "\n" + prevItemComment; + else + prev.comment = prevItemComment; + props.comment = props.comment.substring(prevItemComment.length + 1); + } + } + } + if (!isMap2 && !sep && !props.found) { + const valueNode = value2 ? composeNode2(ctx, value2, props, onError) : composeEmptyNode2(ctx, props.end, sep, null, props, onError); + coll.items.push(valueNode); + offset = valueNode.range[2]; + if (isBlock(value2)) + onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else { + ctx.atKey = true; + const keyStart = props.end; + const keyNode = key ? composeNode2(ctx, key, props, onError) : composeEmptyNode2(ctx, keyStart, start, null, props, onError); + if (isBlock(key)) + onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); + ctx.atKey = false; + const valueProps = resolveProps(sep ?? [], { + flow: fcName, + indicator: "map-value-ind", + next: value2, + offset: keyNode.range[2], + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (valueProps.found) { + if (!isMap2 && !props.found && ctx.options.strict) { + if (sep) + for (const st of sep) { + if (st === valueProps.found) + break; + if (st.type === "newline") { + onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); + break; + } + } + if (props.start < valueProps.found.offset - 1024) + onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); + } + } else if (value2) { + if ("source" in value2 && value2.source?.[0] === ":") + onError(value2, "MISSING_CHAR", `Missing space after : in ${fcName}`); + else + onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); + } + const valueNode = value2 ? composeNode2(ctx, value2, valueProps, onError) : valueProps.found ? composeEmptyNode2(ctx, valueProps.end, sep, null, valueProps, onError) : null; + if (valueNode) { + if (isBlock(value2)) + onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += "\n" + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + if (isMap2) { + const map3 = coll; + if (mapIncludes(ctx, map3.items, keyNode)) + onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + map3.items.push(pair); + } else { + const map3 = new YAMLMap(ctx.schema); + map3.flow = true; + map3.items.push(pair); + const endRange = (valueNode ?? keyNode).range; + map3.range = [keyNode.range[0], endRange[1], endRange[2]]; + coll.items.push(map3); + } + offset = valueNode ? valueNode.range[2] : valueProps.end; + } + } + const expectedEnd = isMap2 ? "}" : "]"; + const [ce, ...ee] = fc.end; + let cePos = offset; + if (ce?.source === expectedEnd) + cePos = ce.offset + ce.source.length; + else { + const name = fcName[0].toUpperCase() + fcName.substring(1); + const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; + onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); + if (ce && ce.source.length !== 1) + ee.unshift(ce); + } + if (ee.length > 0) { + const end = resolveEnd(ee, cePos, ctx.options.strict, onError); + if (end.comment) { + if (coll.comment) + coll.comment += "\n" + end.comment; + else + coll.comment = end.comment; + } + coll.range = [fc.offset, cePos, end.offset]; + } else { + coll.range = [fc.offset, cePos, cePos]; + } + return coll; +} + +// node_modules/yaml/browser/dist/compose/compose-collection.js +function resolveCollection(CN2, ctx, token, onError, tagName, tag) { + const coll = token.type === "block-map" ? resolveBlockMap(CN2, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN2, ctx, token, onError, tag) : resolveFlowCollection(CN2, ctx, token, onError, tag); + const Coll = coll.constructor; + if (tagName === "!" || tagName === Coll.tagName) { + coll.tag = Coll.tagName; + return coll; + } + if (tagName) + coll.tag = tagName; + return coll; +} +function composeCollection(CN2, ctx, token, props, onError) { + const tagToken = props.tag; + const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); + if (token.type === "block-seq") { + const { anchor, newlineAfterProp: nl } = props; + const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken; + if (lastProp && (!nl || nl.offset < lastProp.offset)) { + const message = "Missing newline after block sequence props"; + onError(lastProp, "MISSING_CHAR", message); + } + } + const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; + if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.tagName && expType === "seq") { + return resolveCollection(CN2, ctx, token, onError, tagName); + } + let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType); + if (!tag) { + const kt = ctx.schema.knownTags[tagName]; + if (kt?.collection === expType) { + ctx.schema.tags.push(Object.assign({}, kt, { default: false })); + tag = kt; + } else { + if (kt) { + onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true); + } else { + onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); + } + return resolveCollection(CN2, ctx, token, onError, tagName); + } + } + const coll = resolveCollection(CN2, ctx, token, onError, tagName, tag); + const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; + const node = isNode(res) ? res : new Scalar(res); + node.range = coll.range; + node.tag = tagName; + if (tag?.format) + node.format = tag.format; + return node; +} + +// node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +function resolveBlockScalar(ctx, scalar, onError) { + const start = scalar.offset; + const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); + if (!header) + return { value: "", type: null, comment: "", range: [start, start, start] }; + const type = header.mode === ">" ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL; + const lines2 = scalar.source ? splitLines(scalar.source) : []; + let chompStart = lines2.length; + for (let i = lines2.length - 1; i >= 0; --i) { + const content = lines2[i][1]; + if (content === "" || content === "\r") + chompStart = i; + else + break; + } + if (chompStart === 0) { + const value3 = header.chomp === "+" && lines2.length > 0 ? "\n".repeat(Math.max(1, lines2.length - 1)) : ""; + let end2 = start + header.length; + if (scalar.source) + end2 += scalar.source.length; + return { value: value3, type, comment: header.comment, range: [start, end2, end2] }; + } + let trimIndent = scalar.indent + header.indent; + let offset = scalar.offset + header.length; + let contentStart = 0; + for (let i = 0; i < chompStart; ++i) { + const [indent, content] = lines2[i]; + if (content === "" || content === "\r") { + if (header.indent === 0 && indent.length > trimIndent) + trimIndent = indent.length; + } else { + if (indent.length < trimIndent) { + const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"; + onError(offset + indent.length, "MISSING_CHAR", message); + } + if (header.indent === 0) + trimIndent = indent.length; + contentStart = i; + if (trimIndent === 0 && !ctx.atRoot) { + const message = "Block scalar values in collections must be indented"; + onError(offset, "BAD_INDENT", message); + } + break; + } + offset += indent.length + content.length + 1; + } + for (let i = lines2.length - 1; i >= chompStart; --i) { + if (lines2[i][0].length > trimIndent) + chompStart = i + 1; + } + let value2 = ""; + let sep = ""; + let prevMoreIndented = false; + for (let i = 0; i < contentStart; ++i) + value2 += lines2[i][0].slice(trimIndent) + "\n"; + for (let i = contentStart; i < chompStart; ++i) { + let [indent, content] = lines2[i]; + offset += indent.length + content.length + 1; + const crlf = content[content.length - 1] === "\r"; + if (crlf) + content = content.slice(0, -1); + if (content && indent.length < trimIndent) { + const src = header.indent ? "explicit indentation indicator" : "first line"; + const message = `Block scalar lines must not be less indented than their ${src}`; + onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); + indent = ""; + } + if (type === Scalar.BLOCK_LITERAL) { + value2 += sep + indent.slice(trimIndent) + content; + sep = "\n"; + } else if (indent.length > trimIndent || content[0] === " ") { + if (sep === " ") + sep = "\n"; + else if (!prevMoreIndented && sep === "\n") + sep = "\n\n"; + value2 += sep + indent.slice(trimIndent) + content; + sep = "\n"; + prevMoreIndented = true; + } else if (content === "") { + if (sep === "\n") + value2 += "\n"; + else + sep = "\n"; + } else { + value2 += sep + content; + sep = " "; + prevMoreIndented = false; + } + } + switch (header.chomp) { + case "-": + break; + case "+": + for (let i = chompStart; i < lines2.length; ++i) + value2 += "\n" + lines2[i][0].slice(trimIndent); + if (value2[value2.length - 1] !== "\n") + value2 += "\n"; + break; + default: + value2 += "\n"; + } + const end = start + header.length + scalar.source.length; + return { value: value2, type, comment: header.comment, range: [start, end, end] }; +} +function parseBlockScalarHeader({ offset, props }, strict, onError) { + if (props[0].type !== "block-scalar-header") { + onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); + return null; + } + const { source } = props[0]; + const mode = source[0]; + let indent = 0; + let chomp = ""; + let error = -1; + for (let i = 1; i < source.length; ++i) { + const ch = source[i]; + if (!chomp && (ch === "-" || ch === "+")) + chomp = ch; + else { + const n = Number(ch); + if (!indent && n) + indent = n; + else if (error === -1) + error = offset + i; + } + } + if (error !== -1) + onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); + let hasSpace = false; + let comment = ""; + let length = source.length; + for (let i = 1; i < props.length; ++i) { + const token = props[i]; + switch (token.type) { + case "space": + hasSpace = true; + // fallthrough + case "newline": + length += token.source.length; + break; + case "comment": + if (strict && !hasSpace) { + const message = "Comments must be separated from other tokens by white space characters"; + onError(token, "MISSING_CHAR", message); + } + length += token.source.length; + comment = token.source.substring(1); + break; + case "error": + onError(token, "UNEXPECTED_TOKEN", token.message); + length += token.source.length; + break; + /* istanbul ignore next should not happen */ + default: { + const message = `Unexpected token in block scalar header: ${token.type}`; + onError(token, "UNEXPECTED_TOKEN", message); + const ts = token.source; + if (ts && typeof ts === "string") + length += ts.length; + } + } + } + return { mode, indent, chomp, comment, length }; +} +function splitLines(source) { + const split = source.split(/\n( *)/); + const first = split[0]; + const m = first.match(/^( *)/); + const line0 = m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]; + const lines2 = [line0]; + for (let i = 1; i < split.length; i += 2) + lines2.push([split[i], split[i + 1]]); + return lines2; +} + +// node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +function resolveFlowScalar(scalar, strict, onError) { + const { offset, type, source, end } = scalar; + let _type; + let value2; + const _onError = (rel, code, msg) => onError(offset + rel, code, msg); + switch (type) { + case "scalar": + _type = Scalar.PLAIN; + value2 = plainValue(source, _onError); + break; + case "single-quoted-scalar": + _type = Scalar.QUOTE_SINGLE; + value2 = singleQuotedValue(source, _onError); + break; + case "double-quoted-scalar": + _type = Scalar.QUOTE_DOUBLE; + value2 = doubleQuotedValue(source, _onError); + break; + /* istanbul ignore next should not happen */ + default: + onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`); + return { + value: "", + type: null, + comment: "", + range: [offset, offset + source.length, offset + source.length] + }; + } + const valueEnd = offset + source.length; + const re = resolveEnd(end, valueEnd, strict, onError); + return { + value: value2, + type: _type, + comment: re.comment, + range: [offset, valueEnd, re.offset] + }; +} +function plainValue(source, onError) { + let badChar = ""; + switch (source[0]) { + /* istanbul ignore next should not happen */ + case " ": + badChar = "a tab character"; + break; + case ",": + badChar = "flow indicator character ,"; + break; + case "%": + badChar = "directive indicator character %"; + break; + case "|": + case ">": { + badChar = `block scalar indicator ${source[0]}`; + break; + } + case "@": + case "`": { + badChar = `reserved character ${source[0]}`; + break; + } + } + if (badChar) + onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); + return unfoldLines(source); +} +function singleQuotedValue(source, onError) { + if (source[source.length - 1] !== "'" || source.length === 1) + onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); + return unfoldLines(source.slice(1, -1)).replace(/''/g, "'"); +} +function unfoldLines(source) { + const line = /(.*?)\r?\n/sy; + let match = line.exec(source); + if (!match) + return source; + let trimEnd, trimBoth; + try { + trimEnd = new RegExp("(? wsStart ? source.slice(wsStart, i + 1) : ch; + } else { + res += ch; + } + } + if (source[source.length - 1] !== '"' || source.length === 1) + onError(source.length, "MISSING_CHAR", 'Missing closing "quote'); + return res; +} +function foldNewline(source, offset) { + let fold = ""; + let ch = source[offset + 1]; + while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { + if (ch === "\r" && source[offset + 2] !== "\n") + break; + if (ch === "\n") + fold += "\n"; + offset += 1; + ch = source[offset + 1]; + } + if (!fold) + fold = " "; + return { fold, offset }; +} +var escapeCodes = { + "0": "\0", + // null character + a: "\x07", + // bell character + b: "\b", + // backspace + e: "\x1B", + // escape character + f: "\f", + // form feed + n: "\n", + // line feed + r: "\r", + // carriage return + t: " ", + // horizontal tab + v: "\v", + // vertical tab + N: "\x85", + // Unicode next line + _: "\xA0", + // Unicode non-breaking space + L: "\u2028", + // Unicode line separator + P: "\u2029", + // Unicode paragraph separator + " ": " ", + '"': '"', + "/": "/", + "\\": "\\", + " ": " " +}; +function parseCharCode(source, offset, length, onError) { + const cc = source.substr(offset, length); + const ok2 = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); + const code = ok2 ? parseInt(cc, 16) : NaN; + try { + return String.fromCodePoint(code); + } catch { + const raw = source.substr(offset - 2, length + 2); + onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); + return raw; + } +} + +// node_modules/yaml/browser/dist/compose/compose-scalar.js +function composeScalar(ctx, token, tagToken, onError) { + const { value: value2, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError); + const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; + let tag; + if (ctx.options.stringKeys && ctx.atKey) { + tag = ctx.schema[SCALAR]; + } else if (tagName) + tag = findScalarTagByName(ctx.schema, value2, tagName, tagToken, onError); + else if (token.type === "scalar") + tag = findScalarTagByTest(ctx, value2, token, onError); + else + tag = ctx.schema[SCALAR]; + let scalar; + try { + const res = tag.resolve(value2, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); + scalar = isScalar(res) ? res : new Scalar(res); + } catch (error) { + const msg = error instanceof Error ? error.message : String(error); + onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); + scalar = new Scalar(value2); + } + scalar.range = range; + scalar.source = value2; + if (type) + scalar.type = type; + if (tagName) + scalar.tag = tagName; + if (tag.format) + scalar.format = tag.format; + if (comment) + scalar.comment = comment; + return scalar; +} +function findScalarTagByName(schema4, value2, tagName, tagToken, onError) { + if (tagName === "!") + return schema4[SCALAR]; + const matchWithTest = []; + for (const tag of schema4.tags) { + if (!tag.collection && tag.tag === tagName) { + if (tag.default && tag.test) + matchWithTest.push(tag); + else + return tag; + } + } + for (const tag of matchWithTest) + if (tag.test?.test(value2)) + return tag; + const kt = schema4.knownTags[tagName]; + if (kt && !kt.collection) { + schema4.tags.push(Object.assign({}, kt, { default: false, test: void 0 })); + return kt; + } + onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); + return schema4[SCALAR]; +} +function findScalarTagByTest({ atKey, directives, schema: schema4 }, value2, token, onError) { + const tag = schema4.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value2)) || schema4[SCALAR]; + if (schema4.compat) { + const compat = schema4.compat.find((tag2) => tag2.default && tag2.test?.test(value2)) ?? schema4[SCALAR]; + if (tag.tag !== compat.tag) { + const ts = directives.tagString(tag.tag); + const cs = directives.tagString(compat.tag); + const msg = `Value may be parsed as either ${ts} or ${cs}`; + onError(token, "TAG_RESOLVE_FAILED", msg, true); + } + } + return tag; +} + +// node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +function emptyScalarPosition(offset, before, pos) { + if (before) { + pos ?? (pos = before.length); + for (let i = pos - 1; i >= 0; --i) { + let st = before[i]; + switch (st.type) { + case "space": + case "comment": + case "newline": + offset -= st.source.length; + continue; + } + st = before[++i]; + while (st?.type === "space") { + offset += st.source.length; + st = before[++i]; + } + break; + } + } + return offset; +} + +// node_modules/yaml/browser/dist/compose/compose-node.js +var CN = { composeNode, composeEmptyNode }; +function composeNode(ctx, token, props, onError) { + const atKey = ctx.atKey; + const { spaceBefore, comment, anchor, tag } = props; + let node; + let isSrcToken = true; + switch (token.type) { + case "alias": + node = composeAlias(ctx, token, onError); + if (anchor || tag) + onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); + break; + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "block-scalar": + node = composeScalar(ctx, token, tag, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + break; + case "block-map": + case "block-seq": + case "flow-collection": + try { + node = composeCollection(CN, ctx, token, props, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + onError(token, "RESOURCE_EXHAUSTION", message); + } + break; + default: { + const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`; + onError(token, "UNEXPECTED_TOKEN", message); + isSrcToken = false; + } + } + node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError)); + if (anchor && node.anchor === "") + onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) { + const msg = "With stringKeys, all keys must be strings"; + onError(tag ?? token, "NON_STRING_KEY", msg); + } + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + if (token.type === "scalar" && token.source === "") + node.comment = comment; + else + node.commentBefore = comment; + } + if (ctx.options.keepSourceTokens && isSrcToken) + node.srcToken = token; + return node; +} +function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { + const token = { + type: "scalar", + offset: emptyScalarPosition(offset, before, pos), + indent: -1, + source: "" + }; + const node = composeScalar(ctx, token, tag, onError); + if (anchor) { + node.anchor = anchor.source.substring(1); + if (node.anchor === "") + onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + } + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + node.comment = comment; + node.range[2] = end; + } + return node; +} +function composeAlias({ options }, { offset, source, end }, onError) { + const alias = new Alias(source.substring(1)); + if (alias.source === "") + onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); + if (alias.source.endsWith(":")) + onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); + const valueEnd = offset + source.length; + const re = resolveEnd(end, valueEnd, options.strict, onError); + alias.range = [offset, valueEnd, re.offset]; + if (re.comment) + alias.comment = re.comment; + return alias; +} + +// node_modules/yaml/browser/dist/compose/compose-doc.js +function composeDoc(options, directives, { offset, start, value: value2, end }, onError) { + const opts = Object.assign({ _directives: directives }, options); + const doc = new Document(void 0, opts); + const ctx = { + atKey: false, + atRoot: true, + directives: doc.directives, + options: doc.options, + schema: doc.schema + }; + const props = resolveProps(start, { + indicator: "doc-start", + next: value2 ?? end?.[0], + offset, + onError, + parentIndent: 0, + startOnNewline: true + }); + if (props.found) { + doc.directives.docStart = true; + if (value2 && (value2.type === "block-map" || value2.type === "block-seq") && !props.hasNewline) + onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); + } + doc.contents = value2 ? composeNode(ctx, value2, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); + const contentEnd = doc.contents.range[2]; + const re = resolveEnd(end, contentEnd, false, onError); + if (re.comment) + doc.comment = re.comment; + doc.range = [offset, contentEnd, re.offset]; + return doc; +} + +// node_modules/yaml/browser/dist/compose/composer.js +function getErrorPos(src) { + if (typeof src === "number") + return [src, src + 1]; + if (Array.isArray(src)) + return src.length === 2 ? src : [src[0], src[1]]; + const { offset, source } = src; + return [offset, offset + (typeof source === "string" ? source.length : 1)]; +} +function parsePrelude(prelude) { + let comment = ""; + let atComment = false; + let afterEmptyLine = false; + for (let i = 0; i < prelude.length; ++i) { + const source = prelude[i]; + switch (source[0]) { + case "#": + comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); + atComment = true; + afterEmptyLine = false; + break; + case "%": + if (prelude[i + 1]?.[0] !== "#") + i += 1; + atComment = false; + break; + default: + if (!atComment) + afterEmptyLine = true; + atComment = false; + } + } + return { comment, afterEmptyLine }; +} +var Composer = class { + constructor(options = {}) { + this.doc = null; + this.atDirectives = false; + this.prelude = []; + this.errors = []; + this.warnings = []; + this.onError = (source, code, message, warning) => { + const pos = getErrorPos(source); + if (warning) + this.warnings.push(new YAMLWarning(pos, code, message)); + else + this.errors.push(new YAMLParseError(pos, code, message)); + }; + this.directives = new Directives({ version: options.version || "1.2" }); + this.options = options; + } + decorate(doc, afterDoc) { + const { comment, afterEmptyLine } = parsePrelude(this.prelude); + if (comment) { + const dc = doc.contents; + if (afterDoc) { + doc.comment = doc.comment ? `${doc.comment} +${comment}` : comment; + } else if (afterEmptyLine || doc.directives.docStart || !dc) { + doc.commentBefore = comment; + } else if (isCollection(dc) && !dc.flow && dc.items.length > 0) { + let it = dc.items[0]; + if (isPair(it)) + it = it.key; + const cb = it.commentBefore; + it.commentBefore = cb ? `${comment} +${cb}` : comment; + } else { + const cb = dc.commentBefore; + dc.commentBefore = cb ? `${comment} +${cb}` : comment; + } + } + if (afterDoc) { + for (let i = 0; i < this.errors.length; ++i) + doc.errors.push(this.errors[i]); + for (let i = 0; i < this.warnings.length; ++i) + doc.warnings.push(this.warnings[i]); + } else { + doc.errors = this.errors; + doc.warnings = this.warnings; + } + this.prelude = []; + this.errors = []; + this.warnings = []; + } + /** + * Current stream status information. + * + * Mostly useful at the end of input for an empty stream. + */ + streamInfo() { + return { + comment: parsePrelude(this.prelude).comment, + directives: this.directives, + errors: this.errors, + warnings: this.warnings + }; + } + /** + * Compose tokens into documents. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *compose(tokens, forceDoc = false, endOffset = -1) { + for (const token of tokens) + yield* this.next(token); + yield* this.end(forceDoc, endOffset); + } + /** Advance the composer by one CST token. */ + *next(token) { + switch (token.type) { + case "directive": + this.directives.add(token.source, (offset, message, warning) => { + const pos = getErrorPos(token); + pos[0] += offset; + this.onError(pos, "BAD_DIRECTIVE", message, warning); + }); + this.prelude.push(token.source); + this.atDirectives = true; + break; + case "document": { + const doc = composeDoc(this.options, this.directives, token, this.onError); + if (this.atDirectives && !doc.directives.docStart) + this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); + this.decorate(doc, false); + if (this.doc) + yield this.doc; + this.doc = doc; + this.atDirectives = false; + break; + } + case "byte-order-mark": + case "space": + break; + case "comment": + case "newline": + this.prelude.push(token.source); + break; + case "error": { + const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; + const error = new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); + if (this.atDirectives || !this.doc) + this.errors.push(error); + else + this.doc.errors.push(error); + break; + } + case "doc-end": { + if (!this.doc) { + const msg = "Unexpected doc-end without preceding document"; + this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg)); + break; + } + this.doc.directives.docEnd = true; + const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); + this.decorate(this.doc, true); + if (end.comment) { + const dc = this.doc.comment; + this.doc.comment = dc ? `${dc} +${end.comment}` : end.comment; + } + this.doc.range[2] = end.offset; + break; + } + default: + this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); + } + } + /** + * Call at end of input to yield any remaining document. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *end(forceDoc = false, endOffset = -1) { + if (this.doc) { + this.decorate(this.doc, true); + yield this.doc; + this.doc = null; + } else if (forceDoc) { + const opts = Object.assign({ _directives: this.directives }, this.options); + const doc = new Document(void 0, opts); + if (this.atDirectives) + this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); + doc.range = [0, endOffset, endOffset]; + this.decorate(doc, false); + yield doc; + } + } }; // node_modules/yaml/browser/dist/parse/cst-visit.js @@ -43795,9 +63654,9 @@ function visit2(cst, visitor) { visit2.BREAK = BREAK2; visit2.SKIP = SKIP2; visit2.REMOVE = REMOVE2; -visit2.itemAtPath = (cst, path4) => { +visit2.itemAtPath = (cst, path5) => { let item = cst; - for (const [field, index] of path4) { + for (const [field, index] of path5) { const tok = item?.[field]; if (tok && "items" in tok) { item = tok.items[index]; @@ -43806,23 +63665,23 @@ visit2.itemAtPath = (cst, path4) => { } return item; }; -visit2.parentCollection = (cst, path4) => { - const parent = visit2.itemAtPath(cst, path4.slice(0, -1)); - const field = path4[path4.length - 1][0]; - const coll = parent?.[field]; +visit2.parentCollection = (cst, path5) => { + const parent2 = visit2.itemAtPath(cst, path5.slice(0, -1)); + const field = path5[path5.length - 1][0]; + const coll = parent2?.[field]; if (coll && "items" in coll) return coll; throw new Error("Parent collection not found"); }; -function _visit(path4, item, visitor) { - let ctrl = visitor(item, path4); +function _visit(path5, item, visitor) { + let ctrl = visitor(item, path5); if (typeof ctrl === "symbol") return ctrl; for (const field of ["key", "value"]) { const token = item[field]; if (token && "items" in token) { for (let i = 0; i < token.items.length; ++i) { - const ci = _visit(Object.freeze(path4.concat([[field, i]])), token.items[i], visitor); + const ci = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK2) @@ -43833,17 +63692,1591 @@ function _visit(path4, item, visitor) { } } if (typeof ctrl === "function" && field === "key") - ctrl = ctrl(item, path4); + ctrl = ctrl(item, path5); } } - return typeof ctrl === "function" ? ctrl(item, path4) : ctrl; + return typeof ctrl === "function" ? ctrl(item, path5) : ctrl; +} + +// node_modules/yaml/browser/dist/parse/cst.js +var BOM = "\uFEFF"; +var DOCUMENT = ""; +var FLOW_END = ""; +var SCALAR2 = ""; +function tokenType(source) { + switch (source) { + case BOM: + return "byte-order-mark"; + case DOCUMENT: + return "doc-mode"; + case FLOW_END: + return "flow-error-end"; + case SCALAR2: + return "scalar"; + case "---": + return "doc-start"; + case "...": + return "doc-end"; + case "": + case "\n": + case "\r\n": + return "newline"; + case "-": + return "seq-item-ind"; + case "?": + return "explicit-key-ind"; + case ":": + return "map-value-ind"; + case "{": + return "flow-map-start"; + case "}": + return "flow-map-end"; + case "[": + return "flow-seq-start"; + case "]": + return "flow-seq-end"; + case ",": + return "comma"; + } + switch (source[0]) { + case " ": + case " ": + return "space"; + case "#": + return "comment"; + case "%": + return "directive-line"; + case "*": + return "alias"; + case "&": + return "anchor"; + case "!": + return "tag"; + case "'": + return "single-quoted-scalar"; + case '"': + return "double-quoted-scalar"; + case "|": + case ">": + return "block-scalar-header"; + } + return null; } // node_modules/yaml/browser/dist/parse/lexer.js +function isEmpty(ch) { + switch (ch) { + case void 0: + case " ": + case "\n": + case "\r": + case " ": + return true; + default: + return false; + } +} var hexDigits = new Set("0123456789ABCDEFabcdef"); var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"); var flowIndicatorChars = new Set(",[]{}"); var invalidAnchorChars = new Set(" ,[]{}\n\r "); +var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch); +var Lexer = class { + constructor() { + this.atEnd = false; + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + this.buffer = ""; + this.flowKey = false; + this.flowLevel = 0; + this.indentNext = 0; + this.indentValue = 0; + this.lineEndPos = null; + this.next = null; + this.pos = 0; + } + /** + * Generate YAML tokens from the `source` string. If `incomplete`, + * a part of the last line may be left as a buffer for the next call. + * + * @returns A generator of lexical tokens + */ + *lex(source, incomplete = false) { + if (source) { + if (typeof source !== "string") + throw TypeError("source is not a string"); + this.buffer = this.buffer ? this.buffer + source : source; + this.lineEndPos = null; + } + this.atEnd = !incomplete; + let next = this.next ?? "stream"; + while (next && (incomplete || this.hasChars(1))) + next = yield* this.parseNext(next); + } + atLineEnd() { + let i = this.pos; + let ch = this.buffer[i]; + while (ch === " " || ch === " ") + ch = this.buffer[++i]; + if (!ch || ch === "#" || ch === "\n") + return true; + if (ch === "\r") + return this.buffer[i + 1] === "\n"; + return false; + } + charAt(n) { + return this.buffer[this.pos + n]; + } + continueScalar(offset) { + let ch = this.buffer[offset]; + if (this.indentNext > 0) { + let indent = 0; + while (ch === " ") + ch = this.buffer[++indent + offset]; + if (ch === "\r") { + const next = this.buffer[indent + offset + 1]; + if (next === "\n" || !next && !this.atEnd) + return offset + indent + 1; + } + return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; + } + if (ch === "-" || ch === ".") { + const dt = this.buffer.substr(offset, 3); + if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) + return -1; + } + return offset; + } + getLine() { + let end = this.lineEndPos; + if (typeof end !== "number" || end !== -1 && end < this.pos) { + end = this.buffer.indexOf("\n", this.pos); + this.lineEndPos = end; + } + if (end === -1) + return this.atEnd ? this.buffer.substring(this.pos) : null; + if (this.buffer[end - 1] === "\r") + end -= 1; + return this.buffer.substring(this.pos, end); + } + hasChars(n) { + return this.pos + n <= this.buffer.length; + } + setNext(state2) { + this.buffer = this.buffer.substring(this.pos); + this.pos = 0; + this.lineEndPos = null; + this.next = state2; + return null; + } + peek(n) { + return this.buffer.substr(this.pos, n); + } + *parseNext(next) { + switch (next) { + case "stream": + return yield* this.parseStream(); + case "line-start": + return yield* this.parseLineStart(); + case "block-start": + return yield* this.parseBlockStart(); + case "doc": + return yield* this.parseDocument(); + case "flow": + return yield* this.parseFlowCollection(); + case "quoted-scalar": + return yield* this.parseQuotedScalar(); + case "block-scalar": + return yield* this.parseBlockScalar(); + case "plain-scalar": + return yield* this.parsePlainScalar(); + } + } + *parseStream() { + let line = this.getLine(); + if (line === null) + return this.setNext("stream"); + if (line[0] === BOM) { + yield* this.pushCount(1); + line = line.substring(1); + } + if (line[0] === "%") { + let dirEnd = line.length; + let cs = line.indexOf("#"); + while (cs !== -1) { + const ch = line[cs - 1]; + if (ch === " " || ch === " ") { + dirEnd = cs - 1; + break; + } else { + cs = line.indexOf("#", cs + 1); + } + } + while (true) { + const ch = line[dirEnd - 1]; + if (ch === " " || ch === " ") + dirEnd -= 1; + else + break; + } + const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); + yield* this.pushCount(line.length - n); + this.pushNewline(); + return "stream"; + } + if (this.atLineEnd()) { + const sp = yield* this.pushSpaces(true); + yield* this.pushCount(line.length - sp); + yield* this.pushNewline(); + return "stream"; + } + yield DOCUMENT; + return yield* this.parseLineStart(); + } + *parseLineStart() { + const ch = this.charAt(0); + if (!ch && !this.atEnd) + return this.setNext("line-start"); + if (ch === "-" || ch === ".") { + if (!this.atEnd && !this.hasChars(4)) + return this.setNext("line-start"); + const s = this.peek(3); + if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) { + yield* this.pushCount(3); + this.indentValue = 0; + this.indentNext = 0; + return s === "---" ? "doc" : "stream"; + } + } + this.indentValue = yield* this.pushSpaces(false); + if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) + this.indentNext = this.indentValue; + return yield* this.parseBlockStart(); + } + *parseBlockStart() { + const [ch0, ch1] = this.peek(2); + if (!ch1 && !this.atEnd) + return this.setNext("block-start"); + if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { + const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); + this.indentNext = this.indentValue + 1; + this.indentValue += n; + return "block-start"; + } + return "doc"; + } + *parseDocument() { + yield* this.pushSpaces(true); + const line = this.getLine(); + if (line === null) + return this.setNext("doc"); + let n = yield* this.pushIndicators(); + switch (line[n]) { + case "#": + yield* this.pushCount(line.length - n); + // fallthrough + case void 0: + yield* this.pushNewline(); + return yield* this.parseLineStart(); + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel = 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + return "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "doc"; + case '"': + case "'": + return yield* this.parseQuotedScalar(); + case "|": + case ">": + n += yield* this.parseBlockScalarHeader(); + n += yield* this.pushSpaces(true); + yield* this.pushCount(line.length - n); + yield* this.pushNewline(); + return yield* this.parseBlockScalar(); + default: + return yield* this.parsePlainScalar(); + } + } + *parseFlowCollection() { + let nl, sp; + let indent = -1; + do { + nl = yield* this.pushNewline(); + if (nl > 0) { + sp = yield* this.pushSpaces(false); + this.indentValue = indent = sp; + } else { + sp = 0; + } + sp += yield* this.pushSpaces(true); + } while (nl + sp > 0); + const line = this.getLine(); + if (line === null) + return this.setNext("flow"); + if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { + const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"); + if (!atFlowEndMarker) { + this.flowLevel = 0; + yield FLOW_END; + return yield* this.parseLineStart(); + } + } + let n = 0; + while (line[n] === ",") { + n += yield* this.pushCount(1); + n += yield* this.pushSpaces(true); + this.flowKey = false; + } + n += yield* this.pushIndicators(); + switch (line[n]) { + case void 0: + return "flow"; + case "#": + yield* this.pushCount(line.length - n); + return "flow"; + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel += 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + this.flowKey = true; + this.flowLevel -= 1; + return this.flowLevel ? "flow" : "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "flow"; + case '"': + case "'": + this.flowKey = true; + return yield* this.parseQuotedScalar(); + case ":": { + const next = this.charAt(1); + if (this.flowKey || isEmpty(next) || next === ",") { + this.flowKey = false; + yield* this.pushCount(1); + yield* this.pushSpaces(true); + return "flow"; + } + } + // fallthrough + default: + this.flowKey = false; + return yield* this.parsePlainScalar(); + } + } + *parseQuotedScalar() { + const quote = this.charAt(0); + let end = this.buffer.indexOf(quote, this.pos + 1); + if (quote === "'") { + while (end !== -1 && this.buffer[end + 1] === "'") + end = this.buffer.indexOf("'", end + 2); + } else { + while (end !== -1) { + let n = 0; + while (this.buffer[end - 1 - n] === "\\") + n += 1; + if (n % 2 === 0) + break; + end = this.buffer.indexOf('"', end + 1); + } + } + const qb = this.buffer.substring(0, end); + let nl = qb.indexOf("\n", this.pos); + if (nl !== -1) { + while (nl !== -1) { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = qb.indexOf("\n", cs); + } + if (nl !== -1) { + end = nl - (qb[nl - 1] === "\r" ? 2 : 1); + } + } + if (end === -1) { + if (!this.atEnd) + return this.setNext("quoted-scalar"); + end = this.buffer.length; + } + yield* this.pushToIndex(end + 1, false); + return this.flowLevel ? "flow" : "doc"; + } + *parseBlockScalarHeader() { + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + let i = this.pos; + while (true) { + const ch = this.buffer[++i]; + if (ch === "+") + this.blockScalarKeep = true; + else if (ch > "0" && ch <= "9") + this.blockScalarIndent = Number(ch) - 1; + else if (ch !== "-") + break; + } + return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); + } + *parseBlockScalar() { + let nl = this.pos - 1; + let indent = 0; + let ch; + loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) { + switch (ch) { + case " ": + indent += 1; + break; + case "\n": + nl = i2; + indent = 0; + break; + case "\r": { + const next = this.buffer[i2 + 1]; + if (!next && !this.atEnd) + return this.setNext("block-scalar"); + if (next === "\n") + break; + } + // fallthrough + default: + break loop; + } + } + if (!ch && !this.atEnd) + return this.setNext("block-scalar"); + if (indent >= this.indentNext) { + if (this.blockScalarIndent === -1) + this.indentNext = indent; + else { + this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext); + } + do { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = this.buffer.indexOf("\n", cs); + } while (nl !== -1); + if (nl === -1) { + if (!this.atEnd) + return this.setNext("block-scalar"); + nl = this.buffer.length; + } + } + let i = nl + 1; + ch = this.buffer[i]; + while (ch === " ") + ch = this.buffer[++i]; + if (ch === " ") { + while (ch === " " || ch === " " || ch === "\r" || ch === "\n") + ch = this.buffer[++i]; + nl = i - 1; + } else if (!this.blockScalarKeep) { + do { + let i2 = nl - 1; + let ch2 = this.buffer[i2]; + if (ch2 === "\r") + ch2 = this.buffer[--i2]; + const lastChar = i2; + while (ch2 === " ") + ch2 = this.buffer[--i2]; + if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar) + nl = i2; + else + break; + } while (true); + } + yield SCALAR2; + yield* this.pushToIndex(nl + 1, true); + return yield* this.parseLineStart(); + } + *parsePlainScalar() { + const inFlow = this.flowLevel > 0; + let end = this.pos - 1; + let i = this.pos - 1; + let ch; + while (ch = this.buffer[++i]) { + if (ch === ":") { + const next = this.buffer[i + 1]; + if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) + break; + end = i; + } else if (isEmpty(ch)) { + let next = this.buffer[i + 1]; + if (ch === "\r") { + if (next === "\n") { + i += 1; + ch = "\n"; + next = this.buffer[i + 1]; + } else + end = i; + } + if (next === "#" || inFlow && flowIndicatorChars.has(next)) + break; + if (ch === "\n") { + const cs = this.continueScalar(i + 1); + if (cs === -1) + break; + i = Math.max(i, cs - 2); + } + } else { + if (inFlow && flowIndicatorChars.has(ch)) + break; + end = i; + } + } + if (!ch && !this.atEnd) + return this.setNext("plain-scalar"); + yield SCALAR2; + yield* this.pushToIndex(end + 1, true); + return inFlow ? "flow" : "doc"; + } + *pushCount(n) { + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos += n; + return n; + } + return 0; + } + *pushToIndex(i, allowEmpty) { + const s = this.buffer.slice(this.pos, i); + if (s) { + yield s; + this.pos += s.length; + return s.length; + } else if (allowEmpty) + yield ""; + return 0; + } + *pushIndicators() { + let n = 0; + loop: while (true) { + switch (this.charAt(0)) { + case "!": + n += yield* this.pushTag(); + n += yield* this.pushSpaces(true); + continue loop; + case "&": + n += yield* this.pushUntil(isNotAnchorChar); + n += yield* this.pushSpaces(true); + continue loop; + case "-": + // this is an error + case "?": + // this is an error outside flow collections + case ":": { + const inFlow = this.flowLevel > 0; + const ch1 = this.charAt(1); + if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { + if (!inFlow) + this.indentNext = this.indentValue + 1; + else if (this.flowKey) + this.flowKey = false; + n += yield* this.pushCount(1); + n += yield* this.pushSpaces(true); + continue loop; + } + } + } + break loop; + } + return n; + } + *pushTag() { + if (this.charAt(1) === "<") { + let i = this.pos + 2; + let ch = this.buffer[i]; + while (!isEmpty(ch) && ch !== ">") + ch = this.buffer[++i]; + return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false); + } else { + let i = this.pos + 1; + let ch = this.buffer[i]; + while (ch) { + if (tagChars.has(ch)) + ch = this.buffer[++i]; + else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) { + ch = this.buffer[i += 3]; + } else + break; + } + return yield* this.pushToIndex(i, false); + } + } + *pushNewline() { + const ch = this.buffer[this.pos]; + if (ch === "\n") + return yield* this.pushCount(1); + else if (ch === "\r" && this.charAt(1) === "\n") + return yield* this.pushCount(2); + else + return 0; + } + *pushSpaces(allowTabs) { + let i = this.pos - 1; + let ch; + do { + ch = this.buffer[++i]; + } while (ch === " " || allowTabs && ch === " "); + const n = i - this.pos; + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos = i; + } + return n; + } + *pushUntil(test) { + let i = this.pos; + let ch = this.buffer[i]; + while (!test(ch)) + ch = this.buffer[++i]; + return yield* this.pushToIndex(i, false); + } +}; + +// node_modules/yaml/browser/dist/parse/line-counter.js +var LineCounter = class { + constructor() { + this.lineStarts = []; + this.addNewLine = (offset) => this.lineStarts.push(offset); + this.linePos = (offset) => { + let low = 0; + let high = this.lineStarts.length; + while (low < high) { + const mid = low + high >> 1; + if (this.lineStarts[mid] < offset) + low = mid + 1; + else + high = mid; + } + if (this.lineStarts[low] === offset) + return { line: low + 1, col: 1 }; + if (low === 0) + return { line: 0, col: offset }; + const start = this.lineStarts[low - 1]; + return { line: low, col: offset - start + 1 }; + }; + } +}; + +// node_modules/yaml/browser/dist/parse/parser.js +function includesToken(list, type) { + for (let i = 0; i < list.length; ++i) + if (list[i].type === type) + return true; + return false; +} +function findNonEmptyIndex(list) { + for (let i = 0; i < list.length; ++i) { + switch (list[i].type) { + case "space": + case "comment": + case "newline": + break; + default: + return i; + } + } + return -1; +} +function isFlowToken(token) { + switch (token?.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "flow-collection": + return true; + default: + return false; + } +} +function getPrevProps(parent2) { + switch (parent2.type) { + case "document": + return parent2.start; + case "block-map": { + const it = parent2.items[parent2.items.length - 1]; + return it.sep ?? it.start; + } + case "block-seq": + return parent2.items[parent2.items.length - 1].start; + /* istanbul ignore next should not happen */ + default: + return []; + } +} +function getFirstKeyStartProps(prev) { + if (prev.length === 0) + return []; + let i = prev.length; + loop: while (--i >= 0) { + switch (prev[i].type) { + case "doc-start": + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + case "newline": + break loop; + } + } + while (prev[++i]?.type === "space") { + } + return prev.splice(i, prev.length); +} +function arrayPushArray(target, source) { + if (source.length < 1e5) + Array.prototype.push.apply(target, source); + else + for (let i = 0; i < source.length; ++i) + target.push(source[i]); +} +function fixFlowSeqItems(fc) { + if (fc.start.type === "flow-seq-start") { + for (const it of fc.items) { + if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) { + if (it.key) + it.value = it.key; + delete it.key; + if (isFlowToken(it.value)) { + if (it.value.end) + arrayPushArray(it.value.end, it.sep); + else + it.value.end = it.sep; + } else + arrayPushArray(it.start, it.sep); + delete it.sep; + } + } + } +} +var Parser = class { + /** + * @param onNewLine - If defined, called separately with the start position of + * each new line (in `parse()`, including the start of input). + */ + constructor(onNewLine) { + this.atNewLine = true; + this.atScalar = false; + this.indent = 0; + this.offset = 0; + this.onKeyLine = false; + this.stack = []; + this.source = ""; + this.type = ""; + this.lexer = new Lexer(); + this.onNewLine = onNewLine; + } + /** + * Parse `source` as a YAML stream. + * If `incomplete`, a part of the last line may be left as a buffer for the next call. + * + * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. + * + * @returns A generator of tokens representing each directive, document, and other structure. + */ + *parse(source, incomplete = false) { + if (this.onNewLine && this.offset === 0) + this.onNewLine(0); + for (const lexeme of this.lexer.lex(source, incomplete)) + yield* this.next(lexeme); + if (!incomplete) + yield* this.end(); + } + /** + * Advance the parser by the `source` of one lexical token. + */ + *next(source) { + this.source = source; + if (this.atScalar) { + this.atScalar = false; + yield* this.step(); + this.offset += source.length; + return; + } + const type = tokenType(source); + if (!type) { + const message = `Not a YAML token: ${source}`; + yield* this.pop({ type: "error", offset: this.offset, message, source }); + this.offset += source.length; + } else if (type === "scalar") { + this.atNewLine = false; + this.atScalar = true; + this.type = "scalar"; + } else { + this.type = type; + yield* this.step(); + switch (type) { + case "newline": + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) + this.onNewLine(this.offset + source.length); + break; + case "space": + if (this.atNewLine && source[0] === " ") + this.indent += source.length; + break; + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + if (this.atNewLine) + this.indent += source.length; + break; + case "doc-mode": + case "flow-error-end": + return; + default: + this.atNewLine = false; + } + this.offset += source.length; + } + } + /** Call at end of input to push out any remaining constructions */ + *end() { + while (this.stack.length > 0) + yield* this.pop(); + } + get sourceToken() { + const st = { + type: this.type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + return st; + } + *step() { + const top = this.peek(1); + if (this.type === "doc-end" && top?.type !== "doc-end") { + while (this.stack.length > 0) + yield* this.pop(); + this.stack.push({ + type: "doc-end", + offset: this.offset, + source: this.source + }); + return; + } + if (!top) + return yield* this.stream(); + switch (top.type) { + case "document": + return yield* this.document(top); + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + return yield* this.scalar(top); + case "block-scalar": + return yield* this.blockScalar(top); + case "block-map": + return yield* this.blockMap(top); + case "block-seq": + return yield* this.blockSequence(top); + case "flow-collection": + return yield* this.flowCollection(top); + case "doc-end": + return yield* this.documentEnd(top); + } + yield* this.pop(); + } + peek(n) { + return this.stack[this.stack.length - n]; + } + *pop(error) { + const token = error ?? this.stack.pop(); + if (!token) { + const message = "Tried to pop an empty stack"; + yield { type: "error", offset: this.offset, source: "", message }; + } else if (this.stack.length === 0) { + yield token; + } else { + const top = this.peek(1); + if (token.type === "block-scalar") { + token.indent = "indent" in top ? top.indent : 0; + } else if (token.type === "flow-collection" && top.type === "document") { + token.indent = 0; + } + if (token.type === "flow-collection") + fixFlowSeqItems(token); + switch (top.type) { + case "document": + top.value = token; + break; + case "block-scalar": + top.props.push(token); + break; + case "block-map": { + const it = top.items[top.items.length - 1]; + if (it.value) { + top.items.push({ start: [], key: token, sep: [] }); + this.onKeyLine = true; + return; + } else if (it.sep) { + it.value = token; + } else { + Object.assign(it, { key: token, sep: [] }); + this.onKeyLine = !it.explicitKey; + return; + } + break; + } + case "block-seq": { + const it = top.items[top.items.length - 1]; + if (it.value) + top.items.push({ start: [], value: token }); + else + it.value = token; + break; + } + case "flow-collection": { + const it = top.items[top.items.length - 1]; + if (!it || it.value) + top.items.push({ start: [], key: token, sep: [] }); + else if (it.sep) + it.value = token; + else + Object.assign(it, { key: token, sep: [] }); + return; + } + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.pop(token); + } + if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { + const last = token.items[token.items.length - 1]; + if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) { + if (top.type === "document") + top.end = last.start; + else + top.items.push({ start: last.start }); + token.items.splice(-1, 1); + } + } + } + } + *stream() { + switch (this.type) { + case "directive-line": + yield { type: "directive", offset: this.offset, source: this.source }; + return; + case "byte-order-mark": + case "space": + case "comment": + case "newline": + yield this.sourceToken; + return; + case "doc-mode": + case "doc-start": { + const doc = { + type: "document", + offset: this.offset, + start: [] + }; + if (this.type === "doc-start") + doc.start.push(this.sourceToken); + this.stack.push(doc); + return; + } + } + yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML stream`, + source: this.source + }; + } + *document(doc) { + if (doc.value) + return yield* this.lineEnd(doc); + switch (this.type) { + case "doc-start": { + if (findNonEmptyIndex(doc.start) !== -1) { + yield* this.pop(); + yield* this.step(); + } else + doc.start.push(this.sourceToken); + return; + } + case "anchor": + case "tag": + case "space": + case "comment": + case "newline": + doc.start.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(doc); + if (bv) + this.stack.push(bv); + else { + yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML document`, + source: this.source + }; + } + } + *scalar(scalar) { + if (this.type === "map-value-ind") { + const prev = getPrevProps(this.peek(2)); + const start = getFirstKeyStartProps(prev); + let sep; + if (scalar.end) { + sep = scalar.end; + sep.push(this.sourceToken); + delete scalar.end; + } else + sep = [this.sourceToken]; + const map3 = { + type: "block-map", + offset: scalar.offset, + indent: scalar.indent, + items: [{ start, key: scalar, sep }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map3; + } else + yield* this.lineEnd(scalar); + } + *blockScalar(scalar) { + switch (this.type) { + case "space": + case "comment": + case "newline": + scalar.props.push(this.sourceToken); + return; + case "scalar": + scalar.source = this.source; + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + yield* this.pop(); + break; + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.step(); + } + } + *blockMap(map3) { + const it = map3.items[map3.items.length - 1]; + switch (this.type) { + case "newline": + this.onKeyLine = false; + if (it.value) { + const end = "end" in it.value ? it.value.end : void 0; + const last = Array.isArray(end) ? end[end.length - 1] : void 0; + if (last?.type === "comment") + end?.push(this.sourceToken); + else + map3.items.push({ start: [this.sourceToken] }); + } else if (it.sep) { + it.sep.push(this.sourceToken); + } else { + it.start.push(this.sourceToken); + } + return; + case "space": + case "comment": + if (it.value) { + map3.items.push({ start: [this.sourceToken] }); + } else if (it.sep) { + it.sep.push(this.sourceToken); + } else { + if (this.atIndentedComment(it.start, map3.indent)) { + const prev = map3.items[map3.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + arrayPushArray(end, it.start); + end.push(this.sourceToken); + map3.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + } + if (this.indent >= map3.indent) { + const atMapIndent = !this.onKeyLine && this.indent === map3.indent; + const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind"; + let start = []; + if (atNextItem && it.sep && !it.value) { + const nl = []; + for (let i = 0; i < it.sep.length; ++i) { + const st = it.sep[i]; + switch (st.type) { + case "newline": + nl.push(i); + break; + case "space": + break; + case "comment": + if (st.indent > map3.indent) + nl.length = 0; + break; + default: + nl.length = 0; + } + } + if (nl.length >= 2) + start = it.sep.splice(nl[1]); + } + switch (this.type) { + case "anchor": + case "tag": + if (atNextItem || it.value) { + start.push(this.sourceToken); + map3.items.push({ start }); + this.onKeyLine = true; + } else if (it.sep) { + it.sep.push(this.sourceToken); + } else { + it.start.push(this.sourceToken); + } + return; + case "explicit-key-ind": + if (!it.sep && !it.explicitKey) { + it.start.push(this.sourceToken); + it.explicitKey = true; + } else if (atNextItem || it.value) { + start.push(this.sourceToken); + map3.items.push({ start, explicitKey: true }); + } else { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken], explicitKey: true }] + }); + } + this.onKeyLine = true; + return; + case "map-value-ind": + if (it.explicitKey) { + if (!it.sep) { + if (includesToken(it.start, "newline")) { + Object.assign(it, { key: null, sep: [this.sourceToken] }); + } else { + const start2 = getFirstKeyStartProps(it.start); + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: start2, key: null, sep: [this.sourceToken] }] + }); + } + } else if (it.value) { + map3.items.push({ start: [], key: null, sep: [this.sourceToken] }); + } else if (includesToken(it.sep, "map-value-ind")) { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }); + } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) { + const start2 = getFirstKeyStartProps(it.start); + const key = it.key; + const sep = it.sep; + sep.push(this.sourceToken); + delete it.key; + delete it.sep; + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: start2, key, sep }] + }); + } else if (start.length > 0) { + it.sep = it.sep.concat(start, this.sourceToken); + } else { + it.sep.push(this.sourceToken); + } + } else { + if (!it.sep) { + Object.assign(it, { key: null, sep: [this.sourceToken] }); + } else if (it.value || atNextItem) { + map3.items.push({ start, key: null, sep: [this.sourceToken] }); + } else if (includesToken(it.sep, "map-value-ind")) { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: [], key: null, sep: [this.sourceToken] }] + }); + } else { + it.sep.push(this.sourceToken); + } + } + this.onKeyLine = true; + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs3 = this.flowScalar(this.type); + if (atNextItem || it.value) { + map3.items.push({ start, key: fs3, sep: [] }); + this.onKeyLine = true; + } else if (it.sep) { + this.stack.push(fs3); + } else { + Object.assign(it, { key: fs3, sep: [] }); + this.onKeyLine = true; + } + return; + } + default: { + const bv = this.startBlockValue(map3); + if (bv) { + if (bv.type === "block-seq") { + if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) { + yield* this.pop({ + type: "error", + offset: this.offset, + message: "Unexpected block-seq-ind on same line with key", + source: this.source + }); + return; + } + } else if (atMapIndent) { + map3.items.push({ start }); + } + this.stack.push(bv); + return; + } + } + } + } + yield* this.pop(); + yield* this.step(); + } + *blockSequence(seq2) { + const it = seq2.items[seq2.items.length - 1]; + switch (this.type) { + case "newline": + if (it.value) { + const end = "end" in it.value ? it.value.end : void 0; + const last = Array.isArray(end) ? end[end.length - 1] : void 0; + if (last?.type === "comment") + end?.push(this.sourceToken); + else + seq2.items.push({ start: [this.sourceToken] }); + } else + it.start.push(this.sourceToken); + return; + case "space": + case "comment": + if (it.value) + seq2.items.push({ start: [this.sourceToken] }); + else { + if (this.atIndentedComment(it.start, seq2.indent)) { + const prev = seq2.items[seq2.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + arrayPushArray(end, it.start); + end.push(this.sourceToken); + seq2.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + case "anchor": + case "tag": + if (it.value || this.indent <= seq2.indent) + break; + it.start.push(this.sourceToken); + return; + case "seq-item-ind": + if (this.indent !== seq2.indent) + break; + if (it.value || includesToken(it.start, "seq-item-ind")) + seq2.items.push({ start: [this.sourceToken] }); + else + it.start.push(this.sourceToken); + return; + } + if (this.indent > seq2.indent) { + const bv = this.startBlockValue(seq2); + if (bv) { + this.stack.push(bv); + return; + } + } + yield* this.pop(); + yield* this.step(); + } + *flowCollection(fc) { + const it = fc.items[fc.items.length - 1]; + if (this.type === "flow-error-end") { + let top; + do { + yield* this.pop(); + top = this.peek(1); + } while (top?.type === "flow-collection"); + } else if (fc.end.length === 0) { + switch (this.type) { + case "comma": + case "explicit-key-ind": + if (!it || it.sep) + fc.items.push({ start: [this.sourceToken] }); + else + it.start.push(this.sourceToken); + return; + case "map-value-ind": + if (!it || it.value) + fc.items.push({ start: [], key: null, sep: [this.sourceToken] }); + else if (it.sep) + it.sep.push(this.sourceToken); + else + Object.assign(it, { key: null, sep: [this.sourceToken] }); + return; + case "space": + case "comment": + case "newline": + case "anchor": + case "tag": + if (!it || it.value) + fc.items.push({ start: [this.sourceToken] }); + else if (it.sep) + it.sep.push(this.sourceToken); + else + it.start.push(this.sourceToken); + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs3 = this.flowScalar(this.type); + if (!it || it.value) + fc.items.push({ start: [], key: fs3, sep: [] }); + else if (it.sep) + this.stack.push(fs3); + else + Object.assign(it, { key: fs3, sep: [] }); + return; + } + case "flow-map-end": + case "flow-seq-end": + fc.end.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(fc); + if (bv) + this.stack.push(bv); + else { + yield* this.pop(); + yield* this.step(); + } + } else { + const parent2 = this.peek(2); + if (parent2.type === "block-map" && (this.type === "map-value-ind" && parent2.indent === fc.indent || this.type === "newline" && !parent2.items[parent2.items.length - 1].sep)) { + yield* this.pop(); + yield* this.step(); + } else if (this.type === "map-value-ind" && parent2.type !== "flow-collection") { + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + fixFlowSeqItems(fc); + const sep = fc.end.splice(1, fc.end.length); + sep.push(this.sourceToken); + const map3 = { + type: "block-map", + offset: fc.offset, + indent: fc.indent, + items: [{ start, key: fc, sep }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map3; + } else { + yield* this.lineEnd(fc); + } + } + } + flowScalar(type) { + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + return { + type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + } + startBlockValue(parent2) { + switch (this.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + return this.flowScalar(this.type); + case "block-scalar-header": + return { + type: "block-scalar", + offset: this.offset, + indent: this.indent, + props: [this.sourceToken], + source: "" + }; + case "flow-map-start": + case "flow-seq-start": + return { + type: "flow-collection", + offset: this.offset, + indent: this.indent, + start: this.sourceToken, + items: [], + end: [] + }; + case "seq-item-ind": + return { + type: "block-seq", + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken] }] + }; + case "explicit-key-ind": { + this.onKeyLine = true; + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + start.push(this.sourceToken); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, explicitKey: true }] + }; + } + case "map-value-ind": { + this.onKeyLine = true; + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }; + } + } + return null; + } + atIndentedComment(start, indent) { + if (this.type !== "comment") + return false; + if (this.indent <= indent) + return false; + return start.every((st) => st.type === "newline" || st.type === "space"); + } + *documentEnd(docEnd) { + if (this.type !== "doc-mode") { + if (docEnd.end) + docEnd.end.push(this.sourceToken); + else + docEnd.end = [this.sourceToken]; + if (this.type === "newline") + yield* this.pop(); + } + } + *lineEnd(token) { + switch (this.type) { + case "comma": + case "doc-start": + case "doc-end": + case "flow-seq-end": + case "flow-map-end": + case "map-value-ind": + yield* this.pop(); + yield* this.step(); + break; + case "newline": + this.onKeyLine = false; + // fallthrough + case "space": + case "comment": + default: + if (token.end) + token.end.push(this.sourceToken); + else + token.end = [this.sourceToken]; + if (this.type === "newline") + yield* this.pop(); + } + } +}; + +// node_modules/yaml/browser/dist/public-api.js +function parseOptions(options) { + const prettyErrors = options.prettyErrors !== false; + const lineCounter = options.lineCounter || prettyErrors && new LineCounter() || null; + return { lineCounter, prettyErrors }; +} +function parseDocument(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser = new Parser(lineCounter?.addNewLine); + const composer = new Composer(options); + let doc = null; + for (const _doc of composer.compose(parser.parse(source), true, source.length)) { + if (!doc) + doc = _doc; + else if (doc.options.logLevel !== "silent") { + doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); + break; + } + } + if (prettyErrors && lineCounter) { + doc.errors.forEach(prettifyError(source, lineCounter)); + doc.warnings.forEach(prettifyError(source, lineCounter)); + } + return doc; +} +function parse(src, reviver, options) { + let _reviver = void 0; + if (typeof reviver === "function") { + _reviver = reviver; + } else if (options === void 0 && reviver && typeof reviver === "object") { + options = reviver; + } + const doc = parseDocument(src, options); + if (!doc) + return null; + doc.warnings.forEach((warning) => warn(doc.options.logLevel, warning)); + if (doc.errors.length > 0) { + if (doc.options.logLevel !== "silent") + throw doc.errors[0]; + else + doc.errors = []; + } + return doc.toJS(Object.assign({ reviver: _reviver }, options)); +} // node_modules/@earendil-works/pi-durable/dist/tools/env.js function requireEnv(api) { @@ -43967,15 +65400,15 @@ var Diff = class { } diffWithOptionsObj(oldTokens, newTokens, options, callback) { var _a6; - const done = (value) => { - value = this.postProcess(value, options); + const done = (value2) => { + value2 = this.postProcess(value2, options); if (callback) { setTimeout(function() { - callback(value); + callback(value2); }, 0); return void 0; } else { - return value; + return value2; } }; const newLen = newTokens.length, oldLen = oldTokens.length; @@ -44049,16 +65482,16 @@ var Diff = class { } } } - addToPath(path4, added, removed, oldPosInc, options) { - const last = path4.lastComponent; + addToPath(path5, added, removed, oldPosInc, options) { + const last = path5.lastComponent; if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { return { - oldPos: path4.oldPos + oldPosInc, + oldPos: path5.oldPos + oldPosInc, lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent } }; } else { return { - oldPos: path4.oldPos + oldPosInc, + oldPos: path5.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, previousComponent: last } }; } @@ -44097,12 +65530,12 @@ var Diff = class { return ret; } // eslint-disable-next-line @typescript-eslint/no-unused-vars - castInput(value, options) { - return value; + castInput(value2, options) { + return value2; } // eslint-disable-next-line @typescript-eslint/no-unused-vars - tokenize(value, options) { - return Array.from(value); + tokenize(value2, options) { + return Array.from(value2); } join(chars) { return chars.join(""); @@ -44129,12 +65562,12 @@ var Diff = class { const component = components[componentPos]; if (!component.removed) { if (!component.added && this.useLongestToken) { - let value = newTokens.slice(newPos, newPos + component.count); - value = value.map(function(value2, i) { + let value2 = newTokens.slice(newPos, newPos + component.count); + value2 = value2.map(function(value3, i) { const oldValue = oldTokens[oldPos + i]; - return oldValue.length > value2.length ? oldValue : value2; + return oldValue.length > value3.length ? oldValue : value3; }); - component.value = this.join(value); + component.value = this.join(value2); } else { component.value = this.join(newTokens.slice(newPos, newPos + component.count)); } @@ -44180,11 +65613,11 @@ var lineDiff = new LineDiff(); function diffLines(oldStr, newStr, options) { return lineDiff.diff(oldStr, newStr, options); } -function tokenize2(value, options) { +function tokenize2(value2, options) { if (options.stripTrailingCr) { - value = value.replace(/\r\n/g, "\n"); + value2 = value2.replace(/\r\n/g, "\n"); } - const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); + const retLines = [], linesAndNewlines = value2.split(/(\n|\r\n)/); if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } @@ -44240,16 +65673,16 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne return; } diff.push({ value: "", lines: [] }); - function contextLines(lines) { - return lines.map(function(entry) { - return " " + entry; + function contextLines(lines2) { + return lines2.map(function(entry2) { + return " " + entry2; }); } const hunks = []; let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; for (let i = 0; i < diff.length; i++) { - const current = diff[i], lines = current.lines || splitLines(current.value); - current.lines = lines; + const current = diff[i], lines2 = current.lines || splitLines2(current.value); + current.lines = lines2; if (current.added || current.removed) { if (!oldRangeStart) { const prev = diff[i - 1]; @@ -44261,23 +65694,23 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne newRangeStart -= curRange.length; } } - for (const line of lines) { + for (const line of lines2) { curRange.push((current.added ? "+" : "-") + line); } if (current.added) { - newLine += lines.length; + newLine += lines2.length; } else { - oldLine += lines.length; + oldLine += lines2.length; } } else { if (oldRangeStart) { - if (lines.length <= context * 2 && i < diff.length - 2) { - for (const line of contextLines(lines)) { + if (lines2.length <= context * 2 && i < diff.length - 2) { + for (const line of contextLines(lines2)) { curRange.push(line); } } else { - const contextSize = Math.min(lines.length, context); - for (const line of contextLines(lines.slice(0, contextSize))) { + const contextSize = Math.min(lines2.length, context); + for (const line of contextLines(lines2.slice(0, contextSize))) { curRange.push(line); } const hunk = { @@ -44293,8 +65726,8 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne curRange = []; } } - oldLine += lines.length; - newLine += lines.length; + oldLine += lines2.length; + newLine += lines2.length; } } for (const hunk of hunks) { @@ -44373,7 +65806,7 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader } })); } } -function splitLines(text) { +function splitLines2(text) { const hasTrailingNl = text.endsWith("\n"); const result = text.split("\n").map((line) => line + "\n"); if (hasTrailingNl) { @@ -44414,12 +65847,12 @@ function getLineSpans(content) { return span; }); } -function getReplacementLineRange(lines, replacement) { +function getReplacementLineRange(lines2, replacement) { const replacementStart = replacement.matchIndex; const replacementEnd = replacement.matchIndex + replacement.matchLength; let startLine = -1; - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; + for (let i = 0; i < lines2.length; i++) { + const line = lines2[i]; if (replacementStart >= line.start && replacementStart < line.end) { startLine = i; break; @@ -44429,10 +65862,10 @@ function getReplacementLineRange(lines, replacement) { throw new Error("Replacement range is outside the base content."); } let endLine = startLine; - while (endLine < lines.length && lines[endLine].end < replacementEnd) { + while (endLine < lines2.length && lines2[endLine].end < replacementEnd) { endLine++; } - if (endLine >= lines.length) { + if (endLine >= lines2.length) { throw new Error("Replacement range is outside the base content."); } return { startLine, endLine: endLine + 1 }; @@ -44515,38 +65948,38 @@ function countOccurrences(content, oldText) { const fuzzyOldText = normalizeForFuzzyMatch(oldText); return fuzzyContent.split(fuzzyOldText).length - 1; } -function getNotFoundError(path4, editIndex, totalEdits) { +function getNotFoundError(path5, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`Could not find the exact text in ${path4}. The old text must match exactly including all whitespace and newlines.`); + return new Error(`Could not find the exact text in ${path5}. The old text must match exactly including all whitespace and newlines.`); } - return new Error(`Could not find edits[${editIndex}] in ${path4}. The oldText must match exactly including all whitespace and newlines.`); + return new Error(`Could not find edits[${editIndex}] in ${path5}. The oldText must match exactly including all whitespace and newlines.`); } -function getDuplicateError(path4, editIndex, totalEdits, occurrences) { +function getDuplicateError(path5, editIndex, totalEdits, occurrences) { if (totalEdits === 1) { - return new Error(`Found ${occurrences} occurrences of the text in ${path4}. The text must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of the text in ${path5}. The text must be unique. Please provide more context to make it unique.`); } - return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path4}. Each oldText must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path5}. Each oldText must be unique. Please provide more context to make it unique.`); } -function getEmptyOldTextError(path4, editIndex, totalEdits) { +function getEmptyOldTextError(path5, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`oldText must not be empty in ${path4}.`); + return new Error(`oldText must not be empty in ${path5}.`); } - return new Error(`edits[${editIndex}].oldText must not be empty in ${path4}.`); + return new Error(`edits[${editIndex}].oldText must not be empty in ${path5}.`); } -function getNoChangeError(path4, totalEdits) { +function getNoChangeError(path5, totalEdits) { if (totalEdits === 1) { - return new Error(`No changes made to ${path4}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); + return new Error(`No changes made to ${path5}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); } - return new Error(`No changes made to ${path4}. The replacements produced identical content.`); + return new Error(`No changes made to ${path5}. The replacements produced identical content.`); } -function applyEditsToNormalizedContent(normalizedContent, edits, path4) { +function applyEditsToNormalizedContent(normalizedContent, edits, path5) { const normalizedEdits = edits.map((edit) => ({ oldText: normalizeToLF(edit.oldText), newText: normalizeToLF(edit.newText) })); for (let i = 0; i < normalizedEdits.length; i++) { if (normalizedEdits[i].oldText.length === 0) { - throw getEmptyOldTextError(path4, i, normalizedEdits.length); + throw getEmptyOldTextError(path5, i, normalizedEdits.length); } } const initialMatches = normalizedEdits.map((edit) => fuzzyFindText(normalizedContent, edit.oldText)); @@ -44557,11 +65990,11 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path4) { const edit = normalizedEdits[i]; const matchResult = fuzzyFindText(replacementBaseContent, edit.oldText); if (!matchResult.found) { - throw getNotFoundError(path4, i, normalizedEdits.length); + throw getNotFoundError(path5, i, normalizedEdits.length); } const occurrences = countOccurrences(replacementBaseContent, edit.oldText); if (occurrences > 1) { - throw getDuplicateError(path4, i, normalizedEdits.length, occurrences); + throw getDuplicateError(path5, i, normalizedEdits.length, occurrences); } matchedEdits.push({ editIndex: i, @@ -44575,18 +66008,18 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path4) { const previous = matchedEdits[i - 1]; const current = matchedEdits[i]; if (previous.matchIndex + previous.matchLength > current.matchIndex) { - throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path4}. Merge them into one edit or target disjoint regions.`); + throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path5}. Merge them into one edit or target disjoint regions.`); } } const baseContent = normalizedContent; const newContent = usedFuzzyMatch ? applyReplacementsPreservingUnchangedLines(normalizedContent, replacementBaseContent, matchedEdits) : applyReplacements(replacementBaseContent, matchedEdits); if (baseContent === newContent) { - throw getNoChangeError(path4, normalizedEdits.length); + throw getNoChangeError(path5, normalizedEdits.length); } return { baseContent, newContent }; } -function generateUnifiedPatch(path4, oldContent, newContent, contextLines = 4) { - return createTwoFilesPatch(path4, path4, oldContent, newContent, void 0, void 0, { +function generateUnifiedPatch(path5, oldContent, newContent, contextLines = 4) { + return createTwoFilesPatch(path5, path5, oldContent, newContent, void 0, void 0, { context: contextLines, headerOptions: FILE_HEADERS_ONLY }); @@ -44701,6 +66134,146 @@ function startsWithBom(firstBytes) { return firstBytes[0] === 239 && firstBytes[1] === 187 && firstBytes[2] === 191; } +// node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +var NEWLINE2 = 10; +var encoder2 = new TextEncoder(); +function decodedBytes(text) { + return text === "" ? 0 : encoder2.encode(text).length; +} +var LineScanner = class { + #startLine; + #endLine; + #position = 0; + #newlines = 0; + #lineStart = 0; + #start; + #end; + #firstLineEnd; + #lastLineStart; + #selectedBytes = 0; + #firstLineBytes = 0; + #selection; + #firstLine; + /** The first bytes, held until it is known whether they are a byte-order mark. */ + #head = []; + #bom = false; + /** `startLine` and `endLine` must be non-negative integers with `endLine > startLine`; `endLine` absent: to the end. */ + constructor(startLine, endLine = Number.POSITIVE_INFINITY) { + if (!Number.isSafeInteger(startLine) || startLine < 0 || !(endLine > startLine)) { + throw new RangeError("Invalid line range"); + } + if (endLine !== Number.POSITIVE_INFINITY && !Number.isSafeInteger(endLine)) + throw new RangeError("Invalid line range"); + this.#startLine = startLine; + this.#endLine = endLine; + if (startLine === 0) + this.#begin(0); + } + push(chunk) { + if (this.#head !== void 0) { + const take = Math.min(3 - this.#head.length, chunk.length); + this.#head.push(...chunk.subarray(0, take)); + if (this.#head.length < 3) + return; + this.#releaseHead(); + chunk = chunk.subarray(take); + } + this.#process(chunk); + } + #releaseHead() { + const head = Uint8Array.from(this.#head ?? []); + this.#head = void 0; + this.#bom = startsWithBom(head); + this.#process(head); + } + #process(chunk) { + const base = this.#position; + let from = 0; + for (let index = chunk.indexOf(NEWLINE2); index !== -1; index = chunk.indexOf(NEWLINE2, index + 1)) { + this.#feed(chunk, base, from, index); + const line = this.#newlines; + const position = base + index; + if (line === this.#startLine) + this.#endFirstLine(position); + if (line === this.#endLine - 1) + this.#endSelection(position); + this.#feed(chunk, base, index, index + 1); + from = index + 1; + this.#newlines++; + this.#lineStart = position + 1; + if (this.#newlines === this.#startLine) + this.#begin(this.#lineStart); + if (this.#newlines === this.#endLine - 1) + this.#lastLineStart = this.#lineStart; + } + this.#feed(chunk, base, from, chunk.length); + this.#position += chunk.length; + } + finish() { + if (this.#head !== void 0) + this.#releaseHead(); + const size = this.#position; + if (this.#start === void 0) { + return { + newlines: this.#newlines, + start: size, + end: size, + firstLineEnd: size, + lastLineStart: size, + selectedBytes: 0, + firstLineBytes: 0 + }; + } + if (this.#firstLineEnd === void 0) + this.#endFirstLine(size); + if (this.#end === void 0) + this.#endSelection(size); + return { + newlines: this.#newlines, + start: this.#start, + end: this.#end ?? size, + firstLineEnd: this.#firstLineEnd ?? size, + // A selection that reaches past the last line ends with the last line. + lastLineStart: this.#lastLineStart ?? this.#lineStart, + selectedBytes: this.#selectedBytes, + firstLineBytes: this.#firstLineBytes + }; + } + #begin(start) { + this.#start = start; + if (this.#startLine === this.#endLine - 1) + this.#lastLineStart = start; + this.#selection = rangeDecoder(); + this.#firstLine = rangeDecoder(); + } + #endFirstLine(position) { + this.#firstLineEnd = position; + if (this.#firstLine !== void 0) + this.#firstLineBytes += decodedBytes(this.#firstLine.decode()); + this.#firstLine = void 0; + } + #endSelection(position) { + this.#end = position; + if (this.#selection !== void 0) + this.#selectedBytes += decodedBytes(this.#selection.decode()); + this.#selection = void 0; + } + /** Feed `chunk[from, to)`, which starts at file offset `base`, to the decoders of the ranges still open. */ + #feed(chunk, base, from, to) { + if (this.#bom && base + from < 3) + from = Math.min(to, 3 - base); + if (to <= from) + return; + const bytes2 = chunk.subarray(from, to); + if (this.#selection !== void 0) { + this.#selectedBytes += decodedBytes(this.#selection.decode(bytes2, { stream: true })); + } + if (this.#firstLine !== void 0) { + this.#firstLineBytes += decodedBytes(this.#firstLine.decode(bytes2, { stream: true })); + } + } +}; + // node_modules/@earendil-works/pi-durable/dist/env/index.js function getOrThrow(result) { if (!result.ok) @@ -44710,8 +66283,8 @@ function getOrThrow(result) { // node_modules/@earendil-works/pi-durable/dist/tools/file-mutation-queue.js var queues = /* @__PURE__ */ new Map(); -async function mutationKey(env, path4, context) { - const absolutePath = getOrThrow(await env.absolutePath(path4, context)); +async function mutationKey(env, path5, context) { + const absolutePath = getOrThrow(await env.absolutePath(path5, context)); return `${env.id}\0${await canonical(env, absolutePath, context)}`; } async function canonical(env, absolutePath, context) { @@ -44722,19 +66295,19 @@ async function canonical(env, absolutePath, context) { return absolutePath; if (result.error.code !== "not_found") throw result.error; - const parent = getOrThrow(await env.joinPath([absolutePath, ".."], context)); - if (parent === absolutePath || !absolutePath.startsWith(parent)) + const parent2 = getOrThrow(await env.joinPath([absolutePath, ".."], context)); + if (parent2 === absolutePath || !absolutePath.startsWith(parent2)) return absolutePath; - const name = absolutePath.slice(parent.length + (/[/\\]$/.test(parent) ? 0 : 1)); - return getOrThrow(await env.joinPath([await canonical(env, parent, context), name], context)); + const name = absolutePath.slice(parent2.length + (/[/\\]$/.test(parent2) ? 0 : 1)); + return getOrThrow(await env.joinPath([await canonical(env, parent2, context), name], context)); } -async function withFileMutationQueue(env, path4, fn, context) { - const key = await mutationKey(env, path4, context); +async function withFileMutationQueue(env, path5, fn, context) { + const key = await mutationKey(env, path5, context); const previous = queues.get(key) ?? Promise.resolve(); let release = () => { }; - const done = new Promise((resolve) => { - release = resolve; + const done = new Promise((resolve2) => { + release = resolve2; }); const tail = previous.then(() => done); queues.set(key, tail); @@ -44751,15 +66324,15 @@ async function withFileMutationQueue(env, path4, fn, context) { // node_modules/@earendil-works/pi-durable/dist/tools/path-utils.js var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g; var NARROW_NO_BREAK_SPACE = "\u202F"; -function normalizeToolPath(path4) { - const normalized = path4.replace(UNICODE_SPACES, " "); +function normalizeToolPath(path5) { + const normalized = path5.replace(UNICODE_SPACES, " "); return normalized.startsWith("@") ? normalized.slice(1) : normalized; } -async function resolveToolPath(env, path4, context) { - return getOrThrow(await env.absolutePath(normalizeToolPath(path4), context)); +async function resolveToolPath(env, path5, context) { + return getOrThrow(await env.absolutePath(normalizeToolPath(path5), context)); } -async function resolveReadToolPath(env, path4, context) { - const resolved = await resolveToolPath(env, path4, context); +async function resolveReadToolPath(env, path5, context) { + const resolved = await resolveToolPath(env, path5, context); const variants = [ resolved, resolved.replace(/ (AM|PM)\./gi, `${NARROW_NO_BREAK_SPACE}$1.`), @@ -44787,10 +66360,10 @@ var editSchema = obj({ description: "One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead." }) }, { open: true }); -function isSingleEditInput(value) { - if (!value || typeof value !== "object" || Array.isArray(value)) +function isSingleEditInput(value2) { + if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return false; - const edit = value; + const edit = value2; return typeof edit.oldText === "string" && typeof edit.newText === "string"; } function prepareEditArguments(input) { @@ -44824,8 +66397,8 @@ function validateEditInput(input) { } return { path: input.path, edits: input.edits }; } -function editAccessError(path4, error) { - return new Error(`Could not edit file: ${path4}. Error code: ${error.code}.`, { cause: error }); +function editAccessError(path5, error) { + return new Error(`Could not edit file: ${path5}. Error code: ${error.code}.`, { cause: error }); } function createEditTool() { return defineTool({ @@ -44834,43 +66407,43 @@ function createEditTool() { parameters: editSchema, prepareArguments: prepareEditArguments, async execute(args, api, context) { - const { path: path4, edits } = validateEditInput(args); + const { path: path5, edits } = validateEditInput(args); const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path4, context); + const absolutePath = await resolveToolPath(env, path5, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const info = await env.fileInfo(absolutePath, context); if (!info.ok) - throw editAccessError(path4, info.error); + throw editAccessError(path5, info.error); if (info.value.kind !== "file" && info.value.kind !== "symlink") { - throw new Error(`Could not edit file: ${path4}. Path is not a file.`); + throw new Error(`Could not edit file: ${path5}. Path is not a file.`); } const readResult = await env.readTextFile(absolutePath, context); if (!readResult.ok) - throw editAccessError(path4, readResult.error); + throw editAccessError(path5, readResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const { bom, text: content } = stripBom(readResult.value); const originalEnding = detectLineEnding(content); const normalizedContent = normalizeToLF(content); - const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path4); + const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path5); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const finalContent = bom + restoreLineEndings(newContent, originalEnding); const writeResult = await env.writeFile(absolutePath, finalContent, context); if (!writeResult.ok) - throw editAccessError(path4, writeResult.error); + throw editAccessError(path5, writeResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const diffResult = generateDiffString(baseContent, newContent); const details = { diff: diffResult.diff, - patch: generateUnifiedPatch(path4, baseContent, newContent), + patch: generateUnifiedPatch(path5, baseContent, newContent), ...diffResult.firstChangedLine === void 0 ? {} : { firstChangedLine: diffResult.firstChangedLine } }; return { - output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path4}.` }], + output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path5}.` }], details }; }, context); @@ -45063,8 +66636,8 @@ var readStructuredOutputSchema = union([ obj({ type: lit("image"), data: str(), mimeType: str() }, { open: true }) ]); var READ_CHUNK = 64 * 1024; -function sliceIndex(value) { - return Number.isNaN(value) ? 0 : Math.trunc(value); +function sliceIndex(value2) { + return Number.isNaN(value2) ? 0 : Math.trunc(value2); } async function readHead(reader, start, end, skipBom, context) { const decoder3 = rangeDecoder(); @@ -45085,16 +66658,16 @@ async function readHead(reader, start, end, skipBom, context) { return text + decoder3.decode(); } function createReadTool(options = {}) { - const formats = options.images === void 0 ? "jpg, png, gif, webp" : "jpg, png, gif, webp, bmp"; + const formats2 = options.images === void 0 ? "jpg, png, gif, webp" : "jpg, png, gif, webp, bmp"; return defineTool({ name: "read", - description: `Read the contents of a file. Supports text files and images (${formats}). Images are sent as attachments. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`, + description: `Read the contents of a file. Supports text files and images (${formats2}). Images are sent as attachments. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`, parameters: readSchema, structuredOutputSchema: readStructuredOutputSchema, async execute(args, api, context) { - const { path: path4, offset, limit: limit3 } = args; + const { path: path5, offset, limit: limit3 } = args; const env = requireEnv(api); - const absolutePath = await resolveReadToolPath(env, path4, context); + const absolutePath = await resolveReadToolPath(env, path5, context); const reader = getOrThrow(await env.openBinaryReader(absolutePath, void 0, context)); try { for (let attempt = 0; ; attempt++) { @@ -45103,13 +66676,13 @@ function createReadTool(options = {}) { size: before.size, read: async (position, length) => getOrThrow(await reader.read(position, length, context)) }); - const result = mimeType === void 0 ? await readText(reader, path4, offset, limit3, context) : await readImage(reader, before, path4, mimeType, options.images, await imageModel(api, context), context); + const result = mimeType === void 0 ? await readText(reader, path5, offset, limit3, context) : await readImage(reader, before, path5, mimeType, options.images, await imageModel(api, context), context); const after = getOrThrow(await reader.info(context)); const unchanged = after.size === before.size && after.mtimeMs === before.mtimeMs; if (unchanged || mimeType === void 0 && after.size > before.size) return result; if (attempt === 1) - throw new Error(`${path4} changed while it was read`); + throw new Error(`${path5} changed while it was read`); } } finally { await reader.close(context); @@ -45117,14 +66690,14 @@ function createReadTool(options = {}) { } }); } -async function readImage(reader, info, path4, mimeType, processor, { vision, limits }, context) { +async function readImage(reader, info, path5, mimeType, processor, { vision, limits }, context) { let image; const notes = []; if (processor !== void 0) { const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const prepared = await processor.prepare(bytes2, mimeType, limits); if (prepared === void 0) - return imageError(`${path4} is an image (${mimeType}) that cannot be prepared for the model`); + return imageError(`${path5} is an image (${mimeType}) that cannot be prepared for the model`); image = prepared; if (prepared.convertedFrom !== void 0) notes.push(`Converted from ${prepared.convertedFrom} to ${prepared.mimeType}.`); @@ -45135,18 +66708,18 @@ async function readImage(reader, info, path4, mimeType, processor, { vision, lim } } else { if (!INLINE_IMAGE_TYPES.has(mimeType)) { - return imageError(`${path4} is an image (${mimeType}) that needs converting, and no image processor is configured`); + return imageError(`${path5} is an image (${mimeType}) that needs converting, and no image processor is configured`); } const unshrinkable = "and no image processor is configured to shrink it"; if (base64Length(info.size) > limits.maxBytes) { - return imageError(`${path4} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); + return imageError(`${path5} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); } const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const size = imageDimensions(bytes2, mimeType); if (size === void 0) - return imageError(`${path4} is an image (${mimeType}) whose size cannot be read`); + return imageError(`${path5} is an image (${mimeType}) whose size cannot be read`); if (size.width > limits.maxWidth || size.height > limits.maxHeight) { - return imageError(`${path4} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); + return imageError(`${path5} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); } image = { data: toBase64(bytes2), mimeType }; } @@ -45174,14 +66747,14 @@ async function imageModel(api, context) { function imageError(message) { return { output: [], isError: true, diagnostics: [{ severity: "error", code: "unsupported_image", message }] }; } -async function readText(reader, path4, offset, limit3, context) { +async function readText(reader, path5, offset, limit3, context) { const startLine = offset ? Math.max(0, offset - 1) : 0; const startLineDisplay = startLine + 1; const sliceStart = sliceIndex(startLine); - const scanStart = Number.isSafeInteger(sliceStart) ? sliceStart : 0; - const requestedEnd = limit3 === void 0 ? void 0 : Math.max(scanStart + 1, sliceIndex(startLine + limit3)); + const scanStart2 = Number.isSafeInteger(sliceStart) ? sliceStart : 0; + const requestedEnd = limit3 === void 0 ? void 0 : Math.max(scanStart2 + 1, sliceIndex(startLine + limit3)); const scanEnd = requestedEnd !== void 0 && Number.isSafeInteger(requestedEnd) ? requestedEnd : void 0; - const scanOf = async (endLine) => getOrThrow(await reader.scanLines({ startLine: scanStart, ...endLine === void 0 ? {} : { endLine } }, context)); + const scanOf = async (endLine) => getOrThrow(await reader.scanLines({ startLine: scanStart2, ...endLine === void 0 ? {} : { endLine } }, context)); let scan = await scanOf(scanEnd); const totalFileLines = scan.newlines + 1; if (startLine >= totalFileLines) { @@ -45198,14 +66771,14 @@ async function readText(reader, path4, offset, limit3, context) { if (selectedLineCount > 0 && relativeEnd < 0) scan = await scanOf(sliceEnd); } - const empty2 = selectedLineCount === 0; - const endsWithNewline = !empty2 && scan.lastLineStart === scan.end && scan.lastLineStart > scan.start; + const empty = selectedLineCount === 0; + const endsWithNewline = !empty && scan.lastLineStart === scan.end && scan.lastLineStart > scan.start; const totals = { - lines: empty2 || scan.selectedBytes === 0 ? 0 : selectedLineCount - (endsWithNewline ? 1 : 0), - bytes: empty2 ? 0 : scan.selectedBytes + lines: empty || scan.selectedBytes === 0 ? 0 : selectedLineCount - (endsWithNewline ? 1 : 0), + bytes: empty ? 0 : scan.selectedBytes }; const firstBytes = getOrThrow(await reader.read(0, 3, context)); - const head = empty2 ? "" : await readHead(reader, scan.start, scan.end, startsWithBom(firstBytes), context); + const head = empty ? "" : await readHead(reader, scan.start, scan.end, startsWithBom(firstBytes), context); const { content: headText, ...truncation } = truncateHeadOf(head, totals); const diagnostics = []; let outputText = headText; @@ -45219,7 +66792,7 @@ async function readText(reader, path4, offset, limit3, context) { diagnostics.push({ severity: "warn", code: "truncated", - message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path4} | tail -c +${end + 1}` + message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path5} | tail -c +${end + 1}` }); details = { truncation: { ...truncation, outputBytes: end, outputLines: 1 } }; } else if (truncation.truncated) { @@ -45259,16 +66832,16 @@ function createWriteTool() { description: "Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.", parameters: writeSchema, async execute(args, api, context) { - const { path: path4, content } = args; + const { path: path5, content } = args; const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path4, context); + const absolutePath = await resolveToolPath(env, path5, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); getOrThrow(await env.writeFile(absolutePath, content, context)); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); - return { output: [{ type: "text", text: `Successfully wrote to ${path4}` }] }; + return { output: [{ type: "text", text: `Successfully wrote to ${path5}` }] }; }, context); } }); @@ -45324,57 +66897,1310 @@ var Started = defineDoc({ initial: () => ({}) }); var ops = Deno.core.ops; +var ok = (value2) => ({ ok: true, value: value2 }); +var path4 = (cwd, input) => { + const parts = []; + for (const p of (input.startsWith("/") ? input : `${cwd}/${input}`).split("/")) { + if (p === "..") parts.pop(); + else if (p && p !== ".") parts.push(p); + } + return "/" + parts.join("/"); +}; +function environment(cwd = "/", conversation, invocation) { + const conversations = Array.isArray(conversation) ? conversation : conversation === void 0 ? [] : [String(conversation)]; + const tag = invocation && { id: invocation.id, pid: 0, program: invocation.tool, conversations }; + const call = (kind, p, bytes2 = []) => ops.op_file(kind, path4(cwd, p), bytes2, tag); + const env = { + id: "world", + cwd, + forTool: (id, tool) => environment(cwd, conversations, { id, tool }), + absolutePath: async (p) => ok(path4(cwd, p)), + canonicalPath: async () => ({ ok: false, error: { code: "not_supported", message: "The VFS does not expose canonical paths" } }), + joinPath: async (parts) => ok(path4(cwd, parts.join("/"))), + fileInfo: (p) => call("stat", p), + exists: async (p) => { + const result = await call("stat", p); + return result.ok ? ok(true) : result.error.code === "not_found" ? ok(false) : result; + }, + readBinaryFile: async (p) => { + const r = await call("read", p); + return r.ok ? ok(new Uint8Array(r.value)) : r; + }, + readTextFile: async (p) => { + const r = await env.readBinaryFile(p); + return r.ok ? ok(new TextDecoder().decode(r.value)) : r; + }, + writeFile: async (p, content) => { + const full = path4(cwd, p); + const parent2 = full.slice(0, full.lastIndexOf("/")) || "/"; + const created = await env.createDir(parent2, { recursive: true }); + if (!created.ok) return created; + return call("write", full, Array.from(typeof content === "string" ? new TextEncoder().encode(content) : content)); + }, + createDir: async (p, options) => { + const full = path4(cwd, p); + if (!options?.recursive) return call("mkdir", full); + let current = ""; + for (const part of full.split("/").filter(Boolean)) { + current += "/" + part; + const exists = await call("stat", current); + if (!exists.ok) { + const r = await call("mkdir", current); + if (!r.ok && (await call("stat", current)).value?.kind !== "directory") return r; + } + } + return ok(void 0); + }, + openBinaryReader: async (p) => { + const data = await env.readBinaryFile(p); + if (!data.ok) return data; + const info = await env.fileInfo(p); + return ok({ + info: async () => info, + read: async (offset, length) => ok(data.value.slice(offset, offset + length)), + scanLines: async (options) => { + const scanner = new LineScanner(options.startLine, options.endLine); + scanner.push(data.value); + return ok(scanner.finish()); + }, + close: async () => { + } + }); + }, + exec: async (command, options, context) => { + let spillPath; + let pending = "", bytes2 = 0, lines2 = 0; + const output = async (text, stream5) => { + options?.onOutput?.(text, context, { stream: stream5 }); + if (!options?.spill) return; + bytes2 += new TextEncoder().encode(text).length; + lines2 += text.split("\n").length - 1; + if (!spillPath) { + pending += text; + if (bytes2 <= options.spill.afterBytes && lines2 + (pending.endsWith("\n") ? 0 : 1) <= options.spill.afterLines) return; + spillPath = `/tmp/bash-${crypto.randomUUID()}.log`; + const created = await env.writeFile(spillPath, pending); + if (!created.ok) throw new Error(created.error.message); + pending = ""; + } else { + const appended = await call("append", spillPath, Array.from(new TextEncoder().encode(text))); + if (!appended.ok) throw new Error(appended.error.message); + } + }; + let rid; + const abort = () => { + if (rid !== void 0) { + Deno.core.close(rid); + rid = void 0; + } + }; + try { + context.abortSignal?.throwIfAborted(); + rid = ops.op_exec(command, options?.cwd ?? cwd, options?.timeout, void 0, void 0, conversations, tag); + context.abortSignal?.addEventListener("abort", abort, { once: true }); + const decoders = { stdout: new TextDecoder(), stderr: new TextDecoder() }; + let result; + while (true) { + const chunk = await ops.op_exec_next(rid); + if (!chunk.stream) { + rid = void 0; + result = chunk; + break; + } + await output(decoders[chunk.stream].decode(new Uint8Array(chunk.bytes), { stream: true }), chunk.stream); + } + if (result.error) throw new Error(result.error); + for (const stream5 of ["stdout", "stderr"]) { + const text = decoders[stream5].decode(); + if (text) await output(text, stream5); + } + return ok({ exitCode: result.exitCode, ...spillPath ? { spillPath } : {} }); + } catch (error) { + return { ok: false, error: Object.assign(new Error(String(error)), { code: "unknown", ...spillPath ? { spillPath } : {} }) }; + } finally { + context.abortSignal?.removeEventListener("abort", abort); + abort(); + } + }, + cleanup: async () => { + } + }; + return env; +} // extensions.ts var ops2 = Deno.core.ops; -var encoder2 = new TextEncoder(); +var encoder3 = new TextEncoder(); var decoder2 = new TextDecoder(); var ExtensionState = defineDoc({ kind: "sausage.extensions", version: 1, scope: "session", checkpointWhen: () => false, initial: () => ({ good: null, current: null, error: null }) }); var Metadata = defineDoc({ kind: "sausage.metadata", version: 1, scope: "conversation", history: "latest", fork: "current", initial: () => ({ label: "", title: "" }), checkpointWhen: () => false }); -async function file(kind, path4, bytes2 = []) { - const result = await ops2.op_file(kind, path4, bytes2); +async function file(kind, path5, bytes2 = []) { + const result = await ops2.op_file(kind, path5, bytes2); if (!result.ok) throw Object.assign(new Error(result.error.message), result.error); return result.value; } var fs2 = { - read: async (path4) => decoder2.decode(new Uint8Array(await file("read", path4))), - write: (path4, text) => file("write", path4, Array.from(encoder2.encode(text))), - append: (path4, text) => file("append", path4, Array.from(encoder2.encode(text))), - list: (path4) => file("list", path4), - stat: (path4) => file("stat", path4), - lstat: (path4) => file("lstat", path4), - mkdir: (path4) => file("mkdir", path4), - remove: (path4) => file("remove", path4), - rename: (from, to) => file("rename", from, Array.from(encoder2.encode(to))) + read: async (path5) => decoder2.decode(new Uint8Array(await file("read", path5))), + write: (path5, text) => file("write", path5, Array.from(encoder3.encode(text))), + append: (path5, text) => file("append", path5, Array.from(encoder3.encode(text))), + list: (path5) => file("list", path5), + stat: (path5) => file("stat", path5), + lstat: (path5) => file("lstat", path5), + mkdir: (path5) => file("mkdir", path5), + remove: (path5) => file("remove", path5), + rename: (from, to) => file("rename", from, Array.from(encoder3.encode(to))) }; -// proxy-models-test.ts -var readProxy = () => Deno.core.ops.op_model_proxy(); -var models = await proxyModels(await readProxy(), readProxy); -for (const [provider2, id] of [["openai", "gpt-6.1-sol"], ["anthropic", "claude-opus-5-5"]]) { - const model2 = models.getModel(provider2, id); - if (model2.cost.input !== 2 || model2.cost.cacheWrite !== 3) throw new Error("catalog prices lost"); - const result = await models.completeSimple(model2, { messages: [{ role: "user", content: "Say hello.", timestamp: Date.now() }] }, { reasoning: "low", maxTokens: 128 }); - if (result.stopReason === "error" || !result.content.some((block) => block.type === "text" && block.text === "hello")) { - throw new Error(`${provider2}: ${result.errorMessage ?? JSON.stringify(result.content)}`); +// node_modules/@earendil-works/chord/dist/sqlite/schema.js +function validateSqliteSchemaPrefix(prefix) { + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(prefix)) { + throw new Error(`Invalid SQLite schema prefix ${JSON.stringify(prefix)}`); + } + if (prefix.toLowerCase().startsWith("sqlite_")) { + throw new Error(`SQLite schema prefix ${JSON.stringify(prefix)} is reserved`); } - if (!(result.usage.cost.total > 0)) throw new Error("turn cost missing"); } -var fallback = await proxyModels({ ...globalThis.testProxy, base_url: `${globalThis.testProxy.base_url}/offline` }); -for (const [provider2, api] of [["openai", "openai-responses"], ["anthropic", "anthropic-messages"]]) { - const model2 = fallback.getModels(provider2)[0]; - if (model2.api !== api || model2.cost.input !== 0) throw new Error("offline transport fallback failed"); + +// node_modules/@earendil-works/chord/dist/sqlite/migrations.js +async function applySqliteMigrations(database, migrations, options) { + const { table } = options; + validateSqliteSchemaPrefix(table); + for (let index = 0; index < migrations.length; index++) { + if (migrations[index]?.version !== index + 1) { + throw new Error("SQLite migrations must have contiguous versions starting at 1"); + } + } + await database.transaction(async (transaction) => { + await transaction.exec(`CREATE TABLE IF NOT EXISTS ${table} ( + singleton INTEGER PRIMARY KEY CHECK (singleton = 1), + version INTEGER NOT NULL CHECK (version >= 0) + ) STRICT`); + await transaction.run(`INSERT OR IGNORE INTO ${table} (singleton, version) VALUES (1, 0)`); + const row = await transaction.get(`SELECT version FROM ${table} WHERE singleton = 1`); + if (row === void 0) + throw new Error("SQLite schema metadata is missing"); + const currentVersion = migrations.at(-1)?.version ?? 0; + if (row.version > currentVersion) { + throw new Error(`SQLite schema version ${row.version} is newer than supported version ${currentVersion}`); + } + for (const migration of migrations) { + if (migration.version <= row.version) + continue; + for (const statement of migration.statements) + await transaction.exec(statement); + await transaction.run(`UPDATE ${table} SET version = ? WHERE singleton = 1`, migration.version); + } + }); } -await fs2.write("/etc/sausage/config.yaml", JSON.stringify({ proxy: { base_url: `${globalThis.testProxy.base_url}/edited`, api_key: "next-key" } })); -var auth = await models.getAuth(models.getModel("openai", "gpt-6.1-sol")); -if (auth.auth.apiKey !== "next-key" || auth.auth.baseUrl !== `${globalThis.testProxy.base_url}/edited/v1`) throw new Error("Proxy edits did not reach the next request"); -await fs2.write("/etc/sausage/config.yaml", JSON.stringify({ proxy: { base_url: "", api_key: "" } })); -var empty = await proxyModels(await readProxy(), readProxy); + +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/schema.js +var TABLE_NAMES = { + durableSchema: "durable_schema", + durableMetadata: "durable_metadata", + recordIds: "record_ids", + conversations: "conversations", + entries: "entries", + tasks: "tasks", + submissions: "submissions", + documents: "documents", + documentRevisions: "document_revisions" +}; +var INDEX_NAMES = { + conversationsByOwnerConversation: "conversations_by_owner_conversation", + conversationsByOwnerTask: "conversations_by_owner_task", + entriesByConversation: "entries_by_conversation", + entryHeadsByConversation: "entry_heads_by_conversation", + tasksByStatus: "tasks_by_status", + tasksByConversation: "tasks_by_conversation", + tasksByKind: "tasks_by_kind", + tasksByAbortRequested: "tasks_by_abort_requested", + tasksByBackground: "tasks_by_background", + submissionsByRequest: "submissions_by_request", + submissionsByConversation: "submissions_by_conversation", + submissionsByStatus: "submissions_by_status", + documentsByAddress: "documents_by_address", + documentsByScope: "documents_by_scope", + documentsByScopeKind: "documents_by_scope_kind", + documentRevisionsByKind: "document_revisions_by_kind" +}; +function prefixIdentifiers(names2, prefix) { + return Object.fromEntries(Object.entries(names2).map(([key, name]) => [key, `${prefix}${name}`])); +} +function createSqliteSchema(prefix) { + if (prefix !== void 0) + validateSqliteSchemaPrefix(prefix); + const actualPrefix = prefix ?? ""; + return { + tables: prefixIdentifiers(TABLE_NAMES, actualPrefix), + indexes: prefixIdentifiers(INDEX_NAMES, actualPrefix) + }; +} +var DEFAULT_SQLITE_SCHEMA = createSqliteSchema(); + +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/migrations.js +function createSqliteMigrations(schema4) { + const { tables, indexes } = schema4; + const initialSchema = [ + `CREATE TABLE ${tables.durableMetadata} ( + singleton INTEGER PRIMARY KEY CHECK (singleton = 1), + next_id TEXT NOT NULL, + next_seq INTEGER NOT NULL + ) STRICT`, + `INSERT INTO ${tables.durableMetadata} (singleton, next_id, next_seq) VALUES (1, '2', 1)`, + `CREATE TABLE ${tables.recordIds} ( + id INTEGER PRIMARY KEY, + record_type TEXT NOT NULL CHECK (record_type IN ('conversation', 'entry', 'task', 'submission', 'document')) + ) STRICT`, + `CREATE TABLE ${tables.conversations} ( + id INTEGER PRIMARY KEY, + owner_conversation_id INTEGER, + owner_task_id INTEGER, + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `CREATE INDEX ${indexes.conversationsByOwnerConversation} ON ${tables.conversations} (owner_conversation_id, id)`, + `CREATE INDEX ${indexes.conversationsByOwnerTask} ON ${tables.conversations} (owner_task_id, id)`, + `CREATE TABLE ${tables.entries} ( + id INTEGER PRIMARY KEY, + conversation_id INTEGER NOT NULL, + head INTEGER, + commit_seq INTEGER NOT NULL, + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `CREATE INDEX ${indexes.entriesByConversation} ON ${tables.entries} (conversation_id, id DESC)`, + `CREATE INDEX ${indexes.entryHeadsByConversation} ON ${tables.entries} (conversation_id, id DESC) WHERE head IS NOT NULL`, + `CREATE TABLE ${tables.tasks} ( + id INTEGER PRIMARY KEY, + conversation_id INTEGER NOT NULL, + kind TEXT NOT NULL, + status TEXT NOT NULL CHECK (status IN ('pending', 'running', 'waiting', 'completing', 'terminal')), + abort_requested INTEGER NOT NULL CHECK (abort_requested IN (0, 1)), + background INTEGER NOT NULL CHECK (background IN (0, 1)), + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `CREATE INDEX ${indexes.tasksByStatus} ON ${tables.tasks} (status, id)`, + `CREATE INDEX ${indexes.tasksByConversation} ON ${tables.tasks} (conversation_id, id)`, + `CREATE INDEX ${indexes.tasksByKind} ON ${tables.tasks} (kind, id)`, + `CREATE INDEX ${indexes.tasksByAbortRequested} ON ${tables.tasks} (abort_requested, id)`, + `CREATE INDEX ${indexes.tasksByBackground} ON ${tables.tasks} (background, id)`, + `CREATE TABLE ${tables.submissions} ( + id INTEGER PRIMARY KEY, + conversation_id INTEGER NOT NULL, + request_id TEXT, + status TEXT NOT NULL CHECK (status IN ('queued', 'placed', 'done', 'unanswered')), + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `CREATE INDEX ${indexes.submissionsByRequest} ON ${tables.submissions} (conversation_id, request_id)`, + `CREATE INDEX ${indexes.submissionsByConversation} ON ${tables.submissions} (conversation_id, id)`, + `CREATE INDEX ${indexes.submissionsByStatus} ON ${tables.submissions} (status, id)`, + `CREATE TABLE ${tables.documents} ( + id INTEGER PRIMARY KEY, + kind TEXT NOT NULL, + family INTEGER NOT NULL CHECK (family IN (0, 1)), + key_value TEXT NOT NULL, + scope_kind TEXT NOT NULL CHECK (scope_kind IN ('session', 'conversation', 'task')), + owner_id INTEGER NOT NULL, + created_at INTEGER NOT NULL, + retired_at INTEGER, + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `CREATE INDEX ${indexes.documentsByAddress} + ON ${tables.documents} (kind, scope_kind, owner_id, family, key_value, created_at DESC, retired_at)`, + `CREATE INDEX ${indexes.documentsByScope} ON ${tables.documents} (scope_kind, owner_id, id)`, + `CREATE INDEX ${indexes.documentsByScopeKind} ON ${tables.documents} (scope_kind, owner_id, kind, id)`, + `CREATE TABLE ${tables.documentRevisions} ( + document_id INTEGER NOT NULL, + seq INTEGER NOT NULL, + kind TEXT NOT NULL CHECK (kind IN ('base', 'delta')), + version INTEGER NOT NULL, + content TEXT NOT NULL CHECK (json_valid(content)), + PRIMARY KEY (document_id, seq) + ) STRICT`, + `CREATE INDEX ${indexes.documentRevisionsByKind} ON ${tables.documentRevisions} (document_id, kind, seq DESC)` + ]; + const rebuiltTasks = `${tables.tasks}_v2`; + const sleepingStatus = [ + `CREATE TABLE ${rebuiltTasks} ( + id INTEGER PRIMARY KEY, + conversation_id INTEGER NOT NULL, + kind TEXT NOT NULL, + status TEXT NOT NULL CHECK (status IN ('pending', 'running', 'waiting', 'sleeping', 'completing', 'terminal')), + abort_requested INTEGER NOT NULL CHECK (abort_requested IN (0, 1)), + background INTEGER NOT NULL CHECK (background IN (0, 1)), + record TEXT NOT NULL CHECK (json_valid(record)) + ) STRICT`, + `INSERT INTO ${rebuiltTasks} (id, conversation_id, kind, status, abort_requested, background, record) + SELECT id, conversation_id, kind, status, abort_requested, background, record FROM ${tables.tasks}`, + `DROP TABLE ${tables.tasks}`, + `ALTER TABLE ${rebuiltTasks} RENAME TO ${tables.tasks}`, + `CREATE INDEX ${indexes.tasksByStatus} ON ${tables.tasks} (status, id)`, + `CREATE INDEX ${indexes.tasksByConversation} ON ${tables.tasks} (conversation_id, id)`, + `CREATE INDEX ${indexes.tasksByKind} ON ${tables.tasks} (kind, id)`, + `CREATE INDEX ${indexes.tasksByAbortRequested} ON ${tables.tasks} (abort_requested, id)`, + `CREATE INDEX ${indexes.tasksByBackground} ON ${tables.tasks} (background, id)` + ]; + return [ + { version: 1, statements: initialSchema }, + { version: 2, statements: sleepingStatus } + ]; +} +var SQLITE_MIGRATIONS = createSqliteMigrations(DEFAULT_SQLITE_SCHEMA); +var CURRENT_SQLITE_SCHEMA_VERSION = SQLITE_MIGRATIONS.at(-1)?.version ?? 0; +async function applySqliteMigrationsForSchema(database, schema4, migrations = createSqliteMigrations(schema4)) { + await applySqliteMigrations(database, migrations, { table: schema4.tables.durableSchema }); +} + +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +var parseJson = (value2) => JSON.parse(value2); +var encodeJson = (value2) => JSON.stringify(value2); +var encodeIndexedString = (value2) => JSON.stringify(value2); +var cursorId = (cursor) => { + const after = cursor?.after; + if (after === void 0) + return void 0; + if (typeof after !== "number" || !Number.isSafeInteger(after)) + throw new StorageRequestError("Invalid storage cursor"); + return idFromNumber(after); +}; +var page = (values, limit3, order = "ascending") => { + const items = values.slice(0, limit3); + if (values.length <= limit3) + return { items }; + return { items, next: nextCursor(items.at(-1).id, order) }; +}; +var scanSql = (start) => start.order === "ascending" ? { clause: "id > ?", param: start.after ?? -1, direction: "ASC" } : { clause: "id < ?", param: start.after ?? Number.MAX_SAFE_INTEGER, direction: "DESC" }; +var scopeColumns = (scope) => { + switch (scope.kind) { + case "session": + return { scopeKind: "session", ownerId: 0 }; + case "conversation": + return { scopeKind: "conversation", ownerId: scope.conversationId }; + case "task": + return { scopeKind: "task", ownerId: scope.taskId }; + } +}; +var addressParts = (address) => { + const scope = scopeColumns(address.scope); + return { + kind: encodeIndexedString(address.kind), + ...scope, + family: address.key === void 0 ? 0 : 1, + keyValue: encodeIndexedString(address.key ?? "") + }; +}; +var addressKey = (address) => { + const parts = addressParts(address); + return JSON.stringify([parts.kind, parts.scopeKind, parts.ownerId, parts.family, parts.keyValue]); +}; +var isAliveAt = (record, at) => { + if (at === "current") + return record.retiredAt === void 0; + return record.createdAt <= at && (record.retiredAt === void 0 || at < record.retiredAt); +}; +var isCurrentOnly = (record) => record.scope.kind !== "conversation" || record.history === "latest"; +var writeId = (write) => { + switch (write.type) { + case "conversation": + case "entry": + case "task": + case "submission": + return write.value.id; + case "document.create": + case "document.copy": + return write.record.id; + case "document.change": + case "document.retire": + return void 0; + } +}; +function watchCalls(executor, calls) { + const watched = async (call) => { + try { + return await call(); + } catch (error) { + calls.failed = true; + throw error; + } + }; + return { + exec: (sql) => watched(() => executor.exec(sql)), + run: (sql, ...params) => watched(() => executor.run(sql, ...params)), + runCounted: (sql, ...params) => watched(() => executor.runCounted(sql, ...params)), + get: (sql, ...params) => watched(() => executor.get(sql, ...params)), + all: (sql, ...params) => watched(() => executor.all(sql, ...params)) + }; +} +var SqliteStorage = class _SqliteStorage { + db; + schema; + nextId; + closed = false; + closing; + admittedReads = 0; + readsDrained; + constructor(db, schema4, nextId) { + this.db = db; + this.schema = schema4; + this.nextId = nextId; + } + /** Initialize storage over an owned SQLite database facade. */ + static async open(db, options = {}) { + try { + const schema4 = createSqliteSchema(options.prefix); + await applySqliteMigrationsForSchema(db, schema4); + const metadata = await db.get(`SELECT next_id, next_seq FROM ${schema4.tables.durableMetadata} WHERE singleton = 1`); + if (metadata === void 0) + throw new Error("Durable SQLite metadata is missing"); + return new _SqliteStorage(db, schema4, Number(metadata.next_id)); + } catch (error) { + try { + await db.close(); + } catch { + } + throw error; + } + } + /** + * Commit `batches` in one SQL transaction, each with its own seq. Each batch is checked before it writes anything, + * against the state the earlier ones left, and the first one refused ends the batch: the transaction commits the ones + * before it. No savepoints, which Durable Objects do not allow: the checks run before the writes instead. + */ + async commit(batches, receive, _context) { + this.assertOpen(); + const seqs = []; + let refused; + let candidateNextId = this.nextId; + await this.db.transaction(async (transaction) => { + const metadata = await this.readMetadata(transaction); + let next = metadata.next_seq; + const calls = { failed: false }; + const checked = watchCalls(transaction, calls); + for (const writes of batches) { + let documentActions; + calls.failed = false; + try { + documentActions = this.prepareDocumentActions(writes); + await this.checkBatch(checked, writes, documentActions); + } catch (error) { + if (calls.failed) + throw error; + refused = { error }; + break; + } + const seq2 = seqFromNumber(next++); + await this.applyBatch(transaction, writes, documentActions, seq2); + seqs.push(seq2); + candidateNextId = Math.max(candidateNextId, this.candidateNextId(writes)); + } + if (seqs.length > 0) { + await this.writeMetadata(transaction, Math.max(Number(metadata.next_id), candidateNextId), next); + } + }); + this.nextId = Math.max(this.nextId, candidateNextId); + for (const [index, seq2] of seqs.entries()) + receive(index, seq2); + return refused === void 0 ? { stored: seqs.length } : { stored: seqs.length, refused: refused.error }; + } + async readMetadata(executor) { + const metadata = await executor.get(`SELECT next_id, next_seq FROM ${this.schema.tables.durableMetadata} WHERE singleton = 1`); + if (metadata === void 0) + throw new Error("Durable SQLite metadata is missing"); + return metadata; + } + async writeMetadata(executor, nextId, nextSeq) { + await executor.run(`UPDATE ${this.schema.tables.durableMetadata} SET next_id = ?, next_seq = ? WHERE singleton = 1`, String(nextId), nextSeq); + } + /** Durable's own checks of one batch, copy resolution included, before it writes anything. */ + async checkBatch(executor, writes, documentActions) { + await this.checkGlobalIds(executor, writes); + await this.checkDocumentActions(executor, documentActions); + await this.resolveCopies(executor, documentActions); + } + async applyBatch(executor, writes, documentActions, seq2) { + for (const write of writes) + await this.applyTableWrite(executor, write, seq2); + await this.applyDocumentActions(executor, documentActions, seq2); + } + async mintId() { + this.assertOpen(); + if (!Number.isSafeInteger(this.nextId)) + throw new Error("ID space is exhausted"); + return idFromNumber(this.nextId++); + } + async conversation(id, _context) { + this.assertOpen(); + const row = await this.db.get(`SELECT record FROM ${this.schema.tables.conversations} WHERE id = ?`, id); + return row === void 0 ? void 0 : parseJson(row.record); + } + async scanConversations(query, limit3, cursor, _context) { + this.assertOpen(); + const start = scanStart(query.order, cursor, "ascending"); + const scan = scanSql(start); + const clauses = [scan.clause]; + const params = [scan.param]; + if (query.ownerConversationId !== void 0) { + clauses.push("owner_conversation_id = ?"); + params.push(query.ownerConversationId); + } + if (query.ownerTaskId !== void 0) { + clauses.push("owner_task_id = ?"); + params.push(query.ownerTaskId); + } + params.push(limit3 + 1); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.conversations} WHERE ${clauses.join(" AND ")} ORDER BY id ${scan.direction} LIMIT ?`, ...params); + return page(rows.map((row) => parseJson(row.record)), limit3, start.order); + } + entry(idOrConversationId, idOrContext, context) { + return this.admitRead(() => this.readEntry(idOrConversationId, idOrContext, context)); + } + findLatestHeadMarker(conversationId, atOrBeforeEntryId, _context) { + return this.admitRead(() => this.readLatestHeadMarker(conversationId, atOrBeforeEntryId)); + } + scanEntries(query, limit3, cursor, _context) { + return this.admitRead(() => this.readEntries(query, limit3, cursor)); + } + async readEntry(idOrConversationId, idOrContext, context) { + const id = context === void 0 ? idFromNumber(idOrConversationId) : typeof idOrContext === "number" ? idFromNumber(idOrContext) : void 0; + if (id === void 0) + throw new StorageRequestError("Storage.entry() requires an entry ID"); + let conversation; + if (context !== void 0) { + const conversationId = idFromNumber(idOrConversationId); + conversation = await this.readConversation(conversationId); + if (conversation === void 0) + throw new StorageRequestError(`Unknown conversation: ${conversationId}`); + } + const row = await this.db.get(`SELECT record, commit_seq FROM ${this.schema.tables.entries} WHERE id = ?`, id); + if (row === void 0) + return void 0; + const entry2 = parseJson(row.record); + if (conversation !== void 0) { + let upperEntryId = Number.POSITIVE_INFINITY; + while (conversation.id !== entry2.conversationId) { + if (conversation.parent === void 0) + return void 0; + upperEntryId = Math.min(upperEntryId, conversation.parent.at); + conversation = await this.readConversation(conversation.parent.conversationId); + } + if (entry2.id > upperEntryId) + return void 0; + } + return { entry: entry2, commitSeq: seqFromNumber(row.commit_seq) }; + } + async readLatestHeadMarker(conversationId, atOrBeforeEntryId) { + let conversation = await this.readConversation(conversationId); + if (conversation === void 0) + throw new StorageRequestError(`Unknown conversation: ${conversationId}`); + let upper = atOrBeforeEntryId; + while (true) { + const row = upper === void 0 ? await this.db.get(`SELECT record FROM ${this.schema.tables.entries} WHERE conversation_id = ? AND head IS NOT NULL ORDER BY id DESC LIMIT 1`, conversation.id) : await this.db.get(`SELECT record FROM ${this.schema.tables.entries} WHERE conversation_id = ? AND head IS NOT NULL AND id <= ? ORDER BY id DESC LIMIT 1`, conversation.id, upper); + if (row !== void 0) + return parseJson(row.record); + if (conversation.parent === void 0) + return void 0; + upper = upper === void 0 ? conversation.parent.at : Math.min(upper, conversation.parent.at); + conversation = await this.readConversation(conversation.parent.conversationId); + } + } + async readEntries(query, limit3, cursor) { + const { order, after } = scanStart(query.order, cursor, "descending"); + if (order === "ascending") + return this.readEntriesAscending(query, limit3, after); + let conversation = await this.readConversation(query.conversationId); + if (conversation === void 0) + throw new StorageRequestError(`Unknown conversation: ${query.conversationId}`); + let upper = query.maxEntryId; + if (after !== void 0) + upper = Math.min(upper ?? Number.MAX_SAFE_INTEGER, after - 1); + const values = []; + while (true) { + const clauses = ["conversation_id = ?"]; + const params = [conversation.id]; + if (query.minEntryId !== void 0) { + clauses.push("id >= ?"); + params.push(query.minEntryId); + } + if (upper !== void 0) { + clauses.push("id <= ?"); + params.push(upper); + } + params.push(limit3 + 1 - values.length); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.entries} WHERE ${clauses.join(" AND ")} ORDER BY id DESC LIMIT ?`, ...params); + values.push(...rows.map((row) => parseJson(row.record))); + if (values.length > limit3 || conversation.parent === void 0) + break; + upper = upper === void 0 ? conversation.parent.at : Math.min(upper, conversation.parent.at); + if (query.minEntryId !== void 0 && upper < query.minEntryId) + break; + conversation = await this.readConversation(conversation.parent.conversationId); + } + return page(values, limit3, "descending"); + } + /** Oldest first: the fork chain's segments from the root conversation forward, each up to its fork point. */ + async readEntriesAscending(query, limit3, after) { + const segments = []; + let conversation = await this.readConversation(query.conversationId); + if (conversation === void 0) + throw new StorageRequestError(`Unknown conversation: ${query.conversationId}`); + let upper = query.maxEntryId; + while (true) { + segments.push({ conversationId: conversation.id, upper }); + if (conversation.parent === void 0) + break; + upper = upper === void 0 ? conversation.parent.at : Math.min(upper, conversation.parent.at); + if (query.minEntryId !== void 0 && upper < query.minEntryId) + break; + conversation = await this.readConversation(conversation.parent.conversationId); + } + let lower = query.minEntryId; + if (after !== void 0) + lower = Math.max(lower ?? after + 1, after + 1); + const values = []; + for (const segment of segments.reverse()) { + const clauses = ["conversation_id = ?"]; + const params = [segment.conversationId]; + if (lower !== void 0) { + clauses.push("id >= ?"); + params.push(lower); + } + if (segment.upper !== void 0) { + clauses.push("id <= ?"); + params.push(segment.upper); + } + params.push(limit3 + 1 - values.length); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.entries} WHERE ${clauses.join(" AND ")} ORDER BY id ASC LIMIT ?`, ...params); + values.push(...rows.map((row) => parseJson(row.record))); + if (values.length > limit3) + break; + } + return page(values, limit3, "ascending"); + } + async task(id, _context) { + this.assertOpen(); + const row = await this.db.get(`SELECT record FROM ${this.schema.tables.tasks} WHERE id = ?`, id); + return row === void 0 ? void 0 : parseJson(row.record); + } + async scanTasks(query, limit3, cursor, _context) { + this.assertOpen(); + const start = scanStart(query.order, cursor, "ascending"); + const scan = scanSql(start); + const clauses = [scan.clause]; + const params = [scan.param]; + if (query.conversationId !== void 0) { + clauses.push("conversation_id = ?"); + params.push(query.conversationId); + } + if (query.kind !== void 0) { + clauses.push("kind = ?"); + params.push(encodeIndexedString(query.kind)); + } + if (query.status !== void 0) { + clauses.push("status = ?"); + params.push(query.status); + } + if (query.abortRequested !== void 0) { + clauses.push("abort_requested = ?"); + params.push(query.abortRequested ? 1 : 0); + } + if (query.background !== void 0) { + clauses.push("background = ?"); + params.push(query.background ? 1 : 0); + } + params.push(limit3 + 1); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.tasks} WHERE ${clauses.join(" AND ")} ORDER BY id ${scan.direction} LIMIT ?`, ...params); + return page(rows.map((row) => parseJson(row.record)), limit3, start.order); + } + async submission(id, _context) { + this.assertOpen(); + const row = await this.db.get(`SELECT record FROM ${this.schema.tables.submissions} WHERE id = ?`, id); + return row === void 0 ? void 0 : parseJson(row.record); + } + async scanSubmissions(query, limit3, cursor, _context) { + this.assertOpen(); + const start = scanStart(query.order, cursor, "ascending"); + const scan = scanSql(start); + const clauses = [scan.clause]; + const params = [scan.param]; + if (query.conversationId !== void 0) { + clauses.push("conversation_id = ?"); + params.push(query.conversationId); + } + if (query.status !== void 0) { + clauses.push("status = ?"); + params.push(query.status); + } + params.push(limit3 + 1); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.submissions} WHERE ${clauses.join(" AND ")} ORDER BY id ${scan.direction} LIMIT ?`, ...params); + return page(rows.map((row) => parseJson(row.record)), limit3, start.order); + } + async submissionByRequest(conversationId, requestId, _context) { + this.assertOpen(); + const row = await this.db.get(`SELECT record FROM ${this.schema.tables.submissions} WHERE conversation_id = ? AND request_id = ?`, conversationId, encodeIndexedString(requestId)); + return row === void 0 ? void 0 : parseJson(row.record); + } + async findDocument(address, at, _context) { + this.assertOpen(); + const parts = addressParts(address); + const sql = at === "current" ? `SELECT record FROM ${this.schema.tables.documents} + WHERE kind = ? AND scope_kind = ? AND owner_id = ? AND family = ? AND key_value = ? + AND retired_at IS NULL ORDER BY created_at DESC LIMIT 1` : `SELECT record FROM ${this.schema.tables.documents} + WHERE kind = ? AND scope_kind = ? AND owner_id = ? AND family = ? AND key_value = ? + AND created_at <= ? AND (retired_at IS NULL OR retired_at > ?) + ORDER BY created_at DESC LIMIT 1`; + const params = [parts.kind, parts.scopeKind, parts.ownerId, parts.family, parts.keyValue]; + if (at !== "current") + params.push(at, at); + const row = await this.db.get(sql, ...params); + return row === void 0 ? void 0 : parseJson(row.record); + } + async document(id, at, _context) { + this.assertOpen(); + return this.db.transaction((transaction) => this.materializeDocument(transaction, id, at)); + } + async scanDocuments(query, limit3, cursor, _context) { + this.assertOpen(); + const scope = scopeColumns(query.scope); + const clauses = ["scope_kind = ?", "owner_id = ?", "id > ?"]; + const params = [scope.scopeKind, scope.ownerId, cursorId(cursor) ?? -1]; + if (query.kind !== void 0) { + clauses.push("kind = ?"); + params.push(encodeIndexedString(query.kind)); + } + if (query.at === "current") { + clauses.push("retired_at IS NULL"); + } else { + clauses.push("created_at <= ?", "(retired_at IS NULL OR retired_at > ?)"); + params.push(query.at, query.at); + } + params.push(limit3 + 1); + const rows = await this.db.all(`SELECT record FROM ${this.schema.tables.documents} WHERE ${clauses.join(" AND ")} ORDER BY id LIMIT ?`, ...params); + return page(rows.map((row) => parseJson(row.record)), limit3); + } + close(_context) { + if (this.closing === void 0) { + this.closed = true; + this.closing = this.closeDatabase(); + } + return this.closing; + } + async closeDatabase() { + if (this.admittedReads > 0) { + await new Promise((resolve2) => { + this.readsDrained = resolve2; + }); + } + await this.db.close(); + } + /** + * Run a read that issues several queries. Close waits for admitted reads, so their later queries never reach a + * closed database. Single-query reads and transactions are already ordered before close by the database. + */ + async admitRead(read2) { + this.assertOpen(); + this.admittedReads++; + try { + return await read2(); + } finally { + if (--this.admittedReads === 0) + this.readsDrained?.(); + } + } + async readConversation(id) { + const row = await this.db.get(`SELECT record FROM ${this.schema.tables.conversations} WHERE id = ?`, id); + return row === void 0 ? void 0 : parseJson(row.record); + } + async materializeDocument(executor, id, at) { + const row = await executor.get(`SELECT record FROM ${this.schema.tables.documents} WHERE id = ?`, id); + if (row === void 0) + return void 0; + const record = parseJson(row.record); + if (at !== "current" && isCurrentOnly(record)) { + throw new StorageRequestError(`Document ${id} does not retain historical content`); + } + if (!isAliveAt(record, at)) + return void 0; + const upper = at === "current" ? Number.MAX_SAFE_INTEGER : at; + const base = await executor.get(`SELECT seq, kind, version, content FROM ${this.schema.tables.documentRevisions} + WHERE document_id = ? AND kind = 'base' AND seq <= ? ORDER BY seq DESC LIMIT 1`, id, upper); + if (base === void 0) + throw new Error(`Document ${id} is missing a required base`); + let value2 = parseJson(base.content); + const tail = await executor.all(`SELECT seq, kind, version, content FROM ${this.schema.tables.documentRevisions} + WHERE document_id = ? AND seq > ? AND seq <= ? ORDER BY seq`, id, base.seq, upper); + for (const revision of tail) { + if (revision.kind !== "delta" || revision.version !== base.version) { + throw new Error(`Document ${id} crosses a stored version boundary without a base`); + } + value2 = apply(value2, parseJson(revision.content)); + } + return { record, version: base.version, value: value2, deltasSinceBase: tail.length }; + } + candidateNextId(writes) { + let nextId = this.nextId; + for (const write of writes) { + const id = writeId(write); + if (id !== void 0) + nextId = Math.max(nextId, id + 1); + } + return nextId; + } + async checkGlobalIds(executor, writes) { + const claimed = /* @__PURE__ */ new Map(); + for (const write of writes) { + if (write.type === "document.change" || write.type === "document.retire") + continue; + const document = write.type === "document.create" || write.type === "document.copy"; + const table = document ? "document" : write.type; + const id = document ? write.record.id : write.value.id; + const existing = (await executor.get(`SELECT record_type FROM ${this.schema.tables.recordIds} WHERE id = ?`, id))?.record_type; + const earlier = claimed.get(id); + if (table === "conversation" || table === "entry" || table === "document") { + if (existing !== void 0) + throw new Error(`ID ${id} already belongs to ${existing}`); + if (earlier !== void 0) + throw new Error(`ID ${id} is written more than once`); + } else { + if (existing !== void 0 && existing !== table) + throw new Error(`ID ${id} already belongs to ${existing}`); + if (earlier !== void 0 && earlier !== table) + throw new Error(`ID ${id} is written as two record types`); + } + claimed.set(id, table); + } + } + prepareDocumentActions(writes) { + const actions = /* @__PURE__ */ new Map(); + for (const write of writes) { + if (write.type !== "document.create" && write.type !== "document.copy" && write.type !== "document.change" && write.type !== "document.retire") { + continue; + } + const id = write.type === "document.create" || write.type === "document.copy" ? write.record.id : write.id; + let action = actions.get(id); + if (action === void 0) { + action = { retire: false }; + actions.set(id, action); + } + switch (write.type) { + case "document.create": + if (action.create !== void 0 || action.content !== void 0 || action.copy !== void 0) { + throw new Error(`Document ${id} has more than one content command`); + } + action.create = write.record; + action.content = write.content; + break; + case "document.copy": + if (action.create !== void 0 || action.content !== void 0 || action.copy !== void 0) { + throw new Error(`Document ${id} has more than one content command`); + } + action.create = write.record; + action.copy = write.source; + break; + case "document.change": + if (action.content !== void 0 || action.copy !== void 0) { + throw new Error(`Document ${id} has more than one content command`); + } + action.content = write.content; + break; + case "document.retire": + if (action.retire) + throw new Error(`Document ${id} is retired more than once`); + action.retire = true; + break; + } + } + return actions; + } + async checkDocumentActions(executor, actions) { + const liveCounts = /* @__PURE__ */ new Map(); + for (const [id, action] of actions) { + if (action.copy !== void 0 && actions.has(action.copy.id)) { + throw new Error(`Document copy ${id} source is changed in the copy batch`); + } + const row = await executor.get(`SELECT record FROM ${this.schema.tables.documents} WHERE id = ?`, id); + const existing = row === void 0 ? void 0 : parseJson(row.record); + if (action.create === void 0 && existing === void 0) + throw new Error(`Unknown document: ${id}`); + if (action.create !== void 0 && existing !== void 0) + throw new Error(`Document ${id} already exists`); + if (existing?.retiredAt !== void 0) + throw new Error(`Document ${id} is retired`); + if (action.content?.kind === "delta") { + const previous = await executor.get(`SELECT version FROM ${this.schema.tables.documentRevisions} WHERE document_id = ? ORDER BY seq DESC LIMIT 1`, id); + if (previous === void 0) + throw new Error(`Document ${id} delta has no base`); + if (previous.version !== action.content.version) { + throw new Error(`Document ${id} version transition requires a base`); + } + } + const record = action.create ?? existing; + const key = addressKey(record); + let live = liveCounts.get(key); + if (live === void 0) + live = await this.currentDocumentId(executor, record) === void 0 ? 0 : 1; + if (action.retire && existing !== void 0) + live--; + if (action.create !== void 0 && !action.retire) + live++; + liveCounts.set(key, live); + } + for (const live of liveCounts.values()) { + if (live > 1) + throw new Error("Document address already has a current incarnation"); + } + } + async currentDocumentId(executor, address) { + const parts = addressParts(address); + const id = (await executor.get(`SELECT id FROM ${this.schema.tables.documents} + WHERE kind = ? AND scope_kind = ? AND owner_id = ? AND family = ? AND key_value = ? AND retired_at IS NULL + LIMIT 1`, parts.kind, parts.scopeKind, parts.ownerId, parts.family, parts.keyValue))?.id; + return id === void 0 ? void 0 : idFromNumber(id); + } + async applyTableWrite(executor, write, seq2) { + switch (write.type) { + case "conversation": + await this.claimId(executor, write.value.id, "conversation"); + await executor.run(`INSERT INTO ${this.schema.tables.conversations} (id, owner_conversation_id, owner_task_id, record) VALUES (?, ?, ?, ?)`, write.value.id, write.value.owner?.conversationId ?? null, write.value.owner?.taskId ?? null, encodeJson(write.value)); + break; + case "entry": + await this.claimId(executor, write.value.id, "entry"); + await executor.run(`INSERT INTO ${this.schema.tables.entries} (id, conversation_id, head, commit_seq, record) VALUES (?, ?, ?, ?, ?)`, write.value.id, write.value.conversationId, write.value.head ?? null, seq2, encodeJson(write.value)); + break; + case "task": + await this.claimId(executor, write.value.id, "task"); + await executor.run(`INSERT INTO ${this.schema.tables.tasks} (id, conversation_id, kind, status, abort_requested, background, record) + VALUES (?, ?, ?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET conversation_id = excluded.conversation_id, kind = excluded.kind, + status = excluded.status, abort_requested = excluded.abort_requested, + background = excluded.background, record = excluded.record`, write.value.id, write.value.conversationId, encodeIndexedString(write.value.kind), write.value.state.status, write.value.abortRequested ? 1 : 0, write.value.background ? 1 : 0, encodeJson(write.value)); + break; + case "submission": + await this.claimId(executor, write.value.id, "submission"); + await executor.run(`INSERT INTO ${this.schema.tables.submissions} (id, conversation_id, request_id, status, record) VALUES (?, ?, ?, ?, ?) + ON CONFLICT(id) DO UPDATE SET conversation_id = excluded.conversation_id, + request_id = excluded.request_id, status = excluded.status, record = excluded.record`, write.value.id, write.value.conversationId, write.value.requestId === void 0 ? null : encodeIndexedString(write.value.requestId), write.value.status, encodeJson(write.value)); + break; + case "document.create": + case "document.copy": + case "document.change": + case "document.retire": + break; + } + } + async claimId(executor, id, table) { + await executor.run(`INSERT OR IGNORE INTO ${this.schema.tables.recordIds} (id, record_type) VALUES (?, ?)`, id, table); + } + /** Resolve each copy to a base of its source's state before this batch, which may not change the source. */ + async resolveCopies(executor, actions) { + for (const [id, action] of actions) { + if (action.copy === void 0) + continue; + try { + const stored = await this.materializeDocument(executor, action.copy.id, action.copy.at); + if (stored === void 0) + throw new Error(`Fork source document ${action.copy.id} cannot be read`); + const create = action.create; + if (stored.record.scope.kind !== "conversation" || create.scope.kind !== "conversation" || stored.record.kind !== create.kind || stored.record.key !== create.key || stored.record.history !== create.history || stored.record.fork !== create.fork) { + throw new Error(`Fork source document ${action.copy.id} does not match the copied record`); + } + action.content = { kind: "base", version: stored.version, value: stored.value }; + } catch (error) { + throw new Error(`Document copy ${id} was rejected`, { cause: error }); + } + } + } + async applyDocumentActions(executor, actions, seq2) { + for (const [id, action] of actions) { + const content = action.content; + let record; + if (action.create !== void 0) { + record = { + ...action.create, + createdAt: seq2, + ...action.retire ? { retiredAt: seq2 } : {} + }; + const parts = addressParts(record); + await this.claimId(executor, id, "document"); + await executor.run(`INSERT INTO ${this.schema.tables.documents} + (id, kind, family, key_value, scope_kind, owner_id, created_at, retired_at, record) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, id, parts.kind, parts.family, parts.keyValue, parts.scopeKind, parts.ownerId, seq2, action.retire ? seq2 : null, encodeJson(record)); + } else { + const row = await executor.get(`SELECT record FROM ${this.schema.tables.documents} WHERE id = ?`, id); + record = parseJson(row.record); + } + if (content !== void 0) { + if (content.kind === "base" && isCurrentOnly(record)) { + await executor.run(`DELETE FROM ${this.schema.tables.documentRevisions} WHERE document_id = ?`, id); + } + const encodedContent = content.kind === "base" ? encodeJson(content.value) : encodeJson(content.ops); + await executor.run(`INSERT INTO ${this.schema.tables.documentRevisions} (document_id, seq, kind, version, content) VALUES (?, ?, ?, ?, ?)`, id, seq2, content.kind, content.version, encodedContent); + } + if (action.retire) { + if (action.create === void 0) { + record = { ...record, retiredAt: seq2 }; + await executor.run(`UPDATE ${this.schema.tables.documents} SET retired_at = ?, record = ? WHERE id = ?`, seq2, encodeJson(record), id); + } + if (isCurrentOnly(record)) { + await executor.run(`DELETE FROM ${this.schema.tables.documentRevisions} WHERE document_id = ?`, id); + } + } + } + } + assertOpen() { + if (this.closed) + throw new Error("SqliteStorage is closed"); + } +}; + +// sqlite.ts +var op = (kind, sql = "", params = []) => Deno.core.ops.op_sql(kind, sql, params.map((p) => p instanceof Uint8Array ? Array.from(p) : typeof p === "bigint" ? Number(p) : p)); +async function openStorage(path5) { + op("open", path5); + let tail = Promise.resolve(); + const queue = (call) => { + const result = tail.then(call); + tail = result.then(() => { + }, () => { + }); + return result; + }; + const executor = { + exec: async (sql) => { + op("exec", sql); + }, + run: async (sql, ...params) => { + op("run", sql, params); + }, + runCounted: async (sql, ...params) => op("run", sql, params).changes, + get: async (sql, ...params) => (await executor.all(sql, ...params))[0], + all: async (sql, ...params) => op("all", sql, params).map((row) => Object.fromEntries(Object.entries(row).map(([key, value2]) => [key, Array.isArray(value2) ? new Uint8Array(value2) : value2]))) + }; + const database = Object.fromEntries(Object.entries(executor).map(([name, method]) => [name, (...args) => queue(() => method(...args))])); + database.transaction = (callback) => queue(async () => { + op("exec", "BEGIN IMMEDIATE"); + try { + const result = await callback(executor); + op("exec", "COMMIT"); + return result; + } catch (error) { + op("exec", "ROLLBACK"); + throw error; + } + }); + database.close = () => queue(async () => { + op("close"); + }); + return SqliteStorage.open(database); +} + +// ../../extensions/core/agents.ts +var CONFIG2 = "/etc/sausage/config.yaml"; +var thinkingLevels = ["off", "minimal", "low", "medium", "high", "xhigh", "max"]; +function parseFrontmatter(text) { + const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(text); + if (!match) throw new Error("Expected frontmatter fields between --- lines"); + return { frontmatter: parse(match[1]), body: match[2].trim() }; +} +var ROSTER = "/etc/sausage/roster"; +function parseDefinition(text, path5, inherited) { + const { frontmatter, body } = parseFrontmatter(text); + const name = path5.split("/").pop().replace(/\.md$/, ""); + const settings = { ...inherited ?? {}, ...frontmatter }; + const instructions = inherited && frontmatter.addTools !== void 0 ? [inherited.instructions, body].filter(Boolean).join("\n\n## Project additions\n\n") : body; + const definition = { ...settings, name, path: path5, instructions }; + if (!/^[a-zA-Z0-9_-]+$/.test(name)) throw new Error(`${path5}: invalid roster name`); + for (const key of ["description", "model", "instructions"]) if (typeof definition[key] !== "string" || !definition[key].trim()) throw new Error(`${path5}: ${key} is required`); + if (definition.thinking !== void 0 && !thinkingLevels.includes(definition.thinking)) throw new Error(`${path5}: invalid thinking`); + for (const key of ["tools", "addTools", "denyTools"]) if (definition[key] !== void 0 && (!Array.isArray(definition[key]) || !definition[key].every((tool) => typeof tool === "string"))) throw new Error(`${path5}: ${key} must be a list of tool names`); + if (inherited && frontmatter.addTools !== void 0) definition.tools = toolsFor(definition, inherited.tools ?? []); + definitionRuns(definition); + return definition; +} +function parseConfig(text) { + const value2 = parse(text); + if (typeof value2?.prompt !== "string") throw new Error(`${CONFIG2}: prompt must be a string`); + if (typeof value2.main_agent_name !== "string" || !value2.main_agent_name) throw new Error(`${CONFIG2}: main_agent_name must name a roster file`); + return value2; +} +function definitionRuns(definition) { + if (!/^[^/\s]+\/\S+$/.test(definition.model)) throw new Error(`${definition.path}: invalid model for ${definition.name}`); + const slash = definition.model.indexOf("/"); + return { model: { provider: definition.model.slice(0, slash), modelId: definition.model.slice(slash + 1) }, thinking: definition.thinking }; +} +function toolsFor(definition, parent2) { + return [.../* @__PURE__ */ new Set([...definition.tools ?? parent2, ...definition.addTools ?? []])].filter((tool) => !definition.denyTools?.includes(tool)); +} + +// ../../extensions/models/files.ts +var parent = (path5) => path5.replace(/\/+$/, "").replace(/\/[^/]+$/, "") || "/"; +async function repoRoot(fs3, cwd) { + for (let at = cwd; ; at = parent(at)) { + try { + await fs3.stat(`${at}/.git`); + return at; + } catch (error) { + if (error.code !== "not_found") throw error; + } + if (at === "/") return cwd; + } +} + +// ../../extensions/models/api.ts +var Profile = defineDoc({ kind: "models.profile", version: 1, scope: "conversation", history: "latest", fork: "current", initial: () => ({}), checkpointWhen: () => false }); +var Pin = { name: "models.pin" }; +var ModelsApi = { name: "models" }; + +// ../../extensions/models/server.ts +function models(host) { + const read2 = async (cwd) => { + const config2 = parseConfig(await host.fs.read(CONFIG2)); + const definitions = /* @__PURE__ */ new Map(); + for (const folder of [ROSTER, `${await repoRoot(host.fs, cwd)}/.sausage/roster`]) { + let entries2; + try { + entries2 = await host.fs.list(folder); + } catch (error) { + if (error.code === "not_found") continue; + throw error; + } + for (const entry2 of entries2) { + if (!entry2.name.endsWith(".md") || entry2.kind === "directory") continue; + const path5 = `${folder}/${entry2.name}`, name = entry2.name.slice(0, -3); + definitions.set(name, parseDefinition(await host.fs.read(path5), path5, definitions.get(name))); + } + } + if (!definitions.has(config2.main_agent_name)) throw new Error(`${CONFIG2}: main_agent_name ${config2.main_agent_name} needs ${ROSTER}/${config2.main_agent_name}.md`); + return { ...config2, definitions: [...definitions.values()].map((definition) => ({ + ...definition, + resident: definition.name === config2.main_agent_name || definition.resident, + runs: definitionRuns(definition) + })), errors: [], replaced: [] }; + }; + const register = (ref) => { + const store = host.models(); + if (store.getModel(ref.provider, ref.modelId)) return; + throw new Error(`${CONFIG2}: unknown provider or unconfigured model ${ref.provider}/${ref.modelId}`); + }; + const apply2 = async (tx, id) => { + const state2 = await tx.doc(AgentDoc, id); + const profile = await tx.doc(Profile, id); + await host.models().refreshConfig?.(); + const config2 = await read2(state2.cwd ?? "/"); + if (profile.mainAgent) profile.agent = config2.main_agent_name; + const definition = profile.agent ? config2.definitions.find((d) => d.name === profile.agent) : void 0; + if (profile.agent && !definition) throw new Error(`Unknown agent ${profile.agent}: ${JSON.stringify(config2.errors)}`); + const selected = (definition ?? config2.definitions.find((d) => d.name === config2.main_agent_name)).runs; + const pinned = await host.want(Pin)?.pin(tx, id); + const ref = pinned ?? profile.model ?? selected.model; + register(ref); + state2.model = ref; + if (profile.thinking ?? selected.thinking) state2.thinkingLevel = profile.thinking ?? selected.thinking; + else delete state2.thinkingLevel; + state2.instructions = [config2.prompt, definition ? `You are @${definition.name}. + +${definition.instructions}` : ""].filter(Boolean).join("\n\n"); + if (definition) { + if (profile.inheritedTools === void 0) profile.inheritedTools = state2.tools ?? null; + const inherited = profile.inheritedTools; + if (definition.tools || Array.isArray(inherited)) state2.tools = toolsFor(definition, inherited ?? []).filter((name) => !profile.excludeTools?.includes(name)); + else state2.tools = { remove: [.../* @__PURE__ */ new Set([...inherited?.remove ?? [], ...definition.denyTools ?? [], ...profile.excludeTools ?? []])] }; + } + return ref; + }; + host.implement(ModelsApi, { + discover: read2, + configure: async (tx, id, options) => { + const profile = await tx.doc(Profile, id); + profile.agent = options.agent; + profile.mainAgent = options.mainAgent ?? false; + profile.inheritedTools = options.inheritedTools; + profile.excludeTools = options.excludeTools ?? []; + if (options.model) profile.model = options.model; + else delete profile.model; + if (options.thinking) profile.thinking = options.thinking; + else delete profile.thinking; + return apply2(tx, id); + }, + resolve: apply2, + start: async ({ agent, cwd, ownership = { kind: "ownerless" } }, context) => { + const conversation = await host.harness().createConversation({ ownership, agent: { cwd }, init: async (tx, id) => { + (await tx.doc(Profile, id)).agent = agent; + await apply2(tx, id); + } }, context); + return conversation; + } + }); + return defineExtension({ name: "models", hooks: [hook(GenerationTask, { beforeInput: async (_input, { tx, conversationId }) => { + await apply2(tx, conversationId); + } })] }); +} + +// provider-models-test.ts +var assert = (ok2, message) => { + if (!ok2) throw new Error(message); +}; +var fetch2 = globalThis.fetch; +globalThis.fetch = async () => { + throw new Error("offline"); +}; +var catalog = await modelCatalog(); +assert(catalog.openai.models["gpt-6.1-sol"], "packaged snapshot works offline"); +await Deno.core.ops.op_model_catalog({ ...catalog, cache_fixture: { id: "cache_fixture", models: {} } }); +assert((await modelCatalog()).cache_fixture.id === "cache_fixture", "persisted metadata cache works offline"); +await Deno.core.ops.op_model_catalog(catalog); +globalThis.fetch = fetch2; +var config = globalThis.providerSettings; +var readProviders = () => Deno.core.ops.op_model_providers(); +var models2 = await configuredModels(readProviders, catalog); +var defaults3 = models2.getModel("responses", "gpt-6.1-sol"); +assert(defaults3.contextWindow === catalog.openai.models["gpt-6.1-sol"].limit.context, "catalog context default"); +var override = resolveModel("custom", { ...config.providers.responses, catalog: "openai" }, { id: "gpt-6.1-sol", context_window: 272e3 }, catalog); +assert(override.contextWindow === 272e3 && override.maxTokens === defaults3.maxTokens && override.cost.input === defaults3.cost.input, "context-only override preserves catalog values"); var failure = ""; try { - const result = await empty.completeSimple(empty.getModels("openai")[0], { messages: [{ role: "user", content: "Missing key", timestamp: Date.now() }] }); - failure = result.errorMessage ?? ""; + resolveModel("custom", config.providers.responses, "unknown-model", catalog); } catch (error) { failure = String(error); } -if (!failure.includes("/etc/sausage/config.yaml")) throw new Error(`Missing proxy settings must name the config file: ${failure}`); +for (const text of [CONFIG, "custom/unknown-model", "context_window", "max_tokens", "reasoning", "cost.input"]) assert(failure.includes(text), `unknown model names missing ${text}`); +var supplied = { id: "unknown-model", context_window: 32e3, max_tokens: 4e3, reasoning: false, cost: { input: 1, output: 2, cache_read: 0, cache_write: 0 } }; +assert(resolveModel("custom", config.providers.responses, supplied, catalog).cost.output === 2, "unknown model accepts complete overrides"); +for (const [provider2, id] of [["messages", "claude-opus-5-5"], ["responses", "gpt-6.1-sol"], ["chat", "gpt-6.1-sol"]]) { + const model2 = models2.getModel(provider2, id); + const result = await models2.completeSimple(model2, { messages: [{ role: "user", content: "Say hello.", timestamp: Date.now() }] }, { maxTokens: 128 }); + assert(result.stopReason !== "error", `${provider2}: ${result.errorMessage}`); + assert(result.content.some((block) => block.type === "text" && block.text === "hello"), `${provider2}: streamed text`); + assert(result.usage.cost.total > 0, `${provider2}: computed usage cost`); +} +await fs2.mkdir("/etc/sausage/roster"); +await fs2.write("/etc/sausage/roster/main.md", "---\ndescription: Main\nmodel: responses/gpt-6.1-sol\n---\nMain role"); +var registry2 = createRegistry(); +registry2.install(models({ fs: fs2, models: () => models2, implement: () => { +}, want: () => void 0 })); +var storage = await openStorage(globalThis.storagePath); +var harness = await Harness.open(storage, { models: models2, registry: registry2, env: () => environment("/"), settings: { retry: { enabled: false }, get extensions() { + return registry2.snapshot().installed(); +} } }, BACKGROUND_CONTEXT); +var root = await harness.root(BACKGROUND_CONTEXT, { agent: { cwd: "/", model: { provider: "responses", modelId: "gpt-6.1-sol" } } }); +harness.resume(); +try { + await (await root.submit({ type: "input", content: "First run" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); + config.providers.responses.base_url = globalThis.providerBase + "/edited-api"; + config.providers.responses.api_key = "next-key"; + config.providers.responses.models = [{ id: "gpt-6.1-sol", context_window: 272e3 }]; + await fs2.write(CONFIG, JSON.stringify(config)); + await (await root.submit({ type: "input", content: "Next run" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); + assert(models2.getModel("responses", "gpt-6.1-sol").contextWindow === 272e3, "provider metadata edit applies on the next run"); + const entries2 = (await root.context(BACKGROUND_CONTEXT)).entries.filter((entry2) => entry2.kind === "pi.assistant"); + assert(entries2.length === 2 && entries2.every((entry2) => entry2.model[0].usage.cost.total > 0), "stored assistant usage includes call costs"); +} finally { + await harness.close(BACKGROUND_CONTEXT); + await storage.close(); +} +config.providers.responses.api_key = ""; +await fs2.write(CONFIG, JSON.stringify(config)); +failure = ""; +try { + await models2.getAuth("responses"); +} catch (error) { + failure = String(error); +} +assert(failure.includes(CONFIG), "missing key identifies config file"); diff --git a/host/js/provider-models-test.ts b/host/js/provider-models-test.ts new file mode 100644 index 0000000..7635d27 --- /dev/null +++ b/host/js/provider-models-test.ts @@ -0,0 +1,58 @@ +/** Real pi-ai API adapters, catalog metadata, live provider edits, and durable usage. */ +import {configuredModels,resolveModel,modelCatalog,CONFIG} from './models'; +import {fs} from './extensions'; +import {environment} from './environment'; +import {BACKGROUND_CONTEXT as context} from '@earendil-works/chord/context'; +import {Harness,createRegistry} from '@earendil-works/pi-durable'; +import {openStorage} from './sqlite'; +import modelExtension from '../../extensions/models/server'; +const assert=(ok:any,message:string)=>{if(!ok)throw new Error(message)}; +const fetch=globalThis.fetch; +globalThis.fetch=async()=>{throw new Error('offline')}; +const catalog=await modelCatalog(); +assert(catalog.openai.models['gpt-6.1-sol'],'packaged snapshot works offline'); +await Deno.core.ops.op_model_catalog({...catalog,cache_fixture:{id:'cache_fixture',models:{}}}); +assert((await modelCatalog()).cache_fixture.id==='cache_fixture','persisted metadata cache works offline'); +await Deno.core.ops.op_model_catalog(catalog); +globalThis.fetch=fetch; +let config=globalThis.providerSettings; +const readProviders=()=>Deno.core.ops.op_model_providers(); +const models=await configuredModels(readProviders,catalog); +const defaults=models.getModel('responses','gpt-6.1-sol'); +assert(defaults.contextWindow===catalog.openai.models['gpt-6.1-sol'].limit.context,'catalog context default'); +const override=resolveModel('custom',{...config.providers.responses,catalog:'openai'},{id:'gpt-6.1-sol',context_window:272000},catalog); +assert(override.contextWindow===272000&&override.maxTokens===defaults.maxTokens&&override.cost.input===defaults.cost.input,'context-only override preserves catalog values'); +let failure=''; +try{resolveModel('custom',config.providers.responses,'unknown-model',catalog)}catch(error){failure=String(error)} +for(const text of [CONFIG,'custom/unknown-model','context_window','max_tokens','reasoning','cost.input'])assert(failure.includes(text),`unknown model names missing ${text}`); +const supplied={id:'unknown-model',context_window:32000,max_tokens:4000,reasoning:false,cost:{input:1,output:2,cache_read:0,cache_write:0}}; +assert(resolveModel('custom',config.providers.responses,supplied,catalog).cost.output===2,'unknown model accepts complete overrides'); +for(const [provider,id] of [['messages','claude-opus-5-5'],['responses','gpt-6.1-sol'],['chat','gpt-6.1-sol']]){ + const model=models.getModel(provider,id); + const result=await models.completeSimple(model,{messages:[{role:'user',content:'Say hello.',timestamp:Date.now()}]},{maxTokens:128}); + assert(result.stopReason!=='error',`${provider}: ${result.errorMessage}`); + assert(result.content.some(block=>block.type==='text'&&block.text==='hello'),`${provider}: streamed text`); + assert(result.usage.cost.total>0,`${provider}: computed usage cost`); +} +await fs.mkdir('/etc/sausage/roster'); +await fs.write('/etc/sausage/roster/main.md','---\ndescription: Main\nmodel: responses/gpt-6.1-sol\n---\nMain role'); +const registry=createRegistry(); +registry.install(modelExtension({fs,models:()=>models,implement:()=>{},want:()=>undefined})); +const storage=await openStorage(globalThis.storagePath); +const harness=await Harness.open(storage,{models,registry,env:()=>environment('/'),settings:{retry:{enabled:false},get extensions(){return registry.snapshot().installed()}}},context); +const root=await harness.root(context,{agent:{cwd:'/',model:{provider:'responses',modelId:'gpt-6.1-sol'}}}); +harness.resume(); +try{ + await (await root.submit({type:'input',content:'First run'},context)).wait(context); + config.providers.responses.base_url=globalThis.providerBase+'/edited-api'; + config.providers.responses.api_key='next-key'; + config.providers.responses.models=[{id:'gpt-6.1-sol',context_window:272000}]; + await fs.write(CONFIG,JSON.stringify(config)); + await (await root.submit({type:'input',content:'Next run'},context)).wait(context); + assert(models.getModel('responses','gpt-6.1-sol').contextWindow===272000,'provider metadata edit applies on the next run'); + const entries=(await root.context(context)).entries.filter(entry=>entry.kind==='pi.assistant'); + assert(entries.length===2&&entries.every(entry=>entry.model[0].usage.cost.total>0),'stored assistant usage includes call costs'); +}finally{await harness.close(context);await storage.close()} +config.providers.responses.api_key='';await fs.write(CONFIG,JSON.stringify(config)); +failure='';try{await models.getAuth('responses')}catch(error){failure=String(error)} +assert(failure.includes(CONFIG),'missing key identifies config file'); diff --git a/host/js/proxy-models-test.ts b/host/js/proxy-models-test.ts deleted file mode 100644 index 21f8a76..0000000 --- a/host/js/proxy-models-test.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** Exercise both real pi-ai transports and their catalog prices, without provider SDK mocks. */ -import { proxyModels } from './proxy-models'; -import { fs } from './extensions'; -const readProxy=()=>Deno.core.ops.op_model_proxy(); -const models = await proxyModels(await readProxy(),readProxy); -for (const [provider, id] of [['openai', 'gpt-6.1-sol'], ['anthropic', 'claude-opus-5-5']]) { - const model = models.getModel(provider, id); - if (model.cost.input !== 2 || model.cost.cacheWrite !== 3) throw new Error('catalog prices lost'); - const result = await models.completeSimple(model, {messages: [{role: 'user', content: 'Say hello.', timestamp: Date.now()}]}, {reasoning: 'low', maxTokens: 128}); - if (result.stopReason === 'error' || !result.content.some(block => block.type === 'text' && block.text === 'hello')) { - throw new Error(`${provider}: ${result.errorMessage ?? JSON.stringify(result.content)}`); - } - if (!(result.usage.cost.total > 0)) throw new Error('turn cost missing'); -} -const fallback = await proxyModels({...globalThis.testProxy, base_url: `${globalThis.testProxy.base_url}/offline`}); -for (const [provider, api] of [['openai', 'openai-responses'], ['anthropic', 'anthropic-messages']]) { - const model = fallback.getModels(provider)[0]; - if (model.api !== api || model.cost.input !== 0) throw new Error('offline transport fallback failed'); -} -await fs.write('/etc/sausage/config.yaml',JSON.stringify({proxy:{base_url:`${globalThis.testProxy.base_url}/edited`,api_key:'next-key'}})); -const auth=await models.getAuth(models.getModel('openai','gpt-6.1-sol')); -if(auth.auth.apiKey!=='next-key'||auth.auth.baseUrl!==`${globalThis.testProxy.base_url}/edited/v1`) throw new Error('Proxy edits did not reach the next request'); -await fs.write('/etc/sausage/config.yaml',JSON.stringify({proxy:{base_url:'',api_key:''}})); -const empty=await proxyModels(await readProxy(),readProxy); -let failure=''; -try { - const result=await empty.completeSimple(empty.getModels('openai')[0],{messages:[{role:'user',content:'Missing key',timestamp:Date.now()}]}); - failure=result.errorMessage??''; -} catch(error) {failure=String(error)} -if(!failure.includes('/etc/sausage/config.yaml')) throw new Error(`Missing proxy settings must name the config file: ${failure}`); diff --git a/host/js/proxy-models.ts b/host/js/proxy-models.ts deleted file mode 100644 index 1d3ff9f..0000000 --- a/host/js/proxy-models.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** Host-only proxy catalog, provider transports, authentication, and quoted token prices. */ -import { createModels } from '@earendil-works/pi-ai/models'; -import { openaiProvider } from '@earendil-works/pi-ai/providers/openai'; -import { anthropicProvider } from '@earendil-works/pi-ai/providers/anthropic'; - -export async function proxyModels(proxy: {base_url: string, api_key: string}, readProxy = async () => proxy) { - const models = createModels(); - const base = proxy.base_url.replace(/\/$/, ''); - let catalog: any[] = []; - try { - if (proxy.base_url && proxy.api_key) { - const response = await fetch(`${base}/v1/models`, { - headers: {Authorization: `Bearer ${proxy.api_key}`}, signal: AbortSignal.timeout(5000), - }); - if (response.ok) catalog = (await response.json()).data ?? []; - } - } catch { /* An unavailable catalog must not prevent durable recovery. */ } - for (const [provider, api, path, fallback] of [ - [openaiProvider(), 'openai-responses', '/v1/responses', 'gpt-6.1-sol'], - [anthropicProvider(), 'anthropic-messages', '/apis/anthropic/v1/messages', 'claude-opus-5-5'], - ] as const) { - const rows = catalog.filter(row => row.creator === provider.id && row.endpoints?.some((endpoint: any) => endpoint.api === api)); - const entries = (rows.length ? rows : [{id: fallback}]).map(row => { - const endpoint = row.endpoints?.find((endpoint: any) => endpoint.api === api)?.path ?? path; - // pi-ai appends /responses or /v1/messages, respectively. - const suffix = api === 'anthropic-messages' ? '/v1/messages' : '/responses'; - const baseUrl = `${base}${endpoint.slice(0, -suffix.length)}`; - const price = row.providers?.[0]?.pricing; - const scale = price?.currency === 'USD' ? 1000000 / price.unit_tokens : 0; - return { - id: row.id, name: row.name ?? row.id, provider: provider.id, api, baseUrl, - reasoning: row.capabilities?.reasoning ?? true, input: ['text'], - thinkingLevelMap: {off: null, minimal: null, - ...Object.fromEntries((row.capabilities?.reasoning_options?.find((option: any) => option.type === 'effort')?.values ?? []).map((level: string) => [level, level]))}, - compat: api === 'anthropic-messages' ? {forceAdaptiveThinking: row.capabilities?.reasoning_options?.some((option: any) => option.type === 'effort') ?? true} : undefined, - cost: {input: (price?.input ?? 0) * scale, output: (price?.output ?? 0) * scale, - cacheRead: (price?.cached_input ?? 0) * scale, cacheWrite: (price?.cache_write ?? 0) * scale}, - contextWindow: row.limits?.context_window ?? 200000, maxTokens: 4096, - }; - }); - models.setProvider({...provider, baseUrl: entries[0].baseUrl, getModels: () => entries as any, - auth: {apiKey: {name: 'Sausage proxy', resolve: async () => { - const current = await readProxy(); - if (!current.base_url || !current.api_key) throw new Error('Set proxy.base_url and proxy.api_key in /etc/sausage/config.yaml before a model request'); - return {auth:{apiKey:current.api_key, - baseUrl:current.base_url.replace(/\/$/,'') + entries[0].baseUrl.slice(base.length), - headers:{'Shopify-Usage-Tag':JSON.stringify(['pi','sausage'])}},source:'/etc/sausage/config.yaml'}; - }}}, - }); - } - return models; -} diff --git a/host/js/questions-cases.ts b/host/js/questions-cases.ts index 1caeb00..72c12b4 100644 --- a/host/js/questions-cases.ts +++ b/host/js/questions-cases.ts @@ -1,5 +1,5 @@ -/** Standing agent server question cases, with a real world fixture. */ +/** Main agent server question cases, with a real world fixture. */ import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context' import {expect,it,describe,afterEach} from './goal-questions-test-support' import {fixture as openFixture} from './goal-questions-fixture' @@ -36,7 +36,7 @@ const decisions = [ describe('questions on a message', () => { it('are stored as the tool validated them, only on reply-expected messages to the user', async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const sent = await f.ask(id, { text: 'Decide these.', questions: decisions }) expect(sent.error).toBeUndefined() expect(sent.message).toMatchObject({ state: 'delivered', questions: decisions }) @@ -55,7 +55,7 @@ describe('questions on a message', () => { it('refuses questions the card could not answer, naming the question', async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const refused = async (questions: unknown, reason: string) => { const { error } = await f.ask(id, { text: 'Decide.', questions }) expect(error).toContain(reason) @@ -118,7 +118,7 @@ describe('questions on a message', () => { it('answers in the message numbering for every kind, with a note after the answers', async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const { message } = await f.ask(id, { text: 'Decide these.', questions: decisions }) expect(userActions).toEqual(['answer', 'dismiss']) await expect( @@ -166,7 +166,7 @@ describe('questions on a message', () => { it('sends a note on its own, and free text for a message without questions', async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const { message } = await f.ask(id, { text: 'Decide these.', questions: decisions }) await expect(f.answer({ messageId: message!.id, answers: [], note: ' ' })).rejects.toThrow( 'Invalid answers', @@ -193,9 +193,9 @@ describe('questions on a message', () => { ) }) - it("keeps @standing's open message open until its card answers it, naming it by its questions", async () => { + it("keeps @mainAgent's open message open until its card answers it, naming it by its questions", async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const { message } = await f.ask(id, { text: 'Decide these.', questions: decisions }) await f.type( f.opened.root.id, @@ -224,7 +224,7 @@ describe('questions on a message', () => { it('dismisses one open question with a one-way note that starts no run, leaving the others open', async () => { const f = await fixture() - const id = await f.standing() + const id = await f.mainAgent() const first = (await f.ask(id, { text: 'Keep it running?', questions: [decisions[2]] })) .message! const second = (await f.ask(id, { text: 'Which layout?' })).message! diff --git a/host/js/roster-fixture.ts b/host/js/roster-fixture.ts new file mode 100644 index 0000000..aeb90f0 --- /dev/null +++ b/host/js/roster-fixture.ts @@ -0,0 +1,25 @@ +/** Tests edit actual Markdown roster files while retaining a convenient in-memory fixture shape. */ +import {parse, stringify} from 'yaml'; +import {parseDefinition} from '../../extensions/core/agents'; +const directory='/etc/sausage/roster', path='/etc/sausage/config.yaml'; +export async function readTestConfig(fs:any) { + const config=parse(await fs.read(path)); + config.roster=[]; + for (const entry of await fs.list(directory)) { + if (!entry.name.endsWith('.md')) continue; + const definition=parseDefinition(await fs.read(`${directory}/${entry.name}`),`${directory}/${entry.name}`); + const {instructions,...fields}=definition; + config.roster.push({...fields,prompt:instructions}); + } + return config; +} +export async function writeTestConfig(fs:any, value:any) { + const {roster,...config}=value; + await fs.mkdir(directory); + for (const entry of await fs.list(directory)) if (entry.name.endsWith('.md')) await fs.remove(`${directory}/${entry.name}`); + for (const entry of roster) { + const {name,prompt,path: _path,...fields}=entry; + await fs.write(`${directory}/${name}.md`,`---\n${stringify(fields)}---\n\n${prompt}\n`); + } + await fs.write(path,stringify(config)); +} diff --git a/host/js/subagents-test-bundle.js b/host/js/subagents-test-bundle.js index e7354b2..7d72f6d 100644 --- a/host/js/subagents-test-bundle.js +++ b/host/js/subagents-test-bundle.js @@ -654,13 +654,13 @@ function lazyApi(load, capabilities) { } // node_modules/@earendil-works/pi-ai/dist/auth/context.js -var __rewriteRelativeImportExtension = function(path, preserveJsx) { - if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +var __rewriteRelativeImportExtension = function(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path; + return path2; }; var importNodeModule = (specifier) => import(__rewriteRelativeImportExtension(specifier)); function getProcessEnv() { @@ -673,10 +673,10 @@ function defaultProviderAuthContext() { const value2 = getProcessEnv()?.[name]; return typeof value2 === "string" && value2.trim().length > 0 ? value2 : void 0; }, - async fileExists(path) { + async fileExists(path2) { try { const fs2 = await importNodeModule("node:fs/promises"); - let resolved = path; + let resolved = path2; if (resolved.startsWith("~")) { const os = await importNodeModule("node:os"); resolved = os.homedir() + resolved.slice(1); @@ -859,7 +859,7 @@ async function resolveProviderAuthWithSignal(provider2, credentials, authContext function overlayEnvAuthContext(base, env) { return { env: async (name) => env[name] || await base.env(name), - fileExists: (path) => base.fileExists(path) + fileExists: (path2) => base.fileExists(path2) }; } var DEFAULT_OAUTH_MINIMUM_VALIDITY_MS = 5 * 60 * 1e3; @@ -2451,11 +2451,11 @@ var StreamingJsonParser = class { return; } const slot = this.#valueSlot(); - const path = this.#reportedPath(slot); - this.#string = { target: "value", slot, text: "", escape: "", path, change: void 0 }; + const path2 = this.#reportedPath(slot); + this.#string = { target: "value", slot, text: "", escape: "", path: path2, change: void 0 }; this.#place(slot, ""); - if (path !== void 0) - this.#string.change = this.#report({ kind: "set", path, value: "" }); + if (path2 !== void 0) + this.#string.change = this.#report({ kind: "set", path: path2, value: "" }); } /** The path of a value at `slot` in the innermost open container, when its changes are reported. */ #reportedPath(slot) { @@ -2540,9 +2540,9 @@ var StreamingJsonParser = class { const value2 = scalarValue(token); if (value2 !== void 0) { this.#place(slot, value2); - const path = this.#reportedPath(slot); - if (path !== void 0) - this.#report({ kind: "set", path, value: value2 }); + const path2 = this.#reportedPath(slot); + if (path2 !== void 0) + this.#report({ kind: "set", path: path2, value: value2 }); } this.#valueEnded(this.#stack.at(-1)); } @@ -2557,21 +2557,21 @@ var StreamingJsonParser = class { } #openContainer(container) { const slot = this.#valueSlot(); - const path = this.#reportedPath(slot); + const path2 = this.#reportedPath(slot); this.#place(slot, container); this.#stack.push({ container, slot, - path, - reportsInside: path !== void 0 && path.length < MAX_REPORTED_DEPTH, + path: path2, + reportsInside: path2 !== void 0 && path2.length < MAX_REPORTED_DEPTH, size: 0, key: void 0, phase: Array.isArray(container) ? "value" : "key" }); this.#pathCost += 1; this.#dirty = true; - if (path !== void 0) - this.#report({ kind: "set", path, value: Array.isArray(container) ? [] : {} }); + if (path2 !== void 0) + this.#report({ kind: "set", path: path2, value: Array.isArray(container) ? [] : {} }); } #closeContainer() { const frame = this.#stack.pop(); @@ -5215,11 +5215,11 @@ var Explainer = class { return this.c.check(node, base)(v); } // For $dynamicRef schemas this check runs outside the original dynamic scope, so their errors are approximate. - walk(node, base, v, path, out) { + walk(node, base, v, path2, out) { if (node === true) return; if (node === false) { - out.push({ path, keyword: "false", message: "no value is allowed here" }); + out.push({ path: path2, keyword: "false", message: "no value is allowed here" }); return; } if (!isSchemaObject(node)) @@ -5228,11 +5228,11 @@ var Explainer = class { if (this.ok(node, b, v)) return; const start2 = out.length; - const push = (keyword, message, at = path) => { + const push = (keyword, message, at = path2) => { out.push({ path: at, keyword, message }); }; if (this.c.draft === "7" && typeof node.$ref === "string") { - this.walkRef(node.$ref, b, v, path, out); + this.walkRef(node.$ref, b, v, path2, out); return; } if (node.type !== void 0) { @@ -5254,56 +5254,56 @@ var Explainer = class { if (typeof v === "number") this.walkNumber(node, v, push); if (isObject(v)) - this.walkObject(node, b, v, path, out, push); + this.walkObject(node, b, v, path2, out, push); if (Array.isArray(v)) - this.walkArray(node, b, v, path, out, push); + this.walkArray(node, b, v, path2, out, push); if (Array.isArray(node.allOf)) for (const s of node.allOf) - this.walk(s, b, v, path, out); + this.walk(s, b, v, path2, out); if (Array.isArray(node.anyOf)) - this.walkUnion(node.anyOf, b, v, path, out, false); + this.walkUnion(node.anyOf, b, v, path2, out, false); if (Array.isArray(node.oneOf)) - this.walkUnion(node.oneOf, b, v, path, out, true); + this.walkUnion(node.oneOf, b, v, path2, out, true); if (node.not !== void 0 && this.ok(node.not, b, v)) push("not", "must not match the schema in not"); if (node.if !== void 0) { const branch = this.ok(node.if, b, v) ? node.then : node.else; if (branch !== void 0) - this.walk(branch, b, v, path, out); + this.walk(branch, b, v, path2, out); } if (typeof node.$ref === "string") - this.walkRef(node.$ref, b, v, path, out); + this.walkRef(node.$ref, b, v, path2, out); if (out.length === start2 && (node.unevaluatedProperties !== void 0 || node.unevaluatedItems !== void 0)) { - this.walkUnevaluated(node, b, v, path, out); + this.walkUnevaluated(node, b, v, path2, out); } if (out.length === start2 && typeof node.$dynamicRef === "string") { push("$dynamicRef", "does not match the dynamically referenced schema"); } } - walkRef(ref, base, v, path, out) { + walkRef(ref, base, v, path2, out) { const target = this.c.r.resolve(ref, base); if (target.node === false && this.c.r.isUnresolved(ref, base)) { - out.push({ path, keyword: "$ref", message: `unresolved reference ${ref}` }); + out.push({ path: path2, keyword: "$ref", message: `unresolved reference ${ref}` }); return; } if (!isSchemaObject(target.node) || typeof v !== "object" || v === null) { - this.walk(target.node, target.base, v, path, out); + this.walk(target.node, target.base, v, path2, out); return; } this.memo ??= /* @__PURE__ */ new Map(); let values = this.memo.get(target.node); const known = values?.get(v); - if (known !== void 0 && known.path === path) { + if (known !== void 0 && known.path === path2) { out.push(...known.errors); return; } const errors = []; - this.walk(target.node, target.base, v, path, errors); + this.walk(target.node, target.base, v, path2, errors); if (values === void 0) { values = /* @__PURE__ */ new Map(); this.memo.set(target.node, values); } - values.set(v, { path, errors }); + values.set(v, { path: path2, errors }); out.push(...errors); } walkString(node, v, push) { @@ -5345,16 +5345,16 @@ var Explainer = class { push("multipleOf", `expected a multiple of ${node.multipleOf}`); } } - walkObject(node, b, v, path, out, push) { + walkObject(node, b, v, path2, out, push) { const properties = isSchemaObject(node.properties) ? node.properties : {}; const required = Array.isArray(node.required) ? node.required : []; for (const k of required) { if (typeof k === "string" && (!Object.hasOwn(v, k) || v[k] === void 0)) - push("required", "missing", pointer(path, k)); + push("required", "missing", pointer(path2, k)); } for (const k of Object.keys(properties)) { if (Object.hasOwn(v, k) && v[k] !== void 0) - this.walk(properties[k], b, v[k], pointer(path, k), out); + this.walk(properties[k], b, v[k], pointer(path2, k), out); } const patterns = isSchemaObject(node.patternProperties) ? Object.entries(node.patternProperties) : []; for (const k of Object.keys(v)) { @@ -5362,17 +5362,17 @@ var Explainer = class { for (const [p, s] of patterns) { if (sharedRegex(p).test(k)) { matched = true; - this.walk(s, b, v[k], pointer(path, k), out); + this.walk(s, b, v[k], pointer(path2, k), out); } } if (!matched && node.additionalProperties !== void 0) { if (node.additionalProperties === false) - push("additionalProperties", "unknown field", pointer(path, k)); + push("additionalProperties", "unknown field", pointer(path2, k)); else - this.walk(node.additionalProperties, b, v[k], pointer(path, k), out); + this.walk(node.additionalProperties, b, v[k], pointer(path2, k), out); } if (node.propertyNames !== void 0 && !this.ok(node.propertyNames, b, k)) { - push("propertyNames", "invalid property name", pointer(path, k)); + push("propertyNames", "invalid property name", pointer(path2, k)); } } const count = Object.keys(v).length; @@ -5390,19 +5390,19 @@ var Explainer = class { if (!Object.hasOwn(v, k)) continue; if (!Array.isArray(d)) - this.walk(d, b, v, path, out); + this.walk(d, b, v, path2, out); else for (const r of d) if (!Object.hasOwn(v, r)) - push("dependentRequired", `required when ${k} is present`, pointer(path, r)); + push("dependentRequired", `required when ${k} is present`, pointer(path2, r)); } if (this.c.draft !== "7" && isSchemaObject(node.dependentSchemas)) { for (const [k, s] of Object.entries(node.dependentSchemas)) if (Object.hasOwn(v, k)) - this.walk(s, b, v, path, out); + this.walk(s, b, v, path2, out); } } - walkArray(node, b, v, path, out, push) { + walkArray(node, b, v, path2, out, push) { let prefix = []; let rest; if (Array.isArray(node.items)) { @@ -5416,7 +5416,7 @@ var Explainer = class { for (let i = 0; i < v.length; i++) { const s = i < prefix.length ? prefix[i] : rest; if (s !== void 0) - this.walk(s, b, v[i], `${path}/${i}`, out); + this.walk(s, b, v[i], `${path2}/${i}`, out); } if (typeof node.minItems === "number" && v.length < node.minItems) { push("minItems", `expected at least ${node.minItems} items`); @@ -5435,13 +5435,13 @@ var Explainer = class { } } } - walkUnion(branches, b, v, path, out, exactlyOne) { + walkUnion(branches, b, v, path2, out, exactlyOne) { const matches = branches.filter((s) => this.ok(s, b, v)).length; if (matches === 1 || !exactlyOne && matches > 0) return; const keyword = exactlyOne ? "oneOf" : "anyOf"; if (matches > 1) { - out.push({ path, keyword, message: "matches more than one alternative" }); + out.push({ path: path2, keyword, message: "matches more than one alternative" }); return; } const tag = this.tagOf(branches, b); @@ -5449,18 +5449,18 @@ var Explainer = class { const i = tag.values.indexOf(v[tag.key]); if (i < 0) out.push({ - path: pointer(path, tag.key), + path: pointer(path2, tag.key), keyword, message: `expected one of ${listValues(tag.values)}` }); else - this.walk(branches[i], b, v, path, out); + this.walk(branches[i], b, v, path2, out); return; } let best; for (const s of branches) { const errors = []; - this.walk(s, b, v, path, errors); + this.walk(s, b, v, path2, errors); if (errors.length === 0) continue; const declared = isObject(v) ? this.declaredKeys(s, b, v) : 0; @@ -5468,7 +5468,7 @@ var Explainer = class { if (better) best = { errors, declared }; } - out.push(...best?.errors ?? [{ path, keyword, message: "matches no alternative" }]); + out.push(...best?.errors ?? [{ path: path2, keyword, message: "matches no alternative" }]); } /** How many of the keys of `v` the branch `s` (through a `$ref`) declares in `properties`. */ declaredKeys(s, b, v) { @@ -5492,7 +5492,7 @@ var Explainer = class { } return void 0; } - walkUnevaluated(node, b, v, path, out) { + walkUnevaluated(node, b, v, path2, out) { const { unevaluatedProperties: unevaluatedProperties2, unevaluatedItems: unevaluatedItems2, ...rest } = node; const a = newAnnotations(); this.c.annotating(rest, b)(v, a); @@ -5501,9 +5501,9 @@ var Explainer = class { if (a.props?.has(k)) continue; if (unevaluatedProperties2 === false) { - out.push({ path: pointer(path, k), keyword: "unevaluatedProperties", message: "unknown field" }); + out.push({ path: pointer(path2, k), keyword: "unevaluatedProperties", message: "unknown field" }); } else - this.walk(unevaluatedProperties2, b, v[k], pointer(path, k), out); + this.walk(unevaluatedProperties2, b, v[k], pointer(path2, k), out); } } if (Array.isArray(v) && unevaluatedItems2 !== void 0 && !a.allItems) { @@ -5511,9 +5511,9 @@ var Explainer = class { if (a.indexes?.has(i)) continue; if (unevaluatedItems2 === false) { - out.push({ path: `${path}/${i}`, keyword: "unevaluatedItems", message: "unexpected item" }); + out.push({ path: `${path2}/${i}`, keyword: "unevaluatedItems", message: "unexpected item" }); } else - this.walk(unevaluatedItems2, b, v[i], `${path}/${i}`, out); + this.walk(unevaluatedItems2, b, v[i], `${path2}/${i}`, out); } } } @@ -5532,8 +5532,8 @@ function containsMessage(min, max) { return `expected at most ${max} matching ${max === 1 ? "item" : "items"}`; return `expected between ${min} and ${max} matching items`; } -function pointer(path, key) { - return `${path}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`; +function pointer(path2, key) { + return `${path2}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`; } function typeName(v) { if (v === null) @@ -6243,11 +6243,11 @@ var emitOperation = (operations, operation) => { operations.push(operation); }; var isContainer = (value2) => value2 !== null && typeof value2 === "object"; -var emitSet = (path, value2, operations) => { - if (path.length === 0) +var emitSet = (path2, value2, operations) => { + if (path2.length === 0) emitOperation(operations, ["r", value2]); else - emitOperation(operations, ["s", path, value2]); + emitOperation(operations, ["s", path2, value2]); }; var equalJson = (left, right) => { if (left === right) @@ -6295,21 +6295,21 @@ var permutation = (before, after) => { } return result; }; -var emitString = (before, after, path, operations) => { +var emitString = (before, after, path2, operations) => { if (before === after) return; if (after.length > before.length && after.slice(0, before.length) === before) { - emitOperation(operations, ["a", path, ownedSlice2(after, before.length)]); + emitOperation(operations, ["a", path2, ownedSlice2(after, before.length)]); return; } const shared = overlap(before, after, DEFAULT_OVERLAP_SCAN); if (shared === 0) { - emitOperation(operations, ["s", path, after]); + emitOperation(operations, ["s", path2, after]); return; } - emitOperation(operations, ["t", path, before.length - shared]); + emitOperation(operations, ["t", path2, before.length - shared]); if (after.length > shared) - emitOperation(operations, ["a", path, ownedSlice2(after, shared)]); + emitOperation(operations, ["a", path2, ownedSlice2(after, shared)]); }; var MAX_IDENTITY_CANDIDATES = 2e5; var MAX_SEMANTIC_CELLS = 65536; @@ -6460,27 +6460,27 @@ var identityAnchors = (before, beforeStart, beforeEnd, after, afterStart, afterE matches.reverse(); return matches; }; -var processArrayMatches = (before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, matches) => { +var processArrayMatches = (before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, matches) => { let beforeAt = beforeStart; let afterAt = afterStart; let outputAt = outputStart; for (const [beforeMatch, afterMatch] of matches) { if (overflowedBatches.has(operations)) return; - diffArrayRegion(before, after, path, operations, beforeAt, beforeMatch, afterAt, afterMatch, outputAt); + diffArrayRegion(before, after, path2, operations, beforeAt, beforeMatch, afterAt, afterMatch, outputAt); outputAt += afterMatch - afterAt; if (!sameValue(before[beforeMatch], after[afterMatch])) { - diffValue(before[beforeMatch], after[afterMatch], [...path, outputAt], operations); + diffValue(before[beforeMatch], after[afterMatch], [...path2, outputAt], operations); } outputAt += 1; beforeAt = beforeMatch + 1; afterAt = afterMatch + 1; } if (!overflowedBatches.has(operations)) { - diffArrayRegion(before, after, path, operations, beforeAt, beforeEnd, afterAt, afterEnd, outputAt); + diffArrayRegion(before, after, path2, operations, beforeAt, beforeEnd, afterAt, afterEnd, outputAt); } }; -function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart) { +function diffArrayRegion(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart) { if (overflowedBatches.has(operations)) return; while (beforeStart < beforeEnd && afterStart < afterEnd && sameValue(before[beforeStart], after[afterStart])) { @@ -6497,7 +6497,7 @@ function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd if (beforeCount === 0 && afterCount === 0) return; if (beforeCount === 0 || afterCount === 0) { - emitOperation(operations, ["p", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); + emitOperation(operations, ["p", path2, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); return; } if (beforeCount === afterCount) { @@ -6508,83 +6508,83 @@ function diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd } } if (positional.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, positional); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, positional); return; } } const subsequence = identitySubsequence(before, beforeStart, beforeEnd, after, afterStart, afterEnd); if (subsequence !== void 0 && subsequence.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, subsequence); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, subsequence); return; } const identity = identityAnchors(before, beforeStart, beforeEnd, after, afterStart, afterEnd); if (identity.length > 0) { - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, identity); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, identity); return; } const semantic = lcsMatches(before.slice(beforeStart, beforeEnd), after.slice(afterStart, afterEnd), semanticallyAligned, MAX_SEMANTIC_CELLS); if (semantic !== void 0 && semantic.length > 0) { const absolute = semantic.map(([beforeIndex, afterIndex]) => [beforeStart + beforeIndex, afterStart + afterIndex]); - processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, absolute); + processArrayMatches(before, after, path2, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, absolute); return; } if (beforeCount === 1 && afterCount === 1) { - diffValue(before[beforeStart], after[afterStart], [...path, outputStart], operations); + diffValue(before[beforeStart], after[afterStart], [...path2, outputStart], operations); return; } - emitOperation(operations, ["p", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); + emitOperation(operations, ["p", path2, outputStart, beforeCount, after.slice(afterStart, afterEnd)]); } -var diffArray = (before, after, path, operations) => { +var diffArray = (before, after, path2, operations) => { if (before === after || equalJson(before, after)) return; if (before.length === after.length && before.length > 1 && !sameValue(before[0], after[0]) && !sameValue(before[before.length - 1], after[after.length - 1])) { const order = permutation(before, after); if (order !== void 0) { - emitOperation(operations, ["m", path, order]); + emitOperation(operations, ["m", path2, order]); return; } } - diffArrayRegion(before, after, path, operations, 0, before.length, 0, after.length, 0); + diffArrayRegion(before, after, path2, operations, 0, before.length, 0, after.length, 0); }; -var diffObject = (before, after, path, operations) => { +var diffObject = (before, after, path2, operations) => { const beforeKeys = Object.keys(before); const afterKeys = Object.keys(after); if ([...beforeKeys, ...afterKeys].some((key) => RESERVED_SEGMENTS.has(key))) { if (!equalJson(before, after)) - emitSet(path, after, operations); + emitSet(path2, after, operations); return; } for (const key of afterKeys) { if (overflowedBatches.has(operations)) return; if (Object.hasOwn(before, key)) - diffValue(before[key], after[key], [...path, key], operations); + diffValue(before[key], after[key], [...path2, key], operations); else - emitSet([...path, key], after[key], operations); + emitSet([...path2, key], after[key], operations); } for (const key of beforeKeys) { if (overflowedBatches.has(operations)) return; if (!Object.hasOwn(after, key)) - emitOperation(operations, ["d", [...path, key]]); + emitOperation(operations, ["d", [...path2, key]]); } }; -var diffValue = (before, after, path, operations) => { +var diffValue = (before, after, path2, operations) => { if (before === after || overflowedBatches.has(operations)) return; - if (typeof before === "string" && typeof after === "string" && path.length > 0) { - emitString(before, after, path, operations); + if (typeof before === "string" && typeof after === "string" && path2.length > 0) { + emitString(before, after, path2, operations); return; } if (Array.isArray(before) && Array.isArray(after)) { - diffArray(before, after, path, operations); + diffArray(before, after, path2, operations); return; } if (isContainer(before) && isContainer(after) && !Array.isArray(before) && !Array.isArray(after)) { - diffObject(before, after, path, operations); + diffObject(before, after, path2, operations); return; } - emitSet(path, after, operations); + emitSet(path2, after, operations); }; var jsonCost = (value2) => { if (value2 === null) @@ -6608,10 +6608,10 @@ var jsonCost = (value2) => { } return cost; }; -var pathCost = (path) => { +var pathCost = (path2) => { let cost = 2; - for (let index = 0; index < path.length; index++) { - const segment = path[index]; + for (let index = 0; index < path2.length; index++) { + const segment = path2[index]; cost += (typeof segment === "string" ? segment.length + 2 : String(segment).length) + (index === 0 ? 0 : 1); } return cost; @@ -6792,10 +6792,10 @@ function applyImmutableTrusted(target, operations) { permuteTrusted(copied2.target, operation[2]); continue; } - const path = operation[1]; - const copied = copyPath(root2, path, path.length - 1, owned); + const path2 = operation[1]; + const copied = copyPath(root2, path2, path2.length - 1, owned); root2 = copied.root; - const key = path[path.length - 1]; + const key = path2[path2.length - 1]; switch (operation[0]) { case "s": defineData2(copied.target, key, operation[2]); @@ -6826,7 +6826,7 @@ function applyImmutableTrusted(target, operations) { } return root2; } -function copyPath(root2, path, length, owned) { +function copyPath(root2, path2, length, owned) { if (!isContainer2(root2)) throw new TypeError("Trusted operation root is not a container"); let copiedRoot = root2; @@ -6836,7 +6836,7 @@ function copyPath(root2, path, length, owned) { } let destination = copiedRoot; for (let index = 0; index < length; index++) { - const segment = path[index]; + const segment = path2[index]; const child = read(destination, segment); if (!isContainer2(child)) throw new TypeError("Trusted operation path is not a container"); @@ -8303,8 +8303,8 @@ function emitOperations(context) { } const denseRegions = /* @__PURE__ */ new Map(); for (const [array, candidates] of denseIndices) { - const path = resolvePath(array); - if (path === void 0 || path.some((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment))) { + const path2 = resolvePath(array); + if (path2 === void 0 || path2.some((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment))) { continue; } const regions = buildDenseRegions(candidates); @@ -8312,50 +8312,50 @@ function emitOperations(context) { denseRegions.set(array, regions); } for (const node of context.dirty) { - const path = resolvePath(node); - if (path === void 0) + const path2 = resolvePath(node); + if (path2 === void 0) continue; - if (hasCoveringDenseRegion(node, path, denseRegions)) + if (hasCoveringDenseRegion(node, path2, denseRegions)) continue; - emissionPaths.set(node, path); + emissionPaths.set(node, path2); if (!Array.isArray(nodeBase(node)) && hasReservedMutation(node)) - forcedFolds.set(node, path); - const reservedAt = path.findIndex((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment)); + forcedFolds.set(node, path2); + const reservedAt = path2.findIndex((segment) => typeof segment === "string" && RESERVED_SEGMENTS.has(segment)); if (reservedAt >= 0) { let ancestor = node; - for (let depth = path.length; depth > reservedAt; depth--) + for (let depth = path2.length; depth > reservedAt; depth--) ancestor = nodeParent(ancestor); - forcedFolds.set(ancestor, path.slice(0, reservedAt)); + forcedFolds.set(ancestor, path2.slice(0, reservedAt)); } } - for (const [node, path] of forcedFolds) - emissionPaths.set(node, path); + for (const [node, path2] of forcedFolds) + emissionPaths.set(node, path2); for (const node of denseRegions.keys()) { - const path = resolvePath(node); - if (path !== void 0 && !hasCoveringDenseRegion(node, path, denseRegions)) - emissionPaths.set(node, path); + const path2 = resolvePath(node); + if (path2 !== void 0 && !hasCoveringDenseRegion(node, path2, denseRegions)) + emissionPaths.set(node, path2); } let maxDepth = 0; - for (const path of emissionPaths.values()) - maxDepth = Math.max(maxDepth, path.length); + for (const path2 of emissionPaths.values()) + maxDepth = Math.max(maxDepth, path2.length); const buckets = Array.from({ length: maxDepth + 1 }, () => []); - for (const [node, path] of emissionPaths) - buckets[path.length].push(node); + for (const [node, path2] of emissionPaths) + buckets[path2.length].push(node); const folded = /* @__PURE__ */ new Set(); for (const bucket of buckets) { for (const node of bucket) { - const path = emissionPaths.get(node); + const path2 = emissionPaths.get(node); if (hasPlacementAncestor(node) || hasFoldedAncestor(node, folded)) continue; if (forcedFolds.has(node)) { - emitSet2(operations, path, cloneNode(node)); + emitSet2(operations, path2, cloneNode(node)); folded.add(node); continue; } if (Array.isArray(nodeBase(node))) - emitArrayOperations(node, path, operations, denseRegions.get(node)); + emitArrayOperations(node, path2, operations, denseRegions.get(node)); else - emitObjectOperations(node, path, operations); + emitObjectOperations(node, path2, operations); if (operations.length > MAX_DELTA_OPERATIONS2) { locatedDenseArray = void 0; return [["r", cloneNode(context.root)]]; @@ -8374,10 +8374,10 @@ function emitSimpleObjectOperations(context) { if (Array.isArray(nodeBase(parent))) return void 0; } - const path = resolvePath(node); - if (path === void 0) + const path2 = resolvePath(node); + if (path2 === void 0) continue; - for (const segment of path) { + for (const segment of path2) { if (typeof segment === "string" && RESERVED_SEGMENTS.has(segment)) return void 0; } @@ -8428,24 +8428,24 @@ function locateDenseArrayPosition(node) { } return false; } -function hasCoveringDenseRegion(node, path, denseRegions) { +function hasCoveringDenseRegion(node, path2, denseRegions) { for (let parent = nodeParent(node); parent !== void 0; parent = nodeParent(parent)) { const regions = denseRegions.get(parent); if (regions === void 0) continue; const parentPath = resolvePath(parent); - if (parentPath === void 0 || path.length <= parentPath.length) + if (parentPath === void 0 || path2.length <= parentPath.length) continue; let matches = true; for (let index2 = 0; index2 < parentPath.length; index2++) { - if (path[index2] !== parentPath[index2]) { + if (path2[index2] !== parentPath[index2]) { matches = false; break; } } if (!matches) continue; - const index = path[parentPath.length]; + const index = path2[parentPath.length]; if (typeof index === "number" && regionContaining(regions, index)) return true; } @@ -8539,8 +8539,8 @@ function hasPlacementAncestor(node) { } return false; } -function emitObjectWrite(node, path, operations, key, value2) { - const nextPath = [...path, key]; +function emitObjectWrite(node, path2, operations, key, value2) { + const nextPath = [...path2, key]; const appended = node.appends?.get(key); if (appended !== void 0) { operations.push(["a", nextPath, appended]); @@ -8551,33 +8551,33 @@ function emitObjectWrite(node, path, operations, key, value2) { const emitted = emitChangedValue(operations, nextPath, before, after); return isContainer3(before) && isContainer3(after) && !emitted; } -function emitObjectOperations(node, path, operations) { +function emitObjectOperations(node, path2, operations) { if (node.readded !== void 0) { for (const key of node.readded) { if (Object.hasOwn(nodeBase(node), key)) - operations.push(["d", [...path, key]]); + operations.push(["d", [...path2, key]]); } } let normalizedContainerWrite = false; if (node.writeKey !== void 0) - normalizedContainerWrite = emitObjectWrite(node, path, operations, node.writeKey, objectValue(node, node.writeKey)); + normalizedContainerWrite = emitObjectWrite(node, path2, operations, node.writeKey, objectValue(node, node.writeKey)); if (node.writes !== void 0) { for (const [key, valueIndex] of node.writes) { if (operations.length > MAX_DELTA_OPERATIONS2) return normalizedContainerWrite; - if (emitObjectWrite(node, path, operations, key, storedValue(node.context, valueIndex))) + if (emitObjectWrite(node, path2, operations, key, storedValue(node.context, valueIndex))) normalizedContainerWrite = true; } } if (node.deleteKey !== void 0 && Object.hasOwn(nodeBase(node), node.deleteKey)) { - operations.push(["d", [...path, node.deleteKey]]); + operations.push(["d", [...path2, node.deleteKey]]); } if (node.deletes !== void 0) { for (const key of node.deletes) { if (operations.length > MAX_DELTA_OPERATIONS2) return normalizedContainerWrite; if (Object.hasOwn(nodeBase(node), key)) - operations.push(["d", [...path, key]]); + operations.push(["d", [...path2, key]]); } } return normalizedContainerWrite; @@ -8673,14 +8673,14 @@ function rangeLength(pieces, start2, end) { length += pieces[index].length; return length; } -function emitArrayOperations(node, path, operations, denseRegions) { +function emitArrayOperations(node, path2, operations, denseRegions) { const overlay = arrayOverlay(node); const base = nodeBase(node); if (denseRegions !== void 0) { for (const region of denseRegions) { if (operations.length > MAX_DELTA_OPERATIONS2) return; - operations.push(["p", path, region.start, region.length, cloneArrayRegion(node, region)]); + operations.push(["p", path2, region.start, region.length, cloneArrayRegion(node, region)]); } } if (overlay.structural) { @@ -8688,10 +8688,10 @@ function emitArrayOperations(node, path, operations, denseRegions) { for (let index = 0; index < plan.removeRuns.length; index += 2) { if (operations.length > MAX_DELTA_OPERATIONS2) return; - operations.push(["p", path, plan.removeRuns[index], plan.removeRuns[index + 1], []]); + operations.push(["p", path2, plan.removeRuns[index], plan.removeRuns[index + 1], []]); } if (plan.permutation !== void 0) - operations.push(["m", path, plan.permutation]); + operations.push(["m", path2, plan.permutation]); const pieces = piecesOf(overlay); for (let run2 = 0; run2 < plan.insertRuns.length; run2 += 3) { if (operations.length > MAX_DELTA_OPERATIONS2) @@ -8705,7 +8705,7 @@ function emitArrayOperations(node, path, operations, denseRegions) { items.push(cloneStored(entryValueAt(node, piece, sourceIndex), node.context)); } } - operations.push(["p", path, logicalIndex, 0, items]); + operations.push(["p", path2, logicalIndex, 0, items]); } } for (const [baseIndex, valueIndex] of overlay.baseOverrides ?? []) { @@ -8714,7 +8714,7 @@ function emitArrayOperations(node, path, operations, denseRegions) { const index = findEntryIndex(overlay, 1, baseIndex, void 0); if (index === void 0 || denseRegions !== void 0 && regionContaining(denseRegions, index)) continue; - emitChangedValue(operations, [...path, index], base[baseIndex], cloneStored(storedValue(node.context, valueIndex), node.context)); + emitChangedValue(operations, [...path2, index], base[baseIndex], cloneStored(storedValue(node.context, valueIndex), node.context)); } } function cloneArrayRegion(node, region) { @@ -8727,32 +8727,32 @@ function cloneArrayRegion(node, region) { } return result; } -function emitChangedValue(operations, path, before, after) { +function emitChangedValue(operations, path2, before, after) { if (!isContainer3(after) && before === after) return false; if (isContainer3(before) && isContainer3(after) && equalTrustedJson(before, after)) return false; if (typeof before === "string" && typeof after === "string") { if (after.length > before.length && after.slice(0, before.length) === before) { - operations.push(["a", path, ownedSlice2(after, before.length)]); + operations.push(["a", path2, ownedSlice2(after, before.length)]); return true; } const shared = overlap(before, after, 65536); if (shared > 0) { - operations.push(["t", path, before.length - shared]); + operations.push(["t", path2, before.length - shared]); if (after.length > shared) - operations.push(["a", path, ownedSlice2(after, shared)]); + operations.push(["a", path2, ownedSlice2(after, shared)]); return true; } } - operations.push(["s", path, after]); + operations.push(["s", path2, after]); return true; } -function emitSet2(operations, path, value2) { - if (path.length === 0) +function emitSet2(operations, path2, value2) { + if (path2.length === 0) operations.push(["r", value2]); else - operations.push(["s", path, value2]); + operations.push(["s", path2, value2]); } function resolvePath(node) { if (node.preparedPath !== void 0) @@ -9042,8 +9042,8 @@ function mergeLeaf(op2, folding) { folding.leaves.set(key, folding.ops.length); return false; } -function pathKey(path) { - return JSON.stringify(path); +function pathKey(path2) { + return JSON.stringify(path2); } function merge2(previous, next) { if (next[0] === "s") @@ -9245,8 +9245,8 @@ function assertValidWireOp(op2) { throw new TypeError(`unknown op verb: ${String(verb)}`); } } -function assertSafePath(path) { - for (const seg of path) { +function assertSafePath(path2) { + for (const seg of path2) { if (typeof seg === "string") { if (RESERVED_SEGMENTS.has(seg)) throw new UnsafePathError(seg); @@ -9261,9 +9261,9 @@ function assertIndexInRange(parent, index) { } var PathError = class extends Error { path; - constructor(path) { - super(`unresolvable path: ${JSON.stringify(path)}`); - this.path = path; + constructor(path2) { + super(`unresolvable path: ${JSON.stringify(path2)}`); + this.path = path2; this.name = "PathError"; } }; @@ -9278,12 +9278,12 @@ function applyOps(target, ops3) { root2 = op2[1]; continue; } - const path = op2[1]; - assertSafePath(path); + const path2 = op2[1]; + assertSafePath(path2); if (op2[0] === "p") { - const target_ = path.length === 0 ? root2 : resolve(root2, path); + const target_ = path2.length === 0 ? root2 : resolve(root2, path2); if (!Array.isArray(target_)) - throw new PathError(path); + throw new PathError(path2); target_.splice(op2[2], op2[3]); const chunkSize = 1e4; for (let offset = 0; offset < op2[4].length; offset += chunkSize) { @@ -9292,16 +9292,16 @@ function applyOps(target, ops3) { continue; } if (op2[0] === "m") { - const target_ = path.length === 0 ? root2 : resolve(root2, path); + const target_ = path2.length === 0 ? root2 : resolve(root2, path2); if (!Array.isArray(target_) || target_.length !== op2[2].length) - throw new PathError(path); + throw new PathError(path2); const previous = target_.slice(); for (let index = 0; index < op2[2].length; index++) target_[index] = previous[op2[2][index]]; continue; } - const parent = resolve(root2, path.slice(0, -1)); - const key = path[path.length - 1]; + const parent = resolve(root2, path2.slice(0, -1)); + const key = path2[path2.length - 1]; if (Array.isArray(parent)) { if (typeof key !== "number") throw new UnsafePathError(key); @@ -9318,7 +9318,7 @@ function applyOps(target, ops3) { case "d": if (Array.isArray(parent)) { if (typeof key !== "number" || key >= parent.length) - throw new PathError(path); + throw new PathError(path2); parent.splice(key, 1); } else delete parent[key]; @@ -9326,14 +9326,14 @@ function applyOps(target, ops3) { case "a": { const current = read2(); if (typeof current !== "string") - throw new PathError(path); + throw new PathError(path2); write(`${current}${op2[2]}`); break; } case "t": { const current = read2(); if (typeof current !== "string") - throw new PathError(path); + throw new PathError(path2); write(current.slice(op2[2])); break; } @@ -9368,11 +9368,11 @@ function applyImmutableBatches(target, batches) { return root2; } function appendCopy(root2, op2, owned) { - const [, path, index, deleteCount, items] = op2; + const [, path2, index, deleteCount, items] = op2; if (deleteCount !== 0) return void 0; let target = root2; - for (const segment of path) { + for (const segment of path2) { const valid = typeof segment === "string" ? !RESERVED_SEGMENTS.has(segment) && isObj(target) && !Array.isArray(target) : Number.isInteger(segment) && segment >= 0 && Array.isArray(target); if (!valid || !Object.hasOwn(target, segment)) return void 0; @@ -9382,11 +9382,11 @@ function appendCopy(root2, op2, owned) { return void 0; const appended = target.concat(items); owned.add(appended); - if (path.length === 0) + if (path2.length === 0) return appended; - const parentPath = path.slice(0, -1); + const parentPath = path2.slice(0, -1); const copiedRoot = copyContainers(root2, parentPath, owned); - Object.defineProperty(resolve(copiedRoot, parentPath), path[path.length - 1], { + Object.defineProperty(resolve(copiedRoot, parentPath), path2[path2.length - 1], { value: appended, writable: true, enumerable: true, @@ -9394,16 +9394,16 @@ function appendCopy(root2, op2, owned) { }); return copiedRoot; } -function copyContainers(root2, path, owned) { +function copyContainers(root2, path2, owned) { const copy2 = (value2) => { if (Array.isArray(value2)) return value2.slice(); if (!isObj(value2)) - throw new PathError(path); + throw new PathError(path2); return Object.getPrototypeOf(value2) === null ? Object.assign(/* @__PURE__ */ Object.create(null), value2) : { ...value2 }; }; if (!isObj(root2)) - throw new PathError(path); + throw new PathError(path2); let copiedRoot; if (owned.has(root2)) copiedRoot = root2; @@ -9412,14 +9412,14 @@ function copyContainers(root2, path, owned) { owned.add(copiedRoot); } let destination = copiedRoot; - for (const segment of path) { + for (const segment of path2) { if (!Object.hasOwn(destination, segment)) - throw new PathError(path); + throw new PathError(path2); if (Array.isArray(destination) && typeof segment !== "number") throw new UnsafePathError(segment); const child = destination[segment]; if (!isObj(child)) - throw new PathError(path); + throw new PathError(path2); if (owned.has(child)) { destination = child; continue; @@ -9436,26 +9436,26 @@ function copyContainers(root2, path, owned) { } return copiedRoot; } -function resolveValue(root2, path) { +function resolveValue(root2, path2) { let node = root2; - for (const seg of path) { + for (const seg of path2) { if (!isObj(node)) - throw new PathError(path); + throw new PathError(path2); if (Array.isArray(node) && typeof seg !== "number") throw new UnsafePathError(seg); if (!Object.hasOwn(node, seg)) - throw new PathError(path); + throw new PathError(path2); node = node[seg]; } return node; } -function resolve(root2, path) { - const node = resolveValue(root2, path); +function resolve(root2, path2) { + const node = resolveValue(root2, path2); if (!isObj(node)) - throw new PathError(path); + throw new PathError(path2); return node; } -var pathKey2 = (path) => JSON.stringify(path); +var pathKey2 = (path2) => JSON.stringify(path2); function encoder() { const seen = /* @__PURE__ */ new Set(); const ids = /* @__PURE__ */ new Map(); @@ -9474,8 +9474,8 @@ function encoder() { previous = void 0; continue; } - const path = op2[1]; - const key = pathKey2(path); + const path2 = op2[1]; + const key = pathKey2(path2); if (key === previous) { switch (op2[0]) { case "s": @@ -9499,14 +9499,14 @@ function encoder() { } continue; } - let ref = path; + let ref = path2; const existing = ids.get(key); if (existing !== void 0) { ref = existing; } else if (seen.has(key)) { const id = nextId++; ids.set(key, id); - out.push(["#", id, path]); + out.push(["#", id, path2]); ref = id; } else { seen.add(key); @@ -9557,45 +9557,45 @@ function decoder() { continue; } const short = op2[0] === "d" && op2.length === 1 || op2[0] !== "d" && op2[0] !== "p" && op2.length === 2 || op2[0] === "p" && op2.length === 4; - let path; + let path2; if (short) { if (previous === void 0) throw new PathError([]); - path = previous; + path2 = previous; } else { const ref = op2[1]; if (typeof ref === "number") { const resolved = paths.get(ref); if (resolved === void 0) throw new PathError(ref); - path = resolved; + path2 = resolved; } else { - path = ref; + path2 = ref; } - previous = path; + previous = path2; } - if (op2[0] !== "p" && op2[0] !== "m" && path.length === 0) - throw new PathError(path); + if (op2[0] !== "p" && op2[0] !== "m" && path2.length === 0) + throw new PathError(path2); switch (op2[0]) { case "s": - out.push(["s", path, short ? op2[1] : op2[2]]); + out.push(["s", path2, short ? op2[1] : op2[2]]); break; case "d": - out.push(["d", path]); + out.push(["d", path2]); break; case "a": - out.push(["a", path, short ? op2[1] : op2[2]]); + out.push(["a", path2, short ? op2[1] : op2[2]]); break; case "t": - out.push(["t", path, short ? op2[1] : op2[2]]); + out.push(["t", path2, short ? op2[1] : op2[2]]); break; case "p": { const [i, r, items] = short ? [op2[1], op2[2], op2[3]] : [op2[2], op2[3], op2[4]]; - out.push(["p", path, i, r, items]); + out.push(["p", path2, i, r, items]); break; } case "m": - out.push(["m", path, short ? op2[1] : op2[2]]); + out.push(["m", path2, short ? op2[1] : op2[2]]); break; } } @@ -9720,21 +9720,21 @@ function unbox(ops3, value2) { for (const op2 of ops3) { if (op2[0] === "r" || op2[1].length === 0) return [["r", value2]]; - const path = op2[1].slice(1); + const path2 = op2[1].slice(1); switch (op2[0]) { case "p": - result.push(["p", path, op2[2], op2[3], op2[4]]); + result.push(["p", path2, op2[2], op2[3], op2[4]]); break; case "m": - result.push(["m", path, op2[2]]); + result.push(["m", path2, op2[2]]); break; default: - if (path.length === 0) + if (path2.length === 0) return [["r", value2]]; if (op2[0] === "d") - result.push(["d", path]); + result.push(["d", path2]); else - result.push([op2[0], path, op2[2]]); + result.push([op2[0], path2, op2[2]]); } } return result; @@ -23031,7 +23031,7 @@ var TaskScheduler = class { from.set(id, via); pending.push(id); }; - const path = (end) => { + const path2 = (end) => { const steps = []; for (let at = end; at !== void 0; at = from.get(at)) steps.unshift(at); @@ -23041,7 +23041,7 @@ var TaskScheduler = class { reach(id, void 0); for (let id = pending.pop(); id !== void 0; id = pending.pop()) { if (id === task) - return path(id); + return path2(id); const record2 = overlay.tasks.get(id) ?? this.#liveRecord(id); if (record2 === void 0 || record2.state.status === "terminal") continue; @@ -24958,8 +24958,8 @@ function structuredOutputError(tool, result) { if (validator.check(value2)) return void 0; const [first] = validator.errors(value2); - const path = first?.path.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") || "root"; - return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path}: ${first?.message ?? "invalid"}`; + const path2 = first?.path.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") || "root"; + return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path2}: ${first?.message ?? "invalid"}`; } async function settle2(runtime, input, call2, ending, result, context, durationMs) { const nestedIds = (await runtime.ownedTasks(context)).filter((record2) => record2.kind === ToolTask.definition.name && record2.input.kind === "nested").map((record2) => record2.id); @@ -27193,19 +27193,19 @@ function advance2(id, mount, publication, context, report2) { const kind = change.record.kind; if (!MOUNTED_KINDS.has(kind) || change.record.key !== void 0) continue; - const path = ["docs", kind]; + const path2 = ["docs", kind]; const mounted = mount.incarnations.get(kind); if (change.kind === "retire") { if (mounted?.id !== change.record.id) continue; mount.incarnations.delete(kind); - docOps.push(["d", path]); + docOps.push(["d", path2]); } else if (mounted?.id === change.record.id && mounted.version === change.version) { for (const op2 of change.ops) - docOps.push(prefixed(op2, path)); + docOps.push(prefixed(op2, path2)); } else { mount.incarnations.set(kind, { id: change.record.id, version: change.version }); - docOps.push(["s", path, change.value]); + docOps.push(["s", path2, change.value]); } } if (docOps.length === 0 && appended.length === 0) @@ -27235,7 +27235,7 @@ function advance2(id, mount, publication, context, report2) { } } function prefixed(op2, prefix) { - const at = (path) => [...prefix, ...path]; + const at = (path2) => [...prefix, ...path2]; switch (op2[0]) { case "r": return ["s", prefix, op2[1]]; @@ -28752,17 +28752,17 @@ function visit(node, visitor) { visit.BREAK = BREAK; visit.SKIP = SKIP; visit.REMOVE = REMOVE; -function visit_(key, node, visitor, path) { - const ctrl = callVisitor(key, node, visitor, path); +function visit_(key, node, visitor, path2) { + const ctrl = callVisitor(key, node, visitor, path2); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visit_(key, ctrl, visitor, path); + replaceNode(key, path2, ctrl); + return visit_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path = Object.freeze(path.concat(node)); + path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = visit_(i, node.items[i], visitor, path); + const ci = visit_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -28773,13 +28773,13 @@ function visit_(key, node, visitor, path) { } } } else if (isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = visit_("key", node.key, visitor, path); + path2 = Object.freeze(path2.concat(node)); + const ck = visit_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = visit_("value", node.value, visitor, path); + const cv = visit_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -28800,17 +28800,17 @@ async function visitAsync(node, visitor) { visitAsync.BREAK = BREAK; visitAsync.SKIP = SKIP; visitAsync.REMOVE = REMOVE; -async function visitAsync_(key, node, visitor, path) { - const ctrl = await callVisitor(key, node, visitor, path); +async function visitAsync_(key, node, visitor, path2) { + const ctrl = await callVisitor(key, node, visitor, path2); if (isNode(ctrl) || isPair(ctrl)) { - replaceNode(key, path, ctrl); - return visitAsync_(key, ctrl, visitor, path); + replaceNode(key, path2, ctrl); + return visitAsync_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (isCollection(node)) { - path = Object.freeze(path.concat(node)); + path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { - const ci = await visitAsync_(i, node.items[i], visitor, path); + const ci = await visitAsync_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) @@ -28821,13 +28821,13 @@ async function visitAsync_(key, node, visitor, path) { } } } else if (isPair(node)) { - path = Object.freeze(path.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path); + path2 = Object.freeze(path2.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path); + const cv = await visitAsync_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -28854,23 +28854,23 @@ function initVisitor(visitor) { } return visitor; } -function callVisitor(key, node, visitor, path) { +function callVisitor(key, node, visitor, path2) { if (typeof visitor === "function") - return visitor(key, node, path); + return visitor(key, node, path2); if (isMap(node)) - return visitor.Map?.(key, node, path); + return visitor.Map?.(key, node, path2); if (isSeq(node)) - return visitor.Seq?.(key, node, path); + return visitor.Seq?.(key, node, path2); if (isPair(node)) - return visitor.Pair?.(key, node, path); + return visitor.Pair?.(key, node, path2); if (isScalar(node)) - return visitor.Scalar?.(key, node, path); + return visitor.Scalar?.(key, node, path2); if (isAlias(node)) - return visitor.Alias?.(key, node, path); + return visitor.Alias?.(key, node, path2); return void 0; } -function replaceNode(key, path, node) { - const parent = path[path.length - 1]; +function replaceNode(key, path2, node) { + const parent = path2[path2.length - 1]; if (isCollection(parent)) { parent.items[key] = node; } else if (isPair(parent)) { @@ -29401,10 +29401,10 @@ function createNode2(value2, tagName, ctx) { } // node_modules/yaml/browser/dist/nodes/Collection.js -function collectionFromPath(schema4, path, value2) { +function collectionFromPath(schema4, path2, value2) { let v = value2; - for (let i = path.length - 1; i >= 0; --i) { - const k = path[i]; + for (let i = path2.length - 1; i >= 0; --i) { + const k = path2[i]; if (typeof k === "number" && Number.isInteger(k) && k >= 0) { const a = []; a[k] = v; @@ -29423,7 +29423,7 @@ function collectionFromPath(schema4, path, value2) { sourceObjects: /* @__PURE__ */ new Map() }); } -var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done; +var isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done; var Collection = class extends NodeBase { constructor(type, schema4) { super(type); @@ -29453,11 +29453,11 @@ var Collection = class extends NodeBase { * be a Pair instance or a `{ key, value }` object, which may not have a key * that already exists in the map. */ - addIn(path, value2) { - if (isEmptyPath(path)) + addIn(path2, value2) { + if (isEmptyPath(path2)) this.add(value2); else { - const [key, ...rest] = path; + const [key, ...rest] = path2; const node = this.get(key, true); if (isCollection(node)) node.addIn(rest, value2); @@ -29471,8 +29471,8 @@ var Collection = class extends NodeBase { * Removes a value from the collection. * @returns `true` if the item was found and removed. */ - deleteIn(path) { - const [key, ...rest] = path; + deleteIn(path2) { + const [key, ...rest] = path2; if (rest.length === 0) return this.delete(key); const node = this.get(key, true); @@ -29486,8 +29486,8 @@ var Collection = class extends NodeBase { * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ - getIn(path, keepScalar) { - const [key, ...rest] = path; + getIn(path2, keepScalar) { + const [key, ...rest] = path2; const node = this.get(key, true); if (rest.length === 0) return !keepScalar && isScalar(node) ? node.value : node; @@ -29505,8 +29505,8 @@ var Collection = class extends NodeBase { /** * Checks if the collection includes a value with the key `key`. */ - hasIn(path) { - const [key, ...rest] = path; + hasIn(path2) { + const [key, ...rest] = path2; if (rest.length === 0) return this.has(key); const node = this.get(key, true); @@ -29516,8 +29516,8 @@ var Collection = class extends NodeBase { * Sets a value in this collection. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ - setIn(path, value2) { - const [key, ...rest] = path; + setIn(path2, value2) { + const [key, ...rest] = path2; if (rest.length === 0) { this.set(key, value2); } else { @@ -31656,9 +31656,9 @@ var Document = class _Document { this.contents.add(value2); } /** Adds a value to the document. */ - addIn(path, value2) { + addIn(path2, value2) { if (assertCollection(this.contents)) - this.contents.addIn(path, value2); + this.contents.addIn(path2, value2); } /** * Create a new `Alias` node, ensuring that the target `node` has the required anchor. @@ -31733,14 +31733,14 @@ var Document = class _Document { * Removes a value from the document. * @returns `true` if the item was found and removed. */ - deleteIn(path) { - if (isEmptyPath(path)) { + deleteIn(path2) { + if (isEmptyPath(path2)) { if (this.contents == null) return false; this.contents = null; return true; } - return assertCollection(this.contents) ? this.contents.deleteIn(path) : false; + return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false; } /** * Returns item at `key`, or `undefined` if not found. By default unwraps @@ -31755,10 +31755,10 @@ var Document = class _Document { * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ - getIn(path, keepScalar) { - if (isEmptyPath(path)) + getIn(path2, keepScalar) { + if (isEmptyPath(path2)) return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents; - return isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0; + return isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0; } /** * Checks if the document includes a value with the key `key`. @@ -31769,10 +31769,10 @@ var Document = class _Document { /** * Checks if the document includes a value at `path`. */ - hasIn(path) { - if (isEmptyPath(path)) + hasIn(path2) { + if (isEmptyPath(path2)) return this.contents !== void 0; - return isCollection(this.contents) ? this.contents.hasIn(path) : false; + return isCollection(this.contents) ? this.contents.hasIn(path2) : false; } /** * Sets a value in this document. For `!!set`, `value` needs to be a @@ -31789,13 +31789,13 @@ var Document = class _Document { * Sets a value in this document. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ - setIn(path, value2) { - if (isEmptyPath(path)) { + setIn(path2, value2) { + if (isEmptyPath(path2)) { this.contents = value2; } else if (this.contents == null) { - this.contents = collectionFromPath(this.schema, Array.from(path), value2); + this.contents = collectionFromPath(this.schema, Array.from(path2), value2); } else if (assertCollection(this.contents)) { - this.contents.setIn(path, value2); + this.contents.setIn(path2, value2); } } /** @@ -33592,9 +33592,9 @@ function visit2(cst, visitor) { visit2.BREAK = BREAK2; visit2.SKIP = SKIP2; visit2.REMOVE = REMOVE2; -visit2.itemAtPath = (cst, path) => { +visit2.itemAtPath = (cst, path2) => { let item = cst; - for (const [field, index] of path) { + for (const [field, index] of path2) { const tok = item?.[field]; if (tok && "items" in tok) { item = tok.items[index]; @@ -33603,23 +33603,23 @@ visit2.itemAtPath = (cst, path) => { } return item; }; -visit2.parentCollection = (cst, path) => { - const parent = visit2.itemAtPath(cst, path.slice(0, -1)); - const field = path[path.length - 1][0]; +visit2.parentCollection = (cst, path2) => { + const parent = visit2.itemAtPath(cst, path2.slice(0, -1)); + const field = path2[path2.length - 1][0]; const coll = parent?.[field]; if (coll && "items" in coll) return coll; throw new Error("Parent collection not found"); }; -function _visit(path, item, visitor) { - let ctrl = visitor(item, path); +function _visit(path2, item, visitor) { + let ctrl = visitor(item, path2); if (typeof ctrl === "symbol") return ctrl; for (const field of ["key", "value"]) { const token = item[field]; if (token && "items" in token) { for (let i = 0; i < token.items.length; ++i) { - const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor); + const ci = _visit(Object.freeze(path2.concat([[field, i]])), token.items[i], visitor); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK2) @@ -33630,10 +33630,10 @@ function _visit(path, item, visitor) { } } if (typeof ctrl === "function" && field === "key") - ctrl = ctrl(item, path); + ctrl = ctrl(item, path2); } } - return typeof ctrl === "function" ? ctrl(item, path) : ctrl; + return typeof ctrl === "function" ? ctrl(item, path2) : ctrl; } // node_modules/yaml/browser/dist/parse/cst.js @@ -35508,16 +35508,16 @@ var Diff = class { } } } - addToPath(path, added, removed, oldPosInc, options) { - const last = path.lastComponent; + addToPath(path2, added, removed, oldPosInc, options) { + const last = path2.lastComponent; if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { return { - oldPos: path.oldPos + oldPosInc, + oldPos: path2.oldPos + oldPosInc, lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent } }; } else { return { - oldPos: path.oldPos + oldPosInc, + oldPos: path2.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, previousComponent: last } }; } @@ -35974,38 +35974,38 @@ function countOccurrences(content, oldText) { const fuzzyOldText = normalizeForFuzzyMatch(oldText); return fuzzyContent.split(fuzzyOldText).length - 1; } -function getNotFoundError(path, editIndex, totalEdits) { +function getNotFoundError(path2, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`); + return new Error(`Could not find the exact text in ${path2}. The old text must match exactly including all whitespace and newlines.`); } - return new Error(`Could not find edits[${editIndex}] in ${path}. The oldText must match exactly including all whitespace and newlines.`); + return new Error(`Could not find edits[${editIndex}] in ${path2}. The oldText must match exactly including all whitespace and newlines.`); } -function getDuplicateError(path, editIndex, totalEdits, occurrences) { +function getDuplicateError(path2, editIndex, totalEdits, occurrences) { if (totalEdits === 1) { - return new Error(`Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of the text in ${path2}. The text must be unique. Please provide more context to make it unique.`); } - return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path}. Each oldText must be unique. Please provide more context to make it unique.`); + return new Error(`Found ${occurrences} occurrences of edits[${editIndex}] in ${path2}. Each oldText must be unique. Please provide more context to make it unique.`); } -function getEmptyOldTextError(path, editIndex, totalEdits) { +function getEmptyOldTextError(path2, editIndex, totalEdits) { if (totalEdits === 1) { - return new Error(`oldText must not be empty in ${path}.`); + return new Error(`oldText must not be empty in ${path2}.`); } - return new Error(`edits[${editIndex}].oldText must not be empty in ${path}.`); + return new Error(`edits[${editIndex}].oldText must not be empty in ${path2}.`); } -function getNoChangeError(path, totalEdits) { +function getNoChangeError(path2, totalEdits) { if (totalEdits === 1) { - return new Error(`No changes made to ${path}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); + return new Error(`No changes made to ${path2}. The replacement produced identical content. This might indicate an issue with special characters or the text not existing as expected.`); } - return new Error(`No changes made to ${path}. The replacements produced identical content.`); + return new Error(`No changes made to ${path2}. The replacements produced identical content.`); } -function applyEditsToNormalizedContent(normalizedContent, edits, path) { +function applyEditsToNormalizedContent(normalizedContent, edits, path2) { const normalizedEdits = edits.map((edit) => ({ oldText: normalizeToLF(edit.oldText), newText: normalizeToLF(edit.newText) })); for (let i = 0; i < normalizedEdits.length; i++) { if (normalizedEdits[i].oldText.length === 0) { - throw getEmptyOldTextError(path, i, normalizedEdits.length); + throw getEmptyOldTextError(path2, i, normalizedEdits.length); } } const initialMatches = normalizedEdits.map((edit) => fuzzyFindText(normalizedContent, edit.oldText)); @@ -36016,11 +36016,11 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path) { const edit = normalizedEdits[i]; const matchResult = fuzzyFindText(replacementBaseContent, edit.oldText); if (!matchResult.found) { - throw getNotFoundError(path, i, normalizedEdits.length); + throw getNotFoundError(path2, i, normalizedEdits.length); } const occurrences = countOccurrences(replacementBaseContent, edit.oldText); if (occurrences > 1) { - throw getDuplicateError(path, i, normalizedEdits.length, occurrences); + throw getDuplicateError(path2, i, normalizedEdits.length, occurrences); } matchedEdits.push({ editIndex: i, @@ -36034,18 +36034,18 @@ function applyEditsToNormalizedContent(normalizedContent, edits, path) { const previous = matchedEdits[i - 1]; const current = matchedEdits[i]; if (previous.matchIndex + previous.matchLength > current.matchIndex) { - throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path}. Merge them into one edit or target disjoint regions.`); + throw new Error(`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path2}. Merge them into one edit or target disjoint regions.`); } } const baseContent = normalizedContent; const newContent = usedFuzzyMatch ? applyReplacementsPreservingUnchangedLines(normalizedContent, replacementBaseContent, matchedEdits) : applyReplacements(replacementBaseContent, matchedEdits); if (baseContent === newContent) { - throw getNoChangeError(path, normalizedEdits.length); + throw getNoChangeError(path2, normalizedEdits.length); } return { baseContent, newContent }; } -function generateUnifiedPatch(path, oldContent, newContent, contextLines = 4) { - return createTwoFilesPatch(path, path, oldContent, newContent, void 0, void 0, { +function generateUnifiedPatch(path2, oldContent, newContent, contextLines = 4) { + return createTwoFilesPatch(path2, path2, oldContent, newContent, void 0, void 0, { context: contextLines, headerOptions: FILE_HEADERS_ONLY }); @@ -36169,8 +36169,8 @@ function getOrThrow(result) { // node_modules/@earendil-works/pi-durable/dist/tools/file-mutation-queue.js var queues = /* @__PURE__ */ new Map(); -async function mutationKey(env, path, context) { - const absolutePath = getOrThrow(await env.absolutePath(path, context)); +async function mutationKey(env, path2, context) { + const absolutePath = getOrThrow(await env.absolutePath(path2, context)); return `${env.id}\0${await canonical(env, absolutePath, context)}`; } async function canonical(env, absolutePath, context) { @@ -36187,8 +36187,8 @@ async function canonical(env, absolutePath, context) { const name = absolutePath.slice(parent.length + (/[/\\]$/.test(parent) ? 0 : 1)); return getOrThrow(await env.joinPath([await canonical(env, parent, context), name], context)); } -async function withFileMutationQueue(env, path, fn, context) { - const key = await mutationKey(env, path, context); +async function withFileMutationQueue(env, path2, fn, context) { + const key = await mutationKey(env, path2, context); const previous = queues.get(key) ?? Promise.resolve(); let release = () => { }; @@ -36210,15 +36210,15 @@ async function withFileMutationQueue(env, path, fn, context) { // node_modules/@earendil-works/pi-durable/dist/tools/path-utils.js var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g; var NARROW_NO_BREAK_SPACE = "\u202F"; -function normalizeToolPath(path) { - const normalized = path.replace(UNICODE_SPACES, " "); +function normalizeToolPath(path2) { + const normalized = path2.replace(UNICODE_SPACES, " "); return normalized.startsWith("@") ? normalized.slice(1) : normalized; } -async function resolveToolPath(env, path, context) { - return getOrThrow(await env.absolutePath(normalizeToolPath(path), context)); +async function resolveToolPath(env, path2, context) { + return getOrThrow(await env.absolutePath(normalizeToolPath(path2), context)); } -async function resolveReadToolPath(env, path, context) { - const resolved = await resolveToolPath(env, path, context); +async function resolveReadToolPath(env, path2, context) { + const resolved = await resolveToolPath(env, path2, context); const variants = [ resolved, resolved.replace(/ (AM|PM)\./gi, `${NARROW_NO_BREAK_SPACE}$1.`), @@ -36283,8 +36283,8 @@ function validateEditInput(input) { } return { path: input.path, edits: input.edits }; } -function editAccessError(path, error) { - return new Error(`Could not edit file: ${path}. Error code: ${error.code}.`, { cause: error }); +function editAccessError(path2, error) { + return new Error(`Could not edit file: ${path2}. Error code: ${error.code}.`, { cause: error }); } function createEditTool() { return defineTool({ @@ -36293,43 +36293,43 @@ function createEditTool() { parameters: editSchema, prepareArguments: prepareEditArguments, async execute(args, api, context) { - const { path, edits } = validateEditInput(args); + const { path: path2, edits } = validateEditInput(args); const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path, context); + const absolutePath = await resolveToolPath(env, path2, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const info = await env.fileInfo(absolutePath, context); if (!info.ok) - throw editAccessError(path, info.error); + throw editAccessError(path2, info.error); if (info.value.kind !== "file" && info.value.kind !== "symlink") { - throw new Error(`Could not edit file: ${path}. Path is not a file.`); + throw new Error(`Could not edit file: ${path2}. Path is not a file.`); } const readResult = await env.readTextFile(absolutePath, context); if (!readResult.ok) - throw editAccessError(path, readResult.error); + throw editAccessError(path2, readResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const { bom, text: content } = stripBom(readResult.value); const originalEnding = detectLineEnding(content); const normalizedContent = normalizeToLF(content); - const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path); + const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path2); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const finalContent = bom + restoreLineEndings(newContent, originalEnding); const writeResult = await env.writeFile(absolutePath, finalContent, context); if (!writeResult.ok) - throw editAccessError(path, writeResult.error); + throw editAccessError(path2, writeResult.error); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); const diffResult = generateDiffString(baseContent, newContent); const details = { diff: diffResult.diff, - patch: generateUnifiedPatch(path, baseContent, newContent), + patch: generateUnifiedPatch(path2, baseContent, newContent), ...diffResult.firstChangedLine === void 0 ? {} : { firstChangedLine: diffResult.firstChangedLine } }; return { - output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path}.` }], + output: [{ type: "text", text: `Successfully replaced ${edits.length} block(s) in ${path2}.` }], details }; }, context); @@ -36551,9 +36551,9 @@ function createReadTool(options = {}) { parameters: readSchema, structuredOutputSchema: readStructuredOutputSchema, async execute(args, api, context) { - const { path, offset, limit } = args; + const { path: path2, offset, limit } = args; const env = requireEnv(api); - const absolutePath = await resolveReadToolPath(env, path, context); + const absolutePath = await resolveReadToolPath(env, path2, context); const reader = getOrThrow(await env.openBinaryReader(absolutePath, void 0, context)); try { for (let attempt = 0; ; attempt++) { @@ -36562,13 +36562,13 @@ function createReadTool(options = {}) { size: before.size, read: async (position, length) => getOrThrow(await reader.read(position, length, context)) }); - const result = mimeType === void 0 ? await readText(reader, path, offset, limit, context) : await readImage(reader, before, path, mimeType, options.images, await imageModel(api, context), context); + const result = mimeType === void 0 ? await readText(reader, path2, offset, limit, context) : await readImage(reader, before, path2, mimeType, options.images, await imageModel(api, context), context); const after = getOrThrow(await reader.info(context)); const unchanged = after.size === before.size && after.mtimeMs === before.mtimeMs; if (unchanged || mimeType === void 0 && after.size > before.size) return result; if (attempt === 1) - throw new Error(`${path} changed while it was read`); + throw new Error(`${path2} changed while it was read`); } } finally { await reader.close(context); @@ -36576,14 +36576,14 @@ function createReadTool(options = {}) { } }); } -async function readImage(reader, info, path, mimeType, processor, { vision, limits }, context) { +async function readImage(reader, info, path2, mimeType, processor, { vision, limits }, context) { let image; const notes = []; if (processor !== void 0) { const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const prepared = await processor.prepare(bytes2, mimeType, limits); if (prepared === void 0) - return imageError(`${path} is an image (${mimeType}) that cannot be prepared for the model`); + return imageError(`${path2} is an image (${mimeType}) that cannot be prepared for the model`); image = prepared; if (prepared.convertedFrom !== void 0) notes.push(`Converted from ${prepared.convertedFrom} to ${prepared.mimeType}.`); @@ -36594,18 +36594,18 @@ async function readImage(reader, info, path, mimeType, processor, { vision, limi } } else { if (!INLINE_IMAGE_TYPES.has(mimeType)) { - return imageError(`${path} is an image (${mimeType}) that needs converting, and no image processor is configured`); + return imageError(`${path2} is an image (${mimeType}) that needs converting, and no image processor is configured`); } const unshrinkable = "and no image processor is configured to shrink it"; if (base64Length(info.size) > limits.maxBytes) { - return imageError(`${path} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); + return imageError(`${path2} is an image (${mimeType}) of ${formatSize(info.size)}, too large to send, ${unshrinkable}`); } const bytes2 = getOrThrow(await reader.read(0, info.size, context)); const size = imageDimensions(bytes2, mimeType); if (size === void 0) - return imageError(`${path} is an image (${mimeType}) whose size cannot be read`); + return imageError(`${path2} is an image (${mimeType}) whose size cannot be read`); if (size.width > limits.maxWidth || size.height > limits.maxHeight) { - return imageError(`${path} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); + return imageError(`${path2} is an image (${mimeType}) of ${size.width}x${size.height}, larger than ${limits.maxWidth}x${limits.maxHeight}, ${unshrinkable}`); } image = { data: toBase64(bytes2), mimeType }; } @@ -36633,7 +36633,7 @@ async function imageModel(api, context) { function imageError(message) { return { output: [], isError: true, diagnostics: [{ severity: "error", code: "unsupported_image", message }] }; } -async function readText(reader, path, offset, limit, context) { +async function readText(reader, path2, offset, limit, context) { const startLine = offset ? Math.max(0, offset - 1) : 0; const startLineDisplay = startLine + 1; const sliceStart = sliceIndex(startLine); @@ -36678,7 +36678,7 @@ async function readText(reader, path, offset, limit, context) { diagnostics.push({ severity: "warn", code: "truncated", - message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path} | tail -c +${end + 1}` + message: `Line ${startLineDisplay} is ${formatSize(lineSize)}, exceeds the ${formatSize(DEFAULT_MAX_BYTES)} limit; showing its first ${formatSize(end)}. Use bash: sed -n '${startLineDisplay}p' ${path2} | tail -c +${end + 1}` }); details = { truncation: { ...truncation, outputBytes: end, outputLines: 1 } }; } else if (truncation.truncated) { @@ -36718,16 +36718,16 @@ function createWriteTool() { description: "Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.", parameters: writeSchema, async execute(args, api, context) { - const { path, content } = args; + const { path: path2, content } = args; const env = requireEnv(api); - const absolutePath = await resolveToolPath(env, path, context); + const absolutePath = await resolveToolPath(env, path2, context); return withFileMutationQueue(env, absolutePath, async () => { if (context.abortSignal?.aborted) throw new Error("Operation aborted"); getOrThrow(await env.writeFile(absolutePath, content, context)); if (context.abortSignal?.aborted) throw new Error("Operation aborted"); - return { output: [{ type: "text", text: `Successfully wrote to ${path}` }] }; + return { output: [{ type: "text", text: `Successfully wrote to ${path2}` }] }; }, context); } }); @@ -37111,20 +37111,20 @@ var encoder4 = new TextEncoder(); var decoder4 = new TextDecoder(); var ExtensionState = defineDoc({ kind: "sausage.extensions", version: 1, scope: "session", checkpointWhen: () => false, initial: () => ({ good: null, current: null, error: null }) }); var Metadata = defineDoc({ kind: "sausage.metadata", version: 1, scope: "conversation", history: "latest", fork: "current", initial: () => ({ label: "", title: "" }), checkpointWhen: () => false }); -async function file(kind, path, bytes2 = []) { - const result = await ops2.op_file(kind, path, bytes2); +async function file(kind, path2, bytes2 = []) { + const result = await ops2.op_file(kind, path2, bytes2); if (!result.ok) throw Object.assign(new Error(result.error.message), result.error); return result.value; } var fs = { - read: async (path) => decoder4.decode(new Uint8Array(await file("read", path))), - write: (path, text2) => file("write", path, Array.from(encoder4.encode(text2))), - append: (path, text2) => file("append", path, Array.from(encoder4.encode(text2))), - list: (path) => file("list", path), - stat: (path) => file("stat", path), - lstat: (path) => file("lstat", path), - mkdir: (path) => file("mkdir", path), - remove: (path) => file("remove", path), + read: async (path2) => decoder4.decode(new Uint8Array(await file("read", path2))), + write: (path2, text2) => file("write", path2, Array.from(encoder4.encode(text2))), + append: (path2, text2) => file("append", path2, Array.from(encoder4.encode(text2))), + list: (path2) => file("list", path2), + stat: (path2) => file("stat", path2), + lstat: (path2) => file("lstat", path2), + mkdir: (path2) => file("mkdir", path2), + remove: (path2) => file("remove", path2), rename: (from, to) => file("rename", from, Array.from(encoder4.encode(to))) }; async function exec(command, options) { @@ -37283,9 +37283,9 @@ async function loadExtensions(harness2, registry2, storage2, models2, context, b const staged = /* @__PURE__ */ new Map(); try { const snapshot2 = `/run/sausage/extensions/${sha}`; - for (const path of ["/run/sausage", "/run/sausage/extensions"]) { + for (const path2 of ["/run/sausage", "/run/sausage/extensions"]) { try { - await fs.mkdir(path); + await fs.mkdir(path2); } catch (error) { if (error.code !== "already_exists") throw error; } @@ -37313,16 +37313,16 @@ async function loadExtensions(harness2, registry2, storage2, models2, context, b throw error; })) { if (entry2.kind !== "directory") continue; - const path = `${snapshot2}/extensions/${entry2.name}/server.ts`; + const path2 = `${snapshot2}/extensions/${entry2.name}/server.ts`; try { - await fs.stat(path); + await fs.stat(path2); } catch (error) { if (error.code === "not_found") continue; throw error; } const module = await import( /* @vite-ignore */ - `file://${path}` + `file://${path2}` ); modules.push({ name: entry2.name, module }); } @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -37416,6 +37416,65 @@ Last good: ${fallback}` : failed; } }; } +// ../../extensions/core/agents.ts +var thinkingLevels = ["off", "minimal", "low", "medium", "high", "xhigh", "max"]; +function parseFrontmatter(text2) { + const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(text2); + if (!match) throw new Error("Expected frontmatter fields between --- lines"); + return { frontmatter: parse(match[1]), body: match[2].trim() }; +} +function parseDefinition(text2, path2, inherited) { + const { frontmatter, body } = parseFrontmatter(text2); + const name = path2.split("/").pop().replace(/\.md$/, ""); + const settings = { ...inherited ?? {}, ...frontmatter }; + const instructions = inherited && frontmatter.addTools !== void 0 ? [inherited.instructions, body].filter(Boolean).join("\n\n## Project additions\n\n") : body; + const definition = { ...settings, name, path: path2, instructions }; + if (!/^[a-zA-Z0-9_-]+$/.test(name)) throw new Error(`${path2}: invalid roster name`); + for (const key of ["description", "model", "instructions"]) if (typeof definition[key] !== "string" || !definition[key].trim()) throw new Error(`${path2}: ${key} is required`); + if (definition.thinking !== void 0 && !thinkingLevels.includes(definition.thinking)) throw new Error(`${path2}: invalid thinking`); + for (const key of ["tools", "addTools", "denyTools"]) if (definition[key] !== void 0 && (!Array.isArray(definition[key]) || !definition[key].every((tool) => typeof tool === "string"))) throw new Error(`${path2}: ${key} must be a list of tool names`); + if (inherited && frontmatter.addTools !== void 0) definition.tools = toolsFor(definition, inherited.tools ?? []); + definitionRuns(definition); + return definition; +} +function definitionRuns(definition) { + if (!/^[^/\s]+\/\S+$/.test(definition.model)) throw new Error(`${definition.path}: invalid model for ${definition.name}`); + const slash = definition.model.indexOf("/"); + return { model: { provider: definition.model.slice(0, slash), modelId: definition.model.slice(slash + 1) }, thinking: definition.thinking }; +} +function toolsFor(definition, parent) { + return [.../* @__PURE__ */ new Set([...definition.tools ?? parent, ...definition.addTools ?? []])].filter((tool) => !definition.denyTools?.includes(tool)); +} + +// roster-fixture.ts +var directory = "/etc/sausage/roster"; +var path = "/etc/sausage/config.yaml"; +async function readTestConfig(fs2) { + const config = parse(await fs2.read(path)); + config.roster = []; + for (const entry2 of await fs2.list(directory)) { + if (!entry2.name.endsWith(".md")) continue; + const definition = parseDefinition(await fs2.read(`${directory}/${entry2.name}`), `${directory}/${entry2.name}`); + const { instructions, ...fields } = definition; + config.roster.push({ ...fields, prompt: instructions }); + } + return config; +} +async function writeTestConfig(fs2, value2) { + const { roster, ...config } = value2; + await fs2.mkdir(directory); + for (const entry2 of await fs2.list(directory)) if (entry2.name.endsWith(".md")) await fs2.remove(`${directory}/${entry2.name}`); + for (const entry2 of roster) { + const { name, prompt, path: _path, ...fields } = entry2; + await fs2.write(`${directory}/${name}.md`, `--- +${stringify3(fields)}--- + +${prompt} +`); + } + await fs2.write(path, stringify3(config)); +} + // node_modules/@earendil-works/chord/dist/sqlite/schema.js function validateSqliteSchemaPrefix(prefix) { if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(prefix)) { @@ -38317,8 +38376,8 @@ var SqliteStorage = class _SqliteStorage { // sqlite.ts var op = (kind, sql = "", params = []) => Deno.core.ops.op_sql(kind, sql, params.map((p) => p instanceof Uint8Array ? Array.from(p) : typeof p === "bigint" ? Number(p) : p)); -async function openStorage(path) { - op("open", path); +async function openStorage(path2) { + op("open", path2); let tail = Promise.resolve(); const queue2 = (call2) => { const result = tail.then(call2); @@ -38386,7 +38445,7 @@ var held2 = defineExtension({ name: "hold", tools: [defineTool({ name: "hold", d } })] }); if (globalThis.subagentsMode === "kill") { const install = registry.install.bind(registry); - registry.install = (extension) => install(extension.name !== "subagents" ? extension : { ...extension, tasks: extension.tasks.map((task) => task.definition.name !== "standing.subagent-reporter" ? task : { definition: { ...task.definition, phases: { ...task.definition.phases, report: async (_task, _runtime, ctx) => { + registry.install = (extension) => install(extension.name !== "subagents" ? extension : { ...extension, tasks: extension.tasks.map((task) => task.definition.name !== "main-agent.subagent-reporter" ? task : { definition: { ...task.definition, phases: { ...task.definition.phases, report: async (_task, _runtime, ctx) => { await fs.write("/report-ready", "yes"); await awaitWithContext(new Promise(() => { }), ctx); @@ -38436,23 +38495,23 @@ try { } else { const service = globalThis.subagentService; assert((await service.residents(BACKGROUND_CONTEXT))[0].name === "scout", "Resident definitions"); - const standing = await service.standing("scout", BACKGROUND_CONTEXT); - assert(await service.standing("scout", BACKGROUND_CONTEXT) === standing, "Standing refresh must reuse its conversation"); - const standingRecord = await harness.commit((tx) => tx.conversation(standing), BACKGROUND_CONTEXT); - assert(!standingRecord.owner, "Standing must be ownerless"); - const config = parse(await fs.read("/etc/sausage/config.yaml")); - const save = () => fs.write("/etc/sausage/config.yaml", JSON.stringify(config)); + const mainAgent = await service.mainAgent("scout", BACKGROUND_CONTEXT); + assert(await service.mainAgent("scout", BACKGROUND_CONTEXT) === mainAgent, "MainAgent refresh must reuse its conversation"); + const mainAgentRecord = await harness.commit((tx) => tx.conversation(mainAgent), BACKGROUND_CONTEXT); + assert(!mainAgentRecord.owner, "MainAgent must be ownerless"); + const config = await readTestConfig(fs); + const save = () => writeTestConfig(fs, config); config.roster[0].prompt = "Updated instructions"; await save(); - await service.standing("scout", BACKGROUND_CONTEXT); - assert((await (await harness.conversation(standing, BACKGROUND_CONTEXT)).agent(BACKGROUND_CONTEXT)).instructions.includes("Updated instructions"), "Standing refresh must reread instructions"); + await service.mainAgent("scout", BACKGROUND_CONTEXT); + assert((await (await harness.conversation(mainAgent, BACKGROUND_CONTEXT)).agent(BACKGROUND_CONTEXT)).instructions.includes("Updated instructions"), "MainAgent refresh must reread instructions"); const answer2 = await call({ action: "start", agent: "scout", task: "facts" }); assert(text(answer2) === "Returned model: faux/faux-1\nChild: facts", `Foreground answer: ${JSON.stringify(answer2)}`); const [first] = await children(); assert(JSON.stringify(await chain(first.conversationId)) === JSON.stringify([String(first.conversationId), String(root.id)]), "Anchor ownership chain"); const record2 = await harness.commit((tx) => tx.conversation(first.conversationId), BACKGROUND_CONTEXT); const anchor = await harness.getTask(record2.owner.taskId, BACKGROUND_CONTEXT); - assert(anchor?.kind === "standing.subagent-anchor", "Child owner must be anchor"); + assert(anchor?.kind === "main-agent.subagent-anchor", "Child owner must be anchor"); const child = await harness.conversation(first.conversationId, BACKGROUND_CONTEXT); assert(!(await child.agent(BACKGROUND_CONTEXT)).tools.some((tool) => tool.name === "subagent"), "Tool denials"); assert((await root.agent(BACKGROUND_CONTEXT)).tools.some((tool) => tool.name === "subagent"), "Parent tools remain unchanged"); @@ -38519,18 +38578,18 @@ try { const pinnedChild = (await children()).at(-1); assert((await (await harness.conversation(pinnedChild.conversationId, BACKGROUND_CONTEXT)).agent(BACKGROUND_CONTEXT)).model?.modelId === "faux-1", "models.pin must apply to subagents"); globalThis.childPin = void 0; - config.standing = "renamed-scout"; - Object.assign(config.roster[0], { name: config.standing, model: "faux/second" }); + config.main_agent_name = "renamed-scout"; + Object.assign(config.roster[0], { name: config.main_agent_name, model: "faux/second" }); await save(); - assert(await service.standing(config.standing, BACKGROUND_CONTEXT) === standing, "Rename must retain the standing conversation"); + assert(await service.mainAgent(config.main_agent_name, BACKGROUND_CONTEXT) === mainAgent, "Rename must retain the mainAgent conversation"); faux.setResponses([(transcript) => { const prompt = JSON.stringify(transcript.messages.filter((m) => m.role === "system")); - assert(prompt.includes("You are @renamed-scout."), "Renamed standing prompt must use the configured name"); + assert(prompt.includes("You are @renamed-scout."), "Renamed mainAgent prompt must use the configured name"); return fauxAssistantMessage("I am @renamed-scout."); }]); - const primary = await harness.conversation(standing, BACKGROUND_CONTEXT); + const primary = await harness.conversation(mainAgent, BACKGROUND_CONTEXT); await (await primary.submit({ type: "input", content: "Who are you?" }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); - assert((await primary.agent(BACKGROUND_CONTEXT)).model?.modelId === "second", "Standing model edit applies at its next run"); + assert((await primary.agent(BACKGROUND_CONTEXT)).model?.modelId === "second", "MainAgent model edit applies at its next run"); assert(JSON.stringify((await primary.context(BACKGROUND_CONTEXT)).entries).includes("I am @renamed-scout."), "Same conversation answers with the new name"); } } finally { diff --git a/host/js/subagents-test.ts b/host/js/subagents-test.ts index dea002f..d5a1934 100644 --- a/host/js/subagents-test.ts +++ b/host/js/subagents-test.ts @@ -5,7 +5,7 @@ import { fauxProvider, fauxAssistantMessage, fauxToolCall } from '@earendil-work import { Harness, createRegistry, defineExtension, defineTool, LiveDoc, InboxDoc } from '@earendil-works/pi-durable'; import { obj } from '@earendil-works/pi-schema'; import { loadExtensions, fs } from './extensions'; -import { parse } from 'yaml'; +import {readTestConfig,writeTestConfig} from './roster-fixture'; import { conversationChains } from './environment'; import { openStorage } from './sqlite'; const assert = (value:any,message:string)=>{if(!value)throw new Error(message);}; @@ -18,7 +18,7 @@ const gate=Promise.withResolvers(), parentGate=Promise.withResolvers const held=defineExtension({name:'hold',tools:[defineTool({name:'hold',description:'Wait for test gate',parameters:obj({}),replay:'safe',execute:async(_args,api,ctx)=>{holding.add(api.conversationId);await awaitWithContext(api.conversationId===root.id?parentGate.promise:gate.promise,ctx);return {output:[{type:'text',text:'released'}]};}})]}); if(globalThis.subagentsMode==='kill') { const install=registry.install.bind(registry); - registry.install=(extension:any)=>install(extension.name!=='subagents'?extension:{...extension,tasks:extension.tasks.map((task:any)=>task.definition.name!=='standing.subagent-reporter'?task:{definition:{...task.definition,phases:{...task.definition.phases,report:async(_task:any,_runtime:any,ctx:any)=>{await fs.write('/report-ready','yes');await awaitWithContext(new Promise(()=>{}),ctx);}}}})}); + registry.install=(extension:any)=>install(extension.name!=='subagents'?extension:{...extension,tasks:extension.tasks.map((task:any)=>task.definition.name!=='main-agent.subagent-reporter'?task:{definition:{...task.definition,phases:{...task.definition.phases,report:async(_task:any,_runtime:any,ctx:any)=>{await fs.write('/report-ready','yes');await awaitWithContext(new Promise(()=>{}),ctx);}}}})}); } const route=(transcript:any):any=>{ faux.appendResponses([route]); @@ -54,22 +54,22 @@ try { } else { const service=globalThis.subagentService; assert((await service.residents(context))[0].name==='scout','Resident definitions'); - const standing=await service.standing('scout',context); - assert(await service.standing('scout',context)===standing,'Standing refresh must reuse its conversation'); - const standingRecord=await harness.commit((tx:any)=>tx.conversation(standing),context); - assert(!standingRecord.owner,'Standing must be ownerless'); - const config=parse(await fs.read('/etc/sausage/config.yaml')); - const save=()=>fs.write('/etc/sausage/config.yaml',JSON.stringify(config)); + const mainAgent=await service.mainAgent('scout',context); + assert(await service.mainAgent('scout',context)===mainAgent,'MainAgent refresh must reuse its conversation'); + const mainAgentRecord=await harness.commit((tx:any)=>tx.conversation(mainAgent),context); + assert(!mainAgentRecord.owner,'MainAgent must be ownerless'); + const config=await readTestConfig(fs); + const save=()=>writeTestConfig(fs,config); config.roster[0].prompt='Updated instructions';await save(); - await service.standing('scout',context); - assert((await (await harness.conversation(standing,context))!.agent(context)).instructions.includes('Updated instructions'),'Standing refresh must reread instructions'); + await service.mainAgent('scout',context); + assert((await (await harness.conversation(mainAgent,context))!.agent(context)).instructions.includes('Updated instructions'),'MainAgent refresh must reread instructions'); const answer=await call({action:'start',agent:'scout',task:'facts'}); assert(text(answer)==='Returned model: faux/faux-1\nChild: facts',`Foreground answer: ${JSON.stringify(answer)}`); const [first]=await children(); assert(JSON.stringify(await chain(first.conversationId))===JSON.stringify([String(first.conversationId),String(root.id)]),'Anchor ownership chain'); const record=await harness.commit((tx:any)=>tx.conversation(first.conversationId),context); const anchor=await harness.getTask(record!.owner!.taskId,context); - assert(anchor?.kind==='standing.subagent-anchor','Child owner must be anchor'); + assert(anchor?.kind==='main-agent.subagent-anchor','Child owner must be anchor'); const child=(await harness.conversation(first.conversationId,context))!; assert(!(await child.agent(context)).tools.some((tool:any)=>tool.name==='subagent'),'Tool denials'); assert((await root.agent(context)).tools.some((tool:any)=>tool.name==='subagent'),'Parent tools remain unchanged'); @@ -127,17 +127,17 @@ try { const pinnedChild=(await children()).at(-1)!; assert((await (await harness.conversation(pinnedChild.conversationId,context))!.agent(context)).model?.modelId==='faux-1','models.pin must apply to subagents'); globalThis.childPin=undefined; - config.standing='renamed-scout'; - Object.assign(config.roster[0],{name:config.standing,model:'faux/second'});await save(); - assert(await service.standing(config.standing,context)===standing,'Rename must retain the standing conversation'); + config.main_agent_name='renamed-scout'; + Object.assign(config.roster[0],{name:config.main_agent_name,model:'faux/second'});await save(); + assert(await service.mainAgent(config.main_agent_name,context)===mainAgent,'Rename must retain the mainAgent conversation'); faux.setResponses([(transcript:any)=>{ const prompt=JSON.stringify(transcript.messages.filter((m:any)=>m.role==='system')); - assert(prompt.includes('You are @renamed-scout.'),'Renamed standing prompt must use the configured name'); + assert(prompt.includes('You are @renamed-scout.'),'Renamed mainAgent prompt must use the configured name'); return fauxAssistantMessage('I am @renamed-scout.'); }]); - const primary=(await harness.conversation(standing,context))!; + const primary=(await harness.conversation(mainAgent,context))!; await (await primary.submit({type:'input',content:'Who are you?'},context)).wait(context); - assert((await primary.agent(context)).model?.modelId==='second','Standing model edit applies at its next run'); + assert((await primary.agent(context)).model?.modelId==='second','MainAgent model edit applies at its next run'); assert(JSON.stringify((await primary.context(context)).entries).includes('I am @renamed-scout.'),'Same conversation answers with the new name'); } } finally {gate.resolve();parentGate.resolve();await loader.close();await harness.close(context);} diff --git a/host/js/watchdog-test-bundle.js b/host/js/watchdog-test-bundle.js index 76e7181..91037ce 100644 --- a/host/js/watchdog-test-bundle.js +++ b/host/js/watchdog-test-bundle.js @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); @@ -38395,7 +38395,7 @@ var loader = await loadExtensions(harness, registry, storage, models, BACKGROUND assert(!loader.state().error, `Extension load: ${loader.state().error}`); var sha = await fs.read("/src/sausage/.git/sausage-last-good"); var base = `file:///run/sausage/extensions/${sha}/extensions`; -var { Standing } = await import(`${base}/subagents/api.ts`); +var { MainAgent } = await import(`${base}/subagents/api.ts`); var { Messages } = await import(`${base}/messages/api.ts`); var { diagnose } = await import(`${base}/watchdog/server.ts`); var service = globalThis.watchdogService; @@ -38407,11 +38407,11 @@ var create = async (title) => harness.commit(async (tx) => { Object.assign(await tx.doc(Metadata, record2.id), { title }); return record2.id; }, BACKGROUND_CONTEXT); -var primary = (await harness.snapshot(Standing, root.id, BACKGROUND_CONTEXT))["$standing"]; +var primary = (await harness.snapshot(MainAgent, root.id, BACKGROUND_CONTEXT))["$main-agent"]; if (!primary) { - primary = await create("@standing"); + primary = await create("@mainAgent"); await harness.commit(async (tx) => { - (await tx.doc(Standing, root.id))["$standing"] = primary; + (await tx.doc(MainAgent, root.id))["$main-agent"] = primary; }, BACKGROUND_CONTEXT); } var submit = async (id, text, requestId) => (await (await harness.conversation(id, BACKGROUND_CONTEXT)).submit({ type: "input", content: text, requestId }, BACKGROUND_CONTEXT)).wait(BACKGROUND_CONTEXT); @@ -38456,7 +38456,7 @@ try { await until2(async () => (await reports(branch)).length === 1); await harness.waitForIdle(BACKGROUND_CONTEXT); assert((await retries(branch)).length === 1, "Expected one retry"); - assert((await reports(branch))[0].to === primary, "The message must reach @standing"); + assert((await reports(branch))[0].to === primary, "The message must reach @mainAgent"); assert((await reports(branch))[0].text.includes("After one automatic retry"), "Report must describe its retry"); await until2(async () => (await service.failures(0)).length === 1); const history = await service.failures(0); diff --git a/host/js/watchdog-test.ts b/host/js/watchdog-test.ts index a701ece..ab40052 100644 --- a/host/js/watchdog-test.ts +++ b/host/js/watchdog-test.ts @@ -26,7 +26,7 @@ const loader = await loadExtensions(harness, registry, storage, models, context) assert(!loader.state().error, `Extension load: ${loader.state().error}`); const sha = await fs.read('/src/sausage/.git/sausage-last-good'); const base = `file:///run/sausage/extensions/${sha}/extensions`; -const {Standing} = await import(`${base}/subagents/api.ts`); +const {MainAgent} = await import(`${base}/subagents/api.ts`); const {Messages} = await import(`${base}/messages/api.ts`); const {diagnose} = await import(`${base}/watchdog/server.ts`); const service = globalThis.watchdogService; @@ -38,8 +38,8 @@ const create = async (title: string) => harness.commit(async (tx: any) => { Object.assign(await tx.doc(Metadata, record.id), {title}); return record.id; }, context); -let primary = (await harness.snapshot(Standing, root.id, context))['$standing']; -if (!primary) {primary = await create('@standing'); await harness.commit(async (tx: any) => {(await tx.doc(Standing, root.id))['$standing'] = primary}, context)} +let primary = (await harness.snapshot(MainAgent, root.id, context))['$main-agent']; +if (!primary) {primary = await create('@mainAgent'); await harness.commit(async (tx: any) => {(await tx.doc(MainAgent, root.id))['$main-agent'] = primary}, context)} const submit = async (id: number, text: string, requestId?: string) => (await (await harness.conversation(id, context))!.submit({type: 'input', content: text, requestId}, context)).wait(context); const requests = async (id: number) => (await storage.scanSubmissions({conversationId: id}, 100, undefined, context)).items; const retries = async (id: number) => (await requests(id)).filter((r: any) => r.requestId?.startsWith('watchdog-retry:')); @@ -70,7 +70,7 @@ try { await until(async () => (await reports(branch)).length === 1); await harness.waitForIdle(context); assert((await retries(branch)).length === 1, 'Expected one retry'); - assert((await reports(branch))[0].to === primary, 'The message must reach @standing'); + assert((await reports(branch))[0].to === primary, 'The message must reach @mainAgent'); assert((await reports(branch))[0].text.includes('After one automatic retry'), 'Report must describe its retry'); await until(async () => (await service.failures(0)).length === 1); const history = await service.failures(0); diff --git a/host/js/workspaces-test-bundle.js b/host/js/workspaces-test-bundle.js index e9f7607..a3c4766 100644 --- a/host/js/workspaces-test-bundle.js +++ b/host/js/workspaces-test-bundle.js @@ -37396,10 +37396,10 @@ Last good: ${fallback}` : failed; if (active) await enqueue2(); } })(); - return { reload: enqueue2, state: () => ({ ...state }), async standing() { + return { reload: enqueue2, state: () => ({ ...state }), async mainAgent() { if (!providers.has("models") || !providers.has("subagents")) return void 0; - const { standing: name } = await providers.get("models").discover(repo); - const conversationId = await providers.get("subagents").standing(name, context); + const { main_agent_name: name } = await providers.get("models").discover(repo); + const conversationId = await providers.get("subagents").mainAgent(name, context); return { name, conversationId }; }, async invoke(name, key, args, signal, conversationId) { const facet = facets.find((f) => f.extension.name === name); diff --git a/host/src/harness/config.rs b/host/src/harness/config.rs index 989b802..6b3c5bd 100644 --- a/host/src/harness/config.rs +++ b/host/src/harness/config.rs @@ -1,19 +1,24 @@ -//! Fresh reads of the user-owned world proxy configuration. +//! Fresh reads of provider keys and cached models.dev metadata for the host harness. +use deno_core::OpState; use sausage_vfs::{Layer, Open}; use serde::{Deserialize, Serialize}; -use std::sync::Arc; +use std::{collections::BTreeMap, sync::Arc}; pub const PATH: &str = "/etc/sausage/config.yaml"; #[derive(Default, Deserialize, Serialize)] #[serde(default)] -pub struct Proxy { +pub struct Provider { + #[serde(rename = "type")] + pub api_type: String, pub base_url: String, pub api_key: String, + pub catalog: Option, + pub models: Vec, } #[derive(Default, Deserialize)] #[serde(default)] pub struct Config { - pub proxy: Proxy, + pub providers: BTreeMap, } impl Config { pub async fn read(root: &Arc) -> anyhow::Result { @@ -28,3 +33,29 @@ impl Config { .map_err(|error| anyhow::anyhow!("Cannot read {PATH}: {error}")) } } + +pub(super) struct CatalogCache(pub std::path::PathBuf); +#[deno_core::op2] +#[serde] +pub(super) async fn op_model_catalog( + state: std::rc::Rc>, + #[serde] updated: Option, +) -> Result { + let path = state.borrow().borrow::().0.clone(); + let result = async { + if let Some(value) = updated { + tokio::fs::write(&path, serde_json::to_vec(&value)?).await?; + return Ok::<_, anyhow::Error>(value); + } + let bytes = match tokio::fs::read(&path).await { + Ok(bytes) => bytes, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => { + include_bytes!("../../js/models-dev.json").to_vec() + } + Err(error) => return Err(error.into()), + }; + Ok(serde_json::from_slice(&bytes)?) + } + .await; + result.map_err(|error| deno_error::JsErrorBox::generic(error.to_string())) +} diff --git a/host/src/harness/credentials.rs b/host/src/harness/credentials.rs index acd00e8..5b56b9b 100644 --- a/host/src/harness/credentials.rs +++ b/host/src/harness/credentials.rs @@ -1,4 +1,4 @@ -//! Credential request snapshots and host-only model proxy configuration. +//! Credential request snapshots and host-only provider configuration. use crate::cred::{store::Cred, types::Subject}; use deno_core::{OpState, op2}; use deno_error::JsErrorBox; @@ -68,7 +68,7 @@ pub(super) fn op_credential_requests(state: &mut OpState) -> Result>, ) -> Result { let root = state @@ -79,5 +79,5 @@ pub(super) async fn op_model_proxy( let config = super::config::Config::read(&root) .await .map_err(|error| JsErrorBox::generic(error.to_string()))?; - serde_json::to_value(config.proxy).map_err(|error| JsErrorBox::generic(error.to_string())) + serde_json::to_value(config.providers).map_err(|error| JsErrorBox::generic(error.to_string())) } diff --git a/host/src/harness/mod.rs b/host/src/harness/mod.rs index 0327570..f224a4f 100644 --- a/host/src/harness/mod.rs +++ b/host/src/harness/mod.rs @@ -84,7 +84,8 @@ deno_core::extension!( ops = [ op_sql, credentials::op_credential_requests, - credentials::op_model_proxy, + credentials::op_model_providers, + config::op_model_catalog, credentials::op_credential_next, environment::op_file, environment::op_exec, @@ -147,7 +148,7 @@ pub async fn run_module_with_input( receiver: input::Receiver, source: &str, ) -> anyhow::Result<()> { - let proxy = serde_json::to_value(config::Config::read(&world.root).await?.proxy)?; + let provider_config = config::Config::read(&world.root).await?; let loader = std::rc::Rc::new(loader::Loader { root: world.root.clone(), modules: Default::default(), @@ -173,6 +174,10 @@ pub async fn run_module_with_input( })), ..Default::default() }); + runtime + .op_state() + .borrow_mut() + .put(config::CatalogCache(world.host_dir.join("models-dev.json"))); runtime.op_state().borrow_mut().put(loader); runtime .op_state() @@ -229,10 +234,10 @@ pub async fn run_module_with_input( .await; result.map_err(|error| { let mut text = error.to_string(); - if let Some(key) = proxy.get("api_key").and_then(Value::as_str) - && !key.is_empty() - { - text = text.replace(key, "[redacted]"); + for provider in provider_config.providers.values() { + if !provider.api_key.is_empty() { + text = text.replace(&provider.api_key, "[redacted]"); + } } anyhow::anyhow!(text) }) diff --git a/host/tests/it/automations.rs b/host/tests/it/automations.rs index 8844999..680893f 100644 --- a/host/tests/it/automations.rs +++ b/host/tests/it/automations.rs @@ -81,9 +81,9 @@ fn setup(directory: &Path) -> Result<()> { )?; crate::common::write_config( directory, - "standing", + "mainAgent", serde_json::json!([ - {"name":"standing","description":"Primary","model":"faux/faux-1","prompt":"Primary agent"} + {"name":"mainAgent","description":"Primary","model":"faux/faux-1","prompt":"Primary agent"} ]), )?; ensure!( diff --git a/host/tests/it/common.rs b/host/tests/it/common.rs index 76b570c..3d2b122 100644 --- a/host/tests/it/common.rs +++ b/host/tests/it/common.rs @@ -9,13 +9,33 @@ use std::{ pub static BUILD: Mutex<()> = Mutex::new(()); /// Keep the real shared prompt in every roster fixture, with an ephemeral approval port. -pub fn write_config(dir: &Path, standing: &str, roster: serde_json::Value) -> anyhow::Result<()> { +pub fn write_config( + dir: &Path, + main_agent_name: &str, + roster: serde_json::Value, +) -> anyhow::Result<()> { let mut config: serde_json::Value = serde_yaml_ng::from_str(include_str!("../../../config/config.yaml"))?; - config["standing"] = serde_json::json!(standing); - config["roster"] = roster; + config["main_agent_name"] = serde_json::json!(main_agent_name); let folder = dir.join("world/etc/sausage"); - std::fs::create_dir_all(&folder)?; + std::fs::create_dir_all(folder.join("roster"))?; + for entry in roster.as_array().unwrap() { + let mut fields = entry.as_object().unwrap().clone(); + let name = fields.remove("name").unwrap().as_str().unwrap().to_owned(); + let prompt = fields + .remove("prompt") + .unwrap() + .as_str() + .unwrap() + .to_owned(); + std::fs::write( + folder.join("roster").join(format!("{name}.md")), + format!( + "---\n{}---\n\n{prompt}\n", + serde_yaml_ng::to_string(&fields)? + ), + )?; + } std::fs::write( folder.join("config.yaml"), serde_yaml_ng::to_string(&config)?, diff --git a/host/tests/it/core_ext.rs b/host/tests/it/core_ext.rs index 962bdb2..f556b78 100644 --- a/host/tests/it/core_ext.rs +++ b/host/tests/it/core_ext.rs @@ -66,8 +66,8 @@ async fn init_seeds_config_tools_and_one_source_commit() -> anyhow::Result<()> { .arg(&destination) .arg("--userland") .arg(&bundle) - .env("PI_PROXY_BASE_URL", "https://proxy.test") - .env("PI_PROXY_API_KEY", "fixture-key") + .env("OPENAI_BASE_URL", "https://provider.test") + .env("OPENAI_API_KEY", "fixture-key") .stdin(std::process::Stdio::null()) .output()?; assert!( @@ -77,9 +77,12 @@ async fn init_seeds_config_tools_and_one_source_commit() -> anyhow::Result<()> { ); let world = World::open(&destination)?; assert!(destination.join("world/bin/git").exists()); - let config = world.root.open("/etc/sausage/config.yaml", Default::default()).await?; + let config = world + .root + .open("/etc/sausage/config.yaml", Default::default()) + .await?; let config = String::from_utf8(config.read(0, 65536).await?)?; - assert!(!config.contains("https://proxy.test")); + assert!(!config.contains("https://provider.test")); assert!(!config.contains("fixture-key")); assert_eq!(config, include_str!("../../../config/config.yaml")); let source = destination.join("world/src/sausage"); diff --git a/host/tests/it/dream.rs b/host/tests/it/dream.rs index b3b341d..8a75d93 100644 --- a/host/tests/it/dream.rs +++ b/host/tests/it/dream.rs @@ -50,9 +50,9 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { repo.join("extensions/probe/server.ts"), "export default host => { globalThis.dreamHost=host; globalThis.dreamService=host.need({name:'dream'}); globalThis.dreamSubagents=host.need({name:'subagents'}); globalThis.dreamAutomations=host.need({name:'automations'}); return {name:'probe'}; }", )?; - let mut roster: Vec = ["standing", "coordinator", "worker", "reviewer"].into_iter().map(|role| serde_json::json!({ + let mut roster: Vec = ["mainAgent", "coordinator", "worker", "reviewer"].into_iter().map(|role| serde_json::json!({ "name":role, "description":format!("P3 {role}"), "model":"faux/faux-1", - "isolate":"none", "resident":role == "standing", "prompt":format!("P3 role:{role}"), + "isolate":"none", "resident":role == "mainAgent", "prompt":format!("P3 role:{role}"), "denyTools":if role == "worker" || role == "reviewer" {vec!["subagent"]} else {vec![]} })).collect(); let defaults: serde_json::Value = @@ -66,7 +66,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { .clone(); pass["model"] = serde_json::json!("faux/faux-1"); roster.push(pass); - crate::common::write_config(dir, "standing", serde_json::json!(roster))?; + crate::common::write_config(dir, "mainAgent", serde_json::json!(roster))?; let demo = disk.join("src/demo"); std::fs::create_dir_all(&demo)?; std::fs::write(demo.join("README.md"), "P3 demo\n")?; diff --git a/host/tests/it/durable.rs b/host/tests/it/durable.rs index b9fc795..a826355 100644 --- a/host/tests/it/durable.rs +++ b/host/tests/it/durable.rs @@ -140,13 +140,13 @@ fn sigkill_preserves_request_wait() -> anyhow::Result<()> { } #[tokio::test(flavor = "current_thread")] -async fn proxy_child() -> anyhow::Result<()> { - let Ok(dir) = std::env::var("DURABLE_PROXY_DIR") else { +async fn provider_child() -> anyhow::Result<()> { + let Ok(dir) = std::env::var("DURABLE_PROVIDER_DIR") else { return Ok(()); }; let dir = std::path::Path::new(&dir); let source = format!( - "globalThis.proxyOnly = true; const proxy = await Deno.core.ops.op_model_proxy(); if (proxy.base_url !== 'https://proxy.invalid' || proxy.api_key !== 'faux-private-token') throw new Error('Wrong proxy config');\n{}", + "globalThis.providerOnly = true; const provider = (await Deno.core.ops.op_model_providers()).test; if (provider.base_url !== 'https://provider.invalid' || provider.api_key !== 'faux-private-token') throw new Error('Wrong provider config');\n{}", include_str!("../../js/durable-test-bundle.js") ); run_module( @@ -158,7 +158,7 @@ async fn proxy_child() -> anyhow::Result<()> { let error = run_module( World::open(dir)?, sausage::process::exec(World::open(dir)?)?, - "throw new Error((await Deno.core.ops.op_model_proxy()).api_key)", + "throw new Error((await Deno.core.ops.op_model_providers()).test.api_key)", ) .await .unwrap_err(); @@ -168,28 +168,28 @@ async fn proxy_child() -> anyhow::Result<()> { } #[test] -fn proxy_config_ignores_environment() -> anyhow::Result<()> { - let dir = std::env::temp_dir().join(format!("sausage-durable-proxy-{}", std::process::id())); +fn provider_config_ignores_environment() -> anyhow::Result<()> { + let dir = std::env::temp_dir().join(format!("sausage-durable-provider-{}", std::process::id())); let settings = dir.join("world/etc/sausage"); std::fs::create_dir_all(&settings)?; std::fs::write( settings.join("config.yaml"), - "proxy:\n base_url: https://proxy.invalid\n api_key: faux-private-token\n", + "providers:\n test:\n base_url: https://provider.invalid\n api_key: faux-private-token\n", )?; for start in 0..2 { let status = std::process::Command::new(std::env::current_exe()?) - .args(["--exact", "durable::proxy_child", "--nocapture"]) - .env("DURABLE_PROXY_DIR", &dir) + .args(["--exact", "durable::provider_child", "--nocapture"]) + .env("DURABLE_PROVIDER_DIR", &dir) .env( - "PI_PROXY_BASE_URL", + "PI_PROVIDER_BASE_URL", if start == 0 { - "https://proxy.invalid" + "https://provider.invalid" } else { "https://ignored.invalid" }, ) .env( - "PI_PROXY_API_KEY", + "PI_PROVIDER_API_KEY", if start == 0 { "faux-private-token" } else { @@ -203,7 +203,7 @@ fn proxy_config_ignores_environment() -> anyhow::Result<()> { assert_eq!( cred.item_list()? .iter() - .filter(|i| i.name == "llm-proxy") + .filter(|i| i.name == "llm-provider") .count(), 0 ); diff --git a/host/tests/it/goal_questions.rs b/host/tests/it/goal_questions.rs index 75b1ae1..66997b9 100644 --- a/host/tests/it/goal_questions.rs +++ b/host/tests/it/goal_questions.rs @@ -24,11 +24,11 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { std::fs::create_dir_all(repo.join("extensions/probe"))?; std::fs::write( repo.join("extensions/probe/server.ts"), - "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setStanding: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", + "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setMainAgent: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", )?; crate::common::write_config( dir, - "standing", + "mainAgent", serde_json::json!([ { "name": "scout", @@ -42,7 +42,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { "prompt": "Scout instructions" }, { - "name": "standing", + "name": "mainAgent", "description": "Primary", "resident": true, "isolate": "none", diff --git a/host/tests/it/harness_api.rs b/host/tests/it/harness_api.rs index fbc62cf..f68085f 100644 --- a/host/tests/it/harness_api.rs +++ b/host/tests/it/harness_api.rs @@ -74,11 +74,11 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { std::fs::create_dir_all(repo.join("extensions/probe"))?; std::fs::write( repo.join("extensions/probe/server.ts"), - "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setStanding: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", + "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setMainAgent: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", )?; crate::common::write_config( dir, - "standing", + "mainAgent", serde_json::json!([ { "name": "scout", @@ -92,7 +92,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { "prompt": "Scout instructions" }, { - "name": "standing", + "name": "mainAgent", "description": "Primary", "resident": true, "isolate": "none", diff --git a/host/tests/it/harness_foundation.rs b/host/tests/it/harness_foundation.rs index 29eeeaa..cd45bc2 100644 --- a/host/tests/it/harness_foundation.rs +++ b/host/tests/it/harness_foundation.rs @@ -136,7 +136,7 @@ fn cli_stays_up_after_stdin_eof() -> anyhow::Result<()> { dir.path(), "console", serde_json::json!([ - {"name":"console","description":"Standing console","model":"openai/gpt-6.1-sol","prompt":"Keep the user conversation"} + {"name":"console","description":"MainAgent console","model":"openai/gpt-6.1-sol","prompt":"Keep the user conversation"} ]), )?; for args in [ diff --git a/host/tests/it/main.rs b/host/tests/it/main.rs index 3fc2b43..7e65cf2 100644 --- a/host/tests/it/main.rs +++ b/host/tests/it/main.rs @@ -1,8 +1,8 @@ //! Host integration tests share one executable. Modules retain their original test registrations. mod api; mod api_auth; -mod api_transport; mod api_listener; +mod api_transport; mod automations; mod builder; mod chain; @@ -56,7 +56,7 @@ mod p3; mod p4; mod plan_todos; mod process; -mod proxy_models; +mod provider_models; mod subagents; mod undo; mod undo_api; diff --git a/host/tests/it/messages.rs b/host/tests/it/messages.rs index 940bf80..d47bbdb 100644 --- a/host/tests/it/messages.rs +++ b/host/tests/it/messages.rs @@ -50,7 +50,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { std::fs::create_dir_all(repo.join("extensions/probe"))?; std::fs::write( repo.join("extensions/probe/server.ts"), - "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setStanding: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", + "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setMainAgent: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", )?; std::fs::copy( source.join("extensions/conversations/api.ts"), @@ -62,7 +62,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { )?; crate::common::write_config( dir, - "standing", + "mainAgent", serde_json::json!([ { "name": "scout", @@ -76,7 +76,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { "prompt": "Scout instructions" }, { - "name": "standing", + "name": "mainAgent", "description": "Primary", "resident": true, "isolate": "none", diff --git a/host/tests/it/p1.rs b/host/tests/it/p1.rs index 9df2813..e189df8 100644 --- a/host/tests/it/p1.rs +++ b/host/tests/it/p1.rs @@ -327,7 +327,7 @@ async fn bundled_extensions_load() -> anyhow::Result<()> { host_dir: world.host_dir.clone(), processes: world.processes.clone(), })?; - // Use the compiled production loader without the console entrypoint or model proxy. + // Use the compiled production loader without the console entrypoint or provider bootstrap. let (library, _) = include_str!("../../js/bundle.js") .split_once("// main.ts") .expect("console bundle entrypoint"); diff --git a/host/tests/it/p3.rs b/host/tests/it/p3.rs index 68b69e2..3b6e443 100644 --- a/host/tests/it/p3.rs +++ b/host/tests/it/p3.rs @@ -61,12 +61,12 @@ fn prepare(dir: &Path, all_extensions: bool) -> anyhow::Result<()> { repo.join("extensions/probe/server.ts"), "export default host => { globalThis.p3Models=host.need({name:'models'}); globalThis.p3Subagents=host.need({name:'subagents'}); globalThis.p3Workspaces=host.need({name:'workspaces'}); globalThis.p3Host=host; return {name:'probe'}; }", )?; - let roster: Vec = ["standing", "coordinator", "worker", "reviewer"].into_iter().map(|role| serde_json::json!({ + let roster: Vec = ["mainAgent", "coordinator", "worker", "reviewer"].into_iter().map(|role| serde_json::json!({ "name":role, "description":format!("P3 {role}"), "model":"faux/faux-1", - "isolate":"none", "resident":role == "standing", "prompt":format!("P3 role:{role}"), + "isolate":"none", "resident":role == "mainAgent", "prompt":format!("P3 role:{role}"), "denyTools":if role == "worker" || role == "reviewer" {vec!["subagent"]} else {vec![]} })).collect(); - crate::common::write_config(dir, "standing", serde_json::json!(roster))?; + crate::common::write_config(dir, "mainAgent", serde_json::json!(roster))?; std::fs::write( repo.join("settings.json"), r#"{"lander":{"checks":["sh -c ': > /check-running; until test -f /check-release; do :; done; test -f feature.txt'"]}}"#, diff --git a/host/tests/it/provider_models.rs b/host/tests/it/provider_models.rs new file mode 100644 index 0000000..6fe2eb5 --- /dev/null +++ b/host/tests/it/provider_models.rs @@ -0,0 +1,109 @@ +//! Configured pi-ai API adapters use a fake server and persist catalog-priced usage. +use sausage::{ + exec::{Command, Exec, Options, Stream}, + world::World, +}; +use std::{sync::Arc, time::Duration}; +struct NoExec; +#[async_trait::async_trait] +impl Exec for NoExec { + async fn exec( + &self, + _: Command, + _: Options, + _: &mut (dyn for<'a> FnMut(Stream, &'a [u8]) + Send), + ) -> anyhow::Result { + anyhow::bail!("unexpected world command") + } +} +fn event(name: &str, value: serde_json::Value) -> String { + format!("event: {name}\ndata: {value}\n\n") +} +#[tokio::test(flavor = "current_thread")] +async fn provider_transport_and_prices() -> anyhow::Result<()> { + use serde_json::json; + let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); + let server = tiny_http::Server::http("127.0.0.1:0").map_err(|e| anyhow::anyhow!(e))?; + let base = format!("http://{}", server.server_addr()); + let settings = json!({"main_agent_name":"main","prompt":"Shared context","providers":{ + "messages":{"type":"anthropic-messages","catalog":"anthropic","base_url":format!("{base}/messages-api"),"api_key":"test-provider-key","models":["claude-opus-5-5"]}, + "responses":{"type":"openai-responses","catalog":"openai","base_url":format!("{base}/responses-api"),"api_key":"test-provider-key","models":["gpt-6.1-sol"]}, + "chat":{"type":"openai-chat-completions","catalog":"openai","base_url":format!("{base}/chat-api"),"api_key":"test-provider-key","models":["gpt-6.1-sol"]} + }}); + let thread = std::thread::spawn(move || -> anyhow::Result<()> { + for path in [ + "/messages-api/v1/messages?beta=true", + "/responses-api/responses", + "/chat-api/chat/completions", + "/responses-api/responses", + "/edited-api/responses", + ] { + let mut request = server + .recv_timeout(Duration::from_secs(30))? + .ok_or_else(|| anyhow::anyhow!("request timeout: {path}"))?; + assert_eq!(request.url(), path); + let key = if path.starts_with("/edited-api") { + "next-key" + } else { + "test-provider-key" + }; + assert!( + request + .headers() + .iter() + .any(|h| (h.field.equiv("Authorization") + && h.value.as_str() == format!("Bearer {key}")) + || (h.field.equiv("x-api-key") && h.value.as_str() == key)), + "missing provider key" + ); + let mut body = String::new(); + request.as_reader().read_to_string(&mut body)?; + let body: serde_json::Value = serde_json::from_str(&body)?; + assert_eq!(body["stream"], true); + let stream = if path.contains("/messages") { + assert_eq!(body["model"], "claude-opus-5-5"); + assert!(body["messages"].is_array()); + [ + event("message_start",json!({"type":"message_start","message":{"id":"m","type":"message","role":"assistant","model":"claude-opus-5-5","content":[],"usage":{"input_tokens":10,"output_tokens":0}}})), + event("content_block_start",json!({"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}})), + event("content_block_delta",json!({"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"hello"}})), + event("content_block_stop",json!({"type":"content_block_stop","index":0})), + event("message_delta",json!({"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":1}})), + event("message_stop",json!({"type":"message_stop"})), + ].concat() + } else if path.contains("/chat/") { + assert_eq!(body["model"], "gpt-6.1-sol"); + assert!(body["messages"].is_array()); + [json!({"id":"c","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"hello"},"finish_reason":null}]}), + json!({"id":"c","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":1,"total_tokens":11}})] + .iter().map(|v|format!("data: {v}\n\n")).collect::()+"data: [DONE]\n\n" + } else { + assert_eq!(body["model"], "gpt-6.1-sol"); + assert!(body["input"].is_array()); + [ + event("response.output_item.added",json!({"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"m","role":"assistant","content":[]}})), + event("response.content_part.added",json!({"type":"response.content_part.added","output_index":0,"content_index":0,"part":{"type":"output_text","text":""}})), + event("response.output_text.delta",json!({"type":"response.output_text.delta","output_index":0,"content_index":0,"delta":"hello"})), + event("response.completed",json!({"type":"response.completed","response":{"id":"r","status":"completed","output":[],"usage":{"input_tokens":10,"output_tokens":1,"total_tokens":11}}})), + ].concat() + }; + request.respond(tiny_http::Response::from_string(stream).with_header( + tiny_http::Header::from_bytes("Content-Type", "text/event-stream").unwrap(), + ))?; + } + Ok(()) + }); + let dir = tempfile::tempdir()?; + let config = dir.path().join("world/etc/sausage"); + std::fs::create_dir_all(&config)?; + std::fs::write(config.join("config.yaml"), serde_json::to_vec(&settings)?)?; + let source = format!( + "globalThis.providerSettings={settings};globalThis.providerBase={};\n{}", + serde_json::to_string(&base)?, + include_str!("../../js/provider-models-test-bundle.js") + ); + let result = + sausage::harness::run_module(World::open(dir.path())?, Arc::new(NoExec), &source).await; + thread.join().unwrap()?; + result +} diff --git a/host/tests/it/proxy_models.rs b/host/tests/it/proxy_models.rs deleted file mode 100644 index b23de83..0000000 --- a/host/tests/it/proxy_models.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! The host proxy catalog selects distinct pi-ai transports with shared proxy authentication. -use sausage::{ - exec::{Command, Exec, Options, Stream}, - world::World, -}; -use std::{sync::Arc, time::Duration}; -struct NoExec; -#[async_trait::async_trait] -impl Exec for NoExec { - async fn exec( - &self, - _: Command, - _: Options, - _: &mut (dyn for<'a> FnMut(Stream, &'a [u8]) + Send), - ) -> anyhow::Result { - anyhow::bail!("unexpected world command") - } -} -fn event(name: &str, value: serde_json::Value) -> String { - format!("event: {name}\ndata: {value}\n\n") -} -#[tokio::test(flavor = "current_thread")] -async fn provider_transport_and_prices() -> anyhow::Result<()> { - use serde_json::json; - // Production initializes this in the process runtime; this fixture uses NoExec. - let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); - let server = tiny_http::Server::http("127.0.0.1:0").map_err(|e| anyhow::anyhow!(e))?; - let base = format!("http://{}", server.server_addr()); - let proxy = json!({"base_url":base,"api_key":"test-proxy-key"}); - let thread = std::thread::spawn(move || -> anyhow::Result<()> { - for path in [ - "/v1/models", - "/v1/responses", - "/apis/anthropic/v1/messages?beta=true", - "/offline/v1/models", - ] { - let mut request = server - .recv_timeout(Duration::from_secs(20))? - .ok_or_else(|| anyhow::anyhow!("request timeout"))?; - assert_eq!(request.url(), path); - let authenticated = request.headers().iter().any(|h| { - (h.field.equiv("Authorization") && h.value.as_str() == "Bearer test-proxy-key") - || (h.field.equiv("x-api-key") && h.value.as_str() == "test-proxy-key") - }); - assert!(authenticated, "missing proxy key"); - if path == "/offline/v1/models" { - request.respond(tiny_http::Response::empty(503))?; - continue; - } - let (body, mime) = if path == "/v1/models" { - let rows: Vec<_> = [("openai", "gpt-6.1-sol", "openai-responses", "/v1/responses"), - ("anthropic", "claude-opus-5-5", "anthropic-messages", "/apis/anthropic/v1/messages")] - .into_iter().map(|(creator,id,api,path)|json!({"creator":creator,"id":id,"endpoints":[{"api":api,"path":path}], - "providers":[{"pricing":{"currency":"USD","unit_tokens":1000,"input":0.002,"output":0.008,"cached_input":0.0001,"cache_write":0.003}}]})).collect(); - (json!({"data":rows}).to_string(), "application/json") - } else { - let mut body = String::new(); - request.as_reader().read_to_string(&mut body)?; - let body: serde_json::Value = serde_json::from_str(&body)?; - assert_eq!(body["stream"], true); - assert!( - request - .headers() - .iter() - .any(|h| h.field.equiv("Shopify-Usage-Tag") - && h.value.as_str() == "[\"pi\",\"sausage\"]") - ); - let stream = if path == "/v1/responses" { - assert_eq!(body["model"], "gpt-6.1-sol"); - [ - event("response.output_item.added", json!({"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"m","role":"assistant","content":[]}})), - event("response.content_part.added", json!({"type":"response.content_part.added","output_index":0,"content_index":0,"part":{"type":"output_text","text":""}})), - event("response.output_text.delta", json!({"type":"response.output_text.delta","output_index":0,"content_index":0,"delta":"hello"})), - event("response.completed", json!({"type":"response.completed","response":{"id":"r","status":"completed","output":[],"usage":{"input_tokens":10,"output_tokens":1,"total_tokens":11}}})), - ].concat() - } else { - assert_eq!(body["model"], "claude-opus-5-5"); - assert_eq!(body["thinking"]["type"], "adaptive"); - assert_eq!(body["output_config"]["effort"], "low"); - [ - event("message_start", json!({"type":"message_start","message":{"id":"m","type":"message","role":"assistant","model":"claude-opus-5-5","content":[],"usage":{"input_tokens":10,"output_tokens":0}}})), - event("content_block_start", json!({"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}})), - event("content_block_delta", json!({"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"hello"}})), - event("content_block_stop", json!({"type":"content_block_stop","index":0})), - event("message_delta", json!({"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":1}})), - event("message_stop", json!({"type":"message_stop"})), - ].concat() - }; - (stream, "text/event-stream") - }; - request.respond( - tiny_http::Response::from_string(body) - .with_header(tiny_http::Header::from_bytes("Content-Type", mime).unwrap()), - )?; - } - Ok(()) - }); - let dir = tempfile::tempdir()?; - let config = dir.path().join("world/etc/sausage"); - std::fs::create_dir_all(&config)?; - std::fs::write( - config.join("config.yaml"), - serde_json::to_vec(&json!({"proxy":proxy}))?, - )?; - let source = format!( - "globalThis.testProxy = {proxy};\n{}", - include_str!("../../js/proxy-models-test-bundle.js") - ); - let result = - sausage::harness::run_module(World::open(dir.path())?, Arc::new(NoExec), &source).await; - thread.join().unwrap()?; - result -} diff --git a/host/tests/it/watchdog.rs b/host/tests/it/watchdog.rs index b54688d..a52d0c0 100644 --- a/host/tests/it/watchdog.rs +++ b/host/tests/it/watchdog.rs @@ -52,7 +52,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { std::fs::create_dir_all(repo.join("extensions/probe"))?; std::fs::write( repo.join("extensions/probe/server.ts"), - "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.watchdogService = host.need({name:'watchdog'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setStanding: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", + "export default host => { globalThis.testHost = host; globalThis.subagentService = host.need({name:'subagents'}); globalThis.messageService = host.need({name:'messages'}); globalThis.watchdogService = host.need({name:'watchdog'}); globalThis.lineageService = host.need({name:'lineage'}); host.implement({name:'conversations'}, {summaryModel: async () => globalThis.summaryRef, concludedIn: async () => new Set(), generatedTitle: async () => {}, setMainAgent: async () => {}, setAutomaticSummaries: async () => {}}); return {name:'probe'}; }", )?; std::fs::copy( source.join("extensions/core/agents.ts"), @@ -64,7 +64,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { )?; crate::common::write_config( dir, - "standing", + "mainAgent", serde_json::json!([ { "name": "scout", @@ -78,7 +78,7 @@ fn prepare(dir: &Path) -> anyhow::Result<()> { "prompt": "Scout instructions" }, { - "name": "standing", + "name": "mainAgent", "description": "Primary", "resident": true, "isolate": "none", diff --git a/skills/README.md b/skills/README.md index 83d0b1c..7d23ea4 100644 --- a/skills/README.md +++ b/skills/README.md @@ -17,7 +17,7 @@ Without images, agents report visual checks as unverified. Automated tests do no The world has no storage chapter changes or subscription login instructions. Managed credentials remain in the host. A 403 requests host approval. -The proxy key in `/etc/sausage/config.yaml` is the explicit exception to host-only secret storage. +Provider API keys in `/etc/sausage/config.yaml` are the explicit exception to host-only secret storage. A commit to `/src/sausage` on `main` reloads the complete coordination snapshot. Run the pure roster and skill tests from the repository root after `npm ci --prefix host/js`: diff --git a/skills/adopt-sausage-workflow/SKILL.md b/skills/adopt-sausage-workflow/SKILL.md index 652ce2a..605ce38 100644 --- a/skills/adopt-sausage-workflow/SKILL.md +++ b/skills/adopt-sausage-workflow/SKILL.md @@ -5,15 +5,16 @@ description: Tour the world roster and review team, then adapt only the user's s # Adopt selected workflow pieces -Read /etc/sausage/config.yaml before the tour. +Read /etc/sausage/config.yaml and /etc/sausage/roster/*.md before the tour. +Read project definitions in /.sausage/roster/*.md. Read the explicit project repository's instructions and check commands. Explain these pieces in one or two lines each: - Each roster entry selects its model, thinking level, role prompt, and tools directly. - Every agent receives the global prompt before its role prompt. -- The configured standing agent keeps the user's conversation and receives branch reports. -- The review lead combines independent correctness, simplicity, and advisory architecture reports. +- The configured main agent keeps the user's conversation and receives branch reports. +- The reviewer reviews alone or combines reports from the project's reviewer-* definitions. - The lander checks the combined result. A push needs the owner's authorization. - A fresh worktree needs the project's required non-secret files and build steps. @@ -21,10 +22,10 @@ Ask the user which pieces to adopt. Include None. Do not write files before the Report the current roster values, not an assumed default team or model assignment. Use only models configured in the world. Never substitute another provider to bypass approval. -Edit only the selected roster entries in /etc/sausage/config.yaml. -Explain that these entries apply across the world, not only to the current project. -There are no model families or project overlays. -Keep unrelated entries intact. Never print or copy the proxy key. +Edit only the selected Markdown definitions. +Global definitions apply across the world. Project definitions apply only within that repository. +There are no model families. +Keep unrelated entries intact. Never print or copy provider API keys. Reviewer entries keep their read-only tools, immutable range rule, and report format. Adapt correctness risks and architecture references to the actual repository. Keep simplicity focused on minimum necessary code. Never add a replacement review lead. @@ -35,5 +36,5 @@ Prove required commands in a disposable worktree with an explicit repository pat Show the exact diff and checks before an authorized commit. Never push without authorization. The host injects managed credentials. A 403 requests host approval. -The proxy key in the world config is the explicit exception to host-only secret storage. +Provider API keys in the world config are the explicit exception to host-only secret storage. Do not copy secrets into worktrees or project configuration. diff --git a/skills/how-sausage-works/SKILL.md b/skills/how-sausage-works/SKILL.md index 4a8fcdd..c777133 100644 --- a/skills/how-sausage-works/SKILL.md +++ b/skills/how-sausage-works/SKILL.md @@ -9,11 +9,11 @@ Use five short beats. Ask one question through message after each beat, and wait Offer Skip the rest at every beat. If the user skips, continue to the final question. Do not claim a particular UI exists. Use the conversation and tools that the prompt supplies. -1. Explain that the standing agent is the standing agent. The user starts work there and can steer branches directly. -2. Explain the flow: user → the standing agent → coordinator → scouts, workers, designers, and reviewer → submission and configured checks. +1. Explain that main_agent_name selects the main agent. The user starts work there and can steer branches directly. +2. Explain the flow: user → the main agent → coordinator → scouts, workers, designers, and reviewer → submission and configured checks. Features need an assessment before code unless the user explicitly waived it. Pushes require authorization. 3. Ask how much control the user wants. They decide most questions, only major questions, or authorize a hands-off goal. - During an active goal, the standing agent records decisions through goal. Host credential approvals still require the user. + During an active goal, the main agent records decisions through goal. Host credential approvals still require the user. 4. Explain memory and context. Branches start from durable memory and explicit briefs. Compact preserves a handoff. Dreams review evidence and propose improvements. They do not switch storage chapters. 5. Ask what the project does, its explicit repo path, and the first task. diff --git a/skills/integrate-sausage/SKILL.md b/skills/integrate-sausage/SKILL.md index cd11220..26f5f9e 100644 --- a/skills/integrate-sausage/SKILL.md +++ b/skills/integrate-sausage/SKILL.md @@ -19,8 +19,9 @@ Do not copy production data or credentials. Ask before shared database changes o Offer two to four ranked changes. State the user outcome, existing code to reuse, required programs, costs, and approvals. Prefer a skill for repeated judgment, an agent for a specialist role, and a CLI or server for deterministic work. Use a coordination extension only for harness behavior, not as a new concept for world programs. -Read the roster in /etc/sausage/config.yaml. Propose changes only to the selected entries. -Explain that roster changes affect the whole world. There are no project overlays or model families. +Read /etc/sausage/roster/*.md and /.sausage/roster/*.md. Propose changes only to the selected definitions. +Global definitions affect the whole world. Project definitions apply only within that repository. +There are no model families. Place repository skills in /.sausage/skills/. Never replace the review lead merely to add reviewers. Add reviewer-* roster entries instead. Read adopt-sausage-workflow for the current team and model choices. diff --git a/skills/write-extension/SKILL.md b/skills/write-extension/SKILL.md index e6fd54a..e4425f9 100644 --- a/skills/write-extension/SKILL.md +++ b/skills/write-extension/SKILL.md @@ -12,7 +12,7 @@ Do not treat uncommitted edits as proof that the live host uses new code. Before changes, read /src/sausage/AGENTS.md, the nearest extension README, and its API contracts. Read the installed loader contract before imports or lifecycle changes. If a contract is absent, report the blocker. -Copy the closest existing extension’s shape. Do not invent host APIs or use Standing agent’s browser facets. +Copy the closest existing extension’s shape. Do not invent host APIs or use Main agent’s browser facets. Keep deterministic world operations in CLIs or servers. Use /bin programs through the documented process interface. Use standard WASI files, HTTP, and sockets. Never add an extra host import. diff --git a/userland/bundle.nu b/userland/bundle.nu index 3034d80..ffe48bf 100644 --- a/userland/bundle.nu +++ b/userland/bundle.nu @@ -66,5 +66,7 @@ def main [destination?: path] { mkdir $settings ^cp --remove-destination ($snapshot | path join config config.yaml) ($settings | path join config.yaml) if $env.LAST_EXIT_CODE != 0 { error make {msg: 'default config copy failed'} } + ^cp -r ($snapshot | path join config roster) ($settings | path join roster) + if $env.LAST_EXIT_CODE != 0 { error make {msg: 'default roster copy failed'} } print $destination } diff --git a/userland/web/index.html b/userland/web/index.html index 671e2be..804e562 100644 --- a/userland/web/index.html +++ b/userland/web/index.html @@ -82,9 +82,9 @@ function entry(record){ function select(id){selected=id;after=0;tools.clear();$('entries').replaceChildren();} async function refresh(){ try{ - const {conversations,standing}=await api('conversations'); + const {conversations,main_agent}=await api('conversations'); conversations.sort((a,b)=>a.id-b.id); - if(selected===null&&standing)select(standing.conversationId); + if(selected===null&&main_agent)select(main_agent.conversationId); $('conversations').replaceChildren(); const parent=c=>c.parent?.conversationId||c.owner?.conversationId||c.starter; for(const c of conversations){